3rd Party plugin

Hi, all,

Got stuck again. I’m trying to compile and load example fmod-plugin, namely fmod_distance_filter, into fmod. What i’ve done so far on Windows:

  • compile low-level-api examples.sln with VS2015 and compiled fmod_distance_filter64.dll.
  • copied the dll to fmod and the plugin can be found and used.
  • built the banks into build/Windows and at the end Unity could use the bank (and plugin) on Windows.

The next step for me is to compile and deploy something like libfmod_distance_filter.so to Android. I was hoping fmod-android low-level-api examples.sln for Android could have some example code for libfmod_distance_filter.so. But the examples seem to be all for native Android apps (i can compile them fine, thanks to previous helps!!). I tried to write the fmod_distance_filter plugin for Android, but no luck to get it compiled and deploy correctly.

Hope i didn’t confuse you… my question is:

  • the banks i built in fmod is in build/Windows. If the banks will be deployed to Android, is that a problem?
  • Is there a similar way to compile libfmod_distance_filter.so for Android just as fmod_distance_filter64.dll can be compiled on Windows? Or I need to write and compile .so myself?

I’m using Unity-fmod integration version 1.07.06. the latest one had JNI_OnLoad issue.


Currently you’ll need to compile the distance filter example into a .so yourself. I’ve added a task to our tracker to include Visual Studio projects for building these.

It should be fairly straight forward to do though, using the NVidia NSight Tegra integration for Visual Studio, create a new project “Dynamic Library for Android Application”. Replace the auto generated code with the plugin code, add a search path for the FMOD headers and build.

Is this still the best way? I tried that, but ending up getting the error “FMOD_OS_Library_Load : dlopen failed: library “libc++_shared.so” not found”
I’m copying the code of the FMOD Gain example. I named the project fmod_gain64 with min sdk 23 and target sdk 26 and the arm64 target architecture.
The built “libfmod_gain64.so” I then copy to the plugins/fmod/lib/android/arm64-v8a folder with importsettings set to android and arm64.
When I build the same cpp file to a dll for windows and fmod studio, it works without any problem.
Maybe I’m doing something fundamentally wrong…

And I forgot to mention that I’m using Fmod 2.01.07

Hi Capraise

The simple explanation is that you need to change the build to not include a std library or link a standard library statically. Not linking a standard library is likely the easiest of those solutions as I don’t believe FMOD Distance filter makes use of any c++ std library calls.

The longer answer is that FMOD 2.1 is build with api compatibility with API 14 and is linking an older standard lib in line with that ndk and api version. It does a similar thing with the resonance plugin that we ship with, which for fmod versions 2.1 and prior, we link with ustl.

In new api versions/ndk versions, this has been replaced with other std library options, and certain build tools willl expect libc++_shared.so to be available to be dynamically linked. We have switched to this for FMOD 2.02 onward, but for previous versions, you will have to see the above recommendations.

Hi tristanjl
that makes a lot of sense, thank you for those insights! It works flawlessly by either including the file which I found now in the ndk or by statically linking it.