Hello,
I have found a bug that seems only reproducible on certain Huawei Android phones where a Buffer starvation occurs when the screen is locked.
Here is an example of the bug happening in the play_sound
sample app taken from FMOD Engine 2.01.06, with the loop enabled on drumloop.wav
: https://www.youtube.com/watch?v=hmHOc09Buig
When the sound stops, I see these warnings in the logs:
2020-12-03 11:31:56.914 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Buffer starvation detected, requested 1920 bytes, 896 / 32768 bytes available.
2020-12-03 11:31:56.914 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Increasing block count to 5.
2020-12-03 11:31:56.915 7424-7545/org.fmod.example W/fmod: OutputAAudio::mixerThread : Increasing buffer size to 2160 due to detected xruns.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Buffer starvation detected, requested 1920 bytes, 896 / 32768 bytes available.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Increasing block count to 6.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Buffer starvation detected, requested 1920 bytes, 0 / 32768 bytes available.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Increasing block count to 7.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Buffer starvation detected, requested 1920 bytes, 0 / 32768 bytes available.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Increasing block count to 8.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Buffer starvation detected, requested 1920 bytes, 0 / 32768 bytes available.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example I/chatty: uid=10137(org.fmod.example) identical 17 lines
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Buffer starvation detected, requested 1920 bytes, 0 / 32768 bytes available.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Buffer starvation detected, requested 1920 bytes, 0 / 32768 bytes available.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Buffer starvation detected, requested 1920 bytes, 0 / 32768 bytes available.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Buffer starvation detected, requested 1920 bytes, 0 / 32768 bytes available.
2020-12-03 11:31:56.916 7424-7552/org.fmod.example W/fmod: OutputRingBuffer::read : Buffer starvation detected, requested 1920 bytes, 256 / 32768 bytes available.
I have also tested the exact same scenario with FMOD 1.10.20, and the bug does not happen.
I was able to reproduce this on the Huawei Mate 30, P30 Pro & P30 Lite, all running Android 10.
Thanks!