Skip to content
SteamVR plugin for using OpenHMD drivers in SteamVR
Branch: master
Clone or download
Christoph Haag
Christoph Haag use -Wall
Latest commit 20204d1 Mar 11, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docker cleanup and update Readme Dec 5, 2017
resources fix last sample name to openhmd Sep 18, 2017
subprojects Make register and unregister script work on all known configurations Feb 18, 2019
.gitmodules move module to subprojects/ Apr 1, 2018
CMakeLists.txt
LICENSE add boost license like OpenHMD Mar 1, 2019
Readme.md add HMD manufacturer string override and document gaze pointer Mar 11, 2019
SteamVR-OpenHMD.kdev4 add kdev project Sep 22, 2017
build-win64.txt add cross file from dxvk Apr 1, 2018
docker.sh cleanup and update Readme Dec 5, 2017
driver.vrdrivermanifest disable alwaysActivate Apr 1, 2018
driver_openhmd.cpp use -Wall Mar 11, 2019
driverlog.cpp initial port into separate project Sep 18, 2017
driverlog.h initial port into separate project Sep 18, 2017
install_files_to_build.sh
meson.build add simple meson build Apr 1, 2018
ohmd_config.h
paths.sh Make register and unregister script work on all known configurations Feb 18, 2019
register.sh Make register and unregister script work on all known configurations Feb 18, 2019
steamvr.vrsettings initial port into separate project Sep 18, 2017
unregister.sh Make register and unregister script work on all known configurations Feb 18, 2019

Readme.md

SteamVR Plugin for OpenHMD Drivers

Status/TODO

  • controller buttons are currently unimplemented and pressing any button does nothing
  • controller models - OpenHMD doesn't provide a method (yet) to get rendermodels, so default (Steam Gamepad controller) is used
  • Controllers are not used by default because of those limitations. To change the default you can use the config file mechanism (on Linux) or change the default config in ohmd_config.h in the else branch (index 2 and 3 are controllers) before compiling

Possible improvements:

  • updating tracking data asynchronously in a separate thread might improve smoothness (if there is a problem)
  • feeding vector acceleration values to SteamVR? Would that improve tracking or make OpenHMD's tracking worse?

Before building: Use latest git OpenHMD (optional)

cd subprojects/openhmd
git pull origin master

Install needed packages (Ubuntu):

sudo apt-get install build-essential cmake libhidapi-dev 

Build with cmake:

git clone --recursive https://github.com/ChristophHaag/SteamVR-OpenHMD.git
cd SteamVR-OpenHMD
mkdir build
cd build
cmake ..
make

OpenHMD is included as a git submodule. An OpenHMD shared library will be built first and the steamvr plugin will link to the OpenHMD library built in build/external/openhmd/libopenhmd.so. If you want to package the SteamVR plugin, make sure you have libopenhmd.so in your library search path or package the openhmd library too and change the rpath.

If you use the Vive and want to use the (imperfect) values from https://github.com/OpenHMD/OpenHMD/pull/90, go to external/openhmd and run git pull origin pull/90/head before the make step to merge the pull request locally.

Run (easy for linux):

Run ./register.sh. add This overwrites SteamVR's settings with a steamvr.vrsettings that disables all SteamVR hardware plugins that ship with SteamVR (Vive lighthouse, Oculus, etc). The current SteamVR config will be backed up to steamvr-config-backup/. Then it registers the current build directory as a SteamVR plugin.

To do the reverse, run ./unregister.sh.

Run (detailed for linux, adapt to your operating system)

First register the driver with SteamVR:

~/.local/share/Steam/steamapps/common/SteamVR/bin/linux64/vrpathreg adddriver ~/SteamVR-OpenHMD/build

The directory given to vrpathreg should contain driver.vrdrivermanifest, resources/ and bin/linux64/driver_openhmd.so.

If you use a HMD for which SteamVR already has a plugin (currently Vive and Oculus Rift), copy the steamvr.vrsettings file that disables those plugins into Steam's config directory.

cp ~/SteamVR-OpenHMD/steamvr.vrsettings ~/.local/share/Steam/config/steamvr.vrsettings

Don't forget to make a backup if you have special SteamVR settings.

Now run SteamVR and check ~/.local/share/Steam/logs/vrserver.txt for errors.

Build and run with docker:

git clone --recursive https://github.com/ChristophHaag/SteamVR-OpenHMD.git
cd SteamVR-OpenHMD
docker.sh

This will create a docker container running the same GCC as Steam uses, so the driver will be compatible with Steam runtime libstdc++ library. The script docker.sh will create the container, build the driver, register it with steam (using vrpathreg adddriver as described above) and, if the build is successful, it launches steamVR using STEAM_RUNTIME_PREFER_HOST_LIBRARIES=0 so Steam uses it's own runtime environment to run steamVR.

This method is simpler to build the driver and builds a driver fully compatible with the steam runtime, no matter the distro you're running. You just need to have Docker installed!

Configuration:

Upstream pull request to follow: https://github.com/OpenHMD/OpenHMD/issues/8

For now. $HOME/.ohmd_config.txt is used.

Example content for a HMD 0, nolo HMD tracker 1, nolo controllers 2 and 3:

hmddisplay 0
hmdtracker 1
leftcontroller 2
rightcontroller 3

or a single HMD 0 with no controllers

hmddisplay 0
hmdtracker 0
leftcontroller -1
rightcontroller -1

This defines 4 openhmd devices.

  • hmdddisplay is opened for the display config. Choose this for the actual HMD like Vive, Oculus Rift, etc.
  • hmdtracker is opened for tracking the head. Choose a different index than the HMD if you have a NOLO tracker (or in the future a Vive tracker).
  • leftcontroller and rightcontroller are the indices for the controllers. There are no separate trackers for controllers for now but it's easy to hack in.

If the config file is not available (probably only works on linux), default values are used. Change them in ohmd_config.h.

Gaze Pointer with gamepad

At least SteamVR Home supports controller based navigation, however it is only enabled when the Manufacturer string provided by the plugin is "Oculus".

The Manufacturer is usually set to what OpenHMD provides as hardware vendor but in SteamVR-OpenHMD the manufacturer string can be overriden with an environment variable.

Start SteamVR like this:

OHMD_VENDOR_OVERRIDE=Oculus ~/.steam/steam/SteamApps/common/SteamVR/bin/vrstartup.sh

Alternatively in the Steam GUI set the SteamVR launch options to

OHMD_VENDOR_OVERRIDE=Oculus %command%

You can verify that the environment variable is set with grep "driver_openhmd: Vendor:" ~/.steam/steam/logs/vrserver.txt.

Udev Rules:

To allow OpenHMD to access any devices, udev rules need to be set on most linux systems. Add a file named 83-hmd.rules to /etc/udev/rules.d/, or your distributions equivalent.

As an example the content of this file could look like this:

#Oculus DK1 DK2 CV1
SUBSYSTEM=="usb", ATTR{idVendor}=="2833", MODE="0666", GROUP="plugdev"'
#Vive
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"'
#Deepoon
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", MODE="0666", GROUP="plugdev"'
#Sony PSVR
SUBSYSTEM=="usb", ATTR{idVendor}=="054c", MODE="0666", GROUP="plugdev"'
#OSVR
SUBSYSTEM=="usb", ATTR{idVendor}=="1532", MODE="0666", GROUP="plugdev"'
#Pimax 4K
SUBSYSTEM=="usb", ATTR{idVendor}=="2833", MODE="0666", GROUP="plugdev"'
#NOLO CV1
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", MODE="0666", GROUP="plugdev"'
#Samsung GearVR
SUBSYSTEM=="usb", ATTR{idVendor}=="04E8", MODE="0666", GROUP="plugdev"'
#HP Mixed Reality
SUBSYSTEM=="usb", ATTR{idVendor}=="03F0", MODE="0666", GROUP="plugdev"'
#Lenovo Mixed Reality
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", MODE="0666", GROUP="plugdev"'
#DreamWorld DreamGlass AR
SUBSYSTEM=="usb", ATTR{idVendor}=="0483", MODE="0666", GROUP="plugdev"'

License

SteamVR-OpenHMD is released under the permissive Boost Software License (see LICENSE for more information), to make sure it can be linked and distributed with both free and non-free software. While it doesn't require contribution from the users, it is still very appreciated.

You can’t perform that action at this time.