Stuttering SFX when loading a scene

Hello,
I’m currently experiencing an issue as stated below:

When I’m loading a new scene, the audio stutters. Gradually, the audio loads in, but in small chunks, and it still sounds glitchy and stuttering while doing so. Some looping audio plays normally, but all of the one-shot SFX stutters.

When I tried messing with the FMOD settings, I found out that changing the “Advanced Loading Mode” from Compressed to Streaming in Build Settings fixes the issue, and the audio no longer stutters and works as normal. The scene does load a lot of things at first, so I do suspect long or heavy loading times since all the objects are loaded at the same time. But I already set limits to the instances and optimized the banks, and still it doesn’t work. I also tried playing with the Real Voice and Virtual Voice channel caps, and using Streaming with maximum caps solves the issue, while having a small cap around 100 RV and 256 VV causes the issue but slightly improved. While Compressed with maximum cap doesn’t fix the issue.

One thing also I found that if I tried enabling Live Update during mid-game immediately fixes the issue, even after a scene reload. But the bug returns if there is no Live Update enabled. All tests are run on Build and not on Editor. Editor works fine actually.

Thank you.

Hi,

Thanks for bringing this to our attention, could I please grab your Unity and FMOD integration versions?

FMOD 2.02.22 and Unity 2022.3.62f3 (current version where bug happens) as of now.
We are planning to upgrade Unity to 6000.0.67f1 for porting purposes

Thanks for the info, could you try updating to 2.02.35 and let me know if the issue persists?

How do you safely update the version? Do I just download the new version on unity asset store?

It can be downloaded from our downloads page

Or from the package manager

Both of these are valid ways to update the integration. Please make sure to create backups of the project before updating as well.

Thank you.
I have updated the FMOD, but the issue still persists

We did have a working solution for now, which is to separate the spawn of objects so that they won’t spawn all at once. But quite frankly, I’m also concerned that I’m not optimizing the assets and banks. So I wanted to solve this issue in FMOD first before going to the other solution

Thank you for updating the integration.

Could you record a profiler (FMOD Studio | Profiling) capture while connected to live update (FMOD Studio | Editing During Live Update) and let me know when playing back to recording in waveform mode (FMOD Studio | Profiling - Waveform Playback Mode) if you can still hear the stuttering?

This could let us know if it is the FMOD system that is stuttering or if something in the scene loading is causing the FMOD thread to stall.


The recording starts at 03:18:44, and yes i can still hear the stuttering if I playback the profiler

Here is the profiler session if you need it

Thank you for testing that and the recording.

Have you made any changes to the FMOD integration specifically to how the system is initialized on line 324 in the RuntimeManager.cs

FMOD.Studio.INITFLAGS studioInitFlags = FMOD.Studio.INITFLAGS.NORMAL | FMOD.Studio.INITFLAGS.DEFERRED_CALLBACKS; 

If using FMOD_STUDIO_INIT_SYNCHRONOUS_UPDATE (FMOD Engine | Studio Api System - Fmod::Studio::Initflags) the Unity game thread stalling could cause audio stuttering.

Could I also please see you build settings in the FMOD Studio preferences:

And how many streaming assets are you loading? Could we also please try enabling Bank Sample Data Loading

Thank you for the reply.

No, I didn’t touch any code on the RuntimeManager.cs . Here is a snippet of the mentioned line.

image

Actually none, even the ambience itself is using audio assets that are not set to streaming


It is already enabled, but for this scene specifically, we have a modified bank loader script with its own “Preload Sample” bool.


Here is the script for the modified bank loader

Hi,

Thank you for all the info and the code.

Having another look at your profiler capture, I can see that we are hitting our real voice limit

I am thinking that the audio glitching may be due to voices swapping in and out quickly rather than the audio actually stuttering.

If we look at the amount of instances being spawned

image

I am expecting it to be quite high. We have the priority system (FMOD Studio | Event Macro Controls Reference - Priority) that you could use to make sure the important events like The Gauntlet are never virtualized and will always be heard. Another option is increasing the real voice limit

This will increase the resource usage of FMOD however.