Sounds still accessible after bank has been unloaded

Hi, we’re having an issue where a previously loaded bank can still play some sounds even after it has been unloaded.

We found this problem because we accidentally had an emitter in a scene playing an event that wasn’t in the required bank, but oddly, we could still hear it.

FMOD – 2.01.09
Unity – 2020.3.44f

Steps to reproduce -

  1. Load the first scene with the sound correctly in the bank.
  2. Change to our second scene, with the code unloading, releasing and unpausing all playing sounds to make sure the bank is unloaded.
  3. Go to the emitter in the second scene and the sound is audible. And no errors display, even for other sounds that correctly don’t play.

If you go directly to the second scene then the sound doesn’t play and you get the expected “Event not found” errors.

We’re using .assets in separate files with our banks in case that makes any difference.

Also we’ve debugged it ourselves and the “runtimemanagers.cs” does not have the bank which has the sound is in loaded it its “loaded banks”.

We get results from FMOD saying the event is still available using the code below -

FMODUnity.RuntimeManager.UnloadBank(bank);
When calling GetEventDescription line 1239
var result = Instance.studioSystem.getEventByID(guid, out eventDesc);
result equals FMOD.RESULT.OK

Any ideas on what could be causing this? Other sounds using the same banks seem to be unloading correctly, it seems to be not all sounds.

Any help would be really appreciated, thanks!

Alex

Hi,

Unfortunately, I was not able to reproduce the issue in 2.01.09 or in 2.02.18 loading banks in the first scene triggering an event. Unloading all banks and then trying to play the same event in a different scene.

Can I confirm the FMOD integration version you are using is 2.01? Unfortunately, we no longer support 2.01. This may be an issue that was solved in 2.02.07.

If you are in 2.02 could I get a screenshot of your FMOD integration settings Initialization tab:
image

Hi Connor,

Thanks for looking into this. Here is what we have setup in Unity -
FMOD Init Settings

All the banks are loaded code side so the default load setting is off. The only difference between what we’re are doing and what you’ve described testing, is that we are not unloading all banks, just the single bank which the sound is in.

We’re still doing some testing our end, it doesn’t look entirely like memory is getting freed up (using the profiler) when a bank is unloaded. Though the memory values given in the profiler vs the in built Unity Fmod UI overlay seem to differ.

Any advice/recommendations on what we could do next would be great.

Thanks,
Alex

Hi Alex,

Could I confirm the version of FMOD you are using?

Hi Connor,

The versions are -
FMOD – 2.01.09
Unity – 2020.3.44f

We are quite far along the dev cycle (game has been out for 2+ years), so are reluctant to upgrade FMOD versions unless we have too. . But I understand that might be the only option? This issue has come up due to porting

Are there any big code side changes between 2.01/2.02? I know when we previously upgraded FMOD is caused a load of code issues due to function changes.

Thanks,
Alex

1 Like

Hi Alex,

My apologies for missing that.

There are some significant code changes. However, we have created some tools to assist with the migration process like the Event Reference Updater.

I updated my tests and was unable to reproduce the issue. Would it be possible to upload the project to your profile to test on my side? Please note that you will have to register a project with us before you can upload files to your profile. If you cannot upload the project is it possible to create a simple project that exhibits the behavior?

Hi Connor,

We’re still investigating this our end. I’ve created a blank project and used our loading script and in that it works successfully and I was unable to reproduce the issue. Though the issue in the main game is from a custom spline emitter which I haven’t be able to bring across to the blank project yet due to it needing lots of other scripts and functionality to work.

We’re hoping to revisit this after Christmas and see if we can get to the bottom of it. If I get a test project which exhibits the bug I’ll send it over.

Thanks for your help,
Alex

1 Like