FMOD waiting for user code in FMODUnity.dll to finish Executing

Hello
Im having an issue where sometimes when i stop play mode in unity the editor gets stuck on this message

image

and it seems to not stop until i forcefully close unity
I was wondering if anyone knew what was causing this

the FMOD version we use is 2022.2.18
any info would be great Thanks

In FMOD for Unity’s settings, can I get you to set your logging level to “Log” and enable API error logging, and provide me with a log from when this issue occurs? Note that you’ll likely have to retrieve the log from the relevant Unity log directory instead of from the editor.

Can I also get both your Unity and FMOD for Unity plugin versions?

yep the unity version we are using is 2022.3.14f1
and the fmod for unity version is also 2.02.18

Appologies ive only just seen the first part of the message i only say the second part asking for the unity and FMOD versions

ive set the settings up but cant seem to find any FMOD specific logs.
do you know what i should be looking for
thanks

No problem!

You’ll want to be looking for the log where you were able to reproduce the hang in Unity’s editor log directories - see Unity’s documentation on Log Files for the location on each platform.

Sorry to hijack this thread, but I’m currently experiencing the same issue w/ my project.

I wasn’t having any luck with the Unity logs, so I opted for a different approach.

I saw in the box Unity displays that the chunk of code that was being waited on was ‘RuntimeManager.HandlePlayModeStateChange()’ so I dropped a breakpoint in there to see how far I could trace it.

Upon exiting play mode I was able to step through the following functions:

FMODUnity.RuntimeManager.HandlePlayModeStateChange() [state = EnteredEditMode]
FMODUnity.RuntimeManager.Destroy()
UnityEngine.Object.DestroyImmediate()
FMODUnity.RuntimeManager.OnDestroy()
FMODUnity.RuntimeManager.ReleaseStudioSystem()
FMOD.Studio.System.release()
FMOD.Studio.System.FMOD_Studio_System_Release()

Upon stepping into ‘FMOD_Studio_System_Release()’ system appears to hang and I get the window pictured above.

Wondering if someone would be able to help me resolve this.

Thanks!

Another update, migrated to another computer and the problem persists, that means it’s not machine dependent. Currently on FMOD Studio 2.02 and Unity 2022.3.5f1.

Why might the studio system not release correctly?

Something callback related would be my first guess - for example:

  • Getting stuck in a user callback that is triggered when the system tries to release
  • A user callback (typicaly with behaviour that occurs when the system is releasing) not meeting the requirements set out in the Callbacks section of the FMOD for Unity user guide

If you’re using callbacks, especially those that would fire when the system is releasing, I would recommend making sure that the code there is safe and meets the requirements mentioned above.

Attempting to do something FMOD related (e.g. something like creating another system) from a different thread when the existing system is releasing may also cause issues. However, this is less likely unless you’ve modified the FMOD for Unity plugin heavily, or have a lot of your own custom editor code for interacting with FMOD.