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:
@@ -21,6 +21,9 @@
|
||||
|
||||
#cmakedefine01 WIVRN_CHECK_CAPSYSNICE
|
||||
|
||||
#cmakedefine01 WIVRN_FEATURE_DEBUG_GUI
|
||||
#cmakedefine01 WIVRN_FEATURE_STEAMVR_LIGHTHOUSE
|
||||
|
||||
#cmakedefine01 WIVRN_USE_NVENC
|
||||
#cmakedefine01 WIVRN_USE_VAAPI
|
||||
#cmakedefine01 WIVRN_USE_VULKAN_ENCODE
|
||||
|
||||
@@ -316,6 +316,22 @@ Kirigami.ScrollablePage {
|
||||
Kirigami.FormData.isSection: true
|
||||
}
|
||||
|
||||
Kirigami.Heading {
|
||||
text: i18n("Advanced options")
|
||||
level: 1
|
||||
type: Kirigami.Heading.Type.Primary
|
||||
}
|
||||
Controls.CheckBox {
|
||||
id: debug_gui
|
||||
text: i18n("Enable debug window")
|
||||
visible: config.debug_gui_supported
|
||||
}
|
||||
Controls.CheckBox {
|
||||
id: steamvr_lh
|
||||
text: i18n("Enable SteamVR tracked devices support")
|
||||
visible: config.steamvr_lh_supported
|
||||
}
|
||||
|
||||
Controls.CheckBox {
|
||||
id: adb_custom
|
||||
Layout.row: 0
|
||||
@@ -452,6 +468,9 @@ Kirigami.ScrollablePage {
|
||||
settings.adb_custom = adb_custom.checked;
|
||||
settings.adb_location = adb_location.text;
|
||||
Adb.setPath(adb_custom.checked ? adb_location.text : "adb");
|
||||
|
||||
config.debugGui = debug_gui.checked;
|
||||
config.steamVrLh = steamvr_lh.checked;
|
||||
}
|
||||
|
||||
function load() {
|
||||
@@ -471,6 +490,10 @@ Kirigami.ScrollablePage {
|
||||
// auto_encoders.checked = true;
|
||||
encoder_layout.currentIndex = 0;
|
||||
}
|
||||
|
||||
debug_gui.checked = config.debugGui;
|
||||
steamvr_lh.checked = config.steamVrLh;
|
||||
|
||||
openvr_combobox.load()
|
||||
|
||||
adb_custom.checked = settings.adb_custom;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "settings.h"
|
||||
|
||||
#include "escape_string.h"
|
||||
#include "gui_config.h"
|
||||
#include "utils/flatpak.h"
|
||||
#include "wivrn_server.h"
|
||||
#include <QList>
|
||||
@@ -213,6 +214,25 @@ void Settings::load(const wivrn_server * server)
|
||||
set_application("");
|
||||
}
|
||||
|
||||
// Advanced options (debug window, steamvr_lh)
|
||||
try
|
||||
{
|
||||
set_debugGui(json_doc.value("debug-gui", false));
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
set_debugGui(false);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
set_steamVrLh(json_doc.value("use-steamvr-lh", false));
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
set_steamVrLh(false);
|
||||
}
|
||||
|
||||
// OpenVR compat library
|
||||
try
|
||||
{
|
||||
@@ -298,6 +318,9 @@ void Settings::save(wivrn_server * server)
|
||||
if (application() != "")
|
||||
json_doc["application"] = unescape_string(application());
|
||||
|
||||
json_doc["debug-gui"] = debugGui();
|
||||
json_doc["use-steamvr-lh"] = steamVrLh();
|
||||
|
||||
if (openvr() == "-")
|
||||
json_doc["openvr-compat-path"] = nullptr;
|
||||
else if (openvr() == "")
|
||||
@@ -315,6 +338,8 @@ void Settings::restore_defaults()
|
||||
set_bitrate(50'000'000);
|
||||
set_scale(-1);
|
||||
set_application("");
|
||||
set_debugGui(false);
|
||||
set_steamVrLh(false);
|
||||
set_tcpOnly(false);
|
||||
}
|
||||
|
||||
@@ -347,4 +372,21 @@ bool Settings::flatpak() const
|
||||
return wivrn::is_flatpak();
|
||||
}
|
||||
|
||||
bool Settings::debug_gui() const
|
||||
{
|
||||
#if WIVRN_FEATURE_DEBUG_GUI
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
bool Settings::steamvr_lh() const
|
||||
{
|
||||
#if WIVRN_FEATURE_STEAMVR_LIGHTHOUSE
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "moc_settings.cpp"
|
||||
|
||||
@@ -122,10 +122,14 @@ class Settings : public QObject
|
||||
Q_PROPERTY(int bitrate READ bitrate WRITE set_bitrate NOTIFY bitrateChanged)
|
||||
Q_PROPERTY(float scale READ scale WRITE set_scale NOTIFY scaleChanged)
|
||||
Q_PROPERTY(QString application READ application WRITE set_application NOTIFY applicationChanged)
|
||||
Q_PROPERTY(bool debugGui READ debugGui WRITE set_debugGui NOTIFY debugGuiChanged)
|
||||
Q_PROPERTY(bool steamVrLh READ steamVrLh WRITE set_steamVrLh NOTIFY steamVrLhChanged)
|
||||
Q_PROPERTY(bool tcpOnly READ tcpOnly WRITE set_tcpOnly NOTIFY tcpOnlyChanged)
|
||||
Q_PROPERTY(QString openvr READ openvr WRITE set_openvr NOTIFY openvrChanged)
|
||||
|
||||
Q_PROPERTY(bool flatpak READ flatpak CONSTANT)
|
||||
Q_PROPERTY(bool debug_gui_supported READ debug_gui CONSTANT)
|
||||
Q_PROPERTY(bool steamvr_lh_supported READ steamvr_lh CONSTANT)
|
||||
|
||||
SETTER_GETTER_NOTIFY(bool, manualEncoders)
|
||||
SETTER_GETTER_NOTIFY(std::vector<encoder>, encoders)
|
||||
@@ -133,6 +137,8 @@ class Settings : public QObject
|
||||
SETTER_GETTER_NOTIFY(int, bitrate)
|
||||
SETTER_GETTER_NOTIFY(float, scale)
|
||||
SETTER_GETTER_NOTIFY(QString, application)
|
||||
SETTER_GETTER_NOTIFY(bool, debugGui)
|
||||
SETTER_GETTER_NOTIFY(bool, steamVrLh)
|
||||
SETTER_GETTER_NOTIFY(bool, tcpOnly)
|
||||
SETTER_GETTER_NOTIFY(QString, openvr)
|
||||
|
||||
@@ -146,6 +152,8 @@ public:
|
||||
Q_INVOKABLE void set_encoder_preset(QJSValue preset);
|
||||
|
||||
bool flatpak() const;
|
||||
bool debug_gui() const;
|
||||
bool steamvr_lh() const;
|
||||
|
||||
static std::optional<encoder::encoder_name> encoder_id_from_string(std::string_view s);
|
||||
static std::optional<encoder::video_codec> codec_id_from_string(std::string_view s);
|
||||
|
||||
@@ -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())
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user