From e32d3bbf3658a0ef407cdd9c6934450dfad50720 Mon Sep 17 00:00:00 2001 From: BERADQ Date: Wed, 25 Feb 2026 21:10:13 +0800 Subject: [PATCH 1/7] Enable intra refresh for H264/HEVC/AV1 with period=fps and count=fps/2 --- server/encoder/video_encoder_nvenc.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/server/encoder/video_encoder_nvenc.cpp b/server/encoder/video_encoder_nvenc.cpp index f5619864..751c6f72 100644 --- a/server/encoder/video_encoder_nvenc.cpp +++ b/server/encoder/video_encoder_nvenc.cpp @@ -232,6 +232,9 @@ video_encoder_nvenc::video_encoder_nvenc( config.encodeCodecConfig.h264Config.maxNumRefFrames = 0; config.encodeCodecConfig.h264Config.idrPeriod = NVENC_INFINITE_GOPLENGTH; config.encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag = 1; + config.encodeCodecConfig.h264Config.enableIntraRefresh = 1; + config.encodeCodecConfig.h264Config.intraRefreshPeriod = (uint32_t)fps; + config.encodeCodecConfig.h264Config.intraRefreshCnt = (uint32_t)(fps / 2); break; case video_codec::h265: @@ -248,6 +251,9 @@ video_encoder_nvenc::video_encoder_nvenc( config.encodeCodecConfig.hevcConfig.maxNumRefFramesInDPB = 0; config.encodeCodecConfig.hevcConfig.idrPeriod = NVENC_INFINITE_GOPLENGTH; config.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFullRangeFlag = 1; + config.encodeCodecConfig.hevcConfig.enableIntraRefresh = 1; + config.encodeCodecConfig.hevcConfig.intraRefreshPeriod = (uint32_t)fps; + config.encodeCodecConfig.hevcConfig.intraRefreshCnt = (uint32_t)(fps / 2); break; case video_codec::av1: @@ -263,6 +269,9 @@ video_encoder_nvenc::video_encoder_nvenc( config.encodeCodecConfig.av1Config.repeatSeqHdr = 1; config.encodeCodecConfig.av1Config.maxNumRefFramesInDPB = 0; config.encodeCodecConfig.av1Config.idrPeriod = NVENC_INFINITE_GOPLENGTH; + config.encodeCodecConfig.av1Config.enableIntraRefresh = 1; + config.encodeCodecConfig.av1Config.intraRefreshPeriod = (uint32_t)fps; + config.encodeCodecConfig.av1Config.intraRefreshCnt = (uint32_t)(fps / 2); break; case video_codec::raw: From 62543863706e9992924fe7bdef0c455ae56cc6cb Mon Sep 17 00:00:00 2001 From: BERADQ Date: Thu, 26 Feb 2026 21:01:52 +0800 Subject: [PATCH 2/7] Set intra refresh period and count to fixed values. --- server/encoder/video_encoder_nvenc.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/server/encoder/video_encoder_nvenc.cpp b/server/encoder/video_encoder_nvenc.cpp index 751c6f72..90b0115d 100644 --- a/server/encoder/video_encoder_nvenc.cpp +++ b/server/encoder/video_encoder_nvenc.cpp @@ -221,6 +221,14 @@ video_encoder_nvenc::video_encoder_nvenc( throw std::runtime_error("nvenc: 10-bit encoding requested, but GPU doesn't support it"); } } + const uint32_t intra_refresh_period = 100; + const uint32_t intra_refresh_cnt = 50; + auto set_intra_refresh = [&](auto & codec_config) { + codec_config.idrPeriod = NVENC_INFINITE_GOPLENGTH; + codec_config.enableIntraRefresh = 1; + codec_config.intraRefreshPeriod = intra_refresh_period; + codec_config.intraRefreshCnt = intra_refresh_cnt; + }; switch (settings.codec) { @@ -230,11 +238,8 @@ video_encoder_nvenc::video_encoder_nvenc( config.encodeCodecConfig.h264Config.repeatSPSPPS = 1; config.encodeCodecConfig.h264Config.maxNumRefFrames = 0; - config.encodeCodecConfig.h264Config.idrPeriod = NVENC_INFINITE_GOPLENGTH; config.encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag = 1; - config.encodeCodecConfig.h264Config.enableIntraRefresh = 1; - config.encodeCodecConfig.h264Config.intraRefreshPeriod = (uint32_t)fps; - config.encodeCodecConfig.h264Config.intraRefreshCnt = (uint32_t)(fps / 2); + set_intra_refresh(config.encodeCodecConfig.h264Config); break; case video_codec::h265: @@ -249,11 +254,8 @@ video_encoder_nvenc::video_encoder_nvenc( config.encodeCodecConfig.hevcConfig.repeatSPSPPS = 1; config.encodeCodecConfig.hevcConfig.maxNumRefFramesInDPB = 0; - config.encodeCodecConfig.hevcConfig.idrPeriod = NVENC_INFINITE_GOPLENGTH; config.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFullRangeFlag = 1; - config.encodeCodecConfig.hevcConfig.enableIntraRefresh = 1; - config.encodeCodecConfig.hevcConfig.intraRefreshPeriod = (uint32_t)fps; - config.encodeCodecConfig.hevcConfig.intraRefreshCnt = (uint32_t)(fps / 2); + set_intra_refresh(config.encodeCodecConfig.hevcConfig); break; case video_codec::av1: @@ -268,10 +270,7 @@ video_encoder_nvenc::video_encoder_nvenc( config.encodeCodecConfig.av1Config.repeatSeqHdr = 1; config.encodeCodecConfig.av1Config.maxNumRefFramesInDPB = 0; - config.encodeCodecConfig.av1Config.idrPeriod = NVENC_INFINITE_GOPLENGTH; - config.encodeCodecConfig.av1Config.enableIntraRefresh = 1; - config.encodeCodecConfig.av1Config.intraRefreshPeriod = (uint32_t)fps; - config.encodeCodecConfig.av1Config.intraRefreshCnt = (uint32_t)(fps / 2); + set_intra_refresh(config.encodeCodecConfig.av1Config); break; case video_codec::raw: From 0f21191e9bb5212dc2092f4493551a467b66ce9d Mon Sep 17 00:00:00 2001 From: BERADQ Date: Thu, 26 Feb 2026 21:43:03 +0800 Subject: [PATCH 3/7] Check NVENC intra-refresh capability before enabling the feature --- server/encoder/video_encoder_nvenc.cpp | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/server/encoder/video_encoder_nvenc.cpp b/server/encoder/video_encoder_nvenc.cpp index 90b0115d..c3678859 100644 --- a/server/encoder/video_encoder_nvenc.cpp +++ b/server/encoder/video_encoder_nvenc.cpp @@ -221,10 +221,22 @@ video_encoder_nvenc::video_encoder_nvenc( throw std::runtime_error("nvenc: 10-bit encoding requested, but GPU doesn't support it"); } } + const uint32_t intra_refresh_period = 100; const uint32_t intra_refresh_cnt = 50; auto set_intra_refresh = [&](auto & codec_config) { - codec_config.idrPeriod = NVENC_INFINITE_GOPLENGTH; + NV_ENC_CAPS_PARAM cap_param{ + .version = NV_ENC_CAPS_PARAM_VER, + .capsToQuery = NV_ENC_CAPS_SUPPORT_INTRA_REFRESH, + }; + + int res = 0; + NVENC_CHECK(shared_state->fn.nvEncGetEncodeCaps(session_handle, encodeGUID, &cap_param, &res)); + if (res != 1) + { + U_LOG_W("nvenc: intra refresh not supported, disabling feature"); + return; + } codec_config.enableIntraRefresh = 1; codec_config.intraRefreshPeriod = intra_refresh_period; codec_config.intraRefreshCnt = intra_refresh_cnt; @@ -239,6 +251,7 @@ video_encoder_nvenc::video_encoder_nvenc( config.encodeCodecConfig.h264Config.repeatSPSPPS = 1; config.encodeCodecConfig.h264Config.maxNumRefFrames = 0; config.encodeCodecConfig.h264Config.h264VUIParameters.videoFullRangeFlag = 1; + config.encodeCodecConfig.h264Config.idrPeriod = NVENC_INFINITE_GOPLENGTH; set_intra_refresh(config.encodeCodecConfig.h264Config); break; @@ -255,6 +268,7 @@ video_encoder_nvenc::video_encoder_nvenc( config.encodeCodecConfig.hevcConfig.repeatSPSPPS = 1; config.encodeCodecConfig.hevcConfig.maxNumRefFramesInDPB = 0; config.encodeCodecConfig.hevcConfig.hevcVUIParameters.videoFullRangeFlag = 1; + config.encodeCodecConfig.hevcConfig.idrPeriod = NVENC_INFINITE_GOPLENGTH; set_intra_refresh(config.encodeCodecConfig.hevcConfig); break; @@ -270,6 +284,7 @@ video_encoder_nvenc::video_encoder_nvenc( config.encodeCodecConfig.av1Config.repeatSeqHdr = 1; config.encodeCodecConfig.av1Config.maxNumRefFramesInDPB = 0; + config.encodeCodecConfig.av1Config.idrPeriod = NVENC_INFINITE_GOPLENGTH; set_intra_refresh(config.encodeCodecConfig.av1Config); break; From 1e6937d4a4ee2b8c0411c20608c9d5bd0f183e6c Mon Sep 17 00:00:00 2001 From: Schmarni Date: Wed, 25 Feb 2026 14:37:35 +0100 Subject: [PATCH 4/7] Add port and hostname config options Signed-off-by: Schmarni --- dashboard/qml/Main.qml | 2 +- dashboard/settings.cpp | 44 +++++++++++++++++++++++++++++++++ dashboard/settings.h | 6 +++++ docs/configuration.md | 10 ++++++++ server/accept_connection.cpp | 4 +-- server/driver/configuration.cpp | 6 +++++ server/driver/configuration.h | 4 +++ server/main.cpp | 6 ++--- 8 files changed, 76 insertions(+), 6 deletions(-) diff --git a/dashboard/qml/Main.qml b/dashboard/qml/Main.qml index 3b1b7612..88144639 100644 --- a/dashboard/qml/Main.qml +++ b/dashboard/qml/Main.qml @@ -165,7 +165,7 @@ Kirigami.ApplicationWindow { text: i18n("Firewall may not allow port 9757") type: Kirigami.MessageType.Warning showCloseButton: true - visible: DashboardSettings.show_system_checks && Firewall.needSetup + visible: DashboardSettings.show_system_checks && Firewall.needSetup && Settings.port == Settings.default_port actions: [ Kirigami.Action { text: i18n("Fix it") diff --git a/dashboard/settings.cpp b/dashboard/settings.cpp index 6f2a7bcc..e378c558 100644 --- a/dashboard/settings.cpp +++ b/dashboard/settings.cpp @@ -21,6 +21,7 @@ #include "escape_string.h" #include "gui_config.h" #include "utils/flatpak.h" +#include "wivrn_config.h" #include "wivrn_server.h" #include #include @@ -121,6 +122,8 @@ void Settings::emitAllChanged() debugGuiChanged(); steamVrLhChanged(); hidForwardingChanged(); + portChanged(); + hostnameChanged(); } void Settings::load(const wivrn_server * server) @@ -429,6 +432,40 @@ void Settings::set_tcpOnly(const bool & value) tcpOnlyChanged(); } +int Settings::port() const +{ + auto it = m_jsonSettings.find("port"); + if (it != m_jsonSettings.end() and it->is_number_integer()) + return *it; + return wivrn::default_port; +} + +void Settings::set_port(const int & value) +{ + auto old = port(); + m_jsonSettings["port"] = value; + if (old != value) + portChanged(); +} + +QString Settings::hostname() const +{ + if (auto it = m_jsonSettings.find("hostname"); it != m_jsonSettings.end() and it->is_string()) + return QString::fromStdString(*it); + return ""; +} + +void Settings::set_hostname(const QString & value) +{ + auto old = hostname(); + if (value == "") + m_jsonSettings.erase("hostname"); + else + m_jsonSettings["hostname"] = value.toStdString(); + if (old != value) + hostnameChanged(); +} + QString Settings::openvr() const { // OpenVR compat library @@ -504,6 +541,8 @@ void Settings::restore_defaults() m_jsonSettings.erase("use-steamvr-lh"); m_jsonSettings.erase("tcp-only"); m_jsonSettings.erase("application"); + m_jsonSettings.erase("port"); + m_jsonSettings.erase("hostname"); emitAllChanged(); } @@ -512,6 +551,11 @@ bool Settings::flatpak() const return wivrn::is_flatpak(); } +int Settings::default_port() const +{ + return wivrn::default_port; +} + bool Settings::debug_gui() const { #if WIVRN_FEATURE_DEBUG_GUI diff --git a/dashboard/settings.h b/dashboard/settings.h index 473a2e9a..5342a22b 100644 --- a/dashboard/settings.h +++ b/dashboard/settings.h @@ -68,6 +68,8 @@ public: Q_PROPERTY(bool tenbit READ tenbit WRITE set_tenbit NOTIFY tenbitChanged) Q_PROPERTY(bool tcpOnly READ tcpOnly WRITE set_tcpOnly NOTIFY tcpOnlyChanged) + Q_PROPERTY(int port READ port WRITE set_port NOTIFY portChanged) + Q_PROPERTY(QString hostname READ hostname WRITE set_hostname NOTIFY hostnameChanged) Q_PROPERTY(QString application READ application WRITE set_application NOTIFY applicationChanged) Q_PROPERTY(QString openvr READ openvr WRITE set_openvr NOTIFY openvrChanged) @@ -76,6 +78,7 @@ public: Q_PROPERTY(bool steamVrLh READ steamVrLh WRITE set_steamVrLh NOTIFY steamVrLhChanged) Q_PROPERTY(bool flatpak READ flatpak CONSTANT) + Q_PROPERTY(int default_port READ default_port CONSTANT) Q_PROPERTY(bool hid_forwarding_supported READ hid_forwarding CONSTANT) Q_PROPERTY(bool debug_gui_supported READ debug_gui CONSTANT) Q_PROPERTY(bool steamvr_lh_supported READ steamvr_lh CONSTANT) @@ -89,6 +92,8 @@ public: SETTER_GETTER_NOTIFY(bool, debugGui) SETTER_GETTER_NOTIFY(bool, steamVrLh) SETTER_GETTER_NOTIFY(bool, tcpOnly) + SETTER_GETTER_NOTIFY(int, port) + SETTER_GETTER_NOTIFY(QString, hostname) SETTER_GETTER_NOTIFY(QString, openvr) private: nlohmann::json m_jsonSettings = nlohmann::json::object(); @@ -107,6 +112,7 @@ public: bool can10bit() const; bool flatpak() const; + int default_port() const; bool debug_gui() const; bool steamvr_lh() const; bool hid_forwarding() const; diff --git a/docs/configuration.md b/docs/configuration.md index 4b9dff6c..da108923 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -158,3 +158,13 @@ Default value: `false` Only available when built with `WIVRN_FEATURE_STEAMVR_LIGHTHOUSE` Enables the driver to load SteamVR Lighthouse devices. + +## `port` +Default value: `9757` + +Change the TCP/UDP port used for the connection. + +## `hostname` +Default value: unset + +If set, overrides the name displayed in the server list. diff --git a/server/accept_connection.cpp b/server/accept_connection.cpp index fb6a011f..e7961e35 100644 --- a/server/accept_connection.cpp +++ b/server/accept_connection.cpp @@ -22,8 +22,8 @@ #include "util/u_logging.h" #include "utils/overloaded.h" +#include "driver/configuration.h" #include "driver/wivrn_session.h" -#include "wivrn_config.h" #include "wivrn_ipc.h" #include "wivrn_sockets.h" @@ -33,7 +33,7 @@ std::unique_ptr wivrn::accept_connection(wivrn_session & cnx, std::s { wivrn_ipc_socket_monado->send(from_monado::headset_disconnected{}); - wivrn::TCPListener listener(wivrn::default_port); + wivrn::TCPListener listener(configuration().port); pollfd fds[2]{ {.fd = listener.get_fd(), .events = POLLIN}, diff --git a/server/driver/configuration.cpp b/server/driver/configuration.cpp index 436c0f94..da4a9f9e 100644 --- a/server/driver/configuration.cpp +++ b/server/driver/configuration.cpp @@ -204,6 +204,12 @@ configuration::configuration() if (auto it = json.find("tcp-only"); it != json.end()) tcp_only = *it; + if (auto it = json.find("port"); it != json.end()) + port = *it; + + if (auto it = json.find("hostname"); it != json.end()) + hostname = *it; + if (auto it = json.find("publish-service"); it != json.end()) { publication = *it; diff --git a/server/driver/configuration.h b/server/driver/configuration.h index 37879ec5..a1fcd191 100644 --- a/server/driver/configuration.h +++ b/server/driver/configuration.h @@ -19,6 +19,8 @@ #pragma once +#include "hostname.h" +#include "wivrn_config.h" #include #include #include @@ -57,6 +59,8 @@ struct configuration bool use_steamvr_lh = false; bool hid_forwarding = false; bool tcp_only = false; + int port = wivrn::default_port; + std::string hostname = wivrn::hostname(); service_publication publication = service_publication::avahi; // monostate: default value, string: user defined, nullptr: disabled diff --git a/server/main.cpp b/server/main.cpp index bcb6bd57..f78ebf09 100644 --- a/server/main.cpp +++ b/server/main.cpp @@ -15,7 +15,6 @@ #include "driver/configuration.h" #include "driver/wivrn_connection.h" #include "exit_codes.h" -#include "hostname.h" #include "ipc_server_cb.h" #include "protocol_version.h" #include "start_application.h" @@ -315,7 +314,7 @@ void start_listening() assert(listener_watch == 0); - listener = std::make_unique(wivrn::default_port); + listener = std::make_unique(configuration().port); auto source_listener = g_unix_fd_source_new(listener->get_fd(), GIOCondition::G_IO_IN); g_source_set_callback(source_listener, G_SOURCE_FUNC(&headset_connected), nullptr, nullptr); listener_watch = g_source_attach(source_listener, nullptr); @@ -352,7 +351,8 @@ void start_publishing() {"version", wivrn::display_version()}, {"cookie", server_cookie()}, }; - publisher.emplace(poll_api, hostname(), "_wivrn._tcp", wivrn::default_port, TXT); + auto configuration = wivrn::configuration(); + publisher.emplace(poll_api, configuration.hostname, "_wivrn._tcp", configuration.port, TXT); } } } From 8a7cc105cb434c554911017588034a35b53b60d7 Mon Sep 17 00:00:00 2001 From: Schmarni Date: Wed, 25 Feb 2026 20:28:37 +0100 Subject: [PATCH 5/7] Call openvrChanged instead of tcpOnlyChanged in set_openvr Signed-off-by: Schmarni --- dashboard/settings.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/settings.cpp b/dashboard/settings.cpp index e378c558..6c783ae4 100644 --- a/dashboard/settings.cpp +++ b/dashboard/settings.cpp @@ -489,7 +489,7 @@ void Settings::set_openvr(const QString & value) else m_jsonSettings["openvr-compat-path"] = value.toStdString(); if (old != value) - tcpOnlyChanged(); + openvrChanged(); } QList Settings::allowedCodecs() const From 9df870a7fac296772f641e5e8b698a4ef335eb44 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 26 Feb 2026 18:19:45 +0100 Subject: [PATCH 6/7] Project layers on the first projection one --- ...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 | 6 +- ...08-Don-t-get-pose-data-for-fast-path.patch | 40 --------- ...08-Don-t-get-pose-data-in-compositor.patch | 83 +++++++++++++++++++ .../monado/0009-don-t-verify-GL-stuff.patch | 2 +- 10 files changed, 93 insertions(+), 50 deletions(-) delete mode 100644 patches/monado/0008-Don-t-get-pose-data-for-fast-path.patch create mode 100644 patches/monado/0008-Don-t-get-pose-data-in-compositor.patch 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 d34362f4..487f061f 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 31c816e45b57fe9c19b35ce6c40624608391f5bd Mon Sep 17 00:00:00 2001 +From 563f347bf4d59b4a82144e25c3be894a0cd17c8d Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 22 Oct 2024 15:23:19 +0200 Subject: [PATCH 1/9] 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 6202a610..077363b3 100644 --- a/patches/monado/0002-Use-extern-socket-fd.patch +++ b/patches/monado/0002-Use-extern-socket-fd.patch @@ -1,4 +1,4 @@ -From 282ac382841ec5208b6a8a98b63b50d007eeb5de Mon Sep 17 00:00:00 2001 +From 7d7c139b9ed03ec492256760c6acd1c7364c2e2a Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 8 Oct 2024 22:13:15 +0200 Subject: [PATCH 2/9] 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 d48f1f69..3e0450f2 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 b798f1574943241b1ac47feba4f66524a282fc23 Mon Sep 17 00:00:00 2001 +From 1328192bc28f312e728460d6c29ab150a9b655bd 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 3/9] 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 6a17dabc..dd3a2967 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 085aa329b48a9f43d23c321b6d8badd4f5cc0346 Mon Sep 17 00:00:00 2001 +From 18f87ff2f292e2f4cab8718601e6d5ba236a5013 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sat, 15 Mar 2025 22:19:48 +0100 Subject: [PATCH 4/9] 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 6f3a90f6..f35b0569 100644 --- a/patches/monado/0005-Replace-distortion-with-foveation.patch +++ b/patches/monado/0005-Replace-distortion-with-foveation.patch @@ -1,4 +1,4 @@ -From 74d980d760e437dccb2c99591d9224e70d8b0065 Mon Sep 17 00:00:00 2001 +From 8c322edfafa6179875bfe1dca1517c4043f0c5b4 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 11 Sep 2024 22:56:29 +0200 Subject: [PATCH 5/9] 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 af55cdca..076c45a3 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 e4e8c532a6f5e46e91b67641feeb09d3f4b52bc7 Mon Sep 17 00:00:00 2001 +From b9acd6d83db324c6f31572615fb6738a6f93d63c Mon Sep 17 00:00:00 2001 From: no name Date: Sun, 28 Sep 2025 11:33:10 +0200 Subject: [PATCH 6/9] 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 b0483d1f..6447c583 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 78aa739c623f7c797f92f2905b59bc73446f3e32 Mon Sep 17 00:00:00 2001 +From 8c6580e84690ffe8f082cdff5ead8443d1f6bf23 Mon Sep 17 00:00:00 2001 From: Sapphire Date: Fri, 7 Nov 2025 20:41:16 -0600 Subject: [PATCH 7/9] st/oxr: push XrEventDataInteractionProfileChanged when @@ -9,10 +9,10 @@ Subject: [PATCH 7/9] st/oxr: push XrEventDataInteractionProfileChanged when 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/xrt/state_trackers/oxr/actions/oxr_input.c b/src/xrt/state_trackers/oxr/actions/oxr_input.c -index 95eef613a..c76dfcb0c 100644 +index 349c9adcb..667163142 100644 --- a/src/xrt/state_trackers/oxr/actions/oxr_input.c +++ b/src/xrt/state_trackers/oxr/actions/oxr_input.c -@@ -1885,26 +1885,21 @@ oxr_session_update_action_bindings(struct oxr_logger *log, struct oxr_session *s +@@ -1945,26 +1945,21 @@ oxr_session_update_action_bindings(struct oxr_logger *log, struct oxr_session *s } } diff --git a/patches/monado/0008-Don-t-get-pose-data-for-fast-path.patch b/patches/monado/0008-Don-t-get-pose-data-for-fast-path.patch deleted file mode 100644 index 3d95068c..00000000 --- a/patches/monado/0008-Don-t-get-pose-data-for-fast-path.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 8f62c1a61729d0550280d0e4e02ffa7cc3f7fdae Mon Sep 17 00:00:00 2001 -From: no name -Date: Thu, 15 Jan 2026 12:13:06 +0100 -Subject: [PATCH 8/9] Don't get pose data for fast path - ---- - src/xrt/compositor/main/comp_renderer.c | 17 +++++++++-------- - 1 file changed, 9 insertions(+), 8 deletions(-) - -diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c -index ff9728a59..08cdef540 100644 ---- a/src/xrt/compositor/main/comp_renderer.c -+++ b/src/xrt/compositor/main/comp_renderer.c -@@ -972,14 +972,15 @@ dispatch_compute(struct comp_renderer *r, - struct xrt_pose world_poses_scanout_begin[XRT_MAX_VIEWS]; - struct xrt_pose world_poses_scanout_end[XRT_MAX_VIEWS]; - struct xrt_pose eye_poses[XRT_MAX_VIEWS]; -- calc_pose_data( // -- r, // -- fov_source, // -- fovs, // -- world_poses_scanout_begin, // -- world_poses_scanout_end, // -- eye_poses, // -- render->r->view_count); // -+ if (!c->base.frame_params.one_projection_layer_fast_path) -+ calc_pose_data( // -+ r, // -+ fov_source, // -+ fovs, // -+ world_poses_scanout_begin, // -+ world_poses_scanout_end, // -+ eye_poses, // -+ render->r->view_count); // - - // Target Vulkan resources.. - VkImage target_image = r->c->target->images[r->acquired_buffer].handle; --- -2.53.0 - diff --git a/patches/monado/0008-Don-t-get-pose-data-in-compositor.patch b/patches/monado/0008-Don-t-get-pose-data-in-compositor.patch new file mode 100644 index 00000000..bdf83dc8 --- /dev/null +++ b/patches/monado/0008-Don-t-get-pose-data-in-compositor.patch @@ -0,0 +1,83 @@ +From 3ec6ede2610ebbaa4ac6e9a76b387a2867db13a2 Mon Sep 17 00:00:00 2001 +From: no name +Date: Thu, 15 Jan 2026 12:13:06 +0100 +Subject: [PATCH 8/9] Don't get pose data in compositor + +Reproject onto the first projection layer's pose, if there isn't any get +it from device instead. +--- + src/xrt/compositor/main/comp_renderer.c | 51 +++++++++++++++++++++---- + 1 file changed, 43 insertions(+), 8 deletions(-) + +diff --git a/src/xrt/compositor/main/comp_renderer.c b/src/xrt/compositor/main/comp_renderer.c +index ff9728a59..1f01662b6 100644 +--- a/src/xrt/compositor/main/comp_renderer.c ++++ b/src/xrt/compositor/main/comp_renderer.c +@@ -948,6 +948,24 @@ dispatch_graphics(struct comp_renderer *r, + * + */ + ++static struct comp_layer * ++get_projection_layer(struct comp_layer_accum *layers) ++{ ++ for (uint32_t layer = 0; layer < layers->layer_count; ++layer) { ++ switch (layers->layers[layer].data.type) { ++ case XRT_LAYER_PROJECTION: ++ case XRT_LAYER_PROJECTION_DEPTH: return &layers->layers[layer]; ++ case XRT_LAYER_QUAD: ++ case XRT_LAYER_CUBE: ++ case XRT_LAYER_CYLINDER: ++ case XRT_LAYER_EQUIRECT1: ++ case XRT_LAYER_EQUIRECT2: ++ case XRT_LAYER_PASSTHROUGH: break; ++ } ++ } ++ return NULL; ++} ++ + /*! + * @pre render_compute_init(render, &c->nr) + */ +@@ -972,14 +990,31 @@ dispatch_compute(struct comp_renderer *r, + struct xrt_pose world_poses_scanout_begin[XRT_MAX_VIEWS]; + struct xrt_pose world_poses_scanout_end[XRT_MAX_VIEWS]; + struct xrt_pose eye_poses[XRT_MAX_VIEWS]; +- calc_pose_data( // +- r, // +- fov_source, // +- fovs, // +- world_poses_scanout_begin, // +- world_poses_scanout_end, // +- eye_poses, // +- render->r->view_count); // ++ if (!c->base.frame_params.one_projection_layer_fast_path) { ++ struct comp_layer *proj_layer = get_projection_layer(&c->base.layer_accum); ++ if (proj_layer) { ++ struct xrt_layer_projection_view_data *data = proj_layer->data.proj.v; ++ // depth has the same first member as proj ++ for (int view = 0; view < XRT_MAX_VIEWS; ++view) { ++ fovs[view] = data[view].fov; ++ world_poses_scanout_begin[view] = data[view].pose; ++ world_poses_scanout_end[view] = data[view].pose; ++ eye_poses[view] = data[view].pose; ++ ++ r->c->base.frame_params.fovs[view] = data[view].fov; ++ r->c->base.frame_params.poses[view] = data[view].pose; ++ } ++ } else { ++ calc_pose_data( // ++ r, // ++ fov_source, // ++ fovs, // ++ world_poses_scanout_begin, // ++ world_poses_scanout_end, // ++ eye_poses, // ++ render->r->view_count); // ++ } ++ } + + // Target Vulkan resources.. + VkImage target_image = r->c->target->images[r->acquired_buffer].handle; +-- +2.53.0 + diff --git a/patches/monado/0009-don-t-verify-GL-stuff.patch b/patches/monado/0009-don-t-verify-GL-stuff.patch index faac8be9..d9e62ff7 100644 --- a/patches/monado/0009-don-t-verify-GL-stuff.patch +++ b/patches/monado/0009-don-t-verify-GL-stuff.patch @@ -1,4 +1,4 @@ -From 45dec6300290d4b7199f15948206fc6492fe41ed Mon Sep 17 00:00:00 2001 +From 14e5d4a2f29b95f0f7933dbf2dde5000c0a98866 Mon Sep 17 00:00:00 2001 From: no name Date: Sun, 25 Jan 2026 10:09:10 +0100 Subject: [PATCH 9/9] don't verify GL stuff From bfe44c6b8dac117527d408e6260f9e073fcecb57 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Thu, 26 Feb 2026 23:09:41 +0100 Subject: [PATCH 7/7] Drop norm > 0.9 assertion --- server/driver/polynomial_interpolator.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/server/driver/polynomial_interpolator.h b/server/driver/polynomial_interpolator.h index 6ef3ff6a..0eef2005 100644 --- a/server/driver/polynomial_interpolator.h +++ b/server/driver/polynomial_interpolator.h @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -199,14 +198,6 @@ public: else sol = (Aprime.transpose() * Aprime).ldlt().solve(Aprime.transpose() * bprime).transpose(); -#ifndef NDEBUG - if constexpr (quaternion) - { - float norm = sol.template block(0, 0).norm(); - assert(norm > 0.9); - } -#endif - return sample{ .production_timestamp = production_timestamp, .timestamp = timestamp,