Hello,

We are seeing some strange problem during voice recording on GingerBread
with OpenCore MMF. The sequence Start -> Stop -> Start ->Stop ->Start ->
Stop doesn't work some times but Start ->Pause-> Stop -> Start ->Pause->Stop
->Start ->Pause->Stop always works.
The Log shows that AuthorDriver::enqueueCommand() function gets AUTHOR_QUIT
command from AuthorDriverWrapper::~AuthorDriverWrapper() function, waits on
semaphore during failure case. The AUTHOR_QUIT command which responsible for
AuthorDriver::handleQuit() StopScheduler() is not called when the command
AUTHOR_QUIT is enqueued. I thought this could be a timing issue and
inserting a delay may solve the issue but it doesn't. Why do we need a
special command to StopScheduler(), can't we handle this in AUTHOR_STOP
command function??

status_t AuthorDriver::enqueueCommand(author_command *ac, media_completion_f
comp, void *cookie)
{
    mQueueLock.unlock();
    // If we are in synchronous mode, wait for completion.
        if (whichcopy == AUTHOR_QUIT) {
         LOGV(" AUTHOR_QUIT command received "); // prints
         if (syncsemcopy) {
            // waits here indefinitely
            syncsemcopy->Wait();
            if (whichcopy == AUTHOR_QUIT) {
                syncsemcopy->Close();
                delete syncsemcopy;
                return 0;
            }
        }

command is passed from the below function

 AuthorDriverWrapper::~AuthorDriverWrapper()
{
        LOGV("Destructor");
                // now it is safe to quit.
        author_command *ac = new author_command(AUTHOR_QUIT);
        enqueueCommand(ac, NULL, NULL); // will wait on mSyncSem, signaled
by author thread
        delete ac; // have to delete this manually because CommandCompleted
won't be called
}

 Please send me your valuable suggestions on how to fix this issue.
 Thanks and regards,
-Lakshman

-- 
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting

Reply via email to