ValveSoftware / unity-xr-plugin

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

XRLoader.Initialize() returns false, XR not initialized, due to OpenVR display subsystem being null #97

Open IronWarrior opened 3 years ago

IronWarrior commented 3 years ago

When running in a simple scene (camera + hands with TrackedPoseDrivers) with only the OpenVR Loader checked, Initialize XR on Startup checked, XR fails to initialize. Using the debugger, in line 206 of OpenVRLoader, I can see that displaySubsystem and inputSubsystem are null. Not sure if relevant, but s_DisplaySubsystemDescriptors has a length of zero before CreateSubsystem is run at line 189.

This doesn't always happen, just randomly stops working sometimes. Affects every project I have. Using Unity 2020.3f3. Note that I do have the SteamVR library imported to make use of SteamVR's input, so that may be affecting it.

EDIT: Digging in, looks like line 109 of XRLoaderHelper from the XR Management package retrieves descriptors of display systems. I have a Rift CV1 plugged in, and it only returns "oculus display", when the method is searching for "OpenVR Display". This has previously worked without change to the code, so not sure what is going wrong there.