Difference between revisions of "SteamVR-OpenHMD"

From The Relativty Wiki
(Windows: missed a step)
(Windows: corrected the backup part)
 
(One intermediate revision by the same user not shown)
Line 59: Line 59:
 
Find steam (Steam not on your C:\ drive?  Adjust the ''c'' below accordingly)
 
Find steam (Steam not on your C:\ drive?  Adjust the ''c'' below accordingly)
 
  VRPATHREG=`find /c/ -iname vrpathreg.exe -print -quit 2>/dev/null`
 
  VRPATHREG=`find /c/ -iname vrpathreg.exe -print -quit 2>/dev/null`
  STEAMDIR=`echo $VRPATHREG | sed -ne 's/^\(.*Steam\/\).*$/\1/p'`
+
  STEAMDIR=`echo $VRPATHREG | sed -ne 's/^\(.*\)\/steamapps.*$/\1/p'`
  
 
Make backup:
 
Make backup:
 
  mkdir steamvr-config-backup
 
  mkdir steamvr-config-backup
  mv "$STEAMDIR/config/steamvr.vrsettings" steamvr-config-backup/
+
  mv "$STEAMDIR/config/steamvr.vrsettings" steamvr-config-backup/steamvr.vrsettings-`date '+%Y%m%d_%H%M%S'`
cp ../steamvr.vrsettings  "steamvr-config-backup/steamvr.vrsettings-`date '+%Y%m%d_%H%M%S'`"
+
cp ../steamvr.vrsettings  "$STEAMDIR/config/"
  
 
Register driver:
 
Register driver:

Latest revision as of 19:02, 12 September 2019

How to install the SteamVR-OpenHMD plugin from source.

Work in progress

TODO:

  • finish writing this page
  • test/verify
  • do proper static linking under windows

Setting up a build environment[edit]

see OpenHMD#Setting_up_a_build_environment

Obtaining the source code[edit]

Get OpenHMD as described here: OpenHMD#Obtaining_the_source_code this plugin depends on it. And set the serial PORT in src/drv_serial/serial.c as described under OpenHMD#Modifying_the_source_code_for_your_system Then get the SteamVR-OpenHMD plugin sources like this:

cd
git clone https://github.com/ChristophHaag/SteamVR-OpenHMD.git
cd SteamVR-OpenHMD
rm -rf subprojects/openhmd
ln -s ../../OpenHMD subprojects/openhmd
mkdir build

Building[edit]

General[edit]

First make sure you're in the build directory

cd ~/SteamVR-OpenHMD/build

Then continue with the platform specific instructions below.

Linux[edit]

cmake ..
make

Windows[edit]

cmake .. -G "MinGW Makefiles" -D CMAKE_SH=CMAKE_SH-NOTFOUND
mingw32-make

Now to put things in their proper place:

cp ../driver.vrdrivermanifest ./
cp -r ../resources ./
mkdir -p bin/win64
cp driver_openhmd.dll bin/win64
cp -v `ldd bin/win64/driver_openhmd.dll | grep -v '/c/' | sed 's/^.* => \([^ ]*\).*$/\1/'` bin/win64/

Installation[edit]

First install SteamVR in Steam (under LIBRARY>TOOLS) and (maybe) switch to the beta (SteamVR>properties>BETAS).

Linux[edit]

cd ~/SteamVR-OpenHMD
./register.sh

If you didn't change the PORT in OpenHMD's code, you can create a symbolic link called com5 to your serial device, like /dev/ttyACM0 for example in the ~/.steam/steam/steamapps/common/SteamVR directory.

ln -s /dev/ttyACM0 ~/.steam/steam/steamapps/common/SteamVR/com5

Windows[edit]

Assuming everything was installed with the defaults, in a nutshell:

  • make backup of the old steamvr.vrsettings file from C:\Program Files (x86)\Steam\config
  • copy steamvr.vrsettings from SteamVR-OpenHMD to C:\Program Files (x86)\Steam\config
  • run: "C:\Program Files (x86)\Steam\steamapps\common\SteamVR\bin\win64\vrpathreg" adddriver C:\msys64\home\<your-username-here>\SteamVR-OpenHMD\build
  • to verify run: "C:\Program Files (x86)\Steam\steamapps\common\SteamVR\bin\win64\vrpathreg" show
  • possibly remove any other external drivers with: "C:\Program Files (x86)\Steam\steamapps\common\SteamVR\bin\win64\vrpathreg" removedriver <path>


cd ~/SteamVR-OpenHMD/build

Find steam (Steam not on your C:\ drive? Adjust the c below accordingly)

VRPATHREG=`find /c/ -iname vrpathreg.exe -print -quit 2>/dev/null`
STEAMDIR=`echo $VRPATHREG | sed -ne 's/^\(.*\)\/steamapps.*$/\1/p'`

Make backup:

mkdir steamvr-config-backup
mv "$STEAMDIR/config/steamvr.vrsettings" steamvr-config-backup/steamvr.vrsettings-`date '+%Y%m%d_%H%M%S'`
cp ../steamvr.vrsettings  "$STEAMDIR/config/"

Register driver:

"$VRPATHREG" adddriver $(cygpath -w `pwd`)
"$VRPATHREG" show
#"$VRPATHREG" removedriver '<path>'