Closed MiPa12 closed 10 months ago
This issue has been marked as stale by an automated process because it has not had any recent activity. It will be automatically closed in 30 days if no further activity occurs. If this is still an issue please add a new comment with more recent details and repro steps.
We appreciate your feedback and thank you for reporting this issue.
Microsoft Mixed Reality Toolkit version 2 (MRTK2) is currently in limited support. This means that Microsoft is only fixing high priority security issues. Unfortunately, this issue does not meet the necessary priority and will be closed. If you strongly feel that this issue deserves more attention, please open a new issue and explain why it is important.
Microsoft recommends that all new HoloLens 2 Unity applications use MRTK3 instead of MRTK2.
Please note that MRTK3 was released in August 2023. It features an all-new architecture for developing rich mixed reality experiences and has a minimum requirement of Unity 2021.3 LTS. For more information about MRTK3, please visit https://www.mixedrealitytoolkit.org.
Thank you for your continued support of the Mixed Reality Toolkit!
Describe the bug
Hi, I need to switch between mulitple devices during runtime (Desktop, HP Reverb G2 and Hololens 2). Currently, I'm working on the device switch between Desktop and VR. When I disable XR with StopXR() and try to enable it afterwards with StartXR(), then I'm not able to provide Inputs to the motion controllers anymore. The headset is working fine, I'm able to see the controllers but an input is not possible anymore. If there is any ohter way to do this, I would be happy about any advice.
For this I'm using the following code:
Error message
After calling StartXR() (before that StopXR() was executed once) , then I stopped unity and after running unity again the follwing error occurs and inputs to the controller,which are implemented by the new input system, are not possible anymore:
Could not recreate input device 'HP HP Reverb G2 Controller OpenXR (XRInputV1)' with layout 'XRInputV1::HP::HPReverbG2ControllerOpenXR' and variants 'Default' after domain reload UnityEngine.InputSystem.LowLevel.NativeInputRuntime/<>cDisplayClass7_0:b 0 (UnityEngineInternal.Input.NativeInputUpdateType,UnityEngineInternal.Input.NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate (UnityEngineInternal.Input.NativeInputUpdateType,intptr)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes (System.Type[])
InvalidOperationException: Cannot find parent 'devicepose' of control 'devicepose/istracked' in layout 'XRInputV1::HP::HPReverbG2ControllerOpenXR' UnityEngine.InputSystem.Layouts.InputDeviceBuilder.InsertChildControl (UnityEngine.InputSystem.Layouts.InputControlLayout layout, UnityEngine.InputSystem.Utilities.InternedString variant, UnityEngine.InputSystem.InputControl parent, System.Boolean& haveChildrenUsingStateFromOtherControls, UnityEngine.InputSystem.Layouts.InputControlLayout+ControlItem& controlItem) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Devices/InputDeviceBuilder.cs:557) UnityEngine.InputSystem.Layouts.InputDeviceBuilder.AddChildControlIfMissing (UnityEngine.InputSystem.Layouts.InputControlLayout layout, UnityEngine.InputSystem.Utilities.InternedString variants, UnityEngine.InputSystem.InputControl parent, System.Boolean& haveChildrenUsingStateFromOtherControls, UnityEngine.InputSystem.Layouts.InputControlLayout+ControlItem& controlItem) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Devices/InputDeviceBuilder.cs:508) UnityEngine.InputSystem.Layouts.InputDeviceBuilder.AddChildControls (UnityEngine.InputSystem.Layouts.InputControlLayout layout, UnityEngine.InputSystem.Utilities.InternedString variants, UnityEngine.InputSystem.InputControl parent, System.Boolean& haveChildrenUsingStateFromOtherControls) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Devices/InputDeviceBuilder.cs:337) UnityEngine.InputSystem.Layouts.InputDeviceBuilder.InstantiateLayout (UnityEngine.InputSystem.Layouts.InputControlLayout layout, UnityEngine.InputSystem.Utilities.InternedString variants, UnityEngine.InputSystem.Utilities.InternedString name, UnityEngine.InputSystem.InputControl parent) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Devices/InputDeviceBuilder.cs:193) UnityEngine.InputSystem.Layouts.InputDeviceBuilder.InstantiateLayout (UnityEngine.InputSystem.Utilities.InternedString layout, UnityEngine.InputSystem.Utilities.InternedString variants, UnityEngine.InputSystem.Utilities.InternedString name, UnityEngine.InputSystem.InputControl parent) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Devices/InputDeviceBuilder.cs:102) UnityEngine.InputSystem.Layouts.InputDeviceBuilder.Setup (UnityEngine.InputSystem.Utilities.InternedString layout, UnityEngine.InputSystem.Utilities.InternedString variants, UnityEngine.InputSystem.Layouts.InputDeviceDescription deviceDescription) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Devices/InputDeviceBuilder.cs:51) UnityEngine.InputSystem.InputDevice.Build[TDevice] (System.String layoutName, System.String layoutVariants, UnityEngine.InputSystem.Layouts.InputDeviceDescription deviceDescription) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/Devices/InputDevice.cs:678) UnityEngine.InputSystem.InputManager.AddDevice (UnityEngine.InputSystem.Utilities.InternedString layout, System.Int32 deviceId, System.String deviceName, UnityEngine.InputSystem.Layouts.InputDeviceDescription deviceDescription, UnityEngine.InputSystem.InputDevice+DeviceFlags deviceFlags, UnityEngine.InputSystem.Utilities.InternedString variants) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/InputManager.cs:1033) UnityEngine.InputSystem.InputManager.RestoreDeviceFromSavedState (UnityEngine.InputSystem.InputManager+DeviceState& deviceState, UnityEngine.InputSystem.Utilities.InternedString layout) (at Library/PackageCache/com.unity.inputsystem@1.0.2/InputSystem/InputManager.cs:3420) UnityEngine.InputSystem.LowLevel.<>cDisplayClass7_0:b 0(NativeInputUpdateType, NativeInputEventBuffer*)
UnityEngineInternal.Input.NativeInputSystem:NotifyUpdate(NativeInputUpdateType, IntPtr)
UnityEngineInternal.Input.NativeInputSystem:Update(NativeInputUpdateType)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes(Type[])
Furthermore, when I enable/disable XR multiple times I got multiple Instances of those devices as depicted in the image below. When I stop Unity and run Unity again those device duplicates stay. I need to restart unity or remove those device duplicates manually to get it work again:
Expected Behavior
run Unity:
stop Unity:
To reproduce
Steps to reproduce the behavior:
Your setup (please complete the following information)
Target platform (please complete the following information)
Thanks.