google / oboe

Oboe is a C++ library that makes it easy to build high-performance audio apps on Android.
Apache License 2.0
3.72k stars 571 forks source link

Realme RMX 1911 cannot play on native buffer size #937

Closed extreamsd closed 12 months ago

extreamsd commented 4 years ago

Android version(s): 9 Android device(s): RMX1911 Oboe version: 1.4.2 App name used for testing: Audio Evolution Mobile Studio

Short description The RMX1911 cannot play correctly at the native sample rate and native buffer size with AAudio. Audio will be very slow and xrun's are high. Forcing OpenSLES in Oboe will make it play correctly.

Both use: frames/burst = 192, frames/cb = 192, buffersize = 384, capacity = 384

Expected behavior

AAudio gives similar or better performance than OpenSLES

Actual behavior

Cannot use AAudio on the native buffer size and native sample rate. Using a buffer size that is 2x the native buffer size will make it play. In all cases, lots of XRun's occur, exactly one for each callback.

Any additional context

Not sure how the OboeTester is supposed to work, but if I select Test Output, fill in AAudio, 48000, 2 channels, PCM_FLOAT, open and press start, it sounds awful. Only with the buffersize at 100%, it will produce some tone which I believe is not the right one. Number of xruns are high, also in the glitch test.

philburk commented 4 years ago

This device, I think: https://www.gsmarena.com/realme_5-9802.php

OpenSL ES defaults to double buffered. (size = 2 bursts) OboeTester is defaulting to a single buffer. (size = 1 burst) Some devices do fine with single buffers but some do not, particularly in Legacy mode.

We should consider always defaulting to a minimum of 2 bursts.

philburk commented 12 months ago

Oboe now defaults to 2 bursts. Please open a new issue if there are still issues.