In my game I’m having an issue where occasionally, FMOD::Studio::EventDescription::getEvent () will not immediately return.
I’ve seen these hangs take anywhere from 100ms to 4000ms(4 seconds).
It only happens when many sounds are being triggered at the same time.
Here is a profile dump showing it cumulatively hanging for slightly over 1 second.
…Profiling: PlaySoundAtLocation (total running time: 1435.066 ms) —
…0 – Release (0.00 %) :: 0.004 ms / frame (18 calls)
…1 – Start (0.00 %) :: 0.005 ms / frame (18 calls)
…2 – CreateEvent (100.00 %) :: 1435.052 ms / frame (18 calls)
…Unaccounted: (0.000 %) :: 0.005 ms
…Profiling: CreateEvent (total running time: 1435.052 ms) —
…0 – createInstance (0.00 %) :: 0.010 ms / frame (18 calls)
…1 – getEvent (100.00 %) :: 1435.036 ms / frame (18 calls)
…Unaccounted: (0.000 %) :: 0.006 ms
I’ve linked against the logging version of FMOD in an attempt to get some information, it does show some spam that looks like this:
Build__1.10__API_Win\lowlevel_api\src\fmod_channel.cpp] FMOD(trace):FMOD_RESULT = 30 – An invalid object handle was used.
Build__1.10__API_Win\lowlevel_api\src\fmod_channelcontrol.cpp] FMOD(trace):FMOD_RESULT = 3 – The specified channel has been reused to play another sound.
(registered like this)
FMOD::Debug_Initialize(FMOD_DEBUG_LEVEL_WARNING | FMOD_DEBUG_TYPE_TRACE, FMOD_DEBUG_MODE_CALLBACK, FmodLogCallback)
Some other information that may or may not be relevant.
My maxChannels is 1024, my MaxAudibleSounds is 32.
I’m also using the phonon(steam audio) plugin, and most sound effects are using its spatializer, not fmods. Phonon does not report any errors. I’ve got indirect audio disabled because it runs like ass.
Any tips or help would be appreciated, thanks
I tried caching the EventDescriptions into my own hash map, to avoid calling getEvent.
This transferred the stall to happening during the call to FMOD::Studio::EventInstance::release()