Resonance Audio Room & Listener not found

Hello all.

This is more of a report than an actual question, since I seem to have found a way to prevent/fix it, and I though I should share the whole deal with users and personnel alike. Not sure if the source of the problem lies with FMOD, Unity, or Resonance though.

I was trying to run some tests with the Resonance Audio Rooms, when I came across this in the console:

[1st message]
Resonance Audio Listener not found in the FMOD project.
UnityEngine.Debug:LogError(Object)
FmodResonanceAudio:Initialize() (at Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs:235)
FmodResonanceAudio:get_ListenerPlugin() (at Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs:132)
FmodResonanceAudio:UpdateAudioRoom(FmodResonanceAudioRoom, Boolean) (at Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs:49)
FmodResonanceAudioRoom:OnEnable() (at Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs:83)

[2nd message]
[FMOD] assert : assertion: ‘mDescription.mDescription->paramdesc[index]->type == FMOD_DSP_PARAMETER_TYPE_DATA’ failed

UnityEngine.Debug:LogError(Object)
FMODUnity.RuntimeManager:DEBUG_CALLBACK(DEBUG_FLAGS, StringWrapper, Int32, StringWrapper, StringWrapper) (at Assets/Plugins/FMOD/src/Runtime/RuntimeManager.cs:28)
FMOD.DSP:FMOD5_DSP_SetParameterData(IntPtr, Int32, IntPtr, UInt32)
FMOD.DSP:setParameterData(Int32, Byte[]) (at Assets/Plugins/FMOD/src/Runtime/wrapper/fmod.cs:3132)
FmodResonanceAudio:UpdateAudioRoom(FmodResonanceAudioRoom, Boolean) (at Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudio.cs:49)
FmodResonanceAudioRoom:OnEnable() (at Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs:83)

[3rd message, repeated every frame]
Same as above, only this time the triggering function was, of course, FmodResonanceAudioRoom:Update().

It seemed to me that, for whatever reason, the code initially thinks that there is no listener in the project (even though there definitely is, and everything sounds as it should apart from the issue with the audio room). I noticed that the script uses the function FmodResonanceAudio.UpdateAudioRoom(this, FmodResonanceAudio.IsListenerInsideRoom(this)); both in the Update function and in the OnEnable function. I commented out line 83 in the Assets/Plugins/FMOD/addons/ResonanceAudio/Scripts/FmodResonanceAudioRoom.cs script, and problem solved, I think because now the listener had time to be visible to the system, before any audio room searched for it for the first time.

P.S.
Unity version 2018.3.9f1
FMOD Studio & Integration version 2.00.03

1 Like

Thanks for the feedback, we will look into this.

1 Like

You are correct, the script isn’t able to find it the first time through because it has not been created yet. The Listener DSP and the bus/channel group it is on won’t exist until a sound on that bus is started, or Bus::lockChannelGroup is used.

There does also appear to be a bug in the Initialize code, where it will return the last DSP even if a listener DSP isn’t found.

I’m not sure why this would be happening, do you have any steps for reproducing this issue?

2 Likes

Thank you for looking into it!

I am not exactly sure either. It had happened once again in the past though, with an older version of FMOD (1.10.xx), but I remember being equally perplexed back then as to why it could not find the listener. I have been trying to think if there is anything in particular about these projects (Unity & FMOD) that might cause this, but I cannot think of anything.

Sorry I couldn’t help further, and thank you all again for the marvelous work you’ve been doing! =)

1 Like

I’m experiencing this same issue here with the same error messages.

To reproduce:

  1. Create an FMOD project with a Resonance Audio Source and an Audio Listener.
  2. Build all banks.
  3. Add ‘resonanceaudio’ as Dynamic Plugin in FMOD Settings.
  4. Play project in Unity and audio should work with no error messages.
  5. Add an empty object with the FmodResonanceAudioRoom script and play again.
  6. See errors in console.

Was this ever solved? Thanks!

It looks like this hasn’t been fixed yet, possibly got missed, but I will give it a bump to see if we can fix it in an upcoming release.

In the meantime, you can work around this by calling Bus::lockChannelGroup on the specific bus that contains the Resonance listener before the FmodResonanceAudioRoom objects are enabled. This will ensure that the bus is created before the Resonance code goes looking into them.

1 Like

Thanks for the sollution cameron!

Here’s the most minimal code in Unity to make it work until a fix is available.

Currently on version 2.02.04

public class ResonanceRoomHotfix : MonoBehaviour {
void Awake()
    {
        var resonanceBus = FMODUnity.RuntimeManager.GetBus("bus:/{YourResonanceBusNameHere}");
        resonanceBus.lockChannelGroup();
    }
}
2 Likes

and put it where exactly?

As per @Stealcase’s suggestion, adding

in a void Awake() event function in any script should be a sufficient workaround for now.

That was not my question, where should it be in Unity?

I am sorry I do not understand your question, can you please rephrase? Do you mean where do you put the workaround script in Unity? If that is the case you need to put it on any game object in the scene.
Here is the workaround in more detail:

  1. Create a new script in Unity
  2. Add the following code to the script, replacing “bus:/{YourResonanceBusNameHere}” with the path to your bus containing the resonance audio listener. You can find the name of your bus by right clicking on it in the FMOD Studio Mixer window and selecting “Copy Path”
void Awake()
{
    var resonanceBus = FMODUnity.RuntimeManager.GetBus("bus:/{YourResonanceBusNameHere}");
    resonanceBus.lockChannelGroup();
}
  1. Attach the script to any game object in the scene by dragging the script onto it
  2. Play the scene and the issue should no longer occur
1 Like

Hey @jeff_fmod - thanks for explaining this in greater detail. Can you give an example of what a path to a bus containing the resonance audio listener would look like? Or how to identify the path? Appreciate it!

In FMOD Studio you can identify buses containing a resonance audio listener by running a query in the Mixer search bar. Typing #query:(Plugin.identifier == "Resonance Audio Listener") will filter all the buses containing a Resonance Audio Listener. For example, in this project the Resonance Audio Listener is on the SFX and VO buses:

Running the query returns all buses containing the a Resonance Audio Listener:

Copying the path for either of these buses will put bus:/SFX or bus:/VO in your clipboard respectively.

In Unity, to determine if a bus contains a plugin instance is less straightforward. You would need to perform a linear search from the master bus and down to any child buses for any instances of the “Resonance Audio Listener” dsp. Here is a basic example of how you do this on an event instance which should be a good starting point.