Add OpenVR runtime override as a setting, add --early-active-runtime to test this (rv2)

I ran into some trouble debugging issues with Vivecraft because my OpenVR runtime setup was being automatically overridden by WiVRn.

It would be nice to attach a UI to this option, but I'm not sure on the details there and I'd like to keep the PR small and easily reviewed.

Being able to set the compat path is more useful than simply disabling compat override because of things like pressure-vessel bypass, which are finicky to get right.
This commit is contained in:
t20kdc
2025-03-21 22:40:48 +01:00
committed by xytovl
parent c23c0ed8e8
commit 0e9b72c776
6 changed files with 38 additions and 3 deletions
+9
View File
@@ -181,3 +181,12 @@ Default value: `avahi`
How to publish the service over the network, `avahi` or null.
If set to null, service will not be published and address has to be entered manually on the headset.
## `openvr-compat-path`
Default value: unset
Provides the path to the directory of an OpenVR compatibility tool (such as OpenComposite).
If unset, WiVRn will autodetect the path of such a tool as usual (see [the SteamVR guide](./steamvr.md)).
If set to an empty string, it is assumed detection failed ; the OpenVR configuration will not be modified and the pressure-vessel configuration won't be adjusted.
+7 -2
View File
@@ -1,9 +1,14 @@
# Notes for OpenVR and Steam
WiVRn only provides an OpenXR runtime. For games that use OpenVR, [OpenComposite](https://gitlab.com/znixian/OpenOVR/) should be used to translate the APIs.
If using Steam, games will be sandboxed by pressure vessel, which is not OpenXR aware yet.
- Files under `/usr` are mapped into `/run/host/usr`, if OpenComposite or WiVRn are installed there, make sure that `XR_RUNTIME_JSON` uses `/run/host/usr` prefix and that `VR_OVERRIDE` or `~/.config/openvr/openvrpaths.vrpath` also uses this configuration.
- WiVRn uses a socket to communicate between the application and the server process, this socket needs to be whitelisted as `PRESSURE_VESSEL_FILESYSTEMS_RW=$XDG_RUNTIME_DIR/wivrn/comp_ipc`.
By default, WiVRn attempts to automatically find OpenComposite in a number of places:
- When WiVRn is shipped as a flatpak, it uses a provided copy of OpenComposite by default.
- WiVRn attempts to autodetect OpenComposite in a number of places (see `OVR_COMPAT_SEARCH_PATH` in `CMakeLists.txt`).
- The `openvr-compat-path` configuration may be used for an unexpected install location.
If it is found, WiVRn adjusts the `openvrpaths.vrpath` file, and includes whitelisting the OpenComposite path and setting `VR_OVERRIDE` in the environment variables.