{"id":1048,"date":"2021-08-13T03:51:07","date_gmt":"2021-08-12T16:51:07","guid":{"rendered":"https:\/\/noraisin.net\/diary\/?page_id=1048"},"modified":"2021-12-26T02:06:27","modified_gmt":"2021-12-25T15:06:27","slug":"testing-steamvr-openhmd","status":"publish","type":"page","link":"https:\/\/noraisin.net\/diary\/?page_id=1048","title":{"rendered":"Testing SteamVR-OpenHMD"},"content":{"rendered":"\n<p>If you want to use the Oculus CV1 with SteamVR in Linux, here is how to get it set up.<\/p>\n\n\n\n<p>There are 6 steps to the process:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Be running Xorg (not Wayland, for now).<\/li><li>Make sure Steam + SteamVR are already installed.<\/li><li>Set up USB permissions so the driver can talk to your devices.<\/li><li>Install build pre-requisites<\/li><li>Get the right version of the code<\/li><li>Build and install<\/li><\/ul>\n\n\n\n<p>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&#8217;t supported on Wayland (although it will be at some point in the future)<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Set up USB device permissions<\/h2>\n\n\n\n<p>Make sure your USB devices are accessible to your user account by configuring udev. See the OpenHMD guide here: <a href=\"https:\/\/github.com\/OpenHMD\/OpenHMD\/wiki\/Udev-rules-list\">https:\/\/github.com\/OpenHMD\/OpenHMD\/wiki\/Udev-rules-list<\/a>. On some distributions you can just install the <code>xr-hardware<\/code> package as the simplest solution.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Install build pre-requisites<\/h2>\n\n\n\n<p>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:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>hidapi<\/li><li>libusb<\/li><li>OpenCV (3.x or 4.x)<\/li><li>libjpeg (libjpeg-turbo recommended)<\/li><\/ul>\n\n\n\n<p>For Fedora, you can do:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">dnf install hidapi-devel libusb-devel opencv-devel libjpeg-turbo-devel<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Get the right version of the code<\/h2>\n\n\n\n<p>The <code>controller-haptics-wip<\/code> 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.<\/p>\n\n\n\n<p>Clone with:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">git clone --recursive --branch=controller-haptics-wip https:\/\/github.com\/thaytan\/SteamVR-OpenHMD\/<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Build and install<\/h2>\n\n\n\n<p><\/p>\n\n\n\n<p>Use <code>meson<\/code> to build and register the SteamVR-OpenHMD binaries. You may need to install <code>meson<\/code> first (see the bottom of this post for help with that):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">meson -Dbuildtype=release build\nninja -C build\n.\/install_files_to_build.sh\n.\/register.sh<\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li><strong>It is important to configure in release mode<\/strong>, as the kalman filtering code is generally too slow for real-time in debug mode (it has to run 2000 times per second).<\/li><li>Please note &#8211; 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.<\/li><li>It can be helpful to test OpenHMD is working by running the simple example. Check that it&#8217;s finding camera sensors at startup, and that the position seems to change when you move the headset:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/build\/subprojects\/openhmd\/openhmd_simple_example<\/pre>\n\n\n\n<p>Start SteamVR. Hopefully it should detect your headset and the light(s) on your Rift Sensor(s) should power on.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Meson<\/h2>\n\n\n\n<p>I prefer the Meson build system here. There&#8217;s also a <code>cmake<\/code> build for SteamVR-OpenHMD you can use instead, but I haven&#8217;t tested it in a while and it sometimes breaks as I work on my development branch.<\/p>\n\n\n\n<p>If you need to install <code>meson<\/code>, there are instructions here &#8211; <a href=\"https:\/\/mesonbuild.com\/Getting-meson.html \">https:\/\/mesonbuild.com\/Getting-meson.html<\/a> summarising the various methods.<\/p>\n\n\n\n<p>I use a copy in my home directory, but you need to make sure <code>~\/.local\/bin<\/code> is in your <code>PATH<\/code><\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">pip3 install --user meson<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>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 &hellip; <a href=\"https:\/\/noraisin.net\/diary\/?page_id=1048\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Testing SteamVR-OpenHMD&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1048","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/pages\/1048","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1048"}],"version-history":[{"count":2,"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/pages\/1048\/revisions"}],"predecessor-version":[{"id":1062,"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/pages\/1048\/revisions\/1062"}],"wp:attachment":[{"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1048"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}