New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

Memory problem with FMOD + Oculus Audio SDK plugin

samijtksamijtk Posts: 2
NerveGear
Hi guys,

I encountered this curious problem with Fmod (1.09.05) equipped with Oculus Audio SDK (1.1.5).

The problem I encountered is as follows:
When I start my FMOD session, the program reserves 51 200 K of memory.
When I play a relatively complex sound from the session with 3D panner equipped, the total of 65 216 K of memory is reserved.
However, when I play much simpler sound with Oculus Spatializer equipped (Attenuation enabled, Reflections disabled), the total of 836 264 K of memory is reserved.

This effect is naturally forwarded to Unity project I'm working on. It also seems that the Unity doesn't take this into account when loading FMOD sound banks as the first sound that uses the Spatializer triggers the memory reservation, which in turn causes a definite lag spike in the runtime.

The most accurate cause for the problem that I can point out is a bigger merge we did in the project version control a while back. Naturally, none of the programs and plugins (OculusSpatializerFMOD.bundle for Unity excluded) are held in the version control so therefore they should be unharmed. After finding the source of the problem, I've re-installed the FMOD, its integration in Unity and Oculus Audio SDK plugins in both ends with no change.

Would you have some tips on how to fix this problem of mine? Until this problem manifested, I've been very happy using Oculus Audio SDK in our VR project and it would be a great pity to ditch it due to this relatively small but really annoying bug.

Best Answer

Answers

  • imperativityimperativity Posts: 1,451 Oculus Staff
    Hi,

    Welcome to the Oculus Developer Forums.

    Thanks for bringing this to our attention. We will look into this on our end and I or another Oculus staff member will respond here with further information.
  • PeterStirlingPeterStirling Posts: 116 Oculus Staff
    Hi sam, thanks for the report. The spatializer does all the memory allocation up front to prevent run time memory allocations. It accounts for the worst case with maximum number of instances playing with long reflections and reverbs, we recently increased that limit to 128. The memory usage you're seeing is expected, but we recognize that 800MB is a lot of memory and we plan to improve this in the near future.
  • samijtksamijtk Posts: 2
    NerveGear
    edited June 20
    Hi imperativity and Peter and thank you for your answers. Your information is really helpful to understand what's going on. There remains but one thing that I don't yet understand.

    Is Spatializer supposed to do the memory allocation upon the first sound activation? What I'm looking for is whether it is supposed to do its memory allocation when e.g. FMOD's soundbanks are loaded or is it completely independent?

    This in itself is quite minor detail and I can always create a workaround where I just play some silent sound with Spatializer plugged in to trigger the memory allocation when suitable. Still, it would still be nice to know the alternatives if such exist.

    Thanks guys for your time.
Sign In or Register to comment.