[HL2] Hand tracking stuck after pause/resume
Describe the bug
On HoloLens 2, after pausing and resuming the app, the hand mesh and the cursor appear to be stuck and don't track the hand, rendering any interaction impossible. Sometimes the cursor still follows the hand movement and it's possible to interact with objects, but the hand mesh never appears to resume tracking.
To reproduce
Steps to reproduce the behavior:
- Create an empty Unity project
- Import the Windows XR Plugin and the MRTK Foundation package
- Add and Configure MRTK in the open scene
- Change the MRTK Configuration Profile to the one made for the XRSDK and clone it
- Disable the Boundary, Teleport and Spatial Awareness systems
- Make sure that Run in Background is disabled in the Player Settings
- In the Build Settings add the open scene, and deploy the app to the device
- When the app starts, bring your hands in view, then open the "Mixed Reality Home" and click on the Home button
- Resume the app by clicking on the window
- Observe that the hand mesh is stuck in one position
- If necessary, repeat steps 8 and 9 multiple times. Sometimes the hand mesh keeps tracking the hand, but with a large offset.
Expected behavior
After resuming the app, the hand mesh and the cursor keep following the hand and it's possible to interact with objects in the scene.
Your setup (please complete the following information)
- Unity 2020.2.0f1
- MRTK 5.3.2
- Windows XR Plugin 4.2.1 (verified)
Appears also on Unity 2020.1.0f1 and 2019.4.0f1 with the respective verified Windows XR Plugin versions.
Target platform (please complete the following information)
- HoloLens 2
The symptoms here seem related to https://github.com/microsoft/MixedRealityToolkit-Unity/issues/7896 (see video in latest comment by xwipeoutx)
This also appears to be the same issue as #9151
hey @ptc-epassaro, have you tried this in Unity 2020 using the OpenXR plugin? I'm curious if you're seeing the same behavior there.
Hey @polar-kev, I just tried with OpenXR and this doesn't seem to happen. With OpenXR I could only see that, when trying to pause/resume multiple times in a row, the app closes and restarts when attempting to resume (after clicking on the window). It's not clear if the two things are connected though. Thank you for the quick replies!
Thanks for checking that @ptc-epassaro. As you suspected, @keveleigh, it looks like the main issue is fixed in OpenXR but there could be a related issue.
This issue reproduces in MRTK v2.5.4: #9238
Root caused this issue, it seems to be on the Unity side of things, in a vein that is similar to the issue that occured here: #8016
Basically, after resuming the application from suspended mode, the camera gets into a state where the tracked pose driver no longer seems to work properly. The entire scene gets "head-locked" so to speak, meaning that the camera and view behave in a way that is similar to running an application with no tracked pose driver attached to the camera.
I was able to replicate this in an application that did not use MRTK and was deployed to hololens using XRSDK. Filed a bug for Unity to look into and address it on their side of things, but not much we can do on the MRTK side of things at the moment :T
@RogPodge, can you share a link to the Unity bug here?
We have to wait until Unity validates it. We'll keep you posted when it happens!
@RogPodge, are there any news from the Unity issue? This behaviour turns out to be a Release Blocker for us.
There is, however, a workaround that can be temporarily employed to mitigate the effects until a fix is available: https://github.com/microsoft/MixedRealityToolkit-Unity/issues/9238#issuecomment-786005286
@Holo-Fiedel sorry for the late response, unfortunately no news from the Unity side of things, we're waiting on them for updates as they dig into it :(
@JBrentJ, any update from the Unity side on this?
@polar-kev @Holo-Fiedel this bug is now on Unity's issue tracker: https://issuetracker.unity3d.com/issues/xr-sdk-tracked-pose-driver-stops-working-after-suspending-play-while-run-in-background-is-unchecked
A fix from Unity is expected to land on May 7th and be available in the next XR SDK package.
The head-lock issue should be fixed in the latest Windows XR Plugin releases, and the stuck hand tracking should be fixed via #9890 in the upcoming 2.7.0 release.