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.