Expected pressure on the CPU by FMOD threads

I’m wondering what’s expected pressure on the CPU by FMOD threads when using FMOD Unity integration? I have a simple scene with only one character where we’re playing a background music and some foley from time to time on the character. When profiling, I realized that more than 1/4 of CPU time is allocated to FMOD. I’m trying to optimize for performance the best as possible (every small optimization counts in our case) and I’m wondering if that’s expected or not? What we can do in order to reduce the pressure on the CPU done by FMOD?

The following screenshot was made when profiling Android device:

Also, I did comparison with plain Unity game which doesn’t use FMOD Unity integration (but Unity uses FMOD under the hood) and I realized that the number of FMOD threads is much much lower in the case when not using FMOD Unity integration.

You can see the difference in FMOD threads in attachments (one is plain Unity game and the other one is Unity game with FMOD Unity integration):

FMOD Threads when using FMOD integration for Unity:
fmod

Do we have an option to reduce the number of these FMOD threads in order to reduce the overhead connected with those threads?

FMOD threads when using plain Unity game without FMOD integration for Unity:
unity

Performance benchmarks for Android can be found in the Platform Details | Android | Performance Reference section of the documentation. These benchmarks are for an Android application using FMOD through JNI, so there will be additional overhead from the Unity/C# things on top of that, but the important details are:

  • FADPCM encoding is the default, but PCM has better performance for shorter sounds and Vorbis has better performance for long streams.
  • Sample rate of 24kHz is ideal.
  • CPU profiling is relatively inaccurate on Android compared to other platforms, but rooting the device and setting the CPU frequency to maximum will allow you to profile more accurately.

FMOD will need most of its threads, but you can disable the FMOD Studio Update thread by initializing FMOD with the INIT_SYNCHRONOUS_UPDATE flag, and call FMOD.Studio.System.update from your main thread or your own worker thread.
Another thing you could try if you are finding one core is getting hit too frequently by a thread (I am not sure how to check that using the profiling tool from your screenshot) you can potentially get better performance by adjusting the thread affinity of that thread in the FMOD Unity Settings, moving it to a core with less activity. More information on what each of these threads are doing can be found in the Threads and Thread Safety white paper.

Hi, thanks a lot for the reply! We’ll try the things that you’ve mentioned and come back to you if we find any problems.