VR: Difference between revisions

Scrumplex (talk | contribs)
m Fix punctuation for SteamVR autostart section
Add WiVRn Entry
Line 88: Line 88:


If you are planning to play any OpenVR game on Steam or OpenXR games through Proton, you will have to use OpenComposite in this manner. In most cases you also have to allow access to the socket path of your OpenXR runtime to Steam's runtime, by using the following launch options for XR applications on Steam: <code>env PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/monado_comp_ipc %command%</code>. This example is for Monado, while other XR runtimes might differ.
If you are planning to play any OpenVR game on Steam or OpenXR games through Proton, you will have to use OpenComposite in this manner. In most cases you also have to allow access to the socket path of your OpenXR runtime to Steam's runtime, by using the following launch options for XR applications on Steam: <code>env PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/monado_comp_ipc %command%</code>. This example is for Monado, while other XR runtimes might differ.
== WiVRn ==
With the merging of https://github.com/NixOS/nixpkgs/pull/316975, [https://github.com/WiVRn/WiVRn WiVRn] is now in Nixpkgs with a module.
Example usage of the WiVRn module:<syntaxhighlight lang="nix">
  services.wivrn = {
    enable = true;
    openFirewall = true;
    # Write information to /etc/xdg/openxr/1/active_runtime.json, VR applications
    # will automatically read this and work with wivrn
    defaultRuntime = true;
    # Executing it through the systemd service executes WiVRn w/ CAP_SYS_NICE
    # Resulting in no stutters!
    autoStart = true;
    # Config for WiVRn (https://github.com/WiVRn/WiVRn/blob/master/docs/configuration.md)
    config = {
      enable = true;
      json = {
        # 1.0x display scaling
        scale = 1.0;
        # 100 Mb/s
        bitrate = 100000000;
        encoders = [
          {
            encoder = "vaapi";
            codec = "h265";
            # 1.0 x 1.0 scaling
            width = 1.0;
            height = 1.0;
            offset_x = 0.0;
            offset_y = 0.0;
          }
        ];
      };
    };
  };
</syntaxhighlight>
=== WiVRn + Steam ===
For each VR game, go to Properties > Launch Options and put:<syntaxhighlight lang="shell">
PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/wivrn/comp_ipc %command%
</syntaxhighlight>This will tell proton/steam to use wivrn when that game is ran.


== SteamVR ==
== SteamVR ==