Loading Bank from Asset Bundle cannot find event

Hi there!

We’re currently attempting to load an bank and strings.bank from an Asset Bundle, in addition to our Master Bank (and strings.bank), which is loaded in at initialization. However, when going to call an event from this bank, we are getting an EventNotFoundException.

Our general flow:

  1. Master Bank (+strings.bank) is included with build of application and loaded on initialization.
  2. Asset Bundle is downloaded when needed.
  3. Additional Bank (+strings.bank) is unpacked from Asset Bundle and loaded using RuntimeManager.LoadBank().
    [Additional Bank (+strings.bank) can be verified to be loaded using FMODUnity.RuntimeManager.HasBankLoaded()]
  4. Attempt to play specific event is made.
  5. EventNotFoundException is thrown.

Strangely, some other events play, but they play older versions of the events. We are also finding that a new Global Parameter is not appearing for one of the events (this is the only event in this bundle that uses the Global Parameter, we assume that this would be universal however).

What is strange is that if we manually load the banks into the editor, all the events play via the Event Browser, and they play correctly (not older versions).

The “Additional Bank” is marked as a master bank in FMOD Studio, could this be an issue?

Unity: 2019.4.13f1
FMOD: 2.01.05

Thanks for your attention, hope we can get this resolved soon!

I just tested out not including a strings bank for the additional bank downloaded via the Asset Bundle, and it appears that the events are working as expected now. I was under the impression that it was possible to import multiple strings banks at the same time, is this not the case?

Glad to hear it’s working as expected now, though it’s strange that it appears to be related to the additional string.bank since you should be able to load multiple.
I have been able to create an error similar to your’s by assigning events to multiple master banks at runtime- are any of the events in your Asset Bundle assigned to more than one master bank?

We aren’t assigning events to multiple master banks at runtime, but there are definitely cases where some events are assigned to more than one master bank. This is because our game systems need certain events (such as ambiences) to be available across different Asset Bundles.

We are still finding some problems, like a certain sound not being triggered when a parameter is changed (though this is not an issue in all cases). Our sound designer has now unmarked all the banks as master (besides the Master Bank), so we will try out another Asset Bundle with this change and see if this solves the issue.

Thanks for your response, I’ll update this thread again after we can test the change out.

Are there any cases where a new version of an event is loaded by an Asset Bundle? If you are updating an event with a new bank version then it’s possible the old bank isn’t being unloaded with RuntimeManager.UnloadBank and that would explain the outdated events.
As for the mistriggering, it would be useful to get some logging output. If you find you are able to recreate it again, if you could set your Logging Level to LOG in the FMOD Settings and post the output during the param change that would help a lot!

Sorry for the late response Jeff! Been flat out here.
I’ve been doing a bit more investigation, and most of the initially reported issues have been resolved. However, we are still getting one particular issue. Here’s our flow, as it might shine some light on what exactly is happening:

  1. Sound designer exports banks from FMOD Studio and hands off to programming team for asset bundling.
  2. Included is the newest version of the Master Bank (+strings.bank), and a bank associated with the 3D content that we are bundling.
  3. Bundling process occurs, with Asset Bundle including 3D assets and FMOD bank.
  4. Master Bank (+strings.bank) is packaged separately for download by users.
  5. A user accesses our Standalone Platform app, allowing them to create content for their game, which is primarily on Mobile.
  6. The Standalone Platform app downloads the Master Bank (+strings.bank) and loads them on start-up of the app.
  7. In the User content creation process, users can preview our ambiences that are available to them.
  8. When a specific ambience is played, and a specific parameter is altered, we are experiencing that one of the sounds that should be triggered by the parameter is not audible OR not being played. We are unsure if this is a one-off case at this current point in time.
  9. The user opens the Mobile app. As with the Standalone Platform app, the Master Bank is downloaded and loaded in - this uses the same system on both platforms.
  10. The user goes to use the outlined ambience. They trigger the parameter and the sound in question that was not heard in the Standalone Platform app can now be heard.

One thing that I’m wondering is whether or not our FMOD Studio Platform setup is the culprit. Currently we only export for Mobile platform. Could this be an issue?

I’ve included Editor logs of both platforms, from the time of the ambience being triggered. I can see that some of the samples from the sound that should be playing are present in the Standalone logs (such as “Thunder_Clap/Rumble”) but I can’t glean too much else from these logs. Would appreciate your eye on it!
StandalonePlatformLogs.txt (231.5 KB)
MobileLogs.txt (231.7 KB)

Thanks so much for your help with this!

I’ve noticed that neither of your logs have any parameter changes. There should be something to the effect of [FMOD] AsyncThread::threadFunc : Starting Asynchronous operation on sound 00000123456789AB. If you definitely recorded parameter changes in those logs then something is wrong with the setParamaterByName or setParameterByID call, either an invalid ID or name depending on which one you were using.
One thing you could try is connecting the FMOD Profiler and see if any param changes come through. These will be visible in the ‘Lifespans’ graph- more information on the specifics are in the docs.

Mobile banks should work fine on Desktop- it’s not ideal in terms of quality, but I don’t think it would be the cause of this issue. There are potential repercussions for using Mobile-targeted AssetBundles on Desktop; there is some mention of it in earlier Unity docs (under Are AssetBundles cross-platform?), though I’m not sure if the advice has changed since then.
That said, I haven’t been able to recreate any unexpected behaviour with param changes by using banks loaded from Mobile-targeted AssetBundles on Desktop, so definitely try connecting the profiler and see if the parameters are changing correctly, if not make sure the correct values are being passed to the param change calls.

I’ve noticed that neither of your logs have any parameter changes. There should be something to the effect of [FMOD] AsyncThread::threadFunc : Starting Asynchronous operation on sound 00000123456789AB . If you definitely recorded parameter changes in those logs then something is wrong with the setParamaterByName or setParameterByID call, either an invalid ID or name depending on which one you were using.

Hmm, that’s odd. The parameter change definitely triggers the correct behaviour on Mobile, and I’ve just hooked up the Profiler to the Editor on both platforms and can see that the parameter change appears.

We’re using a system that changes parameters via the StudioGlobalParameterTrigger component. Each time we trigger a new parameter, if our AmbienceController object does not have a StudioGlobalParameterTrigger that matches the triggered parameter, we add another instance of that component to the GameObject. The systems are identical across both our platforms. Unfortunately, I am unsure how the setParameterByID call would be messing up…

There are potential repercussions for using Mobile-targeted AssetBundles on Desktop;

Ah, I should have mentioned that we create a unique Asset Bundle for each distinct platform, so we have one for iOS, Android, Windows, Mac and Linux. Each of these does contain the Mobile bank however.

I was able to see some discrepancy in the API calls view between Mobile and Standalone when setParameterByID is called.

Standalone:

Playback::frame, 2048
System::setParameterByID, {4132888366,3403377239}, 1, false
System::setListenerAttributes, 0, {{0,0,0},{0,0,0},{0,0,1},{0,1,0}}, {0,0,0}, false
EventInstance::set3DAttributes, 2099968, {{960,540,0},{0,0,0},{0,0,1},{0,1,0}}

Mobile:

Playback::frame, 2048
EventInstance::stop, 2103424, 0
EventInstance::release, 2103424
EventDescription::createInstance, 2099072, 2104704
EventInstance::start, 2104704
System::setParameterByID, {4132888366,3403377239}, 1, false
System::setListenerAttributes, 0, {{0,0,0},{0,0,0},{0,0,1},{0,1,0}}, {0,0,0}, false
EventInstance::set3DAttributes, 2104448, {{0,0,0},{0,0,0},{0,0,1},{0,1,0}}

With the systems being more or less identical however, I’m wondering what could be causing the discrepancy in API calls.

EDIT: Actually, after trying to record a new Profiler session, I realize that it seems like those Event Instance calls are just our button which is hooked up to trigger the parameter. It plays a click sound as well.

Ah, so I seem to have solved the issue, though I’m still not entirely sure what the issue was!

On Mobile, the AmbienceController GameObject is nested inside the prefab that it corresponds to. Users use this parent prefab to access the functionality to call our ambience playing functionality, and the parameter triggering functionality.
In our Standalone app, it followed a similar format, where it was nested inside the prefab that allows users to preview ambiences and parameter changes.
I moved the AmbienceController GameObject out of this preview prefab, and the appropriate storm sounds when our Weather parameter is set to 1 are now audible!

Thanks so much for your help Jeff. I’m unsure if this is helpful in any way, especially as you were not able to reproduce our issue on your end. To anyone else that might be experiencing something similar, definitely try to play around with your hierarchy, as it may solve your issue!


I am also getting some strange behaviour from adding StudioGlobalParameterTrigger components at runtime, though this does not occur on Mobile editor. A number of NullReferenceExceptions appear at the same time. I will have to do some testing to see if this occurs in a build, but I believe it is something to do with the Inspector slider specifically. The errors do not occur if the AmbienceController GameObject is not open in the Inspector. We can definitely live with this issue!