I’ve generated an Audio Application project using Projucer, exported it through Android Studio (didn’t change anything in the Projucer configs or the code), successfully built the app and ran it on the device (samsung SM-960F). The app keeps crashing at start up with the following backtrace:
I’ve tried this with JUCE 6.0.5 and android ndk 21.0.6113669, and JUCE 6.0.7 both with ndk 21.0.6113669 and 22.0.7026061 (forced it through ndkVersion in gradle) which appears to be the latest.
The device is running Android 10.
Min SDK and Target SDK are the default ones (19 and 29) respectively, but I’ve also tried with 26 and the result is still the same.
I can get by this crash if I launch the app with some external BT speaker connected prior, so the problem must come from the device’s default audio device. I tried my best trying to debug the problem but as you can see the crash actually happens inside libaaudio.so, so I’m kinda blindfolded. It definitely happens shortly after the output stream is started, during the first callback.
I can get by this crash if I launch the app with some external BT speaker connected prior
That is an interesting clue. Bluetooth devices typically use the Legacy path in AAudio. But AudioStreamInternalPlay::writeNowWithConversion is in the MMAP path. Maybe it is in the process of switching devices.
We are tracking this issue here:
Please see the Oboe issue for the latest analysis.