# Buffer Starvation + CPU Spike leading into Audio Cuts in Unity

**URL:** <https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033>\
**Category:** Unity\
**Created:** [December 26, 2023, 1:00pm UTC](https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033 "2023-12-26T13:00:30Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mlopezvidal](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@mlopezvidal](https://qa.fmod.com/u/mlopezvidal)\
**Post date:** [December 26, 2023, 1:00pm UTC](https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033/1 "2023-12-26T13:00:30Z")

</div>

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):**

 ![not loaded sample data](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/3/3786a70f8cadb2fb3e8dbd86677f071754411e80.png)

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

 ![loaded sample data](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/3/30ad7db0210f0aee7afb3dae5b3ecd8790d9c416.jpeg)

* * *

**MEMORY LOAD ISSUE, even all events are preloaded ?:**

 ![Captura de pantalla 2023-12-26 a las 15.08.59](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/3/3dca52cfb429d525c8721e94dfe1341e7bced020.png)

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

 ![Captura de pantalla 2023-12-27 a las 13.21.19](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/6/6f6d400767be8b415bd3bb4e4f5c59ac057273a3.png)

* * *

Thank you!

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [January 1, 2024, 11:31pm UTC](https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033/2 "2024-01-01T23:31:42Z")

</div>

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](https://fmod.com/profile#uploads) to your [profile](https://fmod.com/profile)? Please note you will have to register a project with us before you can upload files.

---

<div class="post-metadata">

**Author:** ![dada\_da](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dada\_da](https://qa.fmod.com/u/dada_da)\
**Post date:** [December 9, 2025, 7:26am UTC](https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033/5 "2025-12-09T07:26:24Z")

</div>

does anyone from FMOD team have an idea what to look into?

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [December 10, 2025, 11:15pm UTC](https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033/6 "2025-12-10T23:15:12Z")

</div>

Hi,

Could I please grab your Unity and FMOD integration versions.

Are there any reproduction steps to consistently reproduce the issue? A potential issue could be modifying the [Unity Integration | Settings - Dsp Buffer Settings](https://fmod.com/docs/2.03/unity/settings.html#dsp-buffer-settings).

---

<div class="post-metadata">

**Author:** ![dada\_da](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dada\_da](https://qa.fmod.com/u/dada_da)\
**Post date:** [December 11, 2025, 9:25am UTC](https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033/7 "2025-12-11T09:25:12Z")

</div>

Thanks connor.

Unity: 6.2 (6000.2.14f1)

FMOD integration: Version: 2.03.11, Build Number: 158528

We are building for Windows PC and developing on OSX and Windows. The integration settings are attached, do they look alright?

 ![Default Platform Settings](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/1/1028b725b0d7e080d31e4c8a382a82c5e90ec444.jpeg)

 ![Editor Settings](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/f/fda474dd48ad697422f087949d8f140bc5827aeb.jpeg)

---

<div class="post-metadata">

**Author:** ![dada\_da](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dada\_da](https://qa.fmod.com/u/dada_da)\
**Post date:** [December 15, 2025, 12:09pm UTC](https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033/8 "2025-12-15T12:09:10Z")

</div>

@Connor_FMOD Any suggestions on what to change in these settings? Thanks a lot!

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [December 15, 2025, 10:27pm UTC](https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033/9 "2025-12-15T22:27:41Z")

</div>

Thanks for the images.

For the `DSP Buffer Settings`

![image](https://canada1.discourse-cdn.com/flex036/uploads/fmod/original/2X/7/76166b2ac8b644b7e0dfe0281d4979432eaec6ff.png)

could you please try:

> If you do set the size manually, the `bufferlength` argument must be a multiple of four, typically 256, 480, 512, 1024 or 2048 depending on your latency requirements.

Reducing the size of the buffer will increase CPU usage:

> Making the granularity smaller will just increase CPU usage (cache misses and **[DSP graph](https://fmod.com/docs/2.03/api/glossary.html#dsp-graph)** overhead).

[FMOD Engine | Core Api System - System::Setdspbuffersize](https://fmod.com/docs/2.03/api/core-api-system.html#system_setdspbuffersize)

---

<div class="post-metadata">

**Author:** ![dada\_da](https://avatars.discourse-cdn.com/v4/letter/d/ce73a5/32.png) [@dada\_da](https://qa.fmod.com/u/dada_da)\
**Post date:** [December 17, 2025, 7:43pm UTC](https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033/10 "2025-12-17T19:43:36Z")

</div>

Thanks! very helpful. Increasing the buffer will increase latency, but not independent of the visual output of unity right? Or will visuals and sounds loose sync at higher latencies? In DAW land I would delay video playback to compensate for a bigger buffer size…

---

<div class="post-metadata">

**Author:** ![Connor\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/connor_fmod/32/3685_2.png) [@Connor\_FMOD](https://qa.fmod.com/u/Connor_FMOD)\
**Post date:** [December 18, 2025, 10:45pm UTC](https://qa.fmod.com/t/buffer-starvation-cpu-spike-leading-into-audio-cuts-in-unity/21033/11 "2025-12-18T22:45:40Z")

</div>

> [@dada\_da](#):
>
> Increasing the buffer will increase latency, but not independent of the visual output of unity right?

Yes, increasing the buffer size will increase latency. I’m not sure I understand, but increasing the buffer size should not affect visuals in Unity.

> [@dada\_da](#):
>
> Or will visuals and sounds loose sync at higher latencies?

An option is enabling [Unity Integration | Settings - Load Bank Sample Data](https://fmod.com/docs/2.03/unity/settings.html#load-bank-sample-data), which will reduce latency when playing events.

Hope this helps
