Virtual reality

From ArchWiki
(Redirected from Virtual Reality)

This article or section is out of date.

Reason: Many packages have been deleted.[1][2][3] (Discuss in Talk:Virtual reality)

Virtual reality is the process of simulating an environment for a user, using a variety of peripherals, head mounted displays or CAVEs, and trackers. Instead of showing you a static viewpoint from a screen, it renders your viewpoint relative to where you are standing, on a head-attached or projected surface, to give an effect identical to your own eyes.

A number of peripherals have been released or are about to be released recently which have brought affordable, extremely immersive virtual reality to everyone. Most of these peripherals have full or partial Linux support, and many have AUR packages.

Compatibility matrix

Oculus Rift OSVR OpenVR Leap Motion Razer Hydra
Dolphin (original VR fork) Yes ? Partially complete ? Yes
Dolphin (official OSVR support) Via OSVR Yes ? Via OSVR Via OSVR
Minecrift (Minecraft VR) Yes (Planned) Via OSVR-SteamVR (Planned) (Planned) Via OSVR Yes
Janus VR Yes Yes Yes Yes Via OSVR
Vircadia Via SteamVR-OpenHMD Unknown if working via SteamVR-OSVR Legacy input Not in Linux build and unknown if still supported ?
Team Fortress 2 Via OpenVR Via OSVR-SteamVR Support broken and fixed seemingly at random Via OSVR Via OSVR
Half Life 2 Displays one black eye, one solid color eye Via OSVR-SteamVR Displays one black eye, one solid color eye Via OSVR Via OSVR
VRUI VR Toolkit and demos Yes ? ? Yes Yes
4089: The Ghost Within Via OpenVR Via OSVR-SteamVR Broken until Valve fixes the compositor on Linux Via OSVR Via OSVR
Games/Programs in Wine On OVRSDK versions <=0.5.0.0, with oculus-wine-wrapper-gitAUR[broken link: package not found] and wine-unity3d-gitAUR[broken link: package not found] Trackers work perfectly. Unity demos without Render Manager 'work' but are buggy, ones using the Render Manager display a white or black screen. ? ? ?

Supported peripherals and toolkits

OpenXR

OpenXR is an open, royalty-free standard for access to virtual reality and augmented reality platforms and devices. It is maintained by the Khronos Group and adopted by most of the industry. Most runtimes support OpenXR.

Monado

Monado is an open source OpenXR runtime developed by Collabora. It is under heavy development and aims to provide a common runtime supporting most headsets. Current progress can be found here: https://monado.freedesktop.org/

Install using monadoAUR.

OpenVR / SteamVR

OpenVR is an effort by Valve to create an open API for VR development. Unfortunately, while the API is open, the actual default implementation (SteamVR) is not. It provides an OpenXR runtime

Setting up

Install Vulkan and Steam. If using NVIDIA drivers, you may need to set the VK_DRIVER_FILES environment variable. Required dependencies for 32-bit packages are: lib32-gtk2, lib32-libva, lib32-libvdpau.

From steam, install SteamVR from the tools menu.

Troubleshooting

Configuration or startup errors

SteamVR/OpenVR creates a directory ~/.openvr that can get misconfigured over the various versions. Delete that directory and completely uninstall/reinstall SteamVR.

It can also apparently have trouble accessing the Rift under some configurations. An alternative is to use the OSVR-SteamVR driver and the OSVR-Oculus-Rift plugin.

ALVR

ALVR is a SteamVR driver which allows game streaming to standalone headsets like the Meta/Oculus Quest. It is available in the alvrAUR and alvr-gitAUR packages.

OpenHMD

OpenHMD aims to provide a Free and Open Source API and drivers for immersive technology, such as head mounted displays with built in head tracking. The aim is to implement support for as many devices as possible in a portable, cross-platform package.

OpenHMD supports a wide range of devices such as Oculus Rift, HTC Vive, Sony PSVR, Deepoon E2 and others.

Bindings for .NET, Java, Perl, Python and Rust are available from third-parties.

Installation

Install openhmd-gitAUR.

SteamVR support

It is possible to use OpenHMD with SteamVR. To do that, you need to install steamvr-openhmd-gitAUR and create symlink that points to the OpenHMD SteamVR driver inside your SteamVR drivers directory, for example:

$ ln -s /usr/lib/steamvr/openhmd ~/.steam/steam/steamapps/common/SteamVR/drivers/openhmd

Deprecated peripherals and toolkits

OSVR

OSVR is a joint effort by Sensics, Inc (a long standing VR company) and Razer to create a completely or nearly completely open software API for VR, in which end developers only need to hook their individual headsets into a few functions in order to get first-rate support. It supports the widest variety of peripherals, as well as having extremely flexible configuration via JSON files.

It also provides a plugin which allows it to act as an OpenVR implementation, letting you use it to play OpenVR/SteamVR games with any peripherals it supports.

Setting up

Install osvr-core-gitAUR, and whatever plugins are necessary to support your individual device. Currently available external plugins include:

osvr-oculus-rift-gitAUR[broken link: package not found]

osvr-leap-motion-gitAUR[broken link: package not found]

If wish to use OSVR with SteamVR/OpenVR games and applications, install osvr-steamvr-gitAUR[broken link: package not found] and symlink the driver to your SteamVR installation.

Run the OSVR server and leave it running in the background, by calling it with

   osvr_server /usr/share/osvrcore/sample-configs/your_device_config.json

You may wish to customize the configuration to suit your individual needs.

To test that your installation is working and your trackers are available, install osvr-tracker-viewer-gitAUR[broken link: package not found] and run OSVRTrackerView. You should see a set of axis for each tracker OSVR can pick up. If you do not, run osvr_print_tree to see what trackers are available or if there is a configuration issue.

Oculus Rift

Oculus stopped supporting Linux.

See Oculus Rift.

Leap Motion

The Leap Motion is an incredibly affordable hand tracker which can easily be mounted on the faceplate of an HMD to allow you to interact with virtual objects. Unfortunately, the latest Orion software is not available for Linux while it is awaiting porting, so the currently available tracking is functional but excessively buggy. As such, it is only really suitable on Linux for social interaction, but seeing as it costs less than 1/10th what an HMD or equivalent tracking system, it is still a fairly useful device.

Setting up

Install leap-motion-driverAUR[broken link: package not found], osvr-leap-motion-gitAUR[broken link: package not found] and optionally leap-motion-sdkAUR[broken link: package not found].

To configure, enable and start leapd.service and run LeapControlPanel. To test that tracking works, run the Playground demo included with the installation.

Supported software

Currently there are a handful of applications which work well on the Rift and Linux, with several of them being in the AUR.

Dolphin (original VR fork)

dolphin-emu-vr-gitAUR[broken link: package not found] is an emulator for Gamecube, with patches to allow it to have full headtracking stereoscopic rendering, as well as a number of customizations to make games work well out of the box in VR (for example, disabling culling functions to let you view the entire world).

Support has for the most part been discontinued, in light of the Dolphin project beginning to officially support OSVR upstream.

Note: When using this application with the Rift, it works correctly with Portrait (Direct) Mode, and should be run with the Rift un-rotated to minimize latency.

Dolphin (official OSVR support)

The Dolphin project has begun to work on adding support for VR officially using OSVR, available through the package dolphin-emu-osvr-gitAUR[broken link: package not found]. It can even use OSVR's path tree inputs as controller inputs, such that you can use a pinch or sixaxis controller input as a wiimote input. Support is limited in places however, as the fork is not as far along as the original Oculus-only fork was.

Games/Programs in Wine

A number of applications have some level of compatibility when using Wine, but often require some level of tweaks to make them function as expected.

oculus-wine-wrapper-gitAUR[broken link: package not found] is a utility to patch up the differences between the Linux and Windows versions of the Oculus SDK when running Wine. It creates a shared memory context for the Wine application to use, letting the app access the native Oculus SDK. No installation of the SDK to the wineprefix appears to be necessary.

Unity games

This article or section is out of date.

To get the best performance in Unity based games, ideally you should force them into OpenGL mode with the -force-opengl. However this is not currently possible with an unpatched wine, as the WGL context it tries to force has some differences from a typical GLX context, as described here. Using the wine-unity3d-gitAUR[broken link: package not found] package will allow you to run these games with native OpenGL, allowing you to play them with decent performance on your machine. Unfortunately they often try to change the video mode or mess with other settings, so supplying default screen settings may be necessary. Additionally, since it is using native OpenGL, nvidia's __GL_THREADED_OPTIMIZATIONS may give a significant performance gain. Overall, the command should look something like this:

   env __GL_THREADED_OPTIMIZATIONS=1 wine UnityGame.exe -screen-height 1080 -screen-width 1920 -popupwindow -force-opengl

Or when using oculus-wine-wrapper-gitAUR[broken link: package not found]:

   env __GL_THREADED_OPTIMIZATIONS=1 oculus-wine-wrapper UnityGame.exe -screen-height 1080 -screen-width 1920 -popupwindow -force-opengl

Minecrift (Minecraft VR)

A guide is available here to run an existing Minecrift version with the very latest JRift (native java rift runtime) build. You will likely want to install an older version when using the Rift, as JRift has been updated continuously to match the Oculus SDK.

Additionally, many users have reported much better performance with JRE8, rather than JRE7.

Note: When using the Rift, this application works correctly with Portrait (Direct) Mode, and should be run with the Rift un-rotated. Unfortunately, as of 5/12/15 the ingame GUI will display as an elongated 9:16 rectangle, as opposed to staying at the screen ratio. This is usable but not ideal.

JanusVR

"janusVR: an immersive, collaborative, multi-dimensional internet." JanusVR is an application that lets you explore 3D websites in a multiplayer experience. An AUR package is available: janusvrAUR

The AUR package does not automatically update when JanusVR does, but the application will tell you when a new version is available. Simply re-build the package when this happens.

Note: This application works correctly with Portrait (Direct) Mode (as of 42.3), and should be run with the Rift un-rotated.

Leap Motion support

The Leap Motion allows you to be more expressive with gesture input, seen by other people within the world. You will want to mount your Leap to the front of your HMD and ensure that you are using the default avatar.

linux-vr-player-or-something video player

A (very) simple VR video player using OpenHMD for motion tracking and libmpv for playback. Should behave like normal mpv (same keyboard shortcuts etc.), so just launch with ohmdplayer some-vr-video.mp4. Does not use the aberration shaders to correct for color bleeding, some of the eye distance stuff etc. so things might not look optimal, but it is better than nothing.

Available as linux-vr-player-or-something-gitAUR.

vr-video-player

A simple tool to view any X11 window inside your VR headset. vr-video-player supports stereoscopic/180°/360° videos/games. vr-video-player also lets you view regular videos/games/windows inside VR as a flat screen.

Available as vr-video-player-gitAUR.

xr-video-player

A fork of vr-video-player for OpenXR and wayland that uses pipewire to capture a window or screen/s.

Available as xr-video-player-gitAUR.

SideQuest

SideQuest can be used to install APK files to your Oculus Quest. It is available as sidequest-binAUR.

See https://sidequestvr.com/setup-howto for installation steps:

  1. Create an Oculus developer account.
  2. Turn on Quest in developer mode (e.g., with your phone) and connect your Quest via cable.
  3. Press Allow USB debugging inside Quest.

See the SideQuest website for more information.

xrdesktop

xrdesktop is a library for XR interaction with classical desktop compositors.

Install xrdesktopAUR, which requires gulkanAUR and gxrAUR.

Note that if using KDE, currently xrdesktop-gitAUR, gxr-gitAUR, gulkan-gitAUR are required instead (See below).

KDE Integration

Follow the official guide, installing kdeplasma-applets-xrdesktopAUR[broken link: package not found], which currently requires kwin-effect-xrdesktop-gitAUR[broken link: package not found], libinputsynth-gitAUR, and xrdesktop-gitAUR.

Picom integration

Use picom-xrdesktop-companion, which requires xrdesktop0.15AUR[broken link: package not found].

Other notes

Enable OpenAL's binaural sound support

See Gaming#Binaural audio with OpenAL.