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

Input simulation does not work with SteamVR as default OpenXR runtime (MRTK3)

Open rolandsmeenk opened this issue 2 years ago • 5 comments

Describe the bug

When the default OpenXR runtime is set to SteamVR, either through registry key or environment variable, the in editor input simulation does not work. No WASD camera movement and no hands appear with T or Y. Input simulation does work fine with both WindowMR OpenXR runtime and Oculus OpenXR runtime.

To reproduce

Due to other Unity projects involving the use of the SteamVR OpenXR runtime my system has a registry key HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenXR\ActiveRuntime = c:\program files (x86)\steam\steamapps\common\SteamVR\steamxr_win64.json

To reproduce this more easily you can manually switch the OpenXR runtime inside Unity with help of the following tools:

Use this library to switch runtimes: https://github.com/shiena/OpenXRRuntimeSelector

Here's a small menu script to be able to switch the OpenXR runtime from the Unity editor menu https://gist.github.com/rolandsmeenk/db01b840b3552a405901b096ed78b254

Note that OpenXRRuntimeSelector sets the XR_RUNTIME_JSON environment variable which is of higher priority than the registry setting.

After following the steps to setup MRTK3 and running the application in the Unity editor SteamVR will start up and a window will open with the Unity scene running in it. Input simulation does not work in that window and when switching to the Unity editor game view input simulation does not work either.

Setup

-Unity Version 2020.3.34f1 -MRTK3

Expected behaviour

I would like to see an extra check for the default OpenXR runtime to at least warn for this issue.

rolandsmeenk avatar Jun 09 '22 12:06 rolandsmeenk

Woah, this seems wild!

For the editor specifically, you can also select the runtime for play mode in the XR Plugin Management settings: image

For some reason though (both via the editor setting above and via changing my regkey with https://github.com/maluoi/openxr-explorer, I'm not able to repro this :/ do you have a VR headset attached to your PC when you're reproing this?

keveleigh avatar Jun 10 '22 19:06 keveleigh

Oops, first time actually noticing that Play Mode OpenXR Runtime field. Could have saved me some trouble.

I've not attached a VR headset, but configured a null driver because I only have a Vive tracker and not a headset. So that may make it a bit of an edge case.

rolandsmeenk avatar Jun 10 '22 22:06 rolandsmeenk

Ah interesting! It sounds like you might be hitting the guard in the input simulator that turns all the simulated devices off if an XRDisplaySubsystem is detected.

We could probably look into ways of making this guard optional, but it might be hard to tell if an XRDisplaySubsystem is available but no headset. One usually implies the other, but I'm not sure the OpenXR plugin checks for an actual HMD before spinning the subsystem up.

keveleigh avatar Jun 11 '22 01:06 keveleigh

@keveleigh what's the status on this?

Zee2 avatar Jul 22 '22 21:07 Zee2

@keveleigh did the recent updates to the OpenXR plugin (that also fixed the weirdnesses with Quest Link) fix this problem?

Zee2 avatar Dec 15 '22 04:12 Zee2