Testing SteamVR-OpenHMD

If you want to use the Oculus CV1 with SteamVR in Linux, here is how to get it set up.

There are 6 steps to the process:

  • Be running Xorg (not Wayland, for now).
  • Make sure Steam + SteamVR are already installed.
  • Set up USB permissions so the driver can talk to your devices.
  • Install build pre-requisites
  • Get the right version of the code
  • Build and install

Xorg is required for now, because it provides the DRM lease APIs that let SteamVR claim the headset display device exclusively. For now, this isn’t supported on Wayland (although it will be at some point in the future)

Set up USB device permissions

Make sure your USB devices are accessible to your user account by configuring udev. See the OpenHMD guide here: https://github.com/OpenHMD/OpenHMD/wiki/Udev-rules-list. On some distributions you can just install the xr-hardware package as the simplest solution.

Install build pre-requisites

The OpenHMD branch depends on several libraries you need to install. Exactly how you do this depends on your Linux distribution. The libraries needed are:

  • hidapi
  • libusb
  • OpenCV (3.x or 4.x)
  • libjpeg (libjpeg-turbo recommended)

For Fedora, you can do:

dnf install hidapi-devel libusb-devel opencv-devel libjpeg-turbo-devel

Get the right version of the code

The controller-haptics-wip branch of my SteamVR-OpenHMD branch is the right one to build to get full support for haptics and device velocity reports. It also pulls in the right branch of the OpenHMD subproject.

Clone with:

git clone --recursive --branch=controller-haptics-wip https://github.com/thaytan/SteamVR-OpenHMD/

Build and install

Use meson to build and register the SteamVR-OpenHMD binaries. You may need to install meson first (see the bottom of this post for help with that):

meson -Dbuildtype=release build
ninja -C build
./install_files_to_build.sh
./register.sh
  • It is important to configure in release mode, as the kalman filtering code is generally too slow for real-time in debug mode (it has to run 2000 times per second).
  • Please note – only Rift sensors on USB 3.0 ports will work right now. Supporting cameras on USB 2.0 requires someone implementing JPEG format streaming and decoding.
  • It can be helpful to test OpenHMD is working by running the simple example. Check that it’s finding camera sensors at startup, and that the position seems to change when you move the headset:
./build/subprojects/openhmd/openhmd_simple_example

Start SteamVR. Hopefully it should detect your headset and the light(s) on your Rift Sensor(s) should power on.

Meson

I prefer the Meson build system here. There’s also a cmake build for SteamVR-OpenHMD you can use instead, but I haven’t tested it in a while and it sometimes breaks as I work on my development branch.

If you need to install meson, there are instructions here – https://mesonbuild.com/Getting-meson.html summarising the various methods.

I use a copy in my home directory, but you need to make sure ~/.local/bin is in your PATH

pip3 install --user meson