Hey there. I’m having an issue with audio cutting out “randomly” as I play, and profiling/debug shows that my total channel count grows until it reaches the set limit, then things start cutting out.
The odd thing is that I am most definitely releasing my instances after stopping them, but they just seem to go virtual and never actually clean up, even when loading into a new scene (after making sure to release instances on destroy).
The return result of my stop() and release() calls are “OK” as well.
The issue was that the events use a sustain point to play a start and stop sound for the event, but when you press stop, the timeline never actually stops. I assume I’m just not doing this “the right way” so what would the right way to wrap a loop with a start and stop one-shot be?
I honestly expected the timeline to automatically go from “stopping” to “stopped” after the playhead had moved off of the last clip in the timeline.
But overall, the event is supposed to encompass a car’s engine. So when you press play, it plays a one-shot of the cars starter turning over, then the main idle/rpm loop takes over. This can be controlled through parameters to change RPM and load on/off etc. Once the engine is stopped it would “stop” the event, which causes the idle/rpm loop to stop, and the “engine off” sound to play so that it sounds like it’s sputtering out.
Absolutely. I’ll do you one better and make a minimum repro project with just this case in it.
I’m not sure where best to upload it, so I have it on my personal CDN here: http://zipline.janooba.com/u/fmodRepro.zip
All you need to do is:
Open event:/Mercedes/Mercedes_Engine
Press Play and let run for a few seconds
Press stop once and observe that the state does not go to “STOPPED”, but just continues playing the “Timeline” timeline until stop is pressed again.
Something about having another Parameter sheet in here seems to be what causes the issue.
Hi, since Connor is away, I will be continuing the investigation.
Thank you very much for uploading the project, that’s really helpful.
It looks like that the reason the event wasn’t stopped previously was because events with logic marker in the timeline logic track have no natural end, so they require manual stopping using Studio::EventInstance::stop().
Hope this helps, let me know if the issue persists
So then I would have to call stop twice it seems, once to trigger the stopping effect, then again to stop it completely later, does that sound correct?
Using the profiler, t have noticed that calling stop twice doesn’t fully terminate the event instance, leaving some resources active.
To address the issue, you could consider using a Command Instrument. Placing it at the end of the clip and set the command type to Stop Event - Immediate. This ensures the event stops completely when the timeline reaches the end of the clip.