Oculus Spatializer + Fmod + Unity

Hi there,

I have been trying to make this work for a few hours and can’t make it happen.

-I’m using Unity 2019.3.4f1
-I’m using Fmod 2.01.00
-Up until now, audio was working fine, the fmod implementation in Unity had no issues.
-So, tried to add the Oculus Spatializer to my setup.
-Downloaded this: https://developer.oculus.com/downloads/package/oculus-spatializer-fmod/19.0.0/
-Installed the plugin in fmod, everything works fine.
-Imported the supplied Unity package into Unity. (The one supplied with the fmod implementation, not a Unity standalone version).
-In Unity, added the Plugin name “OculusSpatializerFMOD” to the Plugins section on FMODStudioSettings.
-In Fmod, I used the Oculus Spatializer on a 3D event and built banks.
-When trying to play in editor, Unity throws the following error:

SystemNotInitializedException: [FMOD] Initialization failed : Loading plugin ‘OculusSpatializerFMOD’ from /Assets/Plugins/FMOD/lib/win/X86_64/OculusSpatializerFMOD.dll’ : ERR_FILE_NOTFOUND : File not found.

-Notice that Unity expects the plugin files to be at “/Assets/Plugins/FMOD/lib/win/X86_64”, but the package import puts them at: “/Assets/Plugins/X86_64”. Not sure why this happens.

-So, after reading some forum posts, I try to copy the plugin .dll file on the folder that Unity seems to want. Then I get this error:

Multiple plugins with the same name ‘oculusspatializerfmod’ (found at ‘Assets/Plugins/x86_64/OculusSpatializerFMOD.dll’ and ‘Assets/Plugins/FMOD/lib/win/x86_64/OculusSpatializerFMOD.dll’). That means one or more plugins are set to be compatible with Editor. Only one plugin at the time can be used by Editor

-So then I tried to delete the .dll files from where the packet import put them.
-That seems to work and Unity is “seeing” the plugin but then I get a different set of errors:

[FMOD] PostLoad::initPluginEffects : DSP plugin returned an error, bank will not load properly.

UnityEngine.Debug:LogError(Object)
FMODUnity.RuntimeManager:DEBUG_CALLBACK(DEBUG_FLAGS, IntPtr, Int32, IntPtr, IntPtr) (at Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs:32)

BankLoadException: [FMOD] Could not load bank ‘FMODAssets\Desktop/Master.bank’ : ERR_PLUGIN_MISSING : A requested output, dsp unit type or codec was not available.

-Which sounds like the plugin just can’t be read correctly for some reason. I can also add that on any of those cases, after error I’ve listed I’ve always found a set of fmod events and snapshot that where not found, which makes sense since the master bank could not be loaded.

So things I’ve tried:
-Install older versions of the Oculus Spatializer, a few previous ones and a few older ones.
-Checking 7 times that the plugin name is correct.
-Made sure I had a Oculus Spatial Reverb on the fmod master, as pre-fader.
-Tried doing everything from scratch but not import the Unity package, just copy the plugin file to the proper folder.
-In Unity, tried going to where the package puts the plugin (Assets/Plugins/x86_64) and exclude the plugin from Editor. This seems to remove the “multiple plugin” error but still throws the “DSP plugin” error.
-Tried also the above in reverse, excluding the other way around.
-In Unity, went to Edit > Project Settings>Audio and change the spatializer and ambisonic plugin there. I can choose OculusSpatilizer but doesn’t help.

So that’s where I am at the moment.
Any help please?

Thanks,
Javier.

Hi Javier,
I’ve been testing here, but haven’t managed to reproduce this issue yet. What is the Logging Level set to in your FMOD for Unity settings? Can you try setting it to WARNING and see if you get any additional console output? That may shed some more light on the problem.

Thank you,
Ben

Thanks Ben,

I think I managed to fix it. In case anybody finds this in the future, here is what I could see in the console:

[FMOD] PluginEffectModel::init : Missing DSP plugin ‘Resonance Audio Soundfield’

UnityEngine.Debug:LogWarning(Object)
FMODUnity.RuntimeManager:DEBUG_CALLBACK(DEBUG_FLAGS, IntPtr, Int32, IntPtr, IntPtr) (at Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs:36)

[FMOD] PostLoad::initPluginEffects : DSP plugin returned an error, bank will not load properly.

UnityEngine.Debug:LogError(Object)
FMODUnity.RuntimeManager:DEBUG_CALLBACK(DEBUG_FLAGS, IntPtr, Int32, IntPtr, IntPtr) (at Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs:32)

BankLoadException: [FMOD] Could not load bank ‘FMODAssets\Mobile/Master.bank’ : ERR_PLUGIN_MISSING : A requested output, dsp unit type or codec was not available.
FMODUnity.RuntimeManager.loadedBankRegister (FMODUnity.RuntimeManager+LoadedBank loadedBank, System.String bankPath, System.String bankName, System.Boolean loadSamples, FMOD.RESULT loadResult) (at Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs:703)

[FMOD] ObjectLookup::get : Lookup failed for EventModel: {821da335-a506-4dc6-a4a7-cefc5e90bff4}

UnityEngine.Debug:LogWarning(Object)
FMODUnity.RuntimeManager:DEBUG_CALLBACK(DEBUG_FLAGS, IntPtr, Int32, IntPtr, IntPtr) (at Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs:36)

EventNotFoundException: [FMOD] Event not found ‘snapshot:/Headphones’
FMODUnity.RuntimeManager.CreateInstance (System.String path) (at Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs:932)

[FMOD] ObjectLookup::get : Lookup failed for EventModel: {5765c19c-3e35-427d-973d-0c8ccb558a7e}

UnityEngine.Debug:LogWarning(Object)

So it looks like google resonance is screwing things up. I thought resonance was completely removed but it seems some remnants were still in fmod. I removed a couple of bypassed plugins in the fmod project and also the fmod plugin.

Re-built banks, re-started Unity and now I can play in Editor and have audio working!

Thanks for your help.

Ah great, I’m glad you managed to solve it!