Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Vindicus999
2026-02-27 02:26:53 +00:00
20 changed files with 195 additions and 68 deletions
+1 -1
View File
@@ -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")
+45 -1
View File
@@ -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 <QList>
#include <QObject>
@@ -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
@@ -452,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::video_codec> Settings::allowedCodecs() const
@@ -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
+6
View File
@@ -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;
+10
View File
@@ -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.
@@ -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 <patricknicolas@laposte.net>
Date: Tue, 22 Oct 2024 15:23:19 +0200
Subject: [PATCH 1/9] c/multi: early wake of compositor
@@ -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 <patricknicolas@laposte.net>
Date: Tue, 8 Oct 2024 22:13:15 +0200
Subject: [PATCH 2/9] Use extern socket fd
@@ -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
@@ -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 <patricknicolas@laposte.net>
Date: Sat, 15 Mar 2025 22:19:48 +0100
Subject: [PATCH 4/9] st/oxr: forward 0 refresh rate
@@ -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 <patricknicolas@laposte.net>
Date: Wed, 11 Sep 2024 22:56:29 +0200
Subject: [PATCH 5/9] Replace distortion with foveation
@@ -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 <git-am@invalid>
Date: Sun, 28 Sep 2025 11:33:10 +0200
Subject: [PATCH 6/9] d/steamvr_lh: prevent crash on vive pro2/WiVRn
@@ -1,4 +1,4 @@
From 78aa739c623f7c797f92f2905b59bc73446f3e32 Mon Sep 17 00:00:00 2001
From 8c6580e84690ffe8f082cdff5ead8443d1f6bf23 Mon Sep 17 00:00:00 2001
From: Sapphire <imsapphire0@gmail.com>
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
}
}
@@ -1,40 +0,0 @@
From 8f62c1a61729d0550280d0e4e02ffa7cc3f7fdae Mon Sep 17 00:00:00 2001
From: no name <git-am@invalid>
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
@@ -0,0 +1,83 @@
From 3ec6ede2610ebbaa4ac6e9a76b387a2867db13a2 Mon Sep 17 00:00:00 2001
From: no name <git-am@invalid>
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
@@ -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 <git-am@invalid>
Date: Sun, 25 Jan 2026 10:09:10 +0100
Subject: [PATCH 9/9] don't verify GL stuff
+2 -2
View File
@@ -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::TCP> 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},
+6
View File
@@ -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;
+4
View File
@@ -19,6 +19,8 @@
#pragma once
#include "hostname.h"
#include "wivrn_config.h"
#include <array>
#include <chrono>
#include <filesystem>
@@ -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
-9
View File
@@ -31,7 +31,6 @@
#include <Eigen/Core>
#include <Eigen/QR>
#include <algorithm>
#include <cassert>
#include <limits>
#include <optional>
#include <ranges>
@@ -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<N, 1>(0, 0).norm();
assert(norm > 0.9);
}
#endif
return sample{
.production_timestamp = production_timestamp,
.timestamp = timestamp,
+25 -2
View File
@@ -222,6 +222,26 @@ video_encoder_nvenc::video_encoder_nvenc(
}
}
const uint32_t intra_refresh_period = 100;
const uint32_t intra_refresh_cnt = 50;
auto set_intra_refresh = [&](auto & codec_config) {
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;
};
switch (settings.codec)
{
case video_codec::h264:
@@ -230,8 +250,9 @@ 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.idrPeriod = NVENC_INFINITE_GOPLENGTH;
set_intra_refresh(config.encodeCodecConfig.h264Config);
break;
case video_codec::h265:
@@ -246,8 +267,9 @@ 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.idrPeriod = NVENC_INFINITE_GOPLENGTH;
set_intra_refresh(config.encodeCodecConfig.hevcConfig);
break;
case video_codec::av1:
@@ -263,6 +285,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;
case video_codec::raw:
+3 -3
View File
@@ -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<TCPListener>(wivrn::default_port);
listener = std::make_unique<TCPListener>(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);
}
}
}