Buffer Starvation + CPU Spike leading into Audio Cuts in Unity

Hello!

I were playtesting our project today and realised this known issue appeared several times every time we try to access memory to trigger a sound. For example, when we are standing still hearing ambience and we try to walk or attack, a small cut happens. Same in scene changes with the streaming assets for example.

Following error pops up in Unity:

[FMOD] OutputRingBuffer::read : Buffer starvation detected, requested 4096 bytes, 0 / 16384 bytes available.

I did a profiling session with FMOD and I can see there are huge spikes of CPU when doing anything rather than standing still in-game. Some sample data is being preloaded on scene changes and there are no high cpu events or mixer things happening right at that time. Is just happening when trying to access events to trigger them.

What we can observe is a brief audio freeze (like editor freeze) in Unity while loading any new sound, while in FMOD this does not show up when playing the “waveform” session back in the Profiler.

I tried to load ALL SAMPLE DATA in Editor to test this and it keeps happening, no matter if the sample data is preloaded or not. The most weird thing is that this happened suddenly from day to day, not being a consistent gradual change over time. What could have happened here?

I will try to add further information when researched.

I’m using FMOD 2.02.07 and Unity 2022.3.0f1.

Ask me if you want me to upload or share the .fspackage in any way for further research.
Looks like every time the buffer tries to access the memory it spikes hard on the mixer CPU and cuts + buffer starvation happens. What am I missing here?


Without preloading ALL sample data (file i/o + loading memory on scene change):

With preloading ALL sample data at initialization (Unity option):


MEMORY LOAD ISSUE, even all events are preloaded ?:

Simplest case scenario (playing ambience and then trying to do a footstep or an attack):


Thank you!

Hi,

Thank you for all the information. Would it be possible to get the .fspackage and a copy of your project or a stripped-down version displaying the issue uploaded to your profile? Please note you will have to register a project with us before you can upload files.