ValveSoftware / unity-xr-plugin

OpenVR plugin for Unity's XR API
BSD 3-Clause "New" or "Revised" License
309 stars 64 forks source link

Vive Tracker (1.0) not working with Unity XR Plugin (editor or build modes affected) #20

Closed charlicopter closed 3 years ago

charlicopter commented 4 years ago

Turning a Vive tracker (1.0) on or off during runtime (editor or build) throws the exception: [XRInputSubsystem] A device disconnection with the id 3 has been reported but no device with that id was connected. If the tracker is powered on and detected by SteamVR during launch of the application (editor or build), there is no error, but the tracker is not registered by Unity, and stopping the application throws the same error.

zite commented 4 years ago

Give preview.11 a try and let me know if that fixes it.

charlicopter commented 4 years ago

Give preview.11 a try and let me know if that fixes it.

Unfortunately, the problem persists.

Edit: Further error information I missed...Stopping the player while the tracker is still connected throws a more detailed trace:

[XRInputSubsystem] A device disconnection with the id 3 has been reported but no device with that id was connected. UnityEngine.XR.Management.XRLoaderHelper:StopSubsystem() Unity.XR.OpenVR.OpenVRLoader:Stop() (at Library/PackageCache/com.valvesoftware.unity.openvr@1.0.0-preview.10/Runtime/OpenVRLoader.cs:330) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

zite commented 4 years ago

Looks like you're still on preview 10 from that log. It's possible the update didn't take. Try closing unity, reopening, then going to the package manager, OpenVR XR Plugin, and click update. Then close unity and reopen again, then test. If that still doesn't work try closing unity, deleting the folder Library/PackageCache/com.valvesoftware.unity.openvr@1.0.0-preview.10 then reopen.

charlicopter commented 4 years ago

Some progress: It was difficult to get Unity to take to "...preview.11", however I finally managed to get it up by removing the package from Unity entirely, restarting, reinstalling the package, restarting. Verified ...preview.11 in package manager and by browsing PackageCache + changelog. So there's probably a hang somewhere in there that doesn't like updating through the scoped registry, or something.

Anyway...Still same errors, but updated to "...preview.11":

[XRInputSubsystem] A device disconnection with the id 3 has been reported but no device with that id was connected. UnityEngine.XR.Management.XRLoaderHelper:StopSubsystem() Unity.XR.OpenVR.OpenVRLoader:Stop() (at Library/PackageCache/com.valvesoftware.unity.openvr@1.0.0-preview.11/Runtime/OpenVRLoader.cs:330) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

zite commented 4 years ago

That's strange. Can you reproduce the error and then give me a full editor log from %LocalAppData%/Unity/Editor/Editor.log you can paste it here: https://gist.github.com/

charlicopter commented 4 years ago

Lines 1555, 1564

https://gist.github.com/charlicopter/f8be7ee2226f8e9c81bc7995d6f60098

zite commented 4 years ago

Thanks for the log! Found another mismatched ids case. I think we've fixed this in preview-12 now.

charlicopter commented 4 years ago

Hey zite, Thanks for keeping on it. Unfortunately...preview-12 is still throwing the same errors :( Here's the latest log: https://gist.github.com/charlicopter/390558ed363b53065fd3addfa45f9880

zite commented 4 years ago

@charlicopter what role is that tracker set to in SteamVR under Settings -> Controllers -> Manage Vive Trackers?

charlicopter commented 4 years ago

@zite Currently I have it set to "Held In Hand" I typically use 4 trackers configured this way, but I've been doing all this troubleshooting with just one tracker.

zite commented 4 years ago

Still having trouble reproducing this. Have you done any additional configuration to the trackers? Swapped firmware or anything? Are you using a separate usb dongle to connect them?

charlicopter commented 4 years ago

@zite No additional config. Firmware is up to date. Using stock dongles, one for each tracker (4 total) There was another guy on the SteamVR Unity Plugin forum who reported the same issue here: https://github.com/ValveSoftware/steamvr_unity_plugin/issues/761

charlicopter commented 4 years ago

@zite :: I know it's been a while, but I figured I'd just check to verify that you are using the Vive tracker 1.0 and NOT the Vive tracker 2.0 to test on your end?

JashanChittesh commented 3 years ago

Just as a heads up: We've had an issue with at least one of our players that had Natural Locomotion (NaLo) installed. In the bindings, SteamVR logs and even SteamVR system report, everything looked perfect (controllers were properly assigned to roles, used the correct bindings and so forth). The trackers even did track properly via SteamVR_TrackedObject - but they were not recognized via SteamVR_Behaviour_Pose.

This was still with Unity 2019.4 and the SteamVR Unity Plugin (i.e. no Unity XR Plugin involved), so it's probably a different issue. But as this issue here also seems to be hard to reproduce, I thought I should mention it. With another player, I'm still investigating. The only thing potentially causing issues for that other player might be Revive (but we haven't confirmed that, yet).

I guess the best way to check is via the SteamVR System Report, section Configuration, look under Drivers.

In the logfile, that user had

driver 00natural implements interfaces IVRSettings_002 ITrackedDeviceServerDriver_005 IVRDisplayComponent_002 IVRDriverDirectModeComponent_004 IVRControllerComponent_001 IVRCameraComponent_002 IServerTrackedDeviceProvider_004 IVRWatchdogProvider_001 IVRVirtualDisplay_001 IVRDriverManager_001 IVRResources_001 Loaded server driver 00natural (IServerTrackedDeviceProvider_004) from D:\Program Files (x86)\SteamLibrary\steamapps\common\Natural Locomotion\driver\00natural\bin\win64\driver_00natural.dll

charlicopter commented 3 years ago

@zite I know this isn't a priority bug, but in the interest of keeping it alive for people who are developing for trackers in Unity moving forward:

I just got a bunch of V2.0 trackers and they work fine. There is definitely something wrong with the V1.0 tracker / Unity XR Plugin interaction.

nocanwin commented 3 years ago

Did a quick test and v1 trackers are broken for me too. v2 work.

zite commented 3 years ago

Found the issue and fixed it, sorry about it taking forever. It was indeed a tracker 1.0 issue, they don't return names for some reason so we were erroring out.

zite commented 3 years ago

This should be fixed in the latest release. Thanks again for reporting. https://github.com/ValveSoftware/unity-xr-plugin/releases/tag/v1.1.1b

kisak-valve commented 3 years ago

Closing per the last comment.