This is a small shim library that goes in between an OpenVR runtime and the SteamVR lighthouse driver (driver_lighthouse.so) to allow USB devices to be reconnected to after they disconnect. Devices are matched by vendor ID, product ID, serial number, and interface ID after a disconnect and automatically reconnected to. Either the libusb or hidraw backend of hidapi can be used.
This library only works on x86_64 linux due to the way hidapi functions are hooked (hidapi is linked statically, so LD_PRELOAD
is not an option to do this). Porting to other architectures would be possible, other operating systems a bit more involved.
Build using cmake (requires hidapi and libelf dev packages).
Rename the original driver_lighthouse.so
to driver_lighthouse.so.1
and place the built driver_lighthouse.so
next to it.
For testing with lighthouse_console
, LD_PRELOAD
lhhid.so
, this will set up the hooks before calling main.
While devices are disconnected, tracking may (or in my case will) break, which may be disorienting. This is not a general solution for hotplugging lighthouse devices over USB, the purpose is just to recover from flaky connections without restarting everything.