Sound just stops playing after about 30 minutes

I have this bug where after a Certain amount of time all Fmod events stop working through the entire game. This only happens on this one map but once it happens absolutely zero Fmod sounds will play.
I tried to see if anything in particular happens to recreate the behaviour but I was unable to find a setup that works. It seems to just stop either when doing nothing for 30 minutes or by entering or exiting triggers that play sounds.

Has anyone else had an issue like this and if so how have you been able to solve it? I have tried updating Fmod and I’ve tried re-importing it but I still have not gotten it to work properly. If I play on my 2nd level where I only have 1 fmod sound trigger in total it did not stop playing so I am very stumped for what can be the issue.

Do you have any parameters that are automating the volume/mix levels? And just to clarify, is this happening when you are running the scene for 30min or do you mean it also happens if Unity sits there doing nothing for 30min?
I suggest attaching the Profiler after the sound disappears and seeing if any sounds are coming through. You can also try setting your Logging Level to “LOG” and seeing if any errors are coming up. Other than that, what version of Unity and FMOD are you using?

Hello Jeff,

It only happens when I run the scene for 30 minutes. If I restart the game or re-enter play mode via unity editor again the sound works again. One thing I have seen though which I forgot to mention is that whenever the sound stops working it takes ages to close the game and usually ends up in a freeze or crash. I don’t know if this is Fmod related or not.

I will try attaching a profiler to see i that will help me in troubleshooting.
My unity version is 2021.1.14f1
FMod studio Version 2.00.11
The implementation of Fmod in Unity I think was version 2.01 but I don’t remember 100%

I should also mention that I have upgraded Unity version to make the game HDRP compatible and with that FMOD stopped working as intended so I re-installed it and re-implemented the integration. This issue was not present before the unity upgrade but it seems weird that it should come just after a re-installation.

I will try attaching a profiler like you said 1st off to see if I can decipher what might be the issue.

Hello, I attached a Profiler to the game and ran it in the Editor for an extended period of time and I see that the total instances increase by about 100 per second even though there are only 1 (max. 2) sounds playing at the same time. The CPU and Memory use also goes up linearly with the Instances. I am not quite sure what might be causing this. To play the sounds in the game I use a trigger with an FMOD Studio Event Emitter.

I figured out the issue. Thanks for the tip with the Profiler.

The issue in case anyone else is in the same situation is that I apparently instantiated a new EventInstance with a sound file every frame the game was running. I just made the variable a global one and instantiated it in start instead and just called the functionality for it in update.

Ah that explains the high resource usage and slow shutdown. Glad you were able to get to the bottom of it!