Issue loading banks in Xamarin for iOS

I’m hoping I can get a little help with the problem I’m having.
I’m using Xamarin and currently just focusing on the iOS side.
I was able to build properly with the non-logging lib of FMOD, and initiating a system and generating a default setting utilizing the Unity general implementation approach with adaptation.

When loading a bank,

LoadedBank loadedBank = new LoadedBank();
FMOD.RESULT loadResult = Instance.studioSystem.loadBankFile(path, FMOD.Studio.LOAD_BANK_FLAGS.NORMAL, out loadedBank.Bank);
                if (loadResult == FMOD.RESULT.OK)
                {
                    loadedBank.RefCount = 1;
                    Instance.loadedBanks.Add(path, loadedBank);
                    Debug.WriteLine("Loaded bank " + path);
                    if (loadSamples)
                    {
                        loadedBank.Bank.loadSampleData();
                    }
                }

LoadResult is OK, but when I check after that:

system.getBank(bankName, out bank);
bank.getLoadingState(out FMOD.Studio.LOADING_STATE loadingState);

loadingState results in UNLOADED, and the events are failing to show either.

Some troubleshoot confirmation:

  • I am using the path to the .bank file (not the .string.bank), and confirmed the file size is approx. as expected (using FileInfo(path).Length), so the file is definitely where i’m directing to.
  • I also confirmed that if I give an incorrect path the library doesn’t give OK on result.
  • Before adding the file to the build this way, I did an assembly add with file stream, and tried to load the file using the loadBankMemory method, with similar result, so I assume the system is not properly set, rather than the iOS file read is faulty, but documentation is sparse on initialization and I’m overall following the unity RuntimeManager initialization so I assume I’m covering most cases.

Does anyone have thoughts as to why this would happen? what could possibly prevent loading the bank?

Thanks,
Daniel

I was using version 2.00.08, but just tested on 2.00.03, and issue is still present.

Problem identified, and is currently solved, but leads to more questions.

More information:
Changed the library to Logging library, and now I’m getting more insight.
skipping all init log since it looks ok, and isn’t relevant as far as I’m aware.

Running this several times with a button for testing:

Debug.WriteLine(“Running LoadBank”);
RuntimeManager.LoadBank(bankName, true);
Debug.WriteLine(“Post LoadBank”);

Produces the following debug:
Running LoadBank
[LOG] Manager::readBank : fileversion = 125, compatVersion = 119 (oldest = 44, newest = 125)
[LOG] Manager::finishLoadBank : Bank with guid {395b5d46-968f-4e6f-a4d3-fb79714905c7} has already been loaded

Meaning the library is loaded, but does not resume the code that follows LoadBank. I assume this is because some sort of inside FMOD bug that forces return or breaks something.

The other problem I identified is that the events do not retain their name on a mobile build in my FMOD project for unexplained reason. However, referring to them directly from their GUID works. Not ideal if I had a lot of events, but in this case it’s tolerable.

In the Unity Integration, the RuntimeManager.LoadBank function doesn’t attempt to load a bank that has already been loaded but instead increments a ref count.

To be able to use names/strings to refer to events and other objects, the strings bank/s need to be loaded beforehand.

Truely, however I’m pointing out that the Debug.WriteLine(“Post LoadBank”); is not running, and its breaking the continuation of the rest of the code coming forward.

Now that I know that I can go around it, but it forces some quirky coding.

The other note that I mention is that for the loaded bank when running

tempBank.getEventList(out FMOD.Studio.EventDescription eventDescriptions);
foreach (var desc in eventDescriptions)
{
counter++;
desc.getPath(out string path);
desc.getID(out Guid id);
Debug.WriteLine(counter + " " + path + " with guid " + id.ToString());
}

The path is empty for some reason.
Loading the event using the GUID straight out of FMOD studio works fine. Not ideal, but usable and working.