Lately I have been stress testing my game and letting the AI battle it out. Currently all my “Fire” sound effects are using RuntimeManager.PlayOneShot(fmodEvent, position).
I have Max Stealing set to 8 and Stealing set to Quietest for these events.
It seems the events are not being released and the Instance count keeps climbing the longer the game is played. Causing performance to drop off the longer the game is played.
I am not sure if this is something I am doing wrong, or not using PlayOneShot correctly?
I’m using Fmod 2.03.08 and Unity 6000.0.51f1.
Thanks for any help!
I did some more testing trying to figure this out. Here’s a new profile view.
The Profiler view in the first post you can see the Artillery_Fire events never end once created.
In this new Profiler view you can see they start and end. The Exit_Fighter events start and don’t end in both cases.
What’s the difference between those events? MetaXRAudio Source
I deleted the MetaXRAudio Source from all my weapon firing events just to test it. Any events with MetaXRAudio Source are not having their instance stopped and released while using PlayOneShot().
1 Like
@Connor_FMOD is this a bug with FMOD or the MetaXR Audio integration that I doscovered?
Who should I contact to see it fixed?
Hi,
Thank you for bringing this to our attention.
Unfortunately, I was not able to reproduce the issue with my test:
- I added the meta spatializer to the pistol event:
- Triggered it using the
PlayOneShot()
public class OneShot : MonoBehaviour
{
public FMODUnity.EventReference refEvent;
void Update()
{
if (Input.GetKeyUp(KeyCode.Escape))
{
FMODUnity.RuntimeManager.PlayOneShot(refEvent, transform.position);
}
}
}
- I found my events were being released as expected:
Please let me know if I have missed any steps, could I also please grab a screen shot of your events?
Thanks for looking into it Connor. I updated to meta_xr_audio_sdk_fmod_77.0. And the events started releasing as expected for a time.
However after letting the game run for longer, the events started to pile up and were not being released. See around the 4:40 mark.
I also attached a sample of one of my Events.
1 Like
Thank you for the screenshots, unfortunately I still can’t reproduce the issue.
Could I please grab the editor log with the following settings applied:
Would it be possible to package that profile session with the following settings:
And upload it your
profile?
I had a similar issue. One shot collectable sounds were not clearing up after they have been collected. I had around 200 hundred of them in a scene and they were piling up in the profiler.
If I switched scenes the sound events that were using the memory were cleared. Do you have a way to refresh the scene and check it on the profiler if it’s cleared?
My problem was that I set the one shots to be cleared in the game engine (Unity) when the object is destroyed. Selecting to clear the audio event on disabling the object fixed this issue for me. Now the audio event is being pooled by the limit I set on FMOD in Max Instances
.
Hi,
Thanks for the info.
For oneshots, it is suggested to call release()
directly after start()
: FMOD Engine | Studio Api Eventdescription - Studio::Eventdescription::Isoneshot.
Hope this helps!
Hi Connor, I uploaded the Profiler session and the editor-log to my Profile as requested. Let me know if you find anything,
Thanks!
1 Like
Hi,
Apologies for the delayed response. Thank you for the logs and the profiler recording. Playing back the recording, I only hear the background music and very sporadic events. Do you get the same?
If you create a test Unity project, just playing the one shot events do you still experience the issue? Testing a couple of the one shots I was still unable to reproduce the issue:
In the FMOD settings, do you have
Stop Events Outside Max Distance
enabled?
This behavior was recently updated to stop One shots from triggering if they are not audible:
FMOD Engine | Detailed Revision History. This may help with