-
Notifications
You must be signed in to change notification settings - Fork 543
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
OpenSL ES buffer callbacks on Android #10
Comments
I'm using a slightly modified version of the opensl backend with orx game engine. and It seems to works fine so far. I moved VCALL0(bufferQueue,Clear)(); in opensl_start_playback function.
check if this works for you |
Unfortunately I don't think that's a real fix. If the callback is still being called after the stream is stopped and cleared, surely it would still get called after just being stopped? Perhaps a better fix would be to call |
also I forgot, I added a NULL check on data->buffer in my guess is that
|
Unfortunately I don't think that would be enough. It'd be possible for the callback to see a non-NULL buffer, then the stop method goes and frees it before the callback is done with it. Does the |
not sure... but you can query, the bufferQueue state and wait until state.count == 0. so the sequence should be VCALL(player,SetPlayState)(SL_PLAYSTATE_STOPPED); or something... an other options could be to starve the bufferQueue (by flipping a On Thu, Aug 13, 2015 at 11:28 PM, kcat notifications@github.com wrote:
|
I attempted a fix in commit 7d4e368. Can you test that to see if it works? |
seems to work here, but on my device I have a very small buffer (240 frames) so it's difficult to reproduce |
here is my source download on android and thanks kcat help~ |
Since it's been nearly a year without hearing about a problem, I'll assume this is fixed. If there's still a problem, please create a new issue. |
On some Android implementations the OpenSL ES back-end seems to crash the program when playback is stopped. The cause of the crash is a
SIGSEGV
and happens shortly after playback is stopped. When logging calls toopensl_callback
andopensl_stop_playback
it seems that the stop function frees the buffer while the callback function is still running:The probability of this happening seems to be greatly increased when HRTFs are enabled. These crashes happen on the Android Emulator running API 17 and on a real device running API 19.
The text was updated successfully, but these errors were encountered: