ERR_INVALID_HANDLE after loading scenes

[FMOD] EventInstance::release(2116352) returned ERR_INVALID_HANDLE for STUDIO_EVENTINSTANCE (0x204B00).

After I switch scenes, some scenes get this error and some don’t.
And I’ve checked that Scene A only uses the StudioEventEmitterz Component to control the audio, but it still gives this error when I switch to Scene A.
Sometimes there is more than one of this errors after switching scenes.

And one strange thing is that when my version of Fmod for Unity was 2.02.11, these errors would affect the playback of the audio, but when updated to 2.02.13, the errors would still appear but not affect the audio playback.

Following is my version:
Unity 2020.3.19f1
Fmod for unity:2.02.13 (previously 2.02.11)
Fmod Studio: 2.02.11


When you say switch scenes is this in play mode or while just working on scenes?

Could you elaborate on what you mean by this?

What were the effects you were experiencing? Was the audio stopping or distorting in some way?

It’s in play mode.
The effect is audio stopping but only the BGM stopping which is DONTDESTROY,SFXs were not being affected.
The BGM will stop only when the error is reported a second time, and will still be playing when the error is reported the first time.(onlt when the version was 2.02.11)

After I updated to 2.02.13,BGM won’t stop.


Thanks for the information. Could I see a code snippet that is causing the error to be thrown? Or what are you trying to do to the event that is causing the error?

Thank for your replay.
The error occurs immediately after switching to a new scene, at which point I have no code control or expected event effect. And in the scene where the error is reported, I am not using code to control the Eventinstance, all I am using is StudioEventEmitter.
I observed that the error was reported as Eventinstance::release, is it possible that there was a problem with the Eventinstance release in the previous scene?

Thank you for clarifying, and you are calling DoNotDestroy() on the EventEmitter that is triggering the error. It sounds like the reference to the original instance is being lost when transitioning between scenes. It might be worth keeping track of the EventInstance yourself. This scripting example explains how to start and EventInstance using a EventReference: Unity Integration | Scripting Examples - Basic.

Hope this helps!