FMOD Integration with OpenHarmony OS

we have been working on integrating FMOD with the OpenHarmony Operating System (OS). During our development process, we encountered issues with audio silence and latency when using the libfmod.so library. We were able to resolve these issues by applying the following workarounds:

  1. Increasing the DSP buffer size with System::setDSPBufferSize(2048, 4).
  2. Utilizing the libfmodL.so library instead of the standard libfmod.
  3. Setting the driver with setDriver(1).

While these adjustments allowed us to proceed with our project, we are curious about why these settings are not the default or automatically configured for OpenHarmony OS. What are the potential trade-offs or costs associated with these specific configuration choices? Additionally, is the FMOD team working on improvements to address these issues for a better user experience on OpenHarmony OS?

We would appreciate any insights you could provide on the current performance considerations and any upcoming enhancements for FMOD on OpenHarmony OS.

Thank you for your time and consideration. We look forward to your response.

Hi,

Thank you for bringing this to our attention.

Both System::setDSPBufferSize(2048, 4) and setDriver(1) are known issues: FMOD Engine | Platform Speficifics - Open Harmony Known Issues.

We are not aware that using libfmodL.so has benefits. Would it be possible to try applying the two workarounds and using the libfmod.so and let me know if the audio silence issue persists?

Using CoreSystem->setDSPBufferSize() will increase latency.
Using setDriver(1) is known to cause some devices to crash, if low-latency playback is imported we suggest contacting contact@openharmony.io.

Hope this helps!

Hiļ¼Œ

Thanks a lot for your attention.

Me and a brunch of my co-workers are using libfmodL.soļ¼Œbecause it is not working with libmod.soļ¼Œbehaving as silent problem.

And also low-latency does import for most of our fmod using scenes. Thanks for you guidance, and we will contact contact@openharmony.io for more information and potential solutions. (just want to double check that opean is a typo, ya?)

Another problem we still want to bother you is that? whether there is or going to be a api that enables me to switch the ohaudio stream mode as game mode? So that when initializing fmod, it would automatically switch off all other audio process on background?

Thanks a lot for your help!

1 Like

Thank you for catching that typo!

I can definitely pass this on to our developers to investigate further. Could you elaborate more on the feature you want? What would be a use case?

Thanks a lot for your kind reply, and sorry for my late reply.

The main scene is like: ā€œYou are listening to some music on apps, and the you open a video game ā€ With the ohaudio stream as game mode, it would automatically call the system abilities to switch off all other sounds, letā€™s say in this case, turn off the music, and let the player more involved in the video game. Also, it would handle calling voice.

Thank you for the suggestion.

You may have to use the Open Harmony API to control the audio of the device. FMOD is only responsible for audio inside its program. If I have misunderstood please let me know.