Closed mgood7123 closed 4 years ago
Rapidly closing and opening a stream will expose known race conditions in AudioFlinger. We do not recommend that.
if i keep the stream open during the pausing and unpausing instead of opening on play and closing on pause and it seems to have fixed the problem,
Yes, it is better to keep the stream open and just call pause() and start(). Note that if your app is pushed to the background by another app then we recommend closing the stream to free up the audio resources. Likewise, if the user pauses the stream for a long time then you should probably close it.
Thanks
On Wed, Apr 1, 2020, 9:57 AM Phil Burk notifications@github.com wrote:
Rapidly closing and opening a stream will expose known race conditions in AudioFlinger. We do not recommend that.
if i keep the stream open during the pausing and unpausing instead of opening on play and closing on pause and it seems to have fixed the problem,
Yes, it is better to keep the stream open and just call pause() and start(). Note that if your app is pushed to the background by another app then we recommend closing the stream to free up the audio resources. Likewise, if the user pauses the stream for a long time then you should probably close it.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/google/oboe/issues/810#issuecomment-606948459, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGLITHY7VLC4SILE4GJBQITRKJ7M3ANCNFSM4LNQ6MJQ .
see https://github.com/google/oboe/issues/569 and https://github.com/google/oboe/issues/396
same setup except without root and without Viper4Android installed
this may be related to rapidly opening and closing the streams in a multi threaded environment such as one calllback overlaps with the other
im not sure
im currently testing if the problem persists if i keep the stream open during the pausing and unpausing instead of opening on play and closing on pause
as this will rule out any problems with Oboe callbacks themselves
ei
on play start the
oboe::AudioStream *stream
if it is not already started then stream audio to the engineon pause stream silence
...
and it seems to have fixed the problem, even when my phone extreme lags due to 0% battery while charging (the battery is being drained faster than it can be recharged by the current power source)