Oculus Audio SDK plugin for FMOD (Android) can not be found or crashes

My UE4 (4.12.4) projects works with FMOD Studio plugin just fine. However, I need to use FMOD plugin for Android from Oculus Audio SDK (since it’s more performance optimized for Gear VR).

I followed instructions for FMOD plugins, however, .so files are not located in Android/ folder, but in a subfolder. I tried placing Oculus’ FMOD plugin into Android/ and Android/ar… subfolder, plugins.txt with the filename inside into the same folders and at the end of the day my deployed project either crashes when launching on the device, or simply runs and can not find the plugin.

If someone from FMOD could provide me with contact info, I could send you debug log files from Gear VR.

Thanks beforehand

Here are the steps to get it up and running. I tested it with Oculus 1.0.4, but our last public release has packed up an older version. So the steps will include copying the libraries from the Oculus SDK into the FMODStudio plugin.

This was done a fresh code proeject in Unreal 4.12, using FMOD Studio 1.08.04 in the game’s Plugins directory.

  • Copy the latest 1.08.04 Oculus libraries into the FMODStudio plugin:

    • Copy AudioSDK\Plugins\FMOD\x64\ovrfmod.dll into FMODStudio\Binaries\Win64\
    • Copy AudioSDK\Plugins\FMOD\x64\ovrfmod.lib into FMODStudio\Binaries\Win64\
    • Copy AudioSDK\Plugins\FMOD\android\libovrfmod.so into FMODStudio\Binaries\Android\armeabi-v7a
  • Copy the latest 1.08.04 Oculus libraries into a FMOD Studio (either a Plugins directory where FMOD Studio is installed, or a Plugins directory under your FMOD Studio project directory)

  • In FMOD Studio:

    • Create an event, and replace the panner with an Oculus panner.
    • Go to Preferences -> Build and add Mobile platform, with default settings.
  • Make sure the FMOD Studio project exports into the game Content directory. You can do this with UE4 Help -> Validate FMOD. It will fix up FMOD Studio project output path and also add FMOD to the additional directories to copy.

  • Make sure the Oculus plugin is enabled. For most plugins, this would be done by the “Plugin Files” setting, but for Oculus, you can just tick “Oculus Enabled” under the FMOD Studio Oculus section.

  • Make sure the banks are exported.

  • At this point you should be able to drag an event into the level, and PIE and hear it.

  • For deployment on Windows, you need to create FMODStudio\Binaries\Win64\plugins.txt with the following line:

    ovrfmod

  • For deployment on Android, you need to create an APL file. Luckily the FMOD docs have an example that shows exactly what you need for the libovrfmod.so case. Look at the “Deployment of Android plugins” section in

    http://www.fmod.org/documentation/#content/generated/engine_ue4/deployment.html

  • Create FMODStudio\Binaries\Android\ovr_APL.xml and paste the xml from the above page.

  • Launch on Android. As it is building, you should see your file referenced in the output window, something like:

    LogPlayLevel: UnrealBuildTool: Adding YourGame\Plugins\FMODStudio\Source\FMODStudio\FMODStudioL_APL.xml
    LogPlayLevel: UnrealBuildTool: Adding YourGame\Plugins\FMODStudio\Binaries\Android\ovr_APL.xml

  • Also, have a look at the intermediate directory YourGame\Intermediate\Android\APK\libs\armeabi-v7a. There should be the two fmod .so files, as well as the libovrfmod.so file. If they aren’t there then it mustn’t have used the APL file properly.

  • The game should launch and play on Android.

1 Like

Yep, that did it, thanks! (except now I don’t get spatialized sound played; probably doing something wrong)

Hi there. It’s one year later, and things have changed. Using UE4 4.17.2 and FMOD Studio 1.10.01.

With this workflow listed above, I get most of the way there, and I’m getting spatial audio when in Play mode on the PC. But when I launch to the Android device (Galaxy S8+) I get a whole host of errors. Namely, a bunch of errors where it can’t find the OSP plugins. Not to mention some missing banks errors (although it seems to play fine with the OSP off).

LogPlayLevel: adb: 11-09 16:30:24.553 26183 26211 D UE4 : [2017.11.09-21.30.24:553][ 0]LogPluginManager: Mounting plugin FMODStudio
LogPlayLevel: adb: 11-09 16:30:24.595 26183 26211 D UE4 : LogFMOD: Error: …/android/src/fmod_os_misc.cpp(952) - dlopen failed: library “OculusSpatializerFMOD.so” not found
LogPlayLevel: adb: 11-09 16:30:24.596 26183 26211 D UE4 : LogFMOD: Error: …/android/src/fmod_os_misc.cpp(952) - dlopen failed: library “OculusSpatializerFMOD.so” not found
LogPlayLevel: adb: 11-09 16:30:24.596 26183 26211 D UE4 : LogFMOD: Error: …/android/src/fmod_os_misc.cpp(952) - dlopen failed: library “OculusSpatializerFMOD32.so” not found
LogPlayLevel: adb: 11-09 16:30:24.597 26183 26211 D UE4 : LogFMOD: Error: …/android/src/fmod_os_misc.cpp(952) - dlopen failed: library “OculusSpatializerFMOD32.so” not found
LogPlayLevel: adb: 11-09 16:30:24.597 26183 26211 D UE4 : LogFMOD: Error: …/android/src/fmod_os_misc.cpp(952) - dlopen failed: library “libOculusSpatializerFMOD.so” not found
LogPlayLevel: adb: 11-09 16:30:24.598 26183 26211 D UE4 : LogFMOD: Error: …/android/src/fmod_os_misc.cpp(952) - dlopen failed: library “libOculusSpatializerFMOD.so” not found
LogPlayLevel: adb: 11-09 16:30:24.598 26183 26211 D UE4 : LogFMOD: Error: …/android/src/fmod_os_misc.cpp(952) - dlopen failed: library “libOculusSpatializerFMOD32.so” not found
LogPlayLevel: adb: 11-09 16:30:24.598 26183 26211 D UE4 : LogFMOD: Error: …/android/src/fmod_os_misc.cpp(952) - dlopen failed: library “libOculusSpatializerFMOD32.so” not found
LogPlayLevel: adb: 11-09 16:30:24.598 26183 26211 D UE4 : LogFMOD: Error: Failed to load plugin ‘OculusSpatializerFMOD’, sounds may not play
LogPlayLevel: adb: 11-09 16:30:24.684 26183 26272 D UE4 : LogFMOD: Warning: …/…/src/fmod_effect.cpp(188) - Missing DSP plugin ‘Oculus Spatializer’
LogPlayLevel: adb: 11-09 16:30:24.685 26183 26272 D UE4 : LogFMOD: Error: …/…/src/fmod_bankmodel.cpp(314) - DSP plugin returned an error, bank will not load properly.

Make sure you have added the specific Android Oculus libs to the correct FMOD architecture folders in your project:
{Project Directory}/Plugins/FMODStudio/Binaries/Android/