Partial XR input due to device split

I encountered a bug sometimes happening with XR devices. When it hits, the XR controller is split into multiple devices, each receiving part of the input. For example one device receives tracking and the other device receives button input. However only one of these devices passes input through the Input system. In the following gif you can see that the left controller only receives spatial input while the right controller only receives button input.7394144--903032--PartialInputBug.gif

This can be observed in the Input Debugger as well.

The four devices:

Here you can see both left controller devices. The left one receives button input while the right one receives spatial input:
7394144--903044--PartialInputBug2.gif

There are multiple flavors of this bug.

  • A controller only receiving rotation data but no position and vice versa
  • One controller works completely but the other works only partly

It only happens from time to time, however it seems that on some days it happens 5 times in a row, then for weeks it does not happen at all. I observed it with both Unity 2019.4 + LegacyXR as well as Unity 2020 + OpenXR. It happens with HTC Vive as well as Oculus controllers. It can occur in editor and in build. Therefore I think this problem is rooted in the Input System itself.

Technology stack

  • Unity and XR backend either

  • Unity 2019.4.5f1 + Legacy XR (OpenVR and Oculus)

  • Unity 2020.3.11f1 + OpenXR (multiple versions)

  • Input System Version 1.1.0-preview.3 (I know this is preview but 1.0 had some bug and it has been in preview for half a year now)

  • Windows Standalone64 build

5 Likes

Are you able to supply a sample project that you can submit via Help -> Report a bug ? If you do please respond with the issue # so we can check it out quicker. Also it would be helpful to see what bindings you are using for the controllers (for OpenXR in particular).

These are my Input bindings for OpenXR:


I’m pretty sure however that this info wont help you much because the problem 1. exists in both legacy XR and OpenXR and 2. is already present in the Input debugger.

Unfortunately, I’m not able to provide an example project right now. Because this bug is not consistently reproducible, I cannot even confirm that it occurs in a minimal example project. I think the bug should occur in the XR Interaction Example project from time to time.

You should probably be using left and right hand actions, especially for position and rotation and not one action and two bindings. The input system can only have one of the two bindings flowing data at the same time.

We are using the following code to create schemed assets for Left/Right, so effectively there is only one binding we subscribe to.

private static InputActionAsset CreateSchemedAsset(InputActionAsset asset, string controlSchemeName)
{
     var schemedAsset = Object.Instantiate(asset);
     var scheme = schemedAsset.FindControlScheme(controlSchemeName) ??
                         throw new InvalidOperationException($"scheme {controlSchemeName} not found");

     schemedAsset.bindingMask = new InputBinding {groups = scheme.bindingGroup};
     return schemedAsset;
}

var leftAsset = CreateSchemedAsset(asset, "Left");
var rightAsset = CreateSchemedAsset(asset, "Right");
leftAsset.Enable();
rightAsset.Enable();

99.9% of the time this works just fine.

Apparently, this issue has been resolved with Unity Input System 1.2.0