From 994f67d5fee866022664192ae821f95333702093 Mon Sep 17 00:00:00 2001 From: Sapphire Date: Thu, 5 Feb 2026 16:06:40 -0600 Subject: [PATCH] Update SolarXR patches --- ...001-c-multi-early-wake-of-compositor.patch | 2 +- .../monado/0002-Use-extern-socket-fd.patch | 2 +- ...vironment-blend-mode-selection-logic.patch | 2 +- .../0004-st-oxr-forward-0-refresh-rate.patch | 2 +- ...05-Replace-distortion-with-foveation.patch | 2 +- ..._lh-prevent-crash-on-vive-pro2-WiVRn.patch | 2 +- ...entDataInteractionProfileChanged-whe.patch | 2 +- ...08-d-solarxr-Fix-flatpak-socket-path.patch | 2 +- ...> 0009-d-solarxr-Sync-at-fixed-rate.patch} | 2 +- ...-solarxr-Feed-device-poses-to-server.patch | 74 +++++++++++-------- ...11-Don-t-get-pose-data-for-fast-path.patch | 2 +- 11 files changed, 52 insertions(+), 42 deletions(-) rename patches/monado/{0009-d-solarxr-Sync-at-fixed-rate-This-improves-tracking-.patch => 0009-d-solarxr-Sync-at-fixed-rate.patch} (99%) diff --git a/patches/monado/0001-c-multi-early-wake-of-compositor.patch b/patches/monado/0001-c-multi-early-wake-of-compositor.patch index 777d5f9a..e5f8d1bd 100644 --- a/patches/monado/0001-c-multi-early-wake-of-compositor.patch +++ b/patches/monado/0001-c-multi-early-wake-of-compositor.patch @@ -1,4 +1,4 @@ -From 19832bb0ff8394ee577978ee22980cdb593a2791 Mon Sep 17 00:00:00 2001 +From 0595d01bb32c959e2e64b96d5187fdb5f0f2d929 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 22 Oct 2024 15:23:19 +0200 Subject: [PATCH 01/11] c/multi: early wake of compositor diff --git a/patches/monado/0002-Use-extern-socket-fd.patch b/patches/monado/0002-Use-extern-socket-fd.patch index 1b5c975d..1ed10848 100644 --- a/patches/monado/0002-Use-extern-socket-fd.patch +++ b/patches/monado/0002-Use-extern-socket-fd.patch @@ -1,4 +1,4 @@ -From 722eac50d86482cf5974a60d721deb158dedb255 Mon Sep 17 00:00:00 2001 +From bda12c93b506dd46980ca8f7e3dee6581fbdf549 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 8 Oct 2024 22:13:15 +0200 Subject: [PATCH 02/11] Use extern socket fd diff --git a/patches/monado/0003-change-environment-blend-mode-selection-logic.patch b/patches/monado/0003-change-environment-blend-mode-selection-logic.patch index c2c3b9e0..d2b14222 100644 --- a/patches/monado/0003-change-environment-blend-mode-selection-logic.patch +++ b/patches/monado/0003-change-environment-blend-mode-selection-logic.patch @@ -1,4 +1,4 @@ -From 52d939fa1dc9709b3d7773653c2663cb9d14b82b Mon Sep 17 00:00:00 2001 +From a258427c4c622f838a0360c1f4c1ead3bd3e182a Mon Sep 17 00:00:00 2001 From: galister <85970-galister@users.noreply.gitlab.freedesktop.org> Date: Sat, 23 Nov 2024 02:42:12 +0900 Subject: [PATCH 03/11] change environment blend mode selection logic diff --git a/patches/monado/0004-st-oxr-forward-0-refresh-rate.patch b/patches/monado/0004-st-oxr-forward-0-refresh-rate.patch index bd5cb866..bf1c57e3 100644 --- a/patches/monado/0004-st-oxr-forward-0-refresh-rate.patch +++ b/patches/monado/0004-st-oxr-forward-0-refresh-rate.patch @@ -1,4 +1,4 @@ -From 1f6b04eb3feb14ca332e0bdfc2ff0fd73c564049 Mon Sep 17 00:00:00 2001 +From 4ebef00766669bcda9f27f57ef6e10da4e66a60e Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sat, 15 Mar 2025 22:19:48 +0100 Subject: [PATCH 04/11] st/oxr: forward 0 refresh rate diff --git a/patches/monado/0005-Replace-distortion-with-foveation.patch b/patches/monado/0005-Replace-distortion-with-foveation.patch index 64f6336b..ec39bc64 100644 --- a/patches/monado/0005-Replace-distortion-with-foveation.patch +++ b/patches/monado/0005-Replace-distortion-with-foveation.patch @@ -1,4 +1,4 @@ -From 9bc7706f3fcd7fdaf31da2f305d6939a49817797 Mon Sep 17 00:00:00 2001 +From fb72a558ef3ccdcd9428345efcd2d2f15e474d27 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 11 Sep 2024 22:56:29 +0200 Subject: [PATCH 05/11] Replace distortion with foveation diff --git a/patches/monado/0006-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch b/patches/monado/0006-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch index 9a321234..cab53897 100644 --- a/patches/monado/0006-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch +++ b/patches/monado/0006-d-steamvr_lh-prevent-crash-on-vive-pro2-WiVRn.patch @@ -1,4 +1,4 @@ -From 25660f30f1fffeeeec864e66280619a0fb127859 Mon Sep 17 00:00:00 2001 +From c63be87d014aa9b67d7a8766a952a70701a629b4 Mon Sep 17 00:00:00 2001 From: no name Date: Sun, 28 Sep 2025 11:33:10 +0200 Subject: [PATCH 06/11] d/steamvr_lh: prevent crash on vive pro2/WiVRn diff --git a/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch b/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch index 7177b71a..94794658 100644 --- a/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch +++ b/patches/monado/0007-st-oxr-push-XrEventDataInteractionProfileChanged-whe.patch @@ -1,4 +1,4 @@ -From 6d9977658df239ae367db0ace23ae5e3744899b5 Mon Sep 17 00:00:00 2001 +From ccd1bef8ef971f29bf521abd74b9ebc97cb689fb Mon Sep 17 00:00:00 2001 From: Sapphire Date: Fri, 7 Nov 2025 20:41:16 -0600 Subject: [PATCH 07/11] st/oxr: push XrEventDataInteractionProfileChanged when diff --git a/patches/monado/0008-d-solarxr-Fix-flatpak-socket-path.patch b/patches/monado/0008-d-solarxr-Fix-flatpak-socket-path.patch index e93ead44..483e9713 100644 --- a/patches/monado/0008-d-solarxr-Fix-flatpak-socket-path.patch +++ b/patches/monado/0008-d-solarxr-Fix-flatpak-socket-path.patch @@ -1,4 +1,4 @@ -From 8a05785464f1f8d1ba8f947b57ebf88d37177954 Mon Sep 17 00:00:00 2001 +From b0e8426914c2b3bec366dbeaccce7db0260fa252 Mon Sep 17 00:00:00 2001 From: rcelyte Date: Mon, 8 Dec 2025 19:29:28 +0000 Subject: [PATCH 08/11] d/solarxr: Fix flatpak socket path diff --git a/patches/monado/0009-d-solarxr-Sync-at-fixed-rate-This-improves-tracking-.patch b/patches/monado/0009-d-solarxr-Sync-at-fixed-rate.patch similarity index 99% rename from patches/monado/0009-d-solarxr-Sync-at-fixed-rate-This-improves-tracking-.patch rename to patches/monado/0009-d-solarxr-Sync-at-fixed-rate.patch index a412912c..445db52f 100644 --- a/patches/monado/0009-d-solarxr-Sync-at-fixed-rate-This-improves-tracking-.patch +++ b/patches/monado/0009-d-solarxr-Sync-at-fixed-rate.patch @@ -1,4 +1,4 @@ -From 677fcc118afabccb285c2b4f83c41ef7d3dbfa93 Mon Sep 17 00:00:00 2001 +From b975312f8c05fc12cefe31af791d3db3bc34ac3c Mon Sep 17 00:00:00 2001 From: rcelyte Date: Fri, 14 Nov 2025 19:48:59 +0000 Subject: [PATCH 09/11] d/solarxr: Sync at fixed rate This improves tracking diff --git a/patches/monado/0010-d-solarxr-Feed-device-poses-to-server.patch b/patches/monado/0010-d-solarxr-Feed-device-poses-to-server.patch index 0ffbee50..230943a1 100644 --- a/patches/monado/0010-d-solarxr-Feed-device-poses-to-server.patch +++ b/patches/monado/0010-d-solarxr-Feed-device-poses-to-server.patch @@ -1,16 +1,18 @@ -From 13b8bff84a6bddb7cbf961985575af5aaea09838 Mon Sep 17 00:00:00 2001 +From c39ea86d5312a3b0da0e376161df57a590a4a856 Mon Sep 17 00:00:00 2001 From: rcelyte Date: Mon, 15 Sep 2025 22:46:15 +0000 Subject: [PATCH 10/11] d/solarxr: Feed device poses to server +For now this utilizes SlimeVR's separate "SteamVR Feeder" API, +waiting on https://github.com/SlimeVR/SlimeVR-Server/issues/895. --- src/xrt/drivers/CMakeLists.txt | 2 + - src/xrt/drivers/solarxr/feeder.c | 331 ++++++++++++++++++++ + src/xrt/drivers/solarxr/feeder.c | 339 ++++++++++++++++++++ src/xrt/drivers/solarxr/feeder.h | 85 +++++ src/xrt/drivers/solarxr/protocol.h | 30 +- src/xrt/drivers/solarxr/solarxr_device.c | 161 ++++++---- src/xrt/drivers/solarxr/solarxr_interface.h | 20 ++ - 6 files changed, 565 insertions(+), 64 deletions(-) + 6 files changed, 573 insertions(+), 64 deletions(-) create mode 100644 src/xrt/drivers/solarxr/feeder.c create mode 100644 src/xrt/drivers/solarxr/feeder.h @@ -29,10 +31,10 @@ index b44617e1a..040bd76b7 100644 solarxr/solarxr_device.c diff --git a/src/xrt/drivers/solarxr/feeder.c b/src/xrt/drivers/solarxr/feeder.c new file mode 100644 -index 000000000..596a61008 +index 000000000..3c79eef8b --- /dev/null +++ b/src/xrt/drivers/solarxr/feeder.c -@@ -0,0 +1,331 @@ +@@ -0,0 +1,339 @@ +// Copyright 2025, rcelyte +// SPDX-License-Identifier: BSL-1.0 +/*! @@ -48,6 +50,9 @@ index 000000000..596a61008 +#include "xrt/xrt_device.h" + +#include ++#include ++ ++static const char manufacturer[] = "Monado"; + +#define PROTOBUF_FLOAT(v_) ((uint8_t *)&(v_))[0], ((uint8_t *)&(v_))[1], ((uint8_t *)&(v_))[2], ((uint8_t *)&(v_))[3] +#define PROTOBUF_INT32(v_) \ @@ -115,15 +120,20 @@ index 000000000..596a61008 + // serialize announcement packet + const uint32_t serial_len = strlen(xdev->serial), name_len = strlen(xdev->str); + const uint8_t message_1[] = { -+ (3 << 3) | 2, PROTOBUF_INT32(0), // ProtobufMessage::tracker_added -+ (1 << 3) | 0, PROTOBUF_INT32(feeder->next_id), // TrackerAdded::tracker_id -+ (4 << 3) | 0, role, // TrackerAdded::tracker_role -+ (2 << 3) | 2, PROTOBUF_INT32(serial_len), ++ (3 << 3) | PB_WT_STRING, PROTOBUF_INT32(0), // ProtobufMessage::tracker_added ++ (1 << 3) | PB_WT_VARINT, PROTOBUF_INT32(feeder->next_id), // TrackerAdded::tracker_id ++ (4 << 3) | PB_WT_VARINT, role, // TrackerAdded::tracker_role ++ (2 << 3) | PB_WT_STRING, PROTOBUF_INT32(serial_len), + }; -+ const uint8_t message_2[] = { -+ (3 << 3) | 2, ++ static_assert(sizeof(manufacturer) - 1 < 0x80, ""); ++ uint8_t message_2[] = { ++ (5 << 3) | PB_WT_STRING, ++ sizeof(manufacturer) - 1, ++ // TrackerAdded::manufacturer ++ [2 + (sizeof(manufacturer) - 1)] = (3 << 3) | PB_WT_STRING, + PROTOBUF_INT32(name_len), + }; ++ memcpy(&message_2[2], manufacturer, sizeof(manufacturer) - 1); + uint8_t packet[sizeof(struct solarxr_ipc_message) + sizeof(message_1) + sizeof(xdev->serial) + + sizeof(message_2) + sizeof(xdev->str)]; + struct solarxr_ipc_message *const message = solarxr_ipc_message_start(packet, &packet[ARRAY_SIZE(packet)]); @@ -139,6 +149,10 @@ index 000000000..596a61008 + assert(false); + goto unlock; + } ++ const uint8_t tracker_added[] = { ++ PROTOBUF_INT32(packet_len - sizeof(*message) - sizeof((uint8_t[]){0, PROTOBUF_INT32(0)})), ++ }; ++ memcpy(&message->body[1], tracker_added, sizeof(tracker_added)); + + // initialize tracked state for the device + struct feeder_device *const device = malloc(sizeof(*device)); @@ -155,10 +169,6 @@ index 000000000..596a61008 + u_hashmap_int_insert(feeder->devices, (uint64_t)(uintptr_t)xdev, device); + + // send the announcement -+ const uint8_t tracker_added[] = { -+ PROTOBUF_INT32(packet_len - sizeof(*message) - sizeof((uint8_t[]){0, PROTOBUF_INT32(0)})), -+ }; -+ memcpy(&message->body[1], tracker_added, sizeof(tracker_added)); + solarxr_ipc_socket_send_raw(&feeder->socket, packet, packet_len); + U_LOG_IFL_D(feeder->socket.log_level, " \"%s\" [id=%" PRIu32 " serial=\"%s\" role=TrackerRole::%s]", + xdev->str, device->id, xdev->serial, role_name); @@ -237,10 +247,10 @@ index 000000000..596a61008 + device->battery_charging = charging; + device->battery_charge = charge; + uint8_t message[] = { -+ (5 << 3) | 2, 0, // ProtobufMessage::battery -+ (1 << 3) | 0, PROTOBUF_INT32(device->id), // Battery::tracker_id -+ (2 << 3) | 5, PROTOBUF_FLOAT(charge), // Battery::battery_level -+ (3 << 3) | 0, charging, // Battery::is_charging ++ (5 << 3) | PB_WT_STRING, 0, // ProtobufMessage::battery ++ (1 << 3) | PB_WT_VARINT, PROTOBUF_INT32(device->id), // Battery::tracker_id ++ (2 << 3) | PB_WT_32BIT, PROTOBUF_FLOAT(charge), // Battery::battery_level ++ (3 << 3) | PB_WT_VARINT, charging, // Battery::is_charging + }; + message[1] = sizeof(message) - 2; + solarxr_ipc_message_write_single(&data->packet_end, &data->packet[ARRAY_SIZE(data->packet)], @@ -253,20 +263,20 @@ index 000000000..596a61008 + if (xrt_device_get_tracked_pose(xdev, device->input_name, data->time, &relation) == XRT_SUCCESS && + (relation.relation_flags & XRT_SPACE_RELATION_ORIENTATION_VALID_BIT) != 0) { + uint8_t message[30 + 15] = { -+ (1 << 3) | 2, 0, // ProtobufMessage::position -+ (1 << 3) | 0, PROTOBUF_INT32(device->id), // Position::tracker_id -+ (5 << 3) | 5, PROTOBUF_FLOAT(relation.pose.orientation.x), // Position::qx -+ (6 << 3) | 5, PROTOBUF_FLOAT(relation.pose.orientation.y), // Position::qy -+ (7 << 3) | 5, PROTOBUF_FLOAT(relation.pose.orientation.z), // Position::qz -+ (8 << 3) | 5, PROTOBUF_FLOAT(relation.pose.orientation.w), // Position::qw -+ (9 << 3) | 0, 3, // Position::data_source = DataSource::FULL ++ (1 << 3) | PB_WT_STRING, 0, // ProtobufMessage::position ++ (1 << 3) | PB_WT_VARINT, PROTOBUF_INT32(device->id), // Position::tracker_id ++ (5 << 3) | PB_WT_32BIT, PROTOBUF_FLOAT(relation.pose.orientation.x), // Position::qx ++ (6 << 3) | PB_WT_32BIT, PROTOBUF_FLOAT(relation.pose.orientation.y), // Position::qy ++ (7 << 3) | PB_WT_32BIT, PROTOBUF_FLOAT(relation.pose.orientation.z), // Position::qz ++ (8 << 3) | PB_WT_32BIT, PROTOBUF_FLOAT(relation.pose.orientation.w), // Position::qw ++ (9 << 3) | PB_WT_VARINT, 3, // Position::data_source = DataSource::FULL + }; + uint32_t message_len = sizeof(message); + if ((relation.relation_flags & XRT_SPACE_RELATION_POSITION_VALID_BIT) != 0) { + const uint8_t position[15] = { -+ (2 << 3) | 5, PROTOBUF_FLOAT(relation.pose.position.x), // Position::x -+ (3 << 3) | 5, PROTOBUF_FLOAT(relation.pose.position.y), // Position::y -+ (4 << 3) | 5, PROTOBUF_FLOAT(relation.pose.position.z), // Position::z ++ (2 << 3) | PB_WT_32BIT, PROTOBUF_FLOAT(relation.pose.position.x), // Position::x ++ (3 << 3) | PB_WT_32BIT, PROTOBUF_FLOAT(relation.pose.position.y), // Position::y ++ (4 << 3) | PB_WT_32BIT, PROTOBUF_FLOAT(relation.pose.position.z), // Position::z + }; + memcpy(&message[sizeof(message) - sizeof(position)], position, sizeof(position)); + } else { @@ -285,9 +295,9 @@ index 000000000..596a61008 + if (status != device->last_status) { + device->last_status = status; + uint8_t message[] = { -+ (4 << 3) | 2, 0, // ProtobufMessage::tracker_status -+ (1 << 3) | 0, PROTOBUF_INT32(device->id), // TrackerStatus::tracker_id -+ (2 << 3) | 0, status, // TrackerStatus::status ++ (4 << 3) | PB_WT_STRING, 0, // ProtobufMessage::tracker_status ++ (1 << 3) | PB_WT_VARINT, PROTOBUF_INT32(device->id), // TrackerStatus::tracker_id ++ (2 << 3) | PB_WT_VARINT, status, // TrackerStatus::status + }; + message[1] = sizeof(message) - 2; + solarxr_ipc_message_write_single(&data->packet_end, &data->packet[ARRAY_SIZE(data->packet)], message, diff --git a/patches/monado/0011-Don-t-get-pose-data-for-fast-path.patch b/patches/monado/0011-Don-t-get-pose-data-for-fast-path.patch index a095e90a..d182f144 100644 --- a/patches/monado/0011-Don-t-get-pose-data-for-fast-path.patch +++ b/patches/monado/0011-Don-t-get-pose-data-for-fast-path.patch @@ -1,4 +1,4 @@ -From fe9b669d6d023db39409fb60e66eb498d0610732 Mon Sep 17 00:00:00 2001 +From 671ac1619a8986ef95cdb2dc3ca4c9db79930585 Mon Sep 17 00:00:00 2001 From: no name Date: Thu, 15 Jan 2026 12:13:06 +0100 Subject: [PATCH 11/11] Don't get pose data for fast path