steam-audio icon indicating copy to clipboard operation
steam-audio copied to clipboard

[FMOD, Unity] Steam Audio Spatializer Occlusion Works Only Once Per Gameobject Then Misbehaves

Open Sorgon opened this issue 2 years ago • 4 comments

(Using steamaudio_fmod_4.0.3, Unity 2019.4.0f1, and FMOD 2.02.04)

I baked audio geometry and set up occlusion to be Simulation-Defined. On a gameobject I have a Steam Audio Source (with occlusion activated) and FMOD emitter.

First the sound will play as expected, but when I try to play the emitter again, there is no sound until I disable occlusion in FMOD live update.

I've tried this with emitters OnEnable, but also tried to play it from script, but the result was the same. Occlusion stops working correctly when I start to play the emitter again.

Sorgon avatar May 11 '22 07:05 Sorgon

And when I try to use Runtime.PlayOneshot, it doesn't work at all, since there is no way how to add Steam Source to it.

Sorgon avatar May 12 '22 12:05 Sorgon

I have the same issue. If you directly call instance.start() on the Event Emitter's instance, and never call Stop(), it works. Based on a lot of testing, the issue seems to revolve around when the emitter calls release() and clearHandle(). If you never call those, you can reuse the same instance, though this risks memory issues.

I think this has to do with how the Steam Audio FMOD Engine integration handles the FindDSP() function, though I can't be sure. Tests I've run indicate that the first time an Event Emitter creates an instance and calls an event, the Steam Audio Source calls UpdateParameters on FMODStudioEngineSource, which in turn calls FindDSP, which calls "MOD_DSP_getInfo.Invoke(mDSP, getInfoArgs)", and successfully finds a dspName in getInfoArgs. However, once the Event Emitter calls Stop(), and then Play() again, getInfoArgs returns null.

This seems to make Steam Audio, which can only use Event Emitters, very broken in FMOD--or at least, makes Steam Audio's primary capabilities for occlusion, pathing, etc. useless.

gamesfortourists avatar May 18 '22 02:05 gamesfortourists