FMOD Assertion mNumSubSounds' failed (Unity Player)


Currently, I’m working on a project where we’ve migrated the audio system from Unity to FMOD (in the middle of the game development).

The audio overall works fine with the all fmod features but I got some serious problems during the tests. The error that I got isn’t often and shows from time to time but it’s a serious one I guess and I would like to solve it.

We’ve migrated: the dialogue system to audio tables and also we’ve created the script to play sound from UnityPlayer via FMOD. Does anyone know what can be the cause of the problem and how to solve it?

[FMOD] assert : assertion: 'index >= 0 && index < mNumSubSounds' failed
0x00007ffe0648a9bc (UnityPlayer) 
0x00007ffe064903d9 (UnityPlayer) 
0x00007ffe0646f208 (UnityPlayer) 
0x00007ffe07983810 (UnityPlayer) UnityMain
0x00007ffe0702c503 (UnityPlayer) UnityMain
0x000002b86176ce9b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x000002b86176c83b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x000002b86176bcbe (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000002b8d96758ba (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x000002b8d9675783 (Mono JIT Code) [RuntimeUtils.cs:574] FMODUnity.RuntimeUtils:DebugLogError (string) 
0x000002b8cee0560b (Mono JIT Code) [RuntimeManager.cs:79] FMODUnity.RuntimeManager:DEBUG_CALLBACK (FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr) 
0x000002b8be32c4db (Mono JIT Code) (wrapper native-to-managed) FMODUnity.RuntimeManager:DEBUG_CALLBACK (FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr)
0x00007ffe022c8b05 (fmodstudioL) FMOD::System::update
0x00007ffe022febd2 (fmodstudioL) FMOD::getGlobals
0x00007ffe022bbe72 (fmodstudioL) FMOD::Sound::getSubSound
0x000002b8ba7d7f7f (Mono JIT Code) (wrapper managed-to-native) FMOD.Sound:FMOD5_Sound_GetSubSound (intptr,int,intptr&)
0x000002b8ba7d7e13 (Mono JIT Code) [fmod.cs:1790] FMOD.Sound:getSubSound (int,FMOD.Sound&) 
0x000002b8d61d6bf3 (Mono JIT Code) [FmodDialogueAudioHandler.cs:72] FmodDialogueAudioHandler/<Load>d__9:MoveNext () 
0x000002b8be2edf51 (Mono JIT Code) UnityEngine.SetupCoroutine:InvokeMoveNext (System.Collections.IEnumerator,intptr)
0x000002b8be2ee140 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_object_intptr (object,intptr,intptr,intptr)
0x00007ffe025e00e0 (mono-2.0-bdwgc) mono_get_runtime_build_info
0x00007ffe02562ac2 (mono-2.0-bdwgc) mono_perfcounters_init
0x00007ffe0256bb1f (mono-2.0-bdwgc) mono_runtime_invoke
0x00007ffe06f1727d (UnityPlayer) UnityMain
0x00007ffe06f139cc (UnityPlayer) UnityMain
0x00007ffe06eec325 (UnityPlayer) UnityMain
0x00007ffe067de814 (UnityPlayer) UnityMain
0x00007ffe06ac9ab7 (UnityPlayer) UnityMain
0x00007ffe06ab443e (UnityPlayer) UnityMain
0x00007ffe06ab450f (UnityPlayer) UnityMain
0x00007ffe06aba632 (UnityPlayer) UnityMain
0x00007ffe064c0c1f (UnityPlayer) 
0x00007ffe064be89b (UnityPlayer) 
0x00007ffe064c4616 (UnityPlayer) 
0x00007ffe064c55db (UnityPlayer) UnityMain
0x00007ff7dc6111f2 (Infection Free Zone) 
0x00007ffe6ab17604 (KERNEL32) BaseThreadInitThunk
0x00007ffe6bfe26a1 (ntdll) RtlUserThreadStart


What version of FMOD are you using? Would it be possible to see how you are playing and releasing your Programmer Sounds? I will link to our Unity Integration | Scripting Examples - Programmer Sounds which may help identify the issue.

Hi @Connor_FMOD ,

yes. Our programmer used the scripting examples that you posted above. Unfortunately, the scripting examples needed to be upgraded because of the old audio system (which was created strictly at Unity Engine without FMOD before). We needed to read the audio length of the .wav ID file from auditable and that’s probably a problem.

I would like to ask one more question: is there any official way to get an audio length from the .wav ID in auditable which is in the programmer’s instrument before played?

We are using 2.02.11


I will link this solution: Programmer Sounds length is always 0 - #2 by aishi which will allow you to check the length of the audio file.

Are you still experiencing the assertion issue?

Hi Connor,

it seems that the solution above works and we don’t have any assertion issue because of the programmer instruments so far. However, we got one because of the “FMOD Studio VCA Set Volume” but I’m not sure if that’s still a good thread here to continue the topic. If not then we can close the topic and launch the new one. We got also several other errors with the programmer instrument when we are replaying the same audio file 3 times [FMOD] SoundSourceInstrumentInstance::startChannelIfReady : Resource type 1 for instrument {f7dcc0de-6a9c-4d96-b002-3790aa46b20e} has returned 30 and will now stop.

This is what assertion error we are getting with VCA:

[FMOD] assert : assertion: 'index >= 0 && index < mNumSubSounds' failed
0x00007ffc48b9a9bc (UnityPlayer) 
0x00007ffc48ba03d9 (UnityPlayer) 
0x00007ffc48b7f208 (UnityPlayer) 
0x00007ffc4a093810 (UnityPlayer) UnityMain
0x00007ffc4973c503 (UnityPlayer) UnityMain
0x0000017eec41abeb (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x0000017eec41a5cb (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000017eec419aee (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x000001819d9b098a (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x000001819d9b0853 (Mono JIT Code) [RuntimeUtils.cs:574] FMODUnity.RuntimeUtils:DebugLogError (string) 
0x0000017ee59fdc0b (Mono JIT Code) [RuntimeManager.cs:79] FMODUnity.RuntimeManager:DEBUG_CALLBACK (FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr) 
0x0000017ee2ac25eb (Mono JIT Code) (wrapper native-to-managed) FMODUnity.RuntimeManager:DEBUG_CALLBACK (FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr)
0x00007ffc47b78b05 (fmodstudioL) FMOD::System::update
0x00007ffc47baebd2 (fmodstudioL) FMOD::getGlobals
0x00007ffc47b6be72 (fmodstudioL) FMOD::Sound::getSubSound
0x00007ffc479f54cd (fmodstudioL) 
0x00007ffc47a9721a (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47a980ba (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47a97123 (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47a95d83 (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47a9eb21 (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47a9e90e (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc479ce381 (fmodstudioL) 
0x00007ffc47aa97db (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47aa69bb (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47aa9590 (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc479d94f2 (fmodstudioL) 
0x00007ffc479d722a (fmodstudioL) 
0x00007ffc47a5a260 (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47a73f91 (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47a72410 (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47a7215c (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47a72d9a (fmodstudioL) FMOD_Studio_VCA_SetVolume
0x00007ffc47b80461 (fmodstudioL) FMOD_File_SetDiskBusy
0x00007ffc47b8a04c (fmodstudioL) FMOD_Thread_SetAttributes
0x00007ffc47c143a4 (fmodstudioL) FMOD::SystemI::createMemoryFile
0x00007ffca8887ac4 (KERNEL32) BaseThreadInitThunk
0x00007ffcab2aa351 (ntdll) RtlUserThreadStart


Good to hear the initial issue is solved. It is ok to continue to work on the issue here.

I haven’t been able to reproduce either of the other errors. Would it be possible to get a stipped-out version of the Unity project that is exhibiting the behavior uploaded to your profile? Before uploading you will have to register a project with us.