MSA Soundfield plugin doesn't work unless MLListener in scene

Give us as much detail as possible regarding the issue you're experiencing.

I'm trying to implement MSA Soundfield. After some initial setup issues I got it working. I switched branches in github and came back to the project a day later, and in a device build, there was no audio at all.

This error appeared in the logcat log:

Info | Unity | [MSA - Info] Plugin Hub initialization successful!! Processor Offload False
Error | Unity | NullReferenceException: Object reference not set to an instance of an object.
Error | Unity |
Error | Unity |

(the last two lines are empty lines)

After some poking around I tried adding an MLListener alongside the AudioListener in the scene, and suddenly everything started working and the above error went away. According to the documentation, I don't think this step should be needed, unless you want to use the advanced features. However, removing this component made the error come back in builds.

Note that spatial audio works in-editor without the component.

Broken state:

Working state:

I'm not sure if it's relevant, but when adding the MLListener component, I get this happen in the editor in the console:

MonoScript is registered as both Editor and Runtime script!

Instance of MLListenerEditor couldn't be created. The script class needs to derive from ScriptableObject and be placed in the Assets/Editor folder.

[MSA] SDK/ZI audio is disabled, no compatible ML SDK found
UnityEngine.Debug:Log (object)
MagicLeap.Soundfield.MLListener:Start ()

Unity Editor version: 2022.3.8f1
ML2 OS version: 1.4.1
MLSDK version: 1.5.0
Host OS: (Windows/MacOS): windows 11

Error messages from logs (syntax-highlighting is supported via Markdown):

Hi @abebko,

Thank you for sharing this with us.

We will be sure to share this bug with our team. Thank you for being detailed with your description.



Hi @abebko,

What version of the MSA Soundfield plugin are you using?

There are three possible scenaries

  1. You were using a fairly old version of the plugin from before the auto listener was implemented. (Unlikely)
  2. You updated the plugin and tried to use it without restarting the project (so it was trying to use the new libraries with the old api calls). (Possible)
  3. You had created a new scene in a project that already had the "Auto Create ML Listener" checkbox unchecked (Defaults to checked when the plugin is initially installed, but can be disabled to prevent a possible second listener from being created in case the user desires to use additive scene loading). (Most likely)

Let me know if this helps,



Sorry for the delayed response.

I don't think any of those 3 situations apply to me.

  1. I installed 3.4.4 soundfield audio package.
  2. I tried restarting the project several times and it did not fix the issue
  3. I only have one scene in the project.

I also tried rebuilding the library folder, which did not fix the issue.

Furthermore, this issue is 100% reproducible, I can delete the MLListener and the errors come back up, and the audio no longer works. Re-adding it fixes everything.

Hi @abebko,

I will go ahead and create a bug ticket for this issue. Does the workaround work until we can solve this for you? Is this a blocker?



Not a blocker, It works fine with the MLListener in the scene

1 Like