-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onAudioReady() is called simultaneously from two threads on OpenSL ES backend #1567
Comments
It seems that calling From:
to:
Could this change cause any issues? |
Thanks for finding this issue! Moving processBufferCallback up seems like the right thing to do. However, I don't think we should release the lock. I opened #1570 to change how processBufferCallback instead. Can you help verify whether my set of changes works for you? |
Great! I think there must be a race condition if there is something in the queue when setting the PLAYSTATE. It is possible the callbacks start immediately and drain the queue and then the processBufferCallback gets called. If we call getBufferDepth() BEFORE we call setPlayState_l(SL_PLAYSTATE_PLAYING) |
Per Phil's suggestion, the most recent version of #1570 saves the earlier buffer depth instead. @Devenec can you verify whether this works for you?
|
This doesn't seem to work. However the changes in the first commit of #1570 work, after removing the lock from I'm leaving for summer holiday today and will be back in August. I'll go with the first commit for now. |
Thanks for the feedback! I reverted the PR back to the first commit and made the necessary fixes to it. Have a great vacation! |
Android version(s): 10 and 11
Android device(s): Multiple, see below
Oboe version: 1.6.1
App name used for testing: -
Short description
When calling requestStart() for an OpenSL ES output stream, onAudioReady() is called from the thread that called requestStart(), and simultaneously from an AudioTrack thread.
Steps to reproduce
The issue may be hard to reproduce. It occurs in our game within 5 minutes of starting the game.
Call requestStart() for an OpenSL ES output stream, and observe that onAudioReady() is called from two threads simultaneously.
Expected behavior
onAudioReady() is not called from multiple threads simultaneously.
Actual behavior
onAudioReady() is called from two threads simultaneously.
Device
Any additional context
Stack trace of the thread that called requestStart():
Stack trace of AudioTrack thread:
The text was updated successfully, but these errors were encountered: