From d3e7201774e86e2d931497d044aebe6f5e8775d6 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 21 May 2025 19:56:00 +0200 Subject: [PATCH 1/9] Document debug-gui and use-steamvr-lh --- docs/configuration.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/configuration.md b/docs/configuration.md index 79f5ef14..5e52937f 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -190,3 +190,17 @@ Provides the path to the directory of an OpenVR compatibility tool (such as Open If unset, WiVRn will autodetect the path of such a tool as usual (see [the SteamVR guide](./steamvr.md)). If set to an null, WiVRn will not manage the OpenVR configuration. + +## `debug-gui` +Default value: `false` + +Only available when built with `WIVRN_FEATURE_DEBUG_GUI`. + +Enables the Monado debug gui. + +## `use-steamvr-lh` +Default value: `false` + +Only available when built with `WIVRN_FEATURE_STEAMVR_LIGHTHOUSE` + +Enables the driver to load SteamVR Lighthouse devices. From d9dc4fb8df83d72ff91dbbbdf0b25593bd7c2b96 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Wed, 21 May 2025 20:11:51 +0200 Subject: [PATCH 2/9] Add tooltip for lighthouse button --- dashboard/qml/SettingsPage.qml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/dashboard/qml/SettingsPage.qml b/dashboard/qml/SettingsPage.qml index 78c87ac8..f0b573bd 100644 --- a/dashboard/qml/SettingsPage.qml +++ b/dashboard/qml/SettingsPage.qml @@ -326,10 +326,15 @@ Kirigami.ScrollablePage { text: i18n("Enable debug window") visible: config.debug_gui_supported } - Controls.CheckBox { - id: steamvr_lh - text: i18n("Enable SteamVR tracked devices support") + RowLayout { visible: config.steamvr_lh_supported + Controls.CheckBox { + id: steamvr_lh + text: i18n("Enable SteamVR tracked devices support") + } + Kirigami.ContextualHelpButton { + toolTipText: i18n("Load Lighthouse based controllers and trackers, requires SteamVR to be installed and devices to be powered on when connecting to WiVRn.") + } } Controls.CheckBox { From 4a0a5818ae92cfb33567bb1fad875da749a6b011 Mon Sep 17 00:00:00 2001 From: Sapphire Date: Tue, 13 May 2025 17:51:45 -0500 Subject: [PATCH 3/9] Add nix devshell --- flake.lock | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ flake.nix | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100644 flake.lock create mode 100644 flake.nix diff --git a/flake.lock b/flake.lock new file mode 100644 index 00000000..51376c93 --- /dev/null +++ b/flake.lock @@ -0,0 +1,61 @@ +{ + "nodes": { + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1743550720, + "narHash": "sha256-hIshGgKZCgWh6AYJpJmRgFdR3WUbkY04o82X05xqQiY=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "c621e8422220273271f52058f618c94e405bb0f5", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1747744144, + "narHash": "sha256-W7lqHp0qZiENCDwUZ5EX/lNhxjMdNapFnbErcbnP11Q=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "2795c506fe8fb7b03c36ccb51f75b6df0ab2553f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "lastModified": 1743296961, + "narHash": "sha256-b1EdN3cULCqtorQ4QeWgLMrd5ZGOjLSLemfa00heasc=", + "owner": "nix-community", + "repo": "nixpkgs.lib", + "rev": "e4822aea2a6d1cdd36653c134cacfd64c97ff4fa", + "type": "github" + }, + "original": { + "owner": "nix-community", + "repo": "nixpkgs.lib", + "type": "github" + } + }, + "root": { + "inputs": { + "flake-parts": "flake-parts", + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 00000000..5c33ce92 --- /dev/null +++ b/flake.nix @@ -0,0 +1,57 @@ +{ + inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + inputs.flake-parts.url = "github:hercules-ci/flake-parts"; + + outputs = inputs@{ nixpkgs, flake-parts, ... }: + flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" ]; + perSystem = { pkgs, ... }: let + # Tools used for development work (clangd, clang-format) + devTools = with pkgs; [ + clang-tools + ]; + # Extra build inputs not yet in the nixpkgs recipe. + # Should be submitted to nixpkgs on release + extraBuildInputs = with pkgs; [ + # XRT_FEATURE_DEBUG_GUI requires SDL2 + sdl2-compat + ]; + + package = pkgs.wivrn.overrideAttrs (finalAttrs: oldAttrs: { + src = ./.; + version = "next"; + + # Because src is just a folder path and not a set from a fetcher, it doesn't need to be unpacked, so having a postUnpack throws an error. + postUnpack = null; + prePatch = '' + ourMonadoRev="${finalAttrs.monado.src.rev}" + theirMonadoRev=$(sed -n '/FetchContent_Declare(monado/,/)/p' CMakeLists.txt | grep "GIT_TAG" | awk '{print $2}') + if [ ! "$theirMonadoRev" == "$ourMonadoRev" ]; then + echo "Our Monado source revision doesn't match CMakeLists.txt." >&2 + echo " theirs: $theirMonadoRev" >&2 + echo " ours: $ourMonadoRev" >&2 + return 1 + fi + ''; + + monado = pkgs.applyPatches { + inherit (oldAttrs.monado) patches postPatch; + src = pkgs.fetchFromGitLab { + inherit (oldAttrs.monado.src) owner repo; + domain = "gitlab.freedesktop.org"; + # Keep in sync with CMakeLists.txt monado rev + rev = "2a6932d46dad9aa957205e8a47ec2baa33041076"; + hash = "sha256-Bus9GTNC4+nOSwN8pUsMaFsiXjlpHYioQfBLxbQEF+0="; + }; + }; + + buildInputs = oldAttrs.buildInputs ++ extraBuildInputs; + }); + in { + packages.default = package; + devShells.default = package.overrideAttrs (oldAttrs: { + nativeBuildInputs = oldAttrs.nativeBuildInputs ++ devTools; + }); + }; + }; +} \ No newline at end of file From ac3003ef54186a4bc44069e1663b0bfc6f4ab59d Mon Sep 17 00:00:00 2001 From: Sapphire Date: Wed, 21 May 2025 04:00:27 -0500 Subject: [PATCH 4/9] Add Nix CI step --- .github/workflows/Build.yml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index af74da05..1537c5b3 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -150,6 +150,18 @@ jobs: include-hidden-files: true retention-days: 1 + nix-test: + name: Test Nix package and devshell + runs-on: ubuntu-24.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: cachix/install-nix-action@v31 + - run: nix flake check + - run: nix build + build-test-client: name: Linux client runs-on: ubuntu-24.04 From aa86ee72121ae133bd0f7b84c070c73bc5a9685f Mon Sep 17 00:00:00 2001 From: Sapphire Date: Wed, 21 May 2025 05:41:49 -0500 Subject: [PATCH 5/9] Read monado rev from file --- .github/workflows/Build.yml | 2 +- CMakeLists.txt | 3 ++- flake.nix | 14 +++----------- monado-rev | 1 + tools/gen_flatpak_manifest.py | 2 +- 5 files changed, 8 insertions(+), 14 deletions(-) create mode 100644 monado-rev diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 1537c5b3..e61a4874 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -474,7 +474,7 @@ jobs: - name: Download monado run: | - MONADO_COMMIT=$(grep -zo "FetchContent_Declare(monado[^)]*)" wivrn/CMakeLists.txt | sed -ze "s/^.*GIT_TAG *\([^ )]*\).*$/\1/" | tr -d '\0') + MONADO_COMMIT=$(cat wivrn/monado-rev) wget https://gitlab.freedesktop.org/monado/monado/-/archive/$MONADO_COMMIT/monado-$MONADO_COMMIT.tar.gz mkdir wivrn/monado-src diff --git a/CMakeLists.txt b/CMakeLists.txt index 98678d01..3e213697 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -284,11 +284,12 @@ FetchContent_Declare(uni-algo EXCLUDE_FROM_ALL SYSTEM URL https://github.co URL_HASH SHA256=f2a1539cd8635bc6088d05144a73ecfe7b4d74ee0361fabed6f87f9f19e74ca9) file(GLOB MONADO_PATCHES CONFIGURE_DEPENDS patches/monado/*) +file(READ monado-rev MONADO_REV) # Server dependencies FetchContent_Declare(monado GIT_REPOSITORY https://gitlab.freedesktop.org/monado/monado # The flatpak manifest is updated automatically - GIT_TAG 2a6932d46dad9aa957205e8a47ec2baa33041076 + GIT_TAG ${MONADO_REV} PATCH_COMMAND ${CMAKE_CURRENT_LIST_DIR}/patches/apply.sh ${MONADO_PATCHES} EXCLUDE_FROM_ALL ) diff --git a/flake.nix b/flake.nix index 5c33ce92..df94fe73 100644 --- a/flake.nix +++ b/flake.nix @@ -22,17 +22,8 @@ version = "next"; # Because src is just a folder path and not a set from a fetcher, it doesn't need to be unpacked, so having a postUnpack throws an error. + # We also don't need the check since we read the revision from the monado-rev file. postUnpack = null; - prePatch = '' - ourMonadoRev="${finalAttrs.monado.src.rev}" - theirMonadoRev=$(sed -n '/FetchContent_Declare(monado/,/)/p' CMakeLists.txt | grep "GIT_TAG" | awk '{print $2}') - if [ ! "$theirMonadoRev" == "$ourMonadoRev" ]; then - echo "Our Monado source revision doesn't match CMakeLists.txt." >&2 - echo " theirs: $theirMonadoRev" >&2 - echo " ours: $ourMonadoRev" >&2 - return 1 - fi - ''; monado = pkgs.applyPatches { inherit (oldAttrs.monado) patches postPatch; @@ -40,7 +31,8 @@ inherit (oldAttrs.monado.src) owner repo; domain = "gitlab.freedesktop.org"; # Keep in sync with CMakeLists.txt monado rev - rev = "2a6932d46dad9aa957205e8a47ec2baa33041076"; + rev = builtins.readFile ./monado-rev; + # Nix will output the correct hash when it doesn't match hash = "sha256-Bus9GTNC4+nOSwN8pUsMaFsiXjlpHYioQfBLxbQEF+0="; }; }; diff --git a/monado-rev b/monado-rev new file mode 100644 index 00000000..f4e7a1ab --- /dev/null +++ b/monado-rev @@ -0,0 +1 @@ +2a6932d46dad9aa957205e8a47ec2baa33041076 \ No newline at end of file diff --git a/tools/gen_flatpak_manifest.py b/tools/gen_flatpak_manifest.py index 5c82d1c5..7715416b 100755 --- a/tools/gen_flatpak_manifest.py +++ b/tools/gen_flatpak_manifest.py @@ -58,7 +58,7 @@ if __name__ == "__main__": json.dump(gen_src, f, indent=4, sort_keys=False) - monado_commit = cmake.get("monado", "GIT_TAG") + monado_commit = open(os.path.join(root, "monado-rev")).read() boostpfr_url = cmake.get("boostpfr", "URL") boostpfr_sha256 = cmake.get("boostpfr", "URL_HASH").split("=")[-1] From 4b103ef6b00d18cbc02f9184b97b67e5dcf97097 Mon Sep 17 00:00:00 2001 From: Sapphire Date: Wed, 21 May 2025 07:54:34 -0500 Subject: [PATCH 6/9] Force a refetch when the revision changes --- flake.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index df94fe73..1121315e 100644 --- a/flake.nix +++ b/flake.nix @@ -27,7 +27,8 @@ monado = pkgs.applyPatches { inherit (oldAttrs.monado) patches postPatch; - src = pkgs.fetchFromGitLab { + # Force a refetch when the monado rev changes. + src = pkgs.invalidateFetcherByDrvHash pkgs.fetchFromGitLab { inherit (oldAttrs.monado.src) owner repo; domain = "gitlab.freedesktop.org"; # Keep in sync with CMakeLists.txt monado rev From 61152d95a0e0d0a4c3ba253c787b814bd7114e79 Mon Sep 17 00:00:00 2001 From: mitsuami-megane <173323057+mitsuami-megane@users.noreply.github.com> Date: Thu, 22 May 2025 03:31:42 +0900 Subject: [PATCH 7/9] update steamvr_lh tooltip --- dashboard/qml/SettingsPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/qml/SettingsPage.qml b/dashboard/qml/SettingsPage.qml index f0b573bd..d4c9ed59 100644 --- a/dashboard/qml/SettingsPage.qml +++ b/dashboard/qml/SettingsPage.qml @@ -333,7 +333,7 @@ Kirigami.ScrollablePage { text: i18n("Enable SteamVR tracked devices support") } Kirigami.ContextualHelpButton { - toolTipText: i18n("Load Lighthouse based controllers and trackers, requires SteamVR to be installed and devices to be powered on when connecting to WiVRn.") + toolTipText: i18n("Allows the use of lighthouse-based controllers and trackers.\nRequires SteamVR to be installed.\nDevices must be be powered on before connecting to WiVRn.\nAn external tool such as motoc is needed for calibration.") } } From 77560028963bedc28f088d349d45be2524588e1a Mon Sep 17 00:00:00 2001 From: mitsuami-megane <173323057+mitsuami-megane@users.noreply.github.com> Date: Thu, 22 May 2025 03:47:58 +0900 Subject: [PATCH 8/9] update ja-JP locale --- locale/ja/wivrn-dashboard.po | 66 +++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 19 deletions(-) diff --git a/locale/ja/wivrn-dashboard.po b/locale/ja/wivrn-dashboard.po index 3d7fcafb..32e15228 100644 --- a/locale/ja/wivrn-dashboard.po +++ b/locale/ja/wivrn-dashboard.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: WiVRn-dashboard\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-05-05 23:41+0900\n" +"POT-Creation-Date: 2025-05-22 03:31+0900\n" "PO-Revision-Date: 2025-04-10 07:14+0900\n" "Last-Translator: Mitsuami Megane \n" "Language-Team: Japanese <>\n" @@ -517,54 +517,72 @@ msgstr "H.265" msgid "AV1" msgstr "AV1" -#: dashboard/qml/SettingsPage.qml:323 +#: dashboard/qml/SettingsPage.qml:320 +#, kde-format +msgid "Advanced options" +msgstr "詳細設定" + +#: dashboard/qml/SettingsPage.qml:326 +#, kde-format +msgid "Enable debug window" +msgstr "デバッグ・ウィンドウを表示する" + +#: dashboard/qml/SettingsPage.qml:333 +#, kde-format +msgid "Enable SteamVR tracked devices support" +msgstr "SteamVR・ライトハウス・トラッキング" + +#: dashboard/qml/SettingsPage.qml:336 +#, kde-format +msgid "" +"Allows the use of lighthouse-based controllers and trackers.\n" +"Requires SteamVR to be installed.\n" +"Devices must be be powered on before connecting to WiVRn.\n" +"An external tool such as motoc is needed for calibration." +msgstr "" +"ライトハウスのコントローラーやトラッカーなどの使用します。\n" +"SteamVRをインストールする必要があります。\n" +"すべてのデバイスの電源が入ってからHMDを接続しましょう。\n" +"キャリブレーションはmotocなどのソフトウェアで行います。" + +#: dashboard/qml/SettingsPage.qml:344 #, kde-format msgid "Custom adb location" msgstr "特定なADBの場所" -#: dashboard/qml/SettingsPage.qml:334 +#: dashboard/qml/SettingsPage.qml:355 #, kde-format msgid "Adb location:" msgstr "ADBの場所:" -#: dashboard/qml/SettingsPage.qml:343 +#: dashboard/qml/SettingsPage.qml:364 #, kde-format msgctxt "browse a file to choose the adb binary" msgid "Browse" msgstr "検索する" -#: dashboard/qml/SettingsPage.qml:353 +#: dashboard/qml/SettingsPage.qml:374 #, kde-format msgid "Default" msgstr "デフォルト" -#: dashboard/qml/SettingsPage.qml:360 -#, kde-format -msgid "xrizer" -msgstr "xrizer" - -#: dashboard/qml/SettingsPage.qml:365 -#, kde-format -msgid "Open Composite" -msgstr "OpenComposite" - -#: dashboard/qml/SettingsPage.qml:372 +#: dashboard/qml/SettingsPage.qml:388 #, kde-format msgctxt "set a custom OpenVR compatibility library" msgid "Custom" msgstr "カスタム" -#: dashboard/qml/SettingsPage.qml:377 +#: dashboard/qml/SettingsPage.qml:393 #, kde-format msgid "Disabled" msgstr "無し" -#: dashboard/qml/SettingsPage.qml:385 +#: dashboard/qml/SettingsPage.qml:401 #, kde-format msgid "OpenVR compatibility library:" msgstr "OpenVR実装ライブラリー" -#: dashboard/qml/SettingsPage.qml:411 +#: dashboard/qml/SettingsPage.qml:427 #, kde-format msgid "Library path, excluding bin/linux64/vrclient.so" msgstr "ライブラリーの場所(bin/linux64/vrclient.so 無し)" @@ -862,3 +880,13 @@ msgstr "完了" #, kde-format msgid "Finished" msgstr "完了しました" + +#: dashboard/wivrn_server.cpp:584 +#, kde-format +msgid "xrizer" +msgstr "xrizer" + +#: dashboard/wivrn_server.cpp:585 +#, kde-format +msgid "Open Composite" +msgstr "OpenComposite" From d6fb4d6f36a9ec59be701ee7cfc824381147de96 Mon Sep 17 00:00:00 2001 From: mitsuami-megane <173323057+mitsuami-megane@users.noreply.github.com> Date: Thu, 22 May 2025 04:14:20 +0900 Subject: [PATCH 9/9] Fix ja locale typo --- locale/ja/wivrn-dashboard.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/locale/ja/wivrn-dashboard.po b/locale/ja/wivrn-dashboard.po index 32e15228..40f425ba 100644 --- a/locale/ja/wivrn-dashboard.po +++ b/locale/ja/wivrn-dashboard.po @@ -540,7 +540,7 @@ msgid "" "Devices must be be powered on before connecting to WiVRn.\n" "An external tool such as motoc is needed for calibration." msgstr "" -"ライトハウスのコントローラーやトラッカーなどの使用します。\n" +"ライトハウスのコントローラーやトラッカーなどを使用します。\n" "SteamVRをインストールする必要があります。\n" "すべてのデバイスの電源が入ってからHMDを接続しましょう。\n" "キャリブレーションはmotocなどのソフトウェアで行います。"