juce-framework / JUCE

JUCE is an open-source cross-platform C++ application framework for desktop and mobile applications, including VST, VST3, AU, AUv3, LV2 and AAX audio plug-ins.
https://juce.com
Other
6.54k stars 1.73k forks source link

[Bug]: Android Oboe audio callback `onAudioReady()` invokes pthread_mutex_lock() #1345

Open atsushieno opened 8 months ago

atsushieno commented 8 months ago

Detailed steps on how to reproduce the bug

I found modules/juce_audio_devices/native/juce_Oboe_android.cpp involves pthread_mutex_lock(), which is not realtime safe: https://github.com/juce-framework/JUCE/blob/db60c1d226a8132a6c7cf7522b570b0e25e3dece/modules/juce_audio_devices/native/juce_Oboe_android.cpp#L1367

Some folks are facing weird Oboe audio latency problem with tracktion_engine. Probably this is the cause of the issue.

What is the expected behaviour?

Oboe driver should not involve mutex lock (at least the default Bionic libc implementation is no-go).

Operating systems

Android

What versions of the operating systems?

Android 14 (any version after Android 8.0 should be affected)

Architectures

x86_64, ARM, 64-bit, 32-bit

Stacktrace

No response

Plug-in formats (if applicable)

No response

Plug-in host applications (DAWs) (if applicable)

No response

Testing on the develop branch

The bug is present on the develop branch

Code of Conduct