Audio locked on App start. No head tracked audio. Often starts hard panned to left or right

I think you mean not using AVAudioSessionSpatialExperienceBypassed in the workaround above? By all means, give it a try! For VR apps, the “Bypassed” spatial audio will still be spatialized if you have your audio sources in Unity set to use spatial audio. What’s going on here is that Unity is doing work to spatialize audio, and sending that out over stereo channels to the device’s speakers. We’re asking visionOS not to then try and spatialize that stereo feed, because Unity has full control of the audio experience. So to be clear, if you are using the workaround above in a VR app, you should still be getting spatialized audio. If you aren’t please take a look at the AudioSources in your scene and make sure they are set to 3D, and that your AudioListener is attached to the main camera used for VR rendering.

For MR apps, you might want to try using AVAudioSessionSpatialExperienceHeadTracked in the workaround above. I haven’t tried this yet, but indeed that default setting should be working and will make it so that the audio from your app appears to be coming from the center of the volume.

In my MR unbounded mode project, We use our Spatial Audio Plugin and add the follow line.

[audioSession setIntendedSpatialExperience:AVAudioSessionSpatialExperienceBypassed options:@{} error:nil];

We have an error below: Server returned an error from destroySession:. Error Domain=NSCocoaErrorDomain Code=4099 “The connection to service with pid 39 named was invalidated from this process.” UserInfo={NSDebugDescription=The connection to service with pid 39 named was invalidated from this process.}

Spatial Audio effect is no working.

In my VR project, it works fine. We use same Spatial Audio Plugin, same add AVAudioSessionSpatialExperienceBypassed , there is no error.

Unity: 2022.3.23f1
com.unity.polyspatial.visionos: 1.1.6
com.unity.xr.visionos: 1.1.6

Hm… I’m not familiar with this error. Is audio working at all? It’s possible that the error is just a red herring.

Does your Unbounded MR scene have an AR Session and a TrackedPoseDriver configured to track the user’s head? You don’t get spatial audio “for free” in MR without something moving the Transform with the AudioListener attached.

If you do have an XR Origin/Camera/AudioListener set up, and you’re still not hearing spatial audio, that’s a bug. Please submit a bug using the bug reporter (Help > Report a bug...) with a project that reproduces the issue. If you aren’t able to send your full project, please create a new project with the minimal setup needed to reproduce the issue along with steps for how to reproduce it, what you are seeing, and what you expect. If you are having trouble uploading a large project to the bug reporter, feel free to remove the project zip and include a download link from Google Drive or some secure file sharing service. Without being able to replicate the issue on our end, we won’t be able to solve it.

Confirming the hack below allows Unity’s Spatial audio output to be heard on VisionOS 1.12 using polySpatial 1.2.3, ( MR unbounded mode)

adding the following code on line 141 of Classes/ (in the startUnity method) in the generated Xcode project:
[audioSession setIntendedSpatialExperience:AVAudioSessionSpatialExperienceBypassed options:@{} error:nil];