MixedRealityToolkit-Unity icon indicating copy to clipboard operation
MixedRealityToolkit-Unity copied to clipboard

[HL2] Hand tracking stuck after pause/resume

Open ptc-epassaro opened this issue 5 years ago • 15 comments

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:

  1. Create an empty Unity project
  2. Import the Windows XR Plugin and the MRTK Foundation package
  3. Add and Configure MRTK in the open scene
  4. Change the MRTK Configuration Profile to the one made for the XRSDK and clone it
  5. Disable the Boundary, Teleport and Spatial Awareness systems
  6. Make sure that Run in Background is disabled in the Player Settings
  7. In the Build Settings add the open scene, and deploy the app to the device
  8. When the app starts, bring your hands in view, then open the "Mixed Reality Home" and click on the Home button
  9. Resume the app by clicking on the window
  10. Observe that the hand mesh is stuck in one position
  11. 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

ptc-epassaro avatar Jan 25 '21 10:01 ptc-epassaro

The symptoms here seem related to https://github.com/microsoft/MixedRealityToolkit-Unity/issues/7896 (see video in latest comment by xwipeoutx)

Strepto avatar Jan 25 '21 17:01 Strepto

This also appears to be the same issue as #9151

HaydenLeeteUC avatar Jan 25 '21 20:01 HaydenLeeteUC

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.

polar-kev avatar Jan 27 '21 19:01 polar-kev

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!

ptc-epassaro avatar Jan 28 '21 15:01 ptc-epassaro

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.

polar-kev avatar Feb 05 '21 00:02 polar-kev

This issue reproduces in MRTK v2.5.4: #9238

Holo-Fiedel avatar Feb 11 '21 06:02 Holo-Fiedel

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 avatar Feb 19 '21 23:02 RogPodge

@RogPodge, can you share a link to the Unity bug here?

polar-kev avatar Feb 19 '21 23:02 polar-kev

We have to wait until Unity validates it. We'll keep you posted when it happens!

RogPodge avatar Feb 19 '21 23:02 RogPodge

@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 avatar Feb 25 '21 07:02 Holo-Fiedel

@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 :(

RogPodge avatar Mar 03 '21 19:03 RogPodge

@JBrentJ, any update from the Unity side on this?

polar-kev avatar Mar 10 '21 02:03 polar-kev

@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

RogPodge avatar Mar 12 '21 18:03 RogPodge

A fix from Unity is expected to land on May 7th and be available in the next XR SDK package.

polar-kev avatar Apr 28 '21 18:04 polar-kev

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.

keveleigh avatar May 26 '21 23:05 keveleigh