-
Notifications
You must be signed in to change notification settings - Fork 583
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
App crashes randomly in LiveEffects sample app #796
Comments
@mahaju - was that stack trace from the S8 or S10? AAudio should not be used on Android 8.0 because there can be random crashes related to the PlayerBuf. But this has a different crash signature. (If LiveEffect allows AAudio on 8.0 then it should probably be changed.) We need to test this on Pixel to see if it is Samsung specific. |
@philburk this crash log is from the S7 (Android 8) As far as I know, whenever it crashes on the S7, it has this same signature (that is, a SIGSEGV and crashes at #00 pc 00000000000626ec /system/lib64/libbinder.so (_ZN7android14IPCThreadState20processPendingDerefsEv+128) ) and it's the same on the S10. I don't think I have ever encountered the other crash that is supposed to happen on Android 8. |
I tried to reproduce this on a Pixel 3a running current master. I went back and forth between AAudio and OpenSL ES, starting and stopping repeatedly. No crashes. So it may be version specific, or Samsung specific, or fixed on master. |
I then tried to reproduce the bug on an S10 running a modified version of P. It did not crash when using the default input device. But as soon as I tried the telephone device it crashed. I then tried it on the Pixel 3a on master and it crashed as well. The crash is a null reference in getPerformanceMode(). The open fails and I think LiveEffect is not handling the failure to open the stream. The question is why does device=Telephony not open? |
Note that I may have found a different bug than the OP. |
Just checked what @philburk said on samsung S7 (Android 8), with AAudio/telepone input selected. Crashes immediately. This is the logcat on my device:
Doesn't crash when selecting OpenSL ES but I don't think selecting any input from the drop down list has any effect at all when using OpenSL ES. I am personally more interested in just using the phone's built in mic as the input. |
Used to crash on a nullptr. Now it passes the result up to Java. Bug: #796
The telephony input is not allowed. So AAudio then returns null. LiveEffect does not handle that and crashes. 03-11 21:11:56.791 949 1914 E AudioPolicyIntefaceImpl: getInputForAttr() permission denied: call I modified LiveEffect to not crash. #806 |
@philburk I downloaded the latest version of oboe-master and applied your corrections to the LiveAudio project.Now if I choose AAudio/telephone input it just shows me a message that it couldn't open stream, but doesn't crash. However my main problem is finding a way to make this program more stable in Android 8, while using built in mic as the audio input option. The only hint I have is the
Is there any workaround to using LiveEffect and AAudio in Android 8 (in general, and S7 in particular as it's the only Android 8 phone I have for test)? My final app builds on top of LiveEffect and contains a lot of DSP on the audio. Also some extra information, I have been told that the app is comparatively much more stable on an LG V series phone with Android 10 (not sure about the exact model right now). I have a hunch it has something to do with the underlying Android OS. I think LG's OS is much closer to Google's specifications, while Samsung applies more custom modifications on top of it for their phones. |
No. You should not use AAudio with 8.0. There are bugs in a different part of the system that cause AAudio to crash sometimes by deleting a stream that is active. It is very dependent on subtle timing. So on some devices you will see the crash more than on others. Oboe will allow AAudio on 8.0 if you override the recommendation. But that is only for testing. |
I fixed a bug in LiveEffect that caused a crash when the stream did not open. |
Android Version(s): 8.0,10
Android Device(s): Samsung Galaxy S7 (android 8), Samsung Galaxy S10 (android 10)
Oboe Version:
Short Description
App sometimes crashes at random times
Steps To Reproduce
Turn audio output on and off (Start button press), alternate between AAudio and OpenSL ES, and various mic sources
Expected behavior
Audio output should stop when pressing the stop button, start when pressing the start button
Actual behavior
App sometimes crashes, sometimes when pressing the start/stop button, sometimes while pressing the radio buttons to alternate between AAudio and OpenSL ES. Very seldom it has crashed while just letting the app play audio normally, but even in those cases, start/stop button had been already pressed multiple times, and AAudio/OpenSL ES have been alternated between.
Additional context
Almost all of the crashes have happened when going from no audio output state to audio output state, that is, when pressing the button to start audio, not when pressing the button to stop audio. Program crashes in Samsung Galaxy S7 and S10, but has caused the S10 to actually restart a few times.
Here is a logcat for one of the crashes:
The text was updated successfully, but these errors were encountered: