diff --git a/docs/steamvr.md b/docs/steamvr.md index 15237651..12612887 100644 --- a/docs/steamvr.md +++ b/docs/steamvr.md @@ -1,14 +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. +WiVRn only provides an OpenXR runtime. For games that use OpenVR, [xrizer](https://github.com/Supreeeme/xrizer) or [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`. +If using Steam, games will be sandboxed by pressure vessel, which does not passthrough OpenXR by default. +- Files under `/usr` are mapped into `/run/host/usr`. If xrizer/OpenComposite is installed there, make sure `VR_OVERRIDE` or `~/.config/openvr/openvrpaths.vrpath` uses `/run/host/usr` prefix. +- `PRESSURE_VESSEL_IMPORT_OPENXR_1_RUNTIMES=1` must be set to passthrough the WiVRn OpenXR manifest, library locations, and socket location. -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`). +By default, WiVRn attempts to automatically find xrizer and OpenComposite in a number of places: +- When WiVRn is shipped as a flatpak, it uses a provided copy of xrizer by default. +- WiVRn attempts to autodetect xrizer and 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. +If it is found, WiVRn adjusts the `openvrpaths.vrpath` file, and includes whitelisting the xrizer/OpenComposite path and setting `VR_OVERRIDE` in the environment variables. diff --git a/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch b/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch new file mode 100644 index 00000000..fb6229c4 --- /dev/null +++ b/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch @@ -0,0 +1,44 @@ +From 6f7304dee78dcbf0b485177465d10b4878668ede Mon Sep 17 00:00:00 2001 +From: Sapphire +Date: Fri, 7 Nov 2025 20:41:16 -0600 +Subject: [PATCH] st/oxr: push XrEventDataInteractionProfileChanged when + profile changes to NULL + +--- + src/xrt/state_trackers/oxr/oxr_input.c | 15 +++++++++++---- + 1 file changed, 11 insertions(+), 4 deletions(-) + +diff --git a/src/xrt/state_trackers/oxr/oxr_input.c b/src/xrt/state_trackers/oxr/oxr_input.c +index a319e044d..cd1cd4bd9 100644 +--- a/src/xrt/state_trackers/oxr/oxr_input.c ++++ b/src/xrt/state_trackers/oxr/oxr_input.c +@@ -1882,15 +1882,22 @@ oxr_session_update_action_bindings(struct oxr_logger *log, struct oxr_session *s + } + } + ++ bool any_profile_changed = false; ++ + #define POPULATE_PROFILE(X) \ +- sess->X = XR_NULL_PATH; \ +- if (profiles.X != NULL) { \ +- sess->X = profiles.X->path; \ +- oxr_event_push_XrEventDataInteractionProfileChanged(log, sess); \ ++ { \ ++ const XrPath new_path = profiles.X ? profiles.X->path : XR_NULL_PATH; \ ++ if (sess->X != new_path) { \ ++ sess->X = new_path; \ ++ any_profile_changed = true; \ ++ } \ + } + OXR_FOR_EACH_VALID_SUBACTION_PATH(POPULATE_PROFILE) + #undef POPULATE_PROFILE + ++ if (any_profile_changed) { ++ oxr_event_push_XrEventDataInteractionProfileChanged(log, sess); ++ } + return oxr_session_success_result(sess); + } + +-- +2.52.0 + diff --git a/server/driver/wivrn_session.cpp b/server/driver/wivrn_session.cpp index 63b52dc9..a4e58a83 100644 --- a/server/driver/wivrn_session.cpp +++ b/server/driver/wivrn_session.cpp @@ -214,6 +214,20 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr connection static_roles.hand_tracking.unobstructed.right = nullptr; static_roles.hand_tracking.conforming.right = lhdev; break; + case XRT_DEVICE_TYPE_ANY_HAND_CONTROLLER: + if (roles.left == left_controller_index) + { + roles.left = xdev_count; + static_roles.hand_tracking.unobstructed.left = nullptr; + static_roles.hand_tracking.conforming.left = lhdev; + } + else if (roles.right == right_controller_index) + { + roles.right = xdev_count; + static_roles.hand_tracking.unobstructed.right = nullptr; + static_roles.hand_tracking.conforming.right = lhdev; + } + break; default: break; } @@ -475,8 +489,8 @@ static xrt_device_name get_name(interaction_profile profile) } void wivrn_session::operator()(from_headset::trackings && tracking) { - auto left = (roles.left == left_controller_index || roles.left == left_hand_interaction_index) ? get_name(tracking.interaction_profiles[0]) : XRT_DEVICE_INVALID; - auto right = (roles.right == right_controller_index || roles.right == right_hand_interaction_index) ? get_name(tracking.interaction_profiles[1]) : XRT_DEVICE_INVALID; + auto left = (roles.left == -1 || roles.left == left_controller_index || roles.left == left_hand_interaction_index) ? get_name(tracking.interaction_profiles[0]) : XRT_DEVICE_INVALID; + auto right = (roles.right == -1 || roles.right == right_controller_index || roles.right == right_hand_interaction_index) ? get_name(tracking.interaction_profiles[1]) : XRT_DEVICE_INVALID; if (left != roles.left_profile or right != roles.right_profile) { U_LOG_I("Updating interaction profiles: from \n" @@ -489,37 +503,45 @@ void wivrn_session::operator()(from_headset::trackings && tracking) std::lock_guard lock(roles_mutex); // don't change role when hand from other driver is used - if (roles.left == left_hand_interaction_index || roles.left == left_controller_index) + if (roles.left == -1 || roles.left == left_hand_interaction_index || roles.left == left_controller_index) { if (left == XRT_DEVICE_EXT_HAND_INTERACTION) { left_hand_interaction.reset_history(); roles.left = left_hand_interaction_index; } - else + else if (left != XRT_DEVICE_INVALID) { left_controller.reset_history(); roles.left = left_controller_index; set_enabled(device_id::LEFT_PINCH_POSE, false); set_enabled(device_id::LEFT_POKE, false); } + else + { + roles.left = -1; + } } roles.left_profile = left; - if (roles.right == right_hand_interaction_index || roles.right == right_controller_index) + if (roles.right == -1 || roles.right == right_hand_interaction_index || roles.right == right_controller_index) { if (right == XRT_DEVICE_EXT_HAND_INTERACTION) { right_hand_interaction.reset_history(); roles.right = right_hand_interaction_index; } - else + else if (right != XRT_DEVICE_INVALID) { right_controller.reset_history(); roles.right = right_controller_index; set_enabled(device_id::RIGHT_PINCH_POSE, false); set_enabled(device_id::RIGHT_POKE, false); } + else + { + roles.right = -1; + } } roles.right_profile = right;