The result of Oboe Tester

I tested my device with Oboe Tester for hours, and yes, I noticed the same issue.
Had the problem with AAudio but no problem with OpenSL ES just like my app.
Also, whenever the noise came up, I could make it disappear by turning Wi-Fi off.

So, it has nothing to do with FMOD ?
Well, I think FMOD should be able to deal with these edge cases too.
I found that it’s the buffer size.
When the Wi-Fi related noise occurred, increasing the buffer size could remove it.

The buffer size value recommended by the Android audio team for low-latency is ’ burst * 2 ', and I think FMOD does the same thing internally.
And I believe, you know the burst size varies depending on the API settings.

Using OpenSL ES (instead of AAudio ), non-native sample rate, POWER_SAVING mode increases the burst size.
Thanks to Oboe Tester , I found that the noise issue occurred only when the burst size was the lowest.
In my case with Galaxy S10 Plus , the noise occurred when the burst size was 96 , and no noise when it was 192 or above.
To be more clear, when the burst size was 96, I needed to increase the buffer size to at least 288 (which is 96 * 3 ), but when it was 192, I could just use 192 (which is 192 * 1 ).
I don’t know why, but that’s how it went.
By the way, if Wi-Fi is off, I can use the buffer size of 192 (which is 96 * 2 ) even with the burst size of 96.

You are confused by what I’m saying?
I’m attaching here the screenshots of Oboe Tester for you.
a. Options in the red boxes were set once and untouched throughout the test.
b. Options in the green box (MMAP, Exclusive, Effect) are what I was focusing on.
c. The option in the blue box (bufferSize) was first set to 1 and increased until no noise was heard only when the noise occurred.

MMAP | Exclusive | Effect | bufferSize
ON | ON | ON | 1
ON | off | ON | 1
off | ON | ON | 1
off | ON | off | 1
off | off | ON | 1
off | off | off | 1
ON | ON | off | 3
ON | off | off | FAIL

You can click each one to view details like burst size.
bufferSize above means the value of the bufferSize option which could remove the noise.
The FAIL one is what I was struggling with.
Sometimes the value of 3 fixed the problem, but other times even the maximum buffer size didn’t do anything.
So I think I need some more tests with it.
Anyway, those last two had the lowest burst size and required more buffer size.

In the beginning, I said FMOD should be able to deal with the edge cases.
As you can see from the screenshots, Oboe Tester provides the buffer size option and we can adjust it at runtime.
And as explained here, Oboe provides LatencyTuner which automatically increases the buffer size when underrun occurs.
If I’m not wrong, FMOD uses AAudio and OpenSL ES directly rather than Oboe .
So your team may need to implement a similar thing.
(Or better thing, because the Oboe developer said here, two years ago, LatencyTuner at the moment only increases but doesn’t decrease back again.)

As seen in the screenshots, CPU usage was 1~2% the whole time.
I don’t get why Wi-Fi creates noise and don’t know whether it’s AAudio 's issue or Samsung 's.
Do you know where I can talk to Samsung 's Android audio developers directly about this?

One more question.
Does or will FMOD provide the way to get the current burst and buffer size on Android ?

Thanks.

Thanks for the information. I think we’re starting to get somewhere.

There’s something very interesting in the options - only the last 2 use the MMAP/EX pathway, every other test indicates that its using the legacy path.

FMOD does use AAudio directly - it also uses a larger default buffer size than Oboe (typically we use the initial capacity size the device returns, which might be the value oboe is showing (3072 mmaped and 1536 legacy), then double that for the capacity), and then detect xruns to see if it needs to grow that buffer.

We might have to look at detecting if the device is Samsung and switching its performance mode to NONE (so that it will avoid defaulting to MMAPed) to mitigate the issue. We’ll do some more investigation on our end to see if that makes a difference.

I also found some additional issues filed with oboe that may be related - Noise crackles when playing Drumthumper wav sounds · Issue #1142 · google/oboe · GitHub and AAudio glitches / crackles on S8, S9 · Issue #564 · google/oboe · GitHub

1 Like

Thank you for taking your time on this issue.
I love FMOD so much that I want to use FMOD for everything, so your efforts to make the API better like this make me happy :slight_smile:
Other than the noise issue, I noticed the AAudio mode (within FMOD) on my Samsung device (with Wi-Fi off) definitely worked better.
Especially when screen recording, I had to choose AAudio over OpenSL ES for much smoother results.

Thanks again, and have a wonrderful week.