Fix call to ipc_server_main, add config options for debug GUI and steamvr_lh

* Add config option for SteamVR lighthouse device support

* Add dashboard toggles for debug window and steamvr_lh

* clang-format

* Hide advanced toggles if not enabled during build
This commit is contained in:
Sapphire
2025-05-21 04:58:06 -05:00
parent bc7d0ad6e0
commit b29abf073e
8 changed files with 101 additions and 7 deletions
+6
View File
@@ -140,6 +140,12 @@ configuration configuration::read_user_configuration()
}
}
if (auto it = json.find("debug-gui"); it != json.end())
result.debug_gui = *it;
if (auto it = json.find("use-steamvr-lh"); it != json.end())
result.use_steamvr_lh = *it;
if (auto it = json.find("tcp-only"); it != json.end())
result.tcp_only = *it;
else if (auto it = json.find("tcp_only"); it != json.end())
+2
View File
@@ -59,6 +59,8 @@ struct configuration
std::optional<std::array<double, 2>> scale;
std::optional<std::array<float, 3>> grip_surface;
std::vector<std::string> application;
bool debug_gui = false;
bool use_steamvr_lh = false;
bool tcp_only = false;
service_publication publication = service_publication::avahi;
+2 -1
View File
@@ -20,6 +20,7 @@
#include "wivrn_session.h"
#include "accept_connection.h"
#include "configuration.h"
#include "driver/app_pacer.h"
#include "main/comp_compositor.h"
#include "main/comp_main_interface.h"
@@ -169,7 +170,7 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
static_roles.hand_tracking.right = xdevs[xdev_count++] = &right_hand;
#if WIVRN_FEATURE_STEAMVR_LIGHTHOUSE
auto use_steamvr_lh = std::getenv("WIVRN_USE_STEAMVR_LH");
auto use_steamvr_lh = configuration::read_user_configuration().use_steamvr_lh || std::getenv("WIVRN_USE_STEAMVR_LH");
xrt_system_devices * lhdevs = NULL;
if (use_steamvr_lh && steamvr_lh_create_devices(&lhdevs) == XRT_SUCCESS)
+15 -6
View File
@@ -49,6 +49,7 @@
#include <glib.h>
#include <libnotify/notify.h>
#include <server/ipc_server_interface.h>
#include <shared/ipc_protocol.h>
#include <util/u_file.h>
@@ -57,9 +58,6 @@ U_TRACE_TARGET_SETUP(U_TRACE_WHICH_SERVICE)
extern "C"
{
int
ipc_server_main(int argc, char * argv[]);
int listen_socket = -1;
}
@@ -267,7 +265,7 @@ void start_app()
}
}
void start_server()
void start_server(configuration config)
{
server_pid = do_fork ? fork() : 0;
@@ -298,9 +296,20 @@ void start_server()
setenv("AMD_DEBUG", "lowlatencyenc", false);
ipc_server_main_info server_info{
.udgci = {
.window_title = "WiVRn",
#if WIVRN_FEATURE_DEBUG_GUI
.open = config.debug_gui ? U_DEBUG_GUI_OPEN_ALWAYS : U_DEBUG_GUI_OPEN_AUTO,
#else
.open = U_DEBUG_GUI_OPEN_NEVER,
#endif
},
};
try
{
exit(ipc_server_main(0, 0 /*argc, argv*/));
exit(ipc_server_main(0, 0, &server_info /*argc, argv, ismi*/));
}
catch (std::exception & e)
{
@@ -472,7 +481,7 @@ gboolean headset_connected_success(void *)
expose_known_keys_on_dbus();
start_server();
start_server(configuration::read_user_configuration());
start_app();
delay_next_try = default_delay_next_try;