Hi, I am making a game in mixed reality mode, and from time to time, I encounter an error in Xcode where my head position and rotation stops working altogether (stuck at one pose ). Could you help me fix this problem? I was trying to reset Ar Session but it didn’t help (_arSession.Reset()).
Xcode error
Error in AR data provider state change handler. Error: ar_session_error_code_data_provider_failed_to_run, Failed provider: PositionAndRotation.
UnityEngine.XR.VisionOS.VisionOSSessionProvider:DataProviderStateChangeHandler(IntPtr, AR_Data_Provider_State, IntPtr, IntPtr)
Unity 2022.3.20f1
polyspatial 1.1.4 and 1.1.6
device vision OS 1.0.3 or 1.1.1
Hey there! Sorry to hear you’re having trouble.
Hm… that’s quite odd. Are you switching in and out of unbounded mode on your VolumeCamera? Is there anything else that happens that could be triggering the AR Session to stop working? Have you tried this?
_arSession.enabled = false;
_arSession.enabled = true;
I think that should do the same thing as _arSession.Reset(); but I’ve mostly tested these types of things by enabling or disabling the session object when transitioning in and out of bounded mode.
It will help if you can submit a project that reproduces the issue in a bug report (Help > Report a bug...). That way we can see what you’re seeing and investigate the issue when it happens. If we can’t replicate the issue on our end, it will be very challenging to resolve. Any project that replicates the issue would be fine. If you are having trouble with slow upload times on the Unity bug reporter, please feel free to use Google Drive or some other secure file sharing service, and include a download link in the bug report.
Thank you for reaching out, and good luck!
Thank you for your response. I’ve implemented the suggested solution, but unfortunately, it hasn’t resolved the issue. The problem tends to occur specifically in Mixed Reality mode when mesh scanning is active. Through my investigation, I’ve found that it can be reliably reproduced by toggling the ‘enable/disable ArMeshManager’ button, which activates or deactivates mesh scanning. The errors persist until this sequence is executed.
FingerCollision] -> Click on: ScanningButton
Adding AR data provider for feature PositionAndRotation
UnityEngine.XR.VisionOS.VisionOSSessionProvider:Update(XRSessionUpdateParams, Configuration)
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update(XRSessionUpdateParams)
UnityEngine.XR.ARFoundation.ARSession:Update()
Adding AR data provider for feature PlaneTracking
UnityEngine.XR.VisionOS.VisionOSSessionProvider:Update(XRSessionUpdateParams, Configuration)
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update(XRSessionUpdateParams)
UnityEngine.XR.ARFoundation.ARSession:Update()
Adding AR data provider for feature Body3D
UnityEngine.XR.VisionOS.VisionOSSessionProvider:Update(XRSessionUpdateParams, Configuration)
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update(XRSessionUpdateParams)
UnityEngine.XR.ARFoundation.ARSession:Update()
Running AR session.
UnityEngine.XR.VisionOS.VisionOSSessionProvider:Update(XRSessionUpdateParams, Configuration)
UnityEngine.XR.ARSubsystems.XRSessionSubsystem:Update(XRSessionUpdateParams)
UnityEngine.XR.ARFoundation.ARSession:Update()
Error in AR data provider state change handler. Error: ar_session_error_code_data_provider_failed_to_run, Failed provider: PositionAndRotation.
UnityEngine.XR.VisionOS.VisionOSSessionProvider:DataProviderStateChangeHandler(IntPtr, AR_Data_Provider_State, IntPtr, IntPtr)
After encountering this error, I’m unable to reactivate head tracking despite several attempts. Here’s what I’ve tried:
- Utilizing ArSession.Reset();
- Toggling _arSession.enable from false to true after setting it to false
- Loading a bounded scene followed by reloading the Mixed Reality scene
Unfortunately, none of these methods have proven successful, and the only solution so far has been to force quit the application. I would greatly appreciate any guidance on resolving this issue, particularly if there’s a specific call or action needed to reactivate the AR session.
Hey there! Sorry to hear you’re still having trouble. I’ve done a “naive” test of just trying to turn the mesh manager on/off at runtime but I wasn’t able to replicate the issue. Could you please submit a bug report with a sample project that replicates it?