Audio stops after some time in android from video/Music player

by getandroid » Mon, 16 Feb 2009 12:15:59 GMT


Sponsored Links
 Hi,

   I'm facing a problem with Video/Music player where audio stops
coming after a random number of times. After some debugging I found
that:

In android_audio_output.cpp->audout_thread_func, there is
iAudioThreadSem->Wait(); before the while(1) loop and it is stuck
there indefinitely. I understand it is waiting for a signal from MIO
saying that the buffer is written and ready to be dumped to audio
flinger. For some reason it is not getting the signal. Is this
correct?

Can anybody throw some light on this?
--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Audio stops after some time in android from video/Music player

by Dave Sparks » Mon, 16 Feb 2009 16:28:07 GMT


 Which branch are you working on?



--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---


Sponsored Links


Audio stops after some time in android from video/Music player

by getandroid » Mon, 16 Feb 2009 20:01:41 GMT


 Hi,

   As mentioned audio stops after some random number of times when
played from either Music/Video player. After some debugging, I found
that the problem is:

In "android_audio_output.cpp"->audout_thread_func() there is a call to
wait(iAudioThreadSem->Wait()) just before the while(1) and it is
waiting indefinitely for something.

Can anybody tell me what is it waiting for and why is it not able to
come out? From what I can understand, it is waiting for a signal
(semaphore) but where is it expecting a signal from?
--~--~---------~--~----~------------~-------~--~----~



Audio stops after some time in android from video/Music player

by Dave Sparks » Tue, 17 Feb 2009 00:57:42 GMT


 Please don't cross-post. This question isn't appropriate for the
application developer forum.



--~--~---------~--~----~------------~-------~--~----~



Audio stops after some time in android from video/Music player

by getandroid » Tue, 17 Feb 2009 05:41:09 GMT


 I'm working on android 1.0 release




--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



Audio stops after some time in android from video/Music player

by getandroid » Tue, 17 Feb 2009 08:19:59 GMT


 I've done following change in android_audio_output.cpp. It is better
after enabling RESET mode instead of STOP. Is there any fix for PV
core which mentioned in the comments of code snippet below??

# if 0 //SAMPATH commented
// FIXME: Per PV, we should be exiting thread in Reset, not Stop.
However, doing so
// causes app death, so presumably PV is asserting somewhere and
causing an abort.
// When this gets fixed, remove this Stop function and bring back the
Reset function.
PVMFCommandId AndroidAudioOutput::Stop(const OsclAny* aContext)
{
    // request output thread to exit
    LOGV("Stop (%p)", aContext);
    RequestAndWaitForThreadExit();
    return AndroidAudioMIO::Stop(aContext);
}
#endif

#if 1 //SAMPATH enabled
PVMFCommandId AndroidAudioOutput::Reset(const OsclAny* aContext)
{
    // request output thread to exit
    LOGV("Reset (%p)", aContext);
    RequestAndWaitForThreadExit();
    return AndroidAudioMIO::Reset(aContext);
}
#endif





--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---