Compare commits

..
68 Commits
Author SHA1 Message Date
gitea 291f31adb2 Actualiser .github/workflows/APK-Release.yml
Build / Linux (map[packages:extra-cmake-modules libarchive-dev libboost-all-dev libkf6coreaddons-dev libkf6qqc2desktopstyle-dev libkf6iconthemes-dev libkirigami-dev librsvg2-dev nlohmann-json3-dev qcoro-qt6-dev qml6-module-org-kde-kirigamiaddons-formcard prese… (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server-tracing]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev preset:server-no-systemd]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev wireshark-dev preset:dissector-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libharfbuzz-dev libfreetype-dev libavcodec-dev libavutil-dev libswscale-dev librsvg2-bin gettext libcurl4-openssl-dev libfontconfig-dev preset:client-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libsystemd-dev preset:server-no-system-boost]) (push) Waiting to run
Build / Create release (push) Blocked by required conditions
Build / Sync fork downstream (push) Blocked by required conditions
Build / Linux server (flatpak) (push) Skipped
Build / Test Nix package and devshell (push) Skipped
Build / Android (Debug) (push) Skipped
Build / Android (DebugWithValidationLayer) (push) Skipped
Build / Android (Oculus) (push) Skipped
Build / Android (Release) (push) Skipped
Build / Build Ubuntu package (plucky) (push) Skipped
Format / Formatting check (common) (push) Skipped
Format / Formatting check (dashboard) (push) Skipped
Format / Formatting check (client) (push) Skipped
Format / Formatting check (server) (push) Skipped
Format / Formatting check (tools/wireshark) (push) Skipped
Format / Python lint (ruff) (push) Skipped
Locales / Locale check (push) Skipped
2026-11-29 01:09:53 +00:00
gitea e2cc93f90e Actualiser .github/workflows/APK-Release.yml
Build / Linux (map[packages:extra-cmake-modules libarchive-dev libboost-all-dev libkf6coreaddons-dev libkf6qqc2desktopstyle-dev libkf6iconthemes-dev libkirigami-dev librsvg2-dev nlohmann-json3-dev qcoro-qt6-dev qml6-module-org-kde-kirigamiaddons-formcard prese… (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server-tracing]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev preset:server-no-systemd]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev wireshark-dev preset:dissector-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libharfbuzz-dev libfreetype-dev libavcodec-dev libavutil-dev libswscale-dev librsvg2-bin gettext libcurl4-openssl-dev libfontconfig-dev preset:client-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libsystemd-dev preset:server-no-system-boost]) (push) Waiting to run
Build / Create release (push) Blocked by required conditions
Build / Sync fork downstream (push) Blocked by required conditions
Build / Test Nix package and devshell (push) Skipped
Build / Android (Debug) (push) Skipped
Build / Linux server (flatpak) (push) Skipped
Build / Android (DebugWithValidationLayer) (push) Skipped
Build / Android (Oculus) (push) Skipped
Build / Android (Release) (push) Skipped
Build / Build Ubuntu package (plucky) (push) Skipped
Format / Formatting check (client) (push) Skipped
Format / Formatting check (common) (push) Skipped
Format / Formatting check (dashboard) (push) Skipped
Format / Formatting check (server) (push) Skipped
Format / Formatting check (tools/wireshark) (push) Skipped
Format / Python lint (ruff) (push) Skipped
Locales / Locale check (push) Skipped
2026-11-29 00:19:24 +00:00
gitea eb9fd869cb Actualiser .github/workflows/APK-Release.yml
Build / Linux (map[packages:extra-cmake-modules libarchive-dev libboost-all-dev libkf6coreaddons-dev libkf6qqc2desktopstyle-dev libkf6iconthemes-dev libkirigami-dev librsvg2-dev nlohmann-json3-dev qcoro-qt6-dev qml6-module-org-kde-kirigamiaddons-formcard prese… (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server-tracing]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev preset:server-no-systemd]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev wireshark-dev preset:dissector-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libharfbuzz-dev libfreetype-dev libavcodec-dev libavutil-dev libswscale-dev librsvg2-bin gettext libcurl4-openssl-dev libfontconfig-dev preset:client-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libsystemd-dev preset:server-no-system-boost]) (push) Waiting to run
Build / Create release (push) Blocked by required conditions
Build / Sync fork downstream (push) Blocked by required conditions
Build / Linux server (flatpak) (push) Skipped
Build / Test Nix package and devshell (push) Skipped
Build / Android (Debug) (push) Skipped
Build / Android (DebugWithValidationLayer) (push) Skipped
Build / Android (Oculus) (push) Skipped
Build / Android (Release) (push) Skipped
Build / Build Ubuntu package (plucky) (push) Skipped
Format / Formatting check (client) (push) Skipped
Format / Formatting check (common) (push) Skipped
Format / Formatting check (dashboard) (push) Skipped
Format / Formatting check (server) (push) Skipped
Format / Formatting check (tools/wireshark) (push) Skipped
Format / Python lint (ruff) (push) Skipped
Locales / Locale check (push) Skipped
2026-11-28 23:26:51 +00:00
gitea 33fe0146cb Actualiser .github/workflows/APK-Release.yml
Build / Linux (map[packages:extra-cmake-modules libarchive-dev libboost-all-dev libkf6coreaddons-dev libkf6qqc2desktopstyle-dev libkf6iconthemes-dev libkirigami-dev librsvg2-dev nlohmann-json3-dev qcoro-qt6-dev qml6-module-org-kde-kirigamiaddons-formcard prese… (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server-tracing]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev preset:server-no-systemd]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev wireshark-dev preset:dissector-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libharfbuzz-dev libfreetype-dev libavcodec-dev libavutil-dev libswscale-dev librsvg2-bin gettext libcurl4-openssl-dev libfontconfig-dev preset:client-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libsystemd-dev preset:server-no-system-boost]) (push) Waiting to run
Build / Create release (push) Blocked by required conditions
Build / Sync fork downstream (push) Blocked by required conditions
Build / Linux server (flatpak) (push) Skipped
Build / Test Nix package and devshell (push) Skipped
Build / Android (Debug) (push) Skipped
Build / Android (DebugWithValidationLayer) (push) Skipped
Build / Android (Oculus) (push) Skipped
Build / Android (Release) (push) Skipped
Build / Build Ubuntu package (plucky) (push) Skipped
Format / Formatting check (client) (push) Skipped
Format / Formatting check (common) (push) Skipped
Format / Formatting check (dashboard) (push) Skipped
Format / Formatting check (server) (push) Skipped
Format / Formatting check (tools/wireshark) (push) Skipped
Format / Python lint (ruff) (push) Skipped
Locales / Locale check (push) Skipped
2026-11-28 22:46:54 +00:00
gitea 5671c463a7 Actualiser .github/workflows/APK-Release.yml
Build / Linux (map[packages:extra-cmake-modules libarchive-dev libboost-all-dev libkf6coreaddons-dev libkf6qqc2desktopstyle-dev libkf6iconthemes-dev libkirigami-dev librsvg2-dev nlohmann-json3-dev qcoro-qt6-dev qml6-module-org-kde-kirigamiaddons-formcard prese… (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server-tracing]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev preset:server-no-systemd]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev wireshark-dev preset:dissector-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libharfbuzz-dev libfreetype-dev libavcodec-dev libavutil-dev libswscale-dev librsvg2-bin gettext libcurl4-openssl-dev libfontconfig-dev preset:client-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libsystemd-dev preset:server-no-system-boost]) (push) Waiting to run
Build / Create release (push) Blocked by required conditions
Build / Sync fork downstream (push) Blocked by required conditions
Build / Linux server (flatpak) (push) Skipped
Build / Test Nix package and devshell (push) Skipped
Build / Android (Debug) (push) Skipped
Build / Android (DebugWithValidationLayer) (push) Skipped
Build / Android (Oculus) (push) Skipped
Build / Android (Release) (push) Skipped
Build / Build Ubuntu package (plucky) (push) Skipped
Format / Formatting check (client) (push) Skipped
Format / Formatting check (common) (push) Skipped
Format / Formatting check (dashboard) (push) Skipped
Format / Formatting check (server) (push) Skipped
Format / Formatting check (tools/wireshark) (push) Skipped
Format / Python lint (ruff) (push) Skipped
Locales / Locale check (push) Skipped
2026-11-28 22:45:03 +00:00
gitea 395c5f921b Actualiser .github/workflows/APK-Release.yml
Build / Linux (map[packages:extra-cmake-modules libarchive-dev libboost-all-dev libkf6coreaddons-dev libkf6qqc2desktopstyle-dev libkf6iconthemes-dev libkirigami-dev librsvg2-dev nlohmann-json3-dev qcoro-qt6-dev qml6-module-org-kde-kirigamiaddons-formcard prese… (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server-tracing]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev preset:server-no-systemd]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev wireshark-dev preset:dissector-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libharfbuzz-dev libfreetype-dev libavcodec-dev libavutil-dev libswscale-dev librsvg2-bin gettext libcurl4-openssl-dev libfontconfig-dev preset:client-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libsystemd-dev preset:server-no-system-boost]) (push) Waiting to run
Build / Create release (push) Blocked by required conditions
Build / Sync fork downstream (push) Blocked by required conditions
Build / Linux server (flatpak) (push) Skipped
Build / Test Nix package and devshell (push) Skipped
Build / Android (Debug) (push) Skipped
Build / Android (DebugWithValidationLayer) (push) Skipped
Build / Android (Oculus) (push) Skipped
Build / Android (Release) (push) Skipped
Build / Build Ubuntu package (plucky) (push) Skipped
Format / Formatting check (client) (push) Skipped
Format / Formatting check (common) (push) Skipped
Format / Formatting check (dashboard) (push) Skipped
Format / Formatting check (server) (push) Skipped
Format / Formatting check (tools/wireshark) (push) Skipped
Format / Python lint (ruff) (push) Skipped
Locales / Locale check (push) Skipped
2026-11-28 22:37:53 +00:00
gitea d3db1aecf8 Actualiser .github/workflows/APK-Release.yml
Build / Linux (map[packages:extra-cmake-modules libarchive-dev libboost-all-dev libkf6coreaddons-dev libkf6qqc2desktopstyle-dev libkf6iconthemes-dev libkirigami-dev librsvg2-dev nlohmann-json3-dev qcoro-qt6-dev qml6-module-org-kde-kirigamiaddons-formcard prese… (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server-tracing]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev libsystemd-dev preset:server]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev preset:server-no-systemd]) (push) Waiting to run
Build / Linux (map[packages:libboost-all-dev wireshark-dev preset:dissector-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libharfbuzz-dev libfreetype-dev libavcodec-dev libavutil-dev libswscale-dev librsvg2-bin gettext libcurl4-openssl-dev libfontconfig-dev preset:client-no-system-boost]) (push) Waiting to run
Build / Linux (map[packages:libsystemd-dev preset:server-no-system-boost]) (push) Waiting to run
Build / Create release (push) Blocked by required conditions
Build / Sync fork downstream (push) Blocked by required conditions
Build / Linux server (flatpak) (push) Skipped
Build / Test Nix package and devshell (push) Skipped
Build / Android (Debug) (push) Skipped
Build / Android (DebugWithValidationLayer) (push) Skipped
Build / Android (Oculus) (push) Skipped
Build / Android (Release) (push) Skipped
Build / Build Ubuntu package (plucky) (push) Skipped
Format / Formatting check (client) (push) Skipped
Format / Formatting check (common) (push) Skipped
Format / Formatting check (dashboard) (push) Skipped
Format / Formatting check (server) (push) Skipped
Format / Formatting check (tools/wireshark) (push) Skipped
Format / Python lint (ruff) (push) Skipped
Locales / Locale check (push) Skipped
2026-11-28 22:11:38 +00:00
Vindicus999 1ba4d78f2d Removed patches since it doesnt belong there 2026-10-27 15:01:47 -04:00
Vindicus999 e906c4a88b Add SolarXR patches 2026-10-27 14:53:59 -04:00
Vindicus999 3ea447b9e2 Update APK-Release.yml 2026-09-29 20:17:35 -04:00
Vindicus999 15d72d0698 Update APK-Release.yml
building stuff is wank
2026-09-29 20:17:07 -04:00
Vindicus999 4adb97806b Update APK-Release.yml 2026-09-29 20:01:20 -04:00
Vindicus999 9fdc79af9f Update APK-Release.yml 2026-09-29 19:51:10 -04:00
Vindicus999 e9b574327b Update APK-Release.yml 2026-09-29 19:39:27 -04:00
Vindicus999 ed7ae70b1d Update APK-Release.yml 2026-09-29 19:26:30 -04:00
Vindicus999 deb1d3e346 Update APK-Release.yml 2026-09-29 18:55:51 -04:00
Vindicus999 dc9ad50c7c Update APK-Release.yml 2026-09-29 18:48:43 -04:00
Vindicus999 6a04765718 Update APK-Release.yml 2026-09-29 18:45:39 -04:00
Vindicus999 11ffdab312 Update APK-Release.yml 2026-09-29 18:45:20 -04:00
Vindicus999 064b2706a3 Update APK-Release.yml 2026-09-29 18:32:24 -04:00
Vindicus999 98d6dc92e2 Update APK-Release.yml 2026-09-29 18:31:22 -04:00
Vindicus999 14ec355d60 Update APK-Release.yml 2026-09-29 18:12:54 -04:00
Vindicus999 121c322082 Update APK-Release.yml 2026-09-29 17:23:51 -04:00
Vindicus999 95ea865cb7 Update APK-Release.yml 2026-09-29 16:45:18 -04:00
Vindicus999 324aae6c68 Update APK-Release.yml 2026-09-29 16:19:06 -04:00
Vindicus999 fb3fbc720f Change the appropriate repo for environments 2026-09-29 08:56:23 -04:00
Vindicus999 105c6008f0 Merge branch 'sync' into sneed 2026-09-27 18:51:13 -04:00
Vindicus999 3aff86b7ae Merge branch 'sync' of https://github.com/Vindicus999/WiVRn into sync 2026-09-27 18:50:59 -04:00
Vindicus999 434f84e5f7 Merge branch 'sync' of https://github.com/Vindicus999/WiVRn into sync 2026-08-04 13:14:51 -04:00
Vindicus999 f1abbfd490 Merge branch 'sync' into sneed 2026-07-25 22:36:30 -04:00
Vindicus999 8e03841b94 Change the transparency type of the beam
Also remove semite ideologies from the project
2026-07-25 22:36:07 -04:00
Vindicus999 e3a5496599 Merge branch 'sync' of https://github.com/Vindicus999/WiVRn into sync 2026-07-25 22:24:30 -04:00
Vindicus999 294b9f7937 Merge branch 'sync' into sneed 2026-07-14 00:38:50 -04:00
Vindicus999 64b1eba5a5 Merge branch 'sync' of https://github.com/Vindicus999/WiVRn into sync 2026-07-14 00:37:29 -04:00
Vindicus999 1ae6453e56 Merge branch 'sync' into sneed 2026-07-01 07:10:14 -04:00
Vindicus999 065ae948ce Merge branch 'sync' of https://github.com/Vindicus999/WiVRn into sync 2026-07-01 07:09:08 -04:00
Vindicus999 d279699b05 Reticulate Splines 2026-06-02 08:54:56 -04:00
Vindicus999 d356d22ce4 Deporting every single Wivrn developers to Little John Island 2026-06-02 08:54:56 -04:00
Vindicus999 ba5c4181dc Update CMakeLists.txt 2026-06-02 08:54:56 -04:00
Vindicus999 2d99c4a1a3 Update CMakeLists.txt 2026-06-02 08:54:56 -04:00
Vindicus999 64ece0d31d Update CMakeLists.txt 2026-06-02 08:54:56 -04:00
Patrick Nicolas cf65ac0b23 Crop FOV in layer squasher 2026-06-02 08:54:56 -04:00
Patrick Nicolas 24e9b12dec Return extent in do_layers() 2026-06-02 08:54:19 -04:00
Vindicus999 9efa9e47d6 Update Sync.yml 2026-06-02 08:51:36 -04:00
Vindicus999 9cad31511e Update Sync.yml 2026-06-02 08:51:36 -04:00
Vindicus999 4d67661a2f Update Sync.yml 2026-06-02 08:51:36 -04:00
Vindicus999 3d1e2f9d0b Update Sync.yml 2026-06-02 08:51:36 -04:00
Vindicus999 eac6348bc2 Update Sync.yml 2026-06-02 08:51:36 -04:00
Vindicus999 26c71371a8 Update Sync.yml 2026-06-02 08:51:36 -04:00
Vindicus999 485d7d82aa Update Sync.yml
Update Sync.yml
2026-06-02 08:51:36 -04:00
Vindicus999 fe6c74a996 Fix the models 2026-06-02 08:51:36 -04:00
Vindicus999 478fd88cd4 Update Sync.yml 2026-06-02 08:51:36 -04:00
Vindicus999 637754517c Configure build actions 2026-06-02 08:51:36 -04:00
Vindicus999 9d3ace4a97 feat: revert "Default to xrizer"
This reverts commit 46ffc44.
2026-06-02 08:51:09 -04:00
Vindicus999 0f980265da feat: set solarxr feeder devices 2026-06-02 08:51:09 -04:00
Vindicus999 71779a142f refactor: initialize xdevs with xrt_device_init 2026-06-02 08:51:09 -04:00
Vindicus999 dfc7a57565 feat: add solarxr patches 2026-06-02 08:51:09 -04:00
Vindicus999 15ce383d5c Removed most mentions of NAMbLA 2026-06-02 08:51:09 -04:00
Vindicus999 91e1665cb7 Merge branch 'sync' of https://github.com/Vindicus999/WiVRn into sync 2026-06-02 08:48:50 -04:00
Vindicus999 296ea5dc54 Merge branch 'sync' of https://github.com/Vindicus999/WiVRn into sync 2026-04-27 22:03:25 -04:00
Vindicus999 0351e0f090 Merge branch 'master' into sync 2026-04-27 21:08:17 -04:00
Vindicus999 f2ee7b0fd9 Merge branch 'sync' of https://github.com/Vindicus999/WiVRn into sync 2026-04-27 21:07:19 -04:00
Vindicus999 5e1998c28a Update Sync.yml 2026-04-04 12:56:07 -04:00
Vindicus999 88d2e03f49 Update Sync.yml 2026-04-03 09:44:04 -04:00
Vindicus999 b5d5a5928c Update APK-Release.yml 2026-04-03 09:29:11 -04:00
Vindicus999 7ad6a2451f Update Sync.yml 2026-04-03 09:09:04 -04:00
Vindicus999 0e20f5bfae Merge branch 'master' of https://github.com/Vindicus999/WiVRn 2026-04-03 09:07:31 -04:00
Vindicus999 c01de0a3d2 Create Sync.yml 2026-04-03 09:07:24 -04:00
163 changed files with 3891 additions and 10367 deletions
+6
View File
@@ -0,0 +1,6 @@
version: "1"
rules:
- base: master
upstream: WiVRn:master
mergeMethod: hardreset
+109 -24
View File
@@ -2,15 +2,16 @@ name: Release APK Only
on:
push:
branches: [ "master" ]
branches: [ "apk-build" ]
env:
BUILD_TYPE: RelWithDebInfo
CSS: images/wivrn-${{(github.ref_type == 'tag' && 'release') || 'nightly'}}.css
jobs:
build-android-only:
name: Android
runs-on: ubuntu-24.04
runs-on: ubuntu-24.04-full
if: ${{ vars.APK_ONLY != '' }}
strategy:
@@ -18,25 +19,28 @@ jobs:
buildtype: ['Release', 'Debug', 'DebugWithValidationLayer']
steps:
- uses: actions/checkout@v6
- uses: actions/checkout@v4
with:
# Checkout from upstream instead of WiVRn-APK to ensure the GIT_DESC variable is set correctly
repository: 'WiVRn/WiVRn'
repository: 'gitea/WiVRn'
ref: ${{ github.sha }}
fetch-depth: 0
# Gradle distribution and the Android plugin's dependencies.
- uses: actions/cache@v5
- name: Install CMake
run: |
apt-get update
apt-get install -y cmake build-essential
- name: Prepare Vulkan SDK
uses: humbletim/setup-vulkan-sdk@286ed76c72de45dbf50c515779cf4ca2f6aa3944
with:
key: gradle-android-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties', 'build.gradle') }}
path: |
~/.gradle/caches
~/.gradle/wrapper
restore-keys: gradle-android-
vulkan-query-version: 1.3.296.0
vulkan-components: Glslang, SPIRV-Tools
vulkan-use-cache: true
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install glslang-tools spirv-tools librsvg2-bin gettext npm
sudo apt-get update && sudo apt-get install -y glslang-tools librsvg2-bin gettext npm
wget https://github.com/KhronosGroup/KTX-Software/releases/download/v4.4.0/KTX-Software-4.4.0-Linux-x86_64.deb
sudo dpkg --install KTX-Software-4.4.0-Linux-x86_64.deb
npm install --global @gltf-transform/cli@4.1.1
@@ -60,6 +64,12 @@ jobs:
echo signingKeyPassword="$APK_SIGNINGKEYPASSWORD" > gradle.properties
echo "$APK_KEYSTORE_BASE64" | base64 --decode --ignore-garbage > ks.keystore
# - name: Setup Java
# uses: actions/setup-java@v6
# with:
# distribution: temurin
# java-version: '25'
- name: Build
run: |
chmod +x gradlew
@@ -74,7 +84,7 @@ jobs:
find debug -name libopenxr_loader.so -delete
- name: Archive APK
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: apk-${{ (github.event_name == 'pull_request' && matrix.buildtype == 'Release') && 'Release-unsigned' || matrix.buildtype }}
path: apk/*.apk
@@ -82,12 +92,79 @@ jobs:
- name: Archive debug symbols
if: ${{ matrix.buildtype != 'Release' }}
uses: actions/upload-artifact@v7
uses: actions/upload-artifact@v4
with:
name: symbols-${{ matrix.buildtype }}
path: debug/**/*.so
retention-days: 7
# build-steam-frame:
# name: Steam Frame
# runs-on: ubuntu-24.04-arm
# if: ${{ vars.APK_ONLY != '' }}
# container:
# image: registry.gitlab.steamos.cloud/steamrt/steamrt4/sdk/arm64:4.0.20260805.254769
# volumes:
# - ${{github.workspace}}/install:/tmp/install
#
# steps:
# - uses: actions/checkout@v6
# with:
# fetch-depth: 0
# fetch-tags: true
#
# - name: Apt dependencies
# uses: awalsh128/cache-apt-pkgs-action@v1.6.1
# with:
# packages: librsvg2-bin npm
#
# - name: ccache
# uses: hendrikmuhs/ccache-action@v1.2.23
# with:
# key: steam-frame
# job-summary: ""
#
# - uses: actions/cache@v5
# with:
# key: cmake-frame
# path: |
# ${{github.workspace}}/cmake-fetch/*-subbuild/*-populate-prefix/src/*.tar.*
# ${{github.workspace}}/cmake-fetch/*-subbuild/*-populate-prefix/src/*.zip
# ${{github.workspace}}/cmake-fetch/*.tar.*
# ${{github.workspace}}/cmake-fetch/*.tgz
# ${{github.workspace}}/cmake-fetch/*-src/.git
#
# - name: Install dependencies
# run: |
# wget https://github.com/KhronosGroup/KTX-Software/releases/download/v4.4.2/KTX-Software-4.4.2-Linux-arm64.deb
# sudo dpkg --install KTX-Software-4.4.2-Linux-arm64.deb
# npm install --global @gltf-transform/cli@4.1.1
#
# - name: Configure CMake
# run: >
# cmake -B "$GITHUB_WORKSPACE/build"
# -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
# -DWIVRN_CSS=${{env.CSS}}
# -DFETCHCONTENT_BASE_DIR="$GITHUB_WORKSPACE/cmake-fetch"
# -DCMAKE_C_COMPILER_LAUNCHER=ccache
# -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
# -DCMAKE_INSTALL_PREFIX=/usr
# --preset frame
#
# - name: Build
# run: |
# git config --global --add safe.directory "$GITHUB_WORKSPACE"
# cd "$GITHUB_WORKSPACE/build"
# DESTDIR="$GITHUB_WORKSPACE/install" ninja install
#
# - name: Archive
# uses: actions/upload-artifact@v7
# with:
# name: wivrn-frame-client.zip
# path: install/usr
# if-no-files-found: error
# retention-days: 30
release:
name: Create APK release
runs-on: ubuntu-24.04
@@ -96,22 +173,22 @@ jobs:
steps:
- name: Download APK artifacts
uses: actions/download-artifact@v8
uses: actions/download-artifact@v4
with:
path: apk
pattern: 'apk-*'
merge-multiple: true
- name: Rename APK artifacts
run: |
cd apk
for f in *.apk; do
BASENAME=`echo ${f}|awk -F '-APK-' '{print $2}'`
mv "${f}" "org.meumeu.wivrn-${BASENAME}"
done
# - name: Rename APK artifacts
# run: |
# cd apk
# for f in *.apk; do
# BASENAME=`echo ${f}|awk -F '-APK-' '{print $2}'`
# mv "${f}" "org.meumeu.wivrn-${BASENAME}"
# done
- name: Download APK debug artifacts
uses: actions/download-artifact@v8
uses: actions/download-artifact@v4
with:
path: symbols
pattern: 'symbols-*'
@@ -122,8 +199,15 @@ jobs:
cd symbols
zip -r ../debug-symbols.zip .
# - name: Download Steam Frame artifacts
# uses: actions/download-artifact@v4
# with:
# path: install/usr
# pattern: 'wivrn-frame-client.zip'
# merge-multiple: true
- name: APK Release
uses: softprops/action-gh-release@v3
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.DOWNSTREAM_GITHUB_TOKEN }}
tag_name: "apk-${{ github.sha }}"
@@ -134,3 +218,4 @@ jobs:
files: |
apk/*.apk
debug-symbols.zip
+25 -129
View File
@@ -7,7 +7,6 @@ on:
env:
BUILD_TYPE: Release
SERVER_DEPS: libx264-dev libavcodec-dev libavutil-dev libbsd-dev libavahi-client-dev libavahi-glib-dev libeigen3-dev nlohmann-json3-dev librsvg2-dev libdrm-dev libglib2.0-dev-bin libpipewire-0.3-dev libcli11-dev libnotify-dev libarchive-dev libudev-dev
CSS: images/wivrn-${{(github.ref_type == 'tag' && 'release') || 'nightly'}}.css
jobs:
build-linux:
@@ -20,7 +19,7 @@ jobs:
matrix:
config:
- preset: 'client-no-system-boost'
packages: libharfbuzz-dev libfreetype-dev libavcodec-dev libavutil-dev libswscale-dev librsvg2-bin gettext libcurl4-openssl-dev libfontconfig-dev libpipewire-0.3-dev
packages: libharfbuzz-dev libfreetype-dev libavcodec-dev libavutil-dev libswscale-dev librsvg2-bin gettext libcurl4-openssl-dev libfontconfig-dev
- preset: 'dashboard'
packages: extra-cmake-modules libarchive-dev libboost-all-dev libkf6coreaddons-dev libkf6qqc2desktopstyle-dev libkf6iconthemes-dev libkirigami-dev librsvg2-dev nlohmann-json3-dev qcoro-qt6-dev qml6-module-org-kde-kirigamiaddons-formcard
- preset: 'dissector-no-system-boost'
@@ -45,14 +44,11 @@ jobs:
packages: ccache libvulkan-dev glslang-tools spirv-tools libwayland-dev libxrandr-dev ${{matrix.config.packages}} ${{ startsWith(matrix.config.preset, 'server') && env.SERVER_DEPS || ''}}
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.24
uses: hendrikmuhs/ccache-action@v1.2.23
with:
# The trailing "." keeps one preset's key from being a prefix of another's
key: linux-${{matrix.config.preset}}.
verbose: 1
job-summary: ''
evict-old-files: job
save: ${{ github.ref == 'refs/heads/master' }}
key: linux-${{matrix.config.preset}}
job-summary: ""
restore-keys: linux-
- uses: actions/cache@v5
with:
@@ -121,84 +117,13 @@ jobs:
draft: true
files: server-build-deps.tar.xz
build-steam-frame:
name: Steam Frame
runs-on: ubuntu-24.04-arm
if: ${{ vars.APK_ONLY == '' }}
container:
image: registry.gitlab.steamos.cloud/steamrt/steamrt4/sdk/arm64:4.0.20260805.254769
volumes:
- ${{github.workspace}}/install:/tmp/install
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
fetch-tags: true
- name: Apt dependencies
uses: awalsh128/cache-apt-pkgs-action@v1.6.1
with:
packages: librsvg2-bin npm
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.24
with:
key: steam-frame
verbose: 1
job-summary: ''
evict-old-files: job
save: ${{ github.ref == 'refs/heads/master' }}
restore-keys: steam-frame
- uses: actions/cache@v5
with:
key: cmake-frame
path: |
${{github.workspace}}/cmake-fetch/*-subbuild/*-populate-prefix/src/*.tar.*
${{github.workspace}}/cmake-fetch/*-subbuild/*-populate-prefix/src/*.zip
${{github.workspace}}/cmake-fetch/*.tar.*
${{github.workspace}}/cmake-fetch/*.tgz
${{github.workspace}}/cmake-fetch/*-src/.git
- name: Install dependencies
run: |
wget https://github.com/KhronosGroup/KTX-Software/releases/download/v4.4.2/KTX-Software-4.4.2-Linux-arm64.deb
sudo dpkg --install KTX-Software-4.4.2-Linux-arm64.deb
npm install --global @gltf-transform/cli@4.1.1
- name: Configure CMake
run: >
cmake -B "$GITHUB_WORKSPACE/build"
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-DWIVRN_CSS=${{env.CSS}}
-DFETCHCONTENT_BASE_DIR="$GITHUB_WORKSPACE/cmake-fetch"
-DCMAKE_C_COMPILER_LAUNCHER=ccache
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
-DCMAKE_INSTALL_PREFIX=/usr
--preset frame
- name: Build
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
cd "$GITHUB_WORKSPACE/build"
DESTDIR="$GITHUB_WORKSPACE/install" ninja install
- name: Archive
uses: actions/upload-artifact@v7
with:
name: wivrn-frame-client.zip
path: install/usr
if-no-files-found: error
retention-days: 30
build-server-flatpak:
name: Linux server (flatpak)
runs-on: ubuntu-24.04
if: ${{ vars.APK_ONLY == '' }}
container:
# Tag matches runtime-version in the manifest.
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.11
image: ghcr.io/flathub-infra/flatpak-github-actions:kde-6.10
options: --privileged
steps:
@@ -206,16 +131,6 @@ jobs:
with:
fetch-depth: 0
- uses: actions/cache/restore@v5
id: cache
with:
path: |
flatpak/monado-*.tar.gz
flatpak/xrizer-gen-src-*.json
.flatpak-builder
key: flatpak-build-${{ hashFiles('flatpak/io.github.wivrn.wivrn.yml.in', 'flatpak/ct-ng-x86_64.config', 'flatpak/ct-ng-aarch64.config', 'monado-rev') }}
restore-keys: flatpak-build-
- name: Create the flatpak manifest
run: |
git config --global --add safe.directory $(pwd)
@@ -223,30 +138,15 @@ jobs:
tools/gen_flatpak_manifest.py --gitlocal --out flatpak
cat flatpak/io.github.wivrn.wivrn.yml
- name: Update flatpak runtimes
run: |
for i in 1 2 3; do
flatpak update -y --noninteractive && exit 0
echo "flatpak update failed (attempt $i), retrying"
sleep 20
done
exit 1
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6.8
- uses: flatpak/flatpak-github-actions/flatpak-builder@v6.7
with:
manifest-path: flatpak/io.github.wivrn.wivrn.yml
bundle: wivrn-server.flatpak
restore-cache: false
save-cache: false
- uses: actions/cache/save@v5
if: success() && steps.cache.outputs.cache-hit != 'true'
with:
path: |
flatpak/monado-*.tar.gz
flatpak/xrizer-gen-src-*.json
.flatpak-builder
key: flatpak-build-${{ hashFiles('flatpak/io.github.wivrn.wivrn.yml.in', 'flatpak/ct-ng-x86_64.config', 'flatpak/ct-ng-aarch64.config', 'monado-rev') }}
# The manifest is regenerated on every commit with the git hash embedded,
# so its default (manifest-hash) cache key never hits. Key on the files
# that actually define the dependency set instead, so the toolchain
# downloads and build cache persist across commits.
cache-key: flatpak-builder-${{ hashFiles('flatpak/io.github.wivrn.wivrn.yml.in', 'flatpak/ct-ng-x86_64.config', 'flatpak/ct-ng-aarch64.config', 'monado-rev', 'CMakeLists.txt') }}
- name: Debug bundle
uses: actions/upload-artifact@v7
@@ -296,16 +196,6 @@ jobs:
${{github.workspace}}/cmake-fetch/*.tgz
restore-keys: cmake-android-
- name: ccache
uses: hendrikmuhs/ccache-action@v1.2.24
with:
# The trailing "." keeps one build type's key from being a prefix of another's
key: android-${{matrix.buildtype}}.
verbose: 1
job-summary: ''
evict-old-files: job
save: ${{ github.ref == 'refs/heads/master' }}
# Gradle distribution and the Android plugin's dependencies.
- uses: actions/cache@v5
with:
@@ -347,9 +237,6 @@ jobs:
echo "$APK_KEYSTORE_BASE64" | base64 --decode --ignore-garbage > ks.keystore
- name: Build
env:
# Paths under the workspace are hashed relative to it
CCACHE_BASEDIR: ${{github.workspace}}
run: |
VERSION=$(git describe --tags --always | sed "s/^v\([0-9]\)/\1/")
if [ ${{ matrix.buildtype }} = 'Oculus' ]
@@ -375,19 +262,25 @@ jobs:
fi
fi
if [ ${{ github.ref_type }} = 'tag' ]
then
CSS=images/wivrn-release.css
else
CSS=images/wivrn-nightly.css
fi
echo Setting version $VERSION and version code $VERSION_CODE in manifest
echo Using stylesheet ${{env.CSS}} and name $APPNAME
echo Using stylesheet $CSS and name $APPNAME
chmod +x gradlew
./gradlew \
-Pwivrn_version=$VERSION \
-Pwivrn_versionCode=$VERSION_CODE \
-Psuffix=$SUFFIX \
-Pwivrn_css=${{env.CSS}} \
-Pwivrn_css=$CSS \
-Pwivrn_app_name="$APPNAME" \
-Pwivrn_compress_glb=ON \
-Pfetchcontent_base_dir=${{github.workspace}}/cmake-fetch \
-Pcompiler_launcher=ccache \
assemble${{ matrix.buildtype }}
- name: Upload build dir
@@ -475,7 +368,10 @@ jobs:
- name: Patch monado
working-directory: wivrn/monado-src
run: ../patches/apply.sh ../patches/monado/*
run: >
for p in ../patches/monado/*; do
patch -p1 --fuzz=0 --forward < "$p"
done
- name: Download stb
run: |
+4 -4
View File
@@ -17,9 +17,9 @@ jobs:
steps:
- uses: actions/checkout@v6
- name: Run clang-format style check for C/C++/Protobuf programs.
uses: jidicula/clang-format-action@v4.18.0
uses: jidicula/clang-format-action@v4.16.0
with:
clang-format-version: '22'
clang-format-version: '21'
check-path: ${{ matrix.path }}
python-format-check:
@@ -30,12 +30,12 @@ jobs:
- uses: actions/checkout@v6
# Scope set by `include` in ruff.toml.
- name: Run ruff lint check
uses: astral-sh/ruff-action@v4.1.0
uses: astral-sh/ruff-action@v3
with:
version: "0.16.0"
args: "check"
- name: Run ruff format check
uses: astral-sh/ruff-action@v4.1.0
uses: astral-sh/ruff-action@v3
with:
version: "0.16.0"
args: "format --check"
+49
View File
@@ -0,0 +1,49 @@
name: Sync Fork with Upstream
env:
UPSTREAM_URL: "https://github.com/wivrn/wivrn.git"
WORKFLOW_TOKEN: ${{ secrets.DOWNSTREAM_GITHUB_TOKEN }}
UPSTREAM_BRANCH: "master"
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
upstream_repo: vindicus999/wivrn
fetch-depth: 0
token: ${{ env.WORKFLOW_TOKEN }}
- name: Add upstream
run: |
git remote add upstream ${{ env.UPSTREAM_URL }}
- name: Fetch all
run: |
git fetch origin
git fetch upstream
- name: Update sync branch
run: |
git checkout -B master upstream/master
git push origin master --force
- name: Copy master -> apk-build
run: |
git checkout -B apk-build master
git push origin apk-build --force
- name: Apply sneed changes
run: |
git merge origin/sneed --no-edit
- name: Push apk build
run: |
git push origin build --force
-5
View File
@@ -22,8 +22,3 @@ gradle.properties
local.properties
compile_commands.json
!libopenxr_loader.so
# Generated by tools/gen_flatpak_manifest.py
flatpak/io.github.wivrn.wivrn.yml
flatpak/xrizer-gen-src-*.json
flatpak/monado-*.tar.gz
-5
View File
@@ -1,5 +0,0 @@
# PR instructions
You are not allowed to submit pull requests.
# Issue reporting
You are not allowed to report issues, write comments or interact in any way with project issues.
-3
View File
@@ -60,9 +60,6 @@
<!-- https://developer.oculus.com/documentation/native/android/mobile-passthrough/ -->
<uses-feature android:name="com.oculus.feature.PASSTHROUGH" android:required="false" />
<!-- Required for XR_META_boundary_visibility -->
<uses-permission android:name="com.oculus.permission.BOUNDARY_VISIBILITY" />
<!-- See https://hub.vive.com/storage/docs/en-us/ConfigureAppCapabilities.html -->
<uses-feature android:name="wave.feature.handtracking" android:required="false" />
<uses-feature android:name="wave.feature.eyetracking" android:required="false" />
+10 -28
View File
@@ -1,10 +1,6 @@
cmake_minimum_required(VERSION 3.28)
project(WiVRn VERSION 0.0.0 LANGUAGES C CXX)
# Workaround for boost CMake error
function(source_group)
endfunction()
# Set default for FetchContent projects
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
@@ -12,7 +8,6 @@ set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
if(ANDROID)
@@ -55,14 +50,6 @@ option(WIVRN_OPTIMIZE_SHADERS "Run spirv-opt on compiled shaders" ON)
option(WIVRN_DEBUG_SHADERS "Compile shaders with debug information" OFF)
option(WIVRN_ADDRESS_SANITIZER "Use address sanitizer" OFF)
# V4L2 decoder on by default on Linux AArch64
set(_WIVRN_USE_V4L2_DEFAULT OFF)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64" AND NOT ANDROID)
set(_WIVRN_USE_V4L2_DEFAULT ON)
endif()
option(WIVRN_USE_V4L2 "Enable V4L2 hardware video decoder" ${_WIVRN_USE_V4L2_DEFAULT})
unset(_WIVRN_USE_V4L2_DEFAULT)
if(WIVRN_OPTIMIZE_SHADERS AND WIVRN_DEBUG_SHADERS)
message(FATAL_ERROR "WIVRN_OPTIMIZE_SHADERS and WIVRN_DEBUG_SHADERS are incompatible")
endif()
@@ -102,7 +89,7 @@ option(WIVRN_OPENXR_MANIFEST_ABI "Generate an ABI specific OpenXR manifest")
option(ENABLE_COLOURED_OUTPUT "Always produce ANSI-coloured output (GNU/Clang only)." ON)
set(WIVRN_ENVIRONMENTS_URL "https://github.com/WiVRn/WiVRn-environments/releases/latest/download/index.json" CACHE STRING "URL hosting the custom environments json file")
set(WIVRN_ENVIRONMENTS_URL "https://github.com/Vindicus999/WiVRn-environments/releases/latest/download/index.json" CACHE STRING "URL hosting the custom environments json file")
if (WIVRN_BUILD_CLIENT OR WIVRN_BUILD_SERVER OR WIVRN_BUILD_DASHBOARD OR WIVRN_BUILD_DISSECTOR)
set(NEED_COMMON TRUE)
@@ -153,6 +140,10 @@ if (WIVRN_BUILD_SERVER)
pkg_check_modules(X264 REQUIRED IMPORTED_TARGET x264)
endif()
if (WIVRN_USE_PIPEWIRE)
pkg_check_modules(libpipewire REQUIRED IMPORTED_TARGET libpipewire-0.3)
endif()
pkg_check_modules(AVAHI REQUIRED IMPORTED_TARGET avahi-client avahi-glib)
find_package(Eigen3 REQUIRED)
find_package(nlohmann_json REQUIRED)
@@ -177,8 +168,6 @@ if (WIVRN_BUILD_DASHBOARD)
find_package(Qt6 REQUIRED COMPONENTS QmlPrivate)
endif()
# Prevent KDE cmake module from overwriting defaults
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT FALSE)
find_package(ECM 5.115 REQUIRED NO_MODULE)
list(APPEND CMAKE_MODULE_PATH "${ECM_MODULE_PATH}")
@@ -193,10 +182,6 @@ if (WIVRN_BUILD_CLIENT OR WIVRN_BUILD_DASHBOARD)
find_package(Gettext REQUIRED)
endif()
if (WIVRN_USE_PIPEWIRE AND (WIVRN_BUILD_SERVER OR (WIVRN_BUILD_CLIENT AND NOT ANDROID)))
pkg_check_modules(libpipewire REQUIRED IMPORTED_TARGET libpipewire-0.3)
endif()
if (WIVRN_BUILD_CLIENT)
find_program(RSVG_CONVERT rsvg-convert REQUIRED)
find_program(KTX ktx REQUIRED)
@@ -211,13 +196,11 @@ if (WIVRN_BUILD_CLIENT)
endif()
if (WIVRN_BUILD_CLIENT AND NOT ANDROID)
if(NOT WIVRN_USE_V4L2)
pkg_check_modules(LIBAV_CLIENT REQUIRED IMPORTED_TARGET libavcodec libavutil libswscale)
endif()
pkg_check_modules(LIBAV_CLIENT REQUIRED IMPORTED_TARGET libavcodec libavutil libswscale)
find_package(Fontconfig REQUIRED)
if (WIVRN_USE_SYSTEM_OPENXR)
find_package(OpenXR 1.1.59 REQUIRED)
find_package(OpenXR 1.1.58 REQUIRED)
endif()
if (WIVRN_USE_SYSTEM_LIBKTX)
@@ -255,8 +238,8 @@ FetchContent_Declare(fastgltf EXCLUDE_FROM_ALL SYSTEM URL https://github.co
URL_HASH SHA256=0bb564e127b14c22f062db50f89381dd2e0a20dbaf4987ca138a4ae8728712f9)
FetchContent_Declare(glm EXCLUDE_FROM_ALL SYSTEM URL https://github.com/g-truc/glm/releases/download/1.0.2/glm-1.0.2.zip
URL_HASH SHA256=77fff075c5ab0caf076fade41558c5458d9a242aba2b2076bb72008bdb51a35e)
FetchContent_Declare(openxr_loader EXCLUDE_FROM_ALL SYSTEM URL https://github.com/KhronosGroup/OpenXR-SDK/archive/refs/tags/release-1.1.59.tar.gz
URL_HASH SHA256=d45d12d71cbe381a6fc510ec95ec84a88fe30724674e63bb038dfc9a481d8885)
FetchContent_Declare(openxr_loader EXCLUDE_FROM_ALL SYSTEM URL https://github.com/KhronosGroup/OpenXR-SDK/archive/refs/tags/release-1.1.58.tar.gz
URL_HASH SHA256=815b933219c398314366c289221526428418d799205a73a9640c97ca4242602b)
FetchContent_Declare(spdlog EXCLUDE_FROM_ALL SYSTEM URL https://github.com/gabime/spdlog/archive/refs/tags/v1.16.0.tar.gz
URL_HASH SHA256=8741753e488a78dd0d0024c980e1fb5b5c85888447e309d9cb9d949bdb52aa3e)
FetchContent_Declare(stb EXCLUDE_FROM_ALL SYSTEM URL https://github.com/nothings/stb/archive/013ac3beddff3dbffafd5177e7972067cd2b5083.zip
@@ -307,7 +290,6 @@ add_custom_target(wivrn-version ALL
-P ${CMAKE_SOURCE_DIR}/cmake/GitVersion.cmake
BYPRODUCTS ${CMAKE_BINARY_DIR}/version.cpp ${CMAKE_BINARY_DIR}/u_git_tag.cpp
SOURCES common/version.cpp.in server/u_git_tag.cpp.in
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
add_subdirectory(external)
@@ -347,11 +329,11 @@ foreach(TARGET_NAME wivrn wivrn-server wivrn-dashboard wivrn-common wivrn-dissec
target_compile_options(${TARGET_NAME} PRIVATE
-fdiagnostics-color -Wall -Wextra -pedantic
-ffast-math
-fno-finite-math-only
-Wundef
-Wno-missing-field-initializers
-Wno-unused-parameter
-Wno-comment
-Wno-unused-variable
-Wno-sign-compare
$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-volatile -Wno-array-bounds>
$<$<COMPILE_LANG_AND_ID:CXX,Clang>:-Wno-deprecated-volatile -Wno-unneeded-internal-declaration -Wno-c99-extensions -Wno-unused-private-field>
-22
View File
@@ -157,28 +157,6 @@
"cacheVariables": {
"WIVRN_USE_SYSTEM_BOOST": "OFF"
}
},
{
"name": "frame",
"generator": "Ninja",
"cacheVariables": {
"CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
"CMAKE_INTERPROCEDURAL_OPTIMIZATION": "ON",
"CMAKE_BUILD_TYPE": "Release",
"WIVRN_BUILD_CLIENT": "ON",
"WIVRN_BUILD_SERVER": "OFF",
"WIVRN_BUILD_SERVER_LIBRARY": "OFF",
"WIVRN_BUILD_DASHBOARD": "OFF",
"WIVRN_BUILD_DISSECTOR": "OFF",
"WIVRN_BUILD_WIVRNCTL": "OFF",
"WIVRN_USE_PIPEWIRE": "ON",
"WIVRN_USE_V4L2": "ON",
"WIVRN_USE_SYSTEM_BOOST": "OFF",
"WIVRN_USE_SYSTEM_LIBKTX": "OFF",
"WIVRN_USE_SYSTEM_OPENXR": "OFF",
"WIVRN_COMPRESS_GLB": "ON",
"WIVRN_WERROR": "ON"
}
}
],
"buildPresets": [
-20
View File
@@ -1,20 +0,0 @@
# Contributing to WiVRn
WiVRn is developed by volunteers and published under GPL-3 license.
Contributions are welcome, there are few rules that should be followed:
## Setup your development environment
Instructions on how to build the project are in [docs/building.md], for translations please follow [docs/translating.md].
## Acceptable contributions
The project is developed by humans, machine generated code will not be accepted unless it is for trivial changes.
For changes to be accepted, we have to ensure that we can maintain them in the future.
This means that we will be very careful in case of big pull requests. Changes that rely on specification violation or that violate specifications (especially OpenXR and Vulkan) will not be accepted.
## Conventions
The code does not have strict conventions, there is a clang-format file for formatting. Just try to write code that is correct, concise and easy to understand. Details can be discussed in code reviews.
+2 -2
View File
@@ -62,7 +62,7 @@ Follow the wizard in the PC dashboard to install the client on your VR headset.
It should either lead you to the [Meta Store](https://www.meta.com/experiences/7959676140827574/) (for Meta Quest headsets) or to download the correct APK (for other headsets).
> [!WARNING]
> The VR client and PC server must use the same WiVRn protocol. For development builds, compare the full version string, including the Git commit suffix (for example, `26.8-42-g1234afe`); the release prefix alone (for example, `26.8`) does not identify the build.
> The VR client and PC server need to be on the same version of WiVRn
> [!TIP]
> If the headset fails to connect to the computer, see [troubleshooting](#troubleshooting).
@@ -150,7 +150,7 @@ If the server list is empty in the headset app:
<details><summary>My headset does not connect to my computer</summary>
- If you have a firewall, check that port 9757 (UDP and TCP) is open
- If the app reports an incompatible server protocol, compare the full version shown in the headset app's About screen with the server's startup log. Package metadata may show only the release prefix. For development builds, use client and server built from the same source revision. If multiple builds are installed, make sure you start the intended server.</details>
- The server and client must be the same version.</details>
<details><summary>How do I use a wired connection manually?</summary>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 930 B

After

Width:  |  Height:  |  Size: 856 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 B

BIN
View File
Binary file not shown.
+1 -4
View File
@@ -117,8 +117,6 @@ android {
def compressGlb = project.hasProperty('wivrn_compress_glb') ? wivrn_compress_glb : 'OFF'
def fetchcontentBaseDir = project.hasProperty('fetchcontent_base_dir') ? ['-DFETCHCONTENT_BASE_DIR=' + fetchcontent_base_dir] : []
def compilerLauncher = project.hasProperty('compiler_launcher') ? ['-DCMAKE_C_COMPILER_LAUNCHER=' + compiler_launcher, '-DCMAKE_CXX_COMPILER_LAUNCHER=' + compiler_launcher] : []
def asan = use_asan ? 'ON': 'OFF'
def stl = use_asan ? 'c++_shared' : "c++_static"
@@ -148,8 +146,7 @@ android {
'-DWIVRN_COMPRESS_GLB=' + compressGlb,
'-DWIVRN_ADDRESS_SANITIZER=' + asan,
] +
fetchcontentBaseDir +
compilerLauncher
fetchcontentBaseDir
resValue "string", "app_name", project.hasProperty('wivrn_app_name') ? project.wivrn_app_name : "WiVRn Local"
abiFilters 'arm64-v8a'//, 'x86_64'
}
+3 -35
View File
@@ -108,29 +108,10 @@ else()
target_link_libraries(wivrn openxr_loader)
endif()
target_link_libraries(wivrn Fontconfig::Fontconfig CURL::libcurl)
if(WIVRN_USE_V4L2)
file(GLOB CLIENT_V4L2_SOURCE CONFIGURE_DEPENDS
"decoder/v4l2/*.cpp")
list(APPEND PLATFORM_SOURCE ${CLIENT_V4L2_SOURCE})
else()
target_link_libraries(wivrn PkgConfig::LIBAV_CLIENT)
file(GLOB PLATFORM_SOURCE CONFIGURE_DEPENDS
"decoder/ffmpeg/*.cpp")
endif()
file(GLOB CLIENT_LINUX_SOURCE CONFIGURE_DEPENDS
"linux/*.cpp")
list(APPEND PLATFORM_SOURCE ${CLIENT_LINUX_SOURCE})
if(WIVRN_USE_PIPEWIRE)
file(GLOB CLIENT_PIPEWIRE_SOURCE CONFIGURE_DEPENDS
"audio/linux/*.cpp")
list(APPEND PLATFORM_SOURCE ${CLIENT_PIPEWIRE_SOURCE})
target_link_libraries(wivrn PkgConfig::libpipewire)
endif()
target_link_libraries(wivrn PkgConfig::LIBAV_CLIENT Fontconfig::Fontconfig CURL::libcurl)
file(GLOB PLATFORM_SOURCE CONFIGURE_DEPENDS
"decoder/ffmpeg/*.cpp")
target_sources(wivrn PRIVATE ${PLATFORM_SOURCE})
file(CREATE_LINK ${CMAKE_CURRENT_BINARY_DIR}/share ${CMAKE_BINARY_DIR}/share SYMBOLIC)
@@ -184,8 +165,6 @@ target_compile_definitions(wivrn PRIVATE IMGUI_DEFINE_MATH_OPERATORS)
target_include_directories(wivrn PRIVATE .)
if(NOT ANDROID)
configure_file(io.github.wivrn.wivrn-client.desktop.in io.github.wivrn.wivrn-client.desktop)
install(TARGETS wivrn)
endif()
@@ -297,14 +276,10 @@ set(IMAGES_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../images)
set(ASSETS_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../assets-source)
wivrn_rasterize_svg(SOURCE ${IMAGES_SRC_DIR}/wivrn.svg DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/wivrn.png WIDTH 540 HEIGHT 540 CSS ${WIVRN_CSS_ABS})
wivrn_rasterize_svg(SOURCE ${IMAGES_SRC_DIR}/wivrn-pride.svg DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/wivrn-pride.png WIDTH 540 HEIGHT 540 CSS ${WIVRN_CSS_ABS})
wivrn_rasterize_svg(SOURCE ${IMAGES_SRC_DIR}/wivrn-christmas.svg DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/wivrn-christmas.png WIDTH 540 HEIGHT 540 CSS ${WIVRN_CSS_ABS})
wivrn_rasterize_svg(SOURCE ${ASSETS_SRC_DIR}/passthrough.svg DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/passthrough.png WIDTH 256 HEIGHT 256)
wivrn_rasterize_svg(SOURCE ${ASSETS_SRC_DIR}/default-environment.svg DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/default-environment.png WIDTH 256 HEIGHT 256)
wivrn_generate_ktx( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/wivrn.png DESTINATION ${ASSETS_DIR}/wivrn.ktx2 TARGET wivrn)
wivrn_generate_ktx( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/wivrn-pride.png DESTINATION ${ASSETS_DIR}/wivrn-pride.ktx2 TARGET wivrn)
wivrn_generate_ktx( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/wivrn-christmas.png DESTINATION ${ASSETS_DIR}/wivrn-christmas.ktx2 TARGET wivrn)
wivrn_generate_ktx( SOURCE ${ASSETS_SRC_DIR}/default_icon.png DESTINATION ${ASSETS_DIR}/default_icon.ktx2 TARGET wivrn)
wivrn_generate_ktx( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/passthrough.png DESTINATION ${ASSETS_DIR}/passthrough.ktx2 TARGET wivrn)
wivrn_generate_ktx( SOURCE ${CMAKE_CURRENT_BINARY_DIR}/default-environment.png DESTINATION ${ASSETS_DIR}/default-environment.ktx2 TARGET wivrn)
@@ -353,11 +328,4 @@ if(NOT ANDROID)
set_target_properties(wivrn PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
install(DIRECTORY "${ASSETS_DIR}" DESTINATION ${CMAKE_INSTALL_DATADIR}/wivrn)
install(FILES ../images/wivrn.svg
DESTINATION share/icons/hicolor/scalable/apps
RENAME io.github.wivrn.wivrn-client.svg
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/io.github.wivrn.wivrn-client.desktop
DESTINATION share/applications
)
endif()
+18 -21
View File
@@ -2,7 +2,6 @@
* WiVRn VR streaming
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2024 Patrick Nicolas <patricknicolas@laposte.net>
* Copyright (C) 2026 Sapphire <imsapphire0@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,19 +19,20 @@
#include "battery.h"
#include "android/jnipp.h"
#include "application.h"
#include <mutex>
#include <spdlog/spdlog.h>
battery::battery(xr::instance & instance, xr::session & session, jobject activity) : battery(instance, session)
namespace
{
jni::object<""> act(activity);
auto app = act.call<jni::object<"android/app/Application">>("getApplication");
auto ctx = app.call<jni::object<"android/content/Context">>("getApplicationContext");
std::mutex last_status_lock;
battery_status last_status;
} // namespace
auto bat_receiver = act.field<jni::object<"android/content/BroadcastReceiver">>("BatteryInfoReceiver");
ctx.call<jni::object<"android/content/Intent">>("registerReceiver", bat_receiver, jni::new_object<"android/content/IntentFilter">(jni::string{"android.intent.action.BATTERY_CHANGED"}));
battery_status get_battery_status()
{
std::unique_lock _{last_status_lock};
return last_status;
}
extern "C" void Java_org_meumeu_wivrn_BroadcastReceiver_onReceive(JNIEnv * env, jobject instance, jobject ctxt_obj, jobject intent_obj)
@@ -51,19 +51,16 @@ extern "C" void Java_org_meumeu_wivrn_BroadcastReceiver_onReceive(JNIEnv * env,
auto scale_jint = intent.call<jni::Int>(get_int_extra, scale_jstr, default_jint);
auto plugged_jint = intent.call<jni::Int>(get_int_extra, plugged_jstr, default_jint);
std::optional<float> charge{};
if (level_jint && level_jint.value >= 0 && scale_jint && scale_jint.value >= 0)
charge = (float)(level_jint.value) / (float)(scale_jint.value);
{
std::unique_lock _{last_status_lock};
if (level_jint && level_jint.value >= 0 && scale_jint && scale_jint.value >= 0)
last_status.charge = (float)(level_jint.value) / (float)(scale_jint.value);
else
last_status.charge = std::nullopt;
bool charging = plugged_jint && plugged_jint.value > 0;
last_status.charging = plugged_jint && plugged_jint.value > 0;
}
if (charge)
spdlog::debug("Received ACTION_BATTERY_CHANGED: level {}%, plugged {}", *charge * 100, charging);
application::get_battery_monitor().on_status_update(
battery::device::head,
{
.charge = charge,
.charging = charging,
});
if (level_jint and scale_jint and plugged_jint)
spdlog::debug("Received ACTION_BATTERY_CHANGED: level {}%, plugged {}", *last_status.charge * 100, last_status.charging);
}
@@ -1,7 +1,7 @@
/*
* WiVRn VR streaming
* Copyright (C) 2023 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2023 Patrick Nicolas <patricknicolas@laposte.net>
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2024 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -20,6 +20,11 @@
#pragma once
#include <optional>
#include <string>
std::optional<std::string> get_property(const char * property);
struct battery_status
{
std::optional<float> charge = std::nullopt;
bool charging = false;
};
battery_status get_battery_status();
-38
View File
@@ -1,38 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2023 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2023 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "property.h"
#include "utils/wrap_lambda.h"
#include <sys/system_properties.h>
std::optional<std::string> get_property(const char * property)
{
auto info = __system_property_find(property);
if (not info)
return std::nullopt;
std::string result;
wrap_lambda cb = [&result](const char * name, const char * value, uint32_t serial) {
result = value;
};
__system_property_read_callback(info, cb.userdata_first(), cb);
return result;
}
-2
View File
@@ -16,6 +16,4 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
bool usb_link_properties_changed();
+1 -165
View File
@@ -477,68 +477,6 @@ static std::vector<interaction_profile> interaction_profiles{
"/user/hand/right/input/squeeze/value",
},
},
interaction_profile{
.profile_name = "/interaction_profiles/valve/frame_controller_valve",
.required_extensions = {"XR_VALVE_frame_controller_interaction"},
.input_sources = {
"/user/hand/right/output/haptic",
"/user/hand/left/output/haptic",
"/user/hand/right/input/grip/pose",
"/user/hand/left/input/grip/pose",
"/user/hand/right/input/aim/pose",
"/user/hand/left/input/aim/pose",
"/user/hand/right/input/a/touch",
"/user/hand/right/input/a/click",
"/user/hand/right/input/b/touch",
"/user/hand/right/input/b/click",
"/user/hand/right/input/x/touch",
"/user/hand/right/input/x/click",
"/user/hand/right/input/y/touch",
"/user/hand/right/input/y/click",
"/user/hand/right/input/menu/touch",
"/user/hand/right/input/menu/click",
"/user/hand/right/input/system/touch",
"/user/hand/right/input/system/click",
"/user/hand/right/input/bumper/touch",
"/user/hand/right/input/bumper/click",
"/user/hand/right/input/squeeze/touch",
"/user/hand/right/input/squeeze/click",
"/user/hand/right/input/squeeze/value",
"/user/hand/right/input/trigger/touch",
"/user/hand/right/input/trigger/click",
"/user/hand/right/input/trigger/value",
"/user/hand/right/input/thumbstick/touch",
"/user/hand/right/input/thumbstick/click",
"/user/hand/right/input/thumbstick",
"/user/hand/left/input/dpad_up/touch",
"/user/hand/left/input/dpad_up/click",
"/user/hand/left/input/dpad_left/touch",
"/user/hand/left/input/dpad_left/click",
"/user/hand/left/input/dpad_down/touch",
"/user/hand/left/input/dpad_down/click",
"/user/hand/left/input/dpad_right/touch",
"/user/hand/left/input/dpad_right/click",
"/user/hand/left/input/view/touch",
"/user/hand/left/input/view/click",
"/user/hand/left/input/system/touch",
"/user/hand/left/input/system/click",
"/user/hand/left/input/bumper/touch",
"/user/hand/left/input/bumper/click",
"/user/hand/left/input/squeeze/touch",
"/user/hand/left/input/squeeze/click",
"/user/hand/left/input/squeeze/value",
"/user/hand/left/input/trigger/touch",
"/user/hand/left/input/trigger/click",
"/user/hand/left/input/trigger/value",
"/user/hand/left/input/thumbstick/touch",
"/user/hand/left/input/thumbstick/click",
"/user/hand/left/input/thumbstick",
},
},
interaction_profile{
.profile_name = "/interaction_profiles/yvr/touch_controller_yvr",
.input_sources = {
@@ -899,16 +837,6 @@ void application::initialize_vulkan()
optional_device_extensions.emplace(VK_IMG_FILTER_CUBIC_EXTENSION_NAME);
optional_device_extensions.emplace(VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME);
optional_device_extensions.emplace(VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME);
optional_device_extensions.emplace(VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME);
optional_device_extensions.emplace(VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME);
#if WIVRN_USE_V4L2
// V4L2 decoders expose their output through DMA-buf
optional_device_extensions.emplace(VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME);
optional_device_extensions.emplace(VK_EXT_EXTERNAL_MEMORY_DMA_BUF_EXTENSION_NAME);
optional_device_extensions.emplace(VK_EXT_IMAGE_DRM_FORMAT_MODIFIER_EXTENSION_NAME);
optional_device_extensions.emplace(VK_EXT_QUEUE_FAMILY_FOREIGN_EXTENSION_NAME);
#endif
#ifdef __ANDROID__
vk_device_extensions.push_back(VK_ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION_NAME);
@@ -1056,9 +984,7 @@ void application::initialize_vulkan()
vk::PhysicalDeviceMultiviewFeaturesKHR{
.multiview = true,
},
vk::PhysicalDeviceIndexTypeUint8FeaturesEXT{},
vk::PhysicalDeviceFragmentDensityMapFeaturesEXT{},
vk::PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM{}};
vk::PhysicalDeviceIndexTypeUint8FeaturesEXT{}};
auto check_feature_flag = [&](auto feature_flag, const char * extension_name) -> bool {
using FeatureStruct = class_from_member_t<decltype(feature_flag)>;
@@ -1078,14 +1004,6 @@ void application::initialize_vulkan()
check_feature_flag(&vk::PhysicalDeviceTimelineSemaphoreFeaturesKHR::timelineSemaphore, VK_KHR_TIMELINE_SEMAPHORE_EXTENSION_NAME);
check_feature_flag(&vk::PhysicalDeviceIndexTypeUint8FeaturesEXT::indexTypeUint8, VK_EXT_INDEX_TYPE_UINT8_EXTENSION_NAME);
const bool fragment_density_map_supported =
check_feature_flag(&vk::PhysicalDeviceFragmentDensityMapFeaturesEXT::fragmentDensityMap, VK_EXT_FRAGMENT_DENSITY_MAP_EXTENSION_NAME);
const bool fragment_density_map2_supported =
utils::contains(vk_device_extensions, VK_EXT_FRAGMENT_DENSITY_MAP_2_EXTENSION_NAME);
const bool fragment_density_map_offset_supported =
check_feature_flag(&vk::PhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM::fragmentDensityMapOffset, VK_QCOM_FRAGMENT_DENSITY_MAP_OFFSET_EXTENSION_NAME);
foveation_vulkan_supported = fragment_density_map_supported and fragment_density_map2_supported and fragment_density_map_offset_supported;
spdlog::info(" Vulkan eye-tracked foveation support: {}", foveation_vulkan_supported);
vk_device = xr_system_id.create_device(vk_physical_device, device_create_info.get());
*vk_queue.lock() = vk_device.getQueue(vk_queue_family_index, 0);
@@ -1376,11 +1294,9 @@ void application::initialize()
XR_KHR_MAINTENANCE1_EXTENSION_NAME,
XR_KHR_VISIBILITY_MASK_EXTENSION_NAME,
XR_EXT_INTERACTION_PROFILE_BATTERY_STATE_DISPLAY_EXTENSION_NAME,
XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME,
XR_EXT_HAND_INTERACTION_EXTENSION_NAME,
XR_EXT_HAND_TRACKING_EXTENSION_NAME,
XR_EXT_HAND_TRACKING_DATA_SOURCE_EXTENSION_NAME,
XR_FB_HAND_TRACKING_MESH_EXTENSION_NAME,
XR_EXT_PALM_POSE_EXTENSION_NAME,
XR_EXT_PERFORMANCE_SETTINGS_EXTENSION_NAME,
@@ -1395,9 +1311,6 @@ void application::initialize()
XR_FB_COMPOSITION_LAYER_SETTINGS_EXTENSION_NAME,
XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME,
XR_FB_FACE_TRACKING2_EXTENSION_NAME,
XR_FB_FOVEATION_EXTENSION_NAME,
XR_FB_FOVEATION_CONFIGURATION_EXTENSION_NAME,
XR_FB_FOVEATION_VULKAN_EXTENSION_NAME,
XR_FB_PASSTHROUGH_EXTENSION_NAME,
XR_FB_SWAPCHAIN_UPDATE_STATE_EXTENSION_NAME,
@@ -1408,10 +1321,7 @@ void application::initialize()
XR_META_BODY_TRACKING_FIDELITY_EXTENSION_NAME,
XR_META_BODY_TRACKING_FULL_BODY_EXTENSION_NAME,
XR_META_FOVEATION_EYE_TRACKED_EXTENSION_NAME,
XR_META_LOCAL_DIMMING_EXTENSION_NAME,
XR_META_BOUNDARY_VISIBILITY_EXTENSION_NAME,
XR_META_VULKAN_SWAPCHAIN_CREATE_INFO_EXTENSION_NAME,
};
for (const auto & i: interaction_profiles)
@@ -1462,13 +1372,6 @@ void application::initialize()
eye_gaze_supported = eye_gaze_properties.supportsEyeGazeInteraction;
}
if (xr_instance.has_extension(XR_META_FOVEATION_EYE_TRACKED_EXTENSION_NAME))
{
XrSystemFoveationEyeTrackedPropertiesMETA foveation_properties = xr_system_id.foveation_eye_tracked_properties();
spdlog::info(" Eye tracked foveation center support: {}", (bool)foveation_properties.supportsFoveationEyeTracked);
foveation_center_supported = foveation_properties.supportsFoveationEyeTracked;
}
if (xr_instance.has_extension(XR_FB_COMPOSITION_LAYER_SETTINGS_EXTENSION_NAME))
{
spdlog::info(" OpenXR post-processing extension support: true");
@@ -1501,17 +1404,9 @@ void application::initialize()
spaces[size_t(xr::spaces::view)] = xr_session.create_reference_space(XR_REFERENCE_SPACE_TYPE_VIEW);
spaces[size_t(xr::spaces::world)] = xr_session.create_reference_space(XR_REFERENCE_SPACE_TYPE_STAGE);
#ifdef __ANDROID__
battery_monitor.emplace(xr_instance, xr_session, app_info.native_app->activity->clazz);
#else
battery_monitor.emplace(xr_instance, xr_session);
#endif
config.emplace(xr_system_id, xr_session, application::get_config_path() / "client.json");
default_config.emplace(xr_system_id, xr_session);
xr_session.set_passthrough_boundary_enabled(config->passthrough_boundary_enabled);
#ifdef __ANDROID__
set_usb_networking(config->usb_network);
#endif
@@ -1803,7 +1698,6 @@ application::~application()
void application::loop()
{
poll_events();
battery_monitor->poll_batteries();
auto scene = current_scene();
if (not is_session_running())
@@ -1849,59 +1743,6 @@ void application::loop()
}
}
std::optional<XrQuaternionf> application::locate_gaze(XrTime time)
{
XrSpaceLocation res{
.type = XR_TYPE_SPACE_LOCATION,
};
if (get_hmd_traits().view_locate)
{
xrLocateSpace(spaces[size_t(xr::spaces::eye_gaze)],
spaces[size_t(xr::spaces::view)],
time,
&res);
}
else
{
XrSpaceLocation tmp{
.type = XR_TYPE_SPACE_LOCATION,
};
auto xr_res = xrLocateSpace(spaces[size_t(xr::spaces::view)],
spaces[size_t(xr::spaces::world)],
time,
&tmp);
if (XR_FAILED(xr_res))
return std::nullopt;
xr_res = xrLocateSpace(spaces[size_t(xr::spaces::eye_gaze)],
spaces[size_t(xr::spaces::world)],
time,
&res);
if (XR_FAILED(xr_res))
return std::nullopt;
glm::quat target_quat(
res.pose.orientation.w,
res.pose.orientation.x,
res.pose.orientation.y,
res.pose.orientation.z);
const glm::quat view_quat(
tmp.pose.orientation.w,
tmp.pose.orientation.x,
tmp.pose.orientation.y,
tmp.pose.orientation.z);
target_quat = glm::conjugate(view_quat) * target_quat;
res.pose.orientation = {
.x = target_quat.x,
.y = target_quat.y,
.z = target_quat.z,
.w = target_quat.w};
res.locationFlags &= tmp.locationFlags;
}
if (res.locationFlags & XR_SPACE_LOCATION_ORIENTATION_VALID_BIT)
return res.pose.orientation;
return std::nullopt;
}
#ifdef __ANDROID__
void application::run()
{
@@ -2212,11 +2053,6 @@ void application::poll_events()
spdlog::info(" XR_PASSTHROUGH_STATE_CHANGED_RESTORED_ERROR_BIT_FB");
}
break;
case XR_TYPE_EVENT_DATA_BOUNDARY_VISIBILITY_CHANGED_META: {
spdlog::info("Boundary visibility changed to {}", magic_enum::enum_name(e.boundary_visibility_changed.boundaryVisibility));
xr_session.on_boundary_visibility_changed(e.boundary_visibility_changed.boundaryVisibility);
}
break;
default:
spdlog::info("Received event type {}", xr::to_string(e.header.type));
break;
+2 -24
View File
@@ -19,7 +19,6 @@
#pragma once
#include "battery.h"
#ifdef __ANDROID__
#include "android/hid.h"
#include <android_native_app_glue.h>
@@ -132,8 +131,6 @@ private:
std::vector<std::pair<XrPath, xr::space>> generic_trackers;
bool eye_gaze_supported = false;
bool foveation_center_supported = false;
bool foveation_vulkan_supported = false;
bool openxr_post_processing_supported = false;
@@ -149,7 +146,6 @@ private:
std::filesystem::path cache_path;
std::shared_ptr<wifi_lock> wifi;
std::optional<battery> battery_monitor;
std::mutex server_intent_mutex;
std::optional<wivrn_discover::service> server_intent;
@@ -191,6 +187,8 @@ private:
vk::raii::DebugReportCallbackEXT debug_report_callback = nullptr;
#endif
void set_server_uri(std::string uri);
public:
using singleton<application>::instance;
application(application_info info);
@@ -216,8 +214,6 @@ public:
}
#endif
void set_server_uri(std::string uri);
static bool is_session_running()
{
return instance().session_running;
@@ -280,8 +276,6 @@ public:
return std::make_pair(position, orientation);
}
std::optional<XrQuaternionf> locate_gaze(XrTime time);
void run();
static void push_scene(std::shared_ptr<scene>);
@@ -318,12 +312,6 @@ public:
return *instance().wifi;
}
static battery & get_battery_monitor()
{
assert(instance().battery_monitor);
return *instance().battery_monitor;
}
#ifdef __ANDROID__
void set_usb_networking(bool enabled);
#endif
@@ -419,16 +407,6 @@ public:
return instance().eye_gaze_supported;
}
static bool get_foveation_center_supported()
{
return instance().foveation_center_supported;
}
static bool get_foveation_vulkan_supported()
{
return instance().foveation_vulkan_supported;
}
static bool get_openxr_post_processing_supported()
{
return instance().openxr_post_processing_supported;
-8
View File
@@ -19,20 +19,12 @@
#pragma once
#include "wivrn_config.h"
#ifdef __ANDROID__
#include "android/audio.h"
namespace wivrn
{
using audio = ::wivrn::android::audio;
}
#elif WIVRN_USE_PIPEWIRE
#include "linux/audio.h"
namespace wivrn
{
using audio = ::wivrn::linux_audio::audio;
}
#else
#include "wivrn_client.h"
-640
View File
@@ -1,640 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 galister <galister-dev@pm.me>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "audio.h"
#include "utils/named_thread.h"
#include "wivrn_client.h"
#include "xr/instance.h"
#include "spdlog/spdlog.h"
#include <pipewire/pipewire.h>
#include <spa/param/audio/format-utils.h>
#include <spa/utils/result.h>
#include <algorithm>
#include <chrono>
#include <cstring>
#include <format>
#include <memory>
#include <mutex>
#include <stdexcept>
#include <string>
#include <string_view>
#include <vector>
namespace wivrn::linux_audio
{
void pipewire_deleter::operator()(pw_main_loop * loop) const noexcept
{
pw_main_loop_destroy(loop);
}
void pipewire_deleter::operator()(pw_thread_loop * loop) const noexcept
{
pw_thread_loop_destroy(loop);
}
void pipewire_deleter::operator()(pw_stream * stream) const noexcept
{
pw_stream_destroy(stream);
}
namespace
{
constexpr uint32_t default_sample_rate = 48'000;
constexpr uint32_t target_latency_ms = 5;
void init_pipewire()
{
[[maybe_unused]] static bool done = [] {
int argc = 0;
pw_init(&argc, nullptr);
return true;
}();
}
void set_channel_positions(spa_audio_info_raw & info)
{
switch (info.channels)
{
case 1:
info.position[0] = SPA_AUDIO_CHANNEL_MONO;
break;
case 2:
info.position[0] = SPA_AUDIO_CHANNEL_FL;
info.position[1] = SPA_AUDIO_CHANNEL_FR;
break;
default:
info.flags = SPA_AUDIO_FLAG_UNPOSITIONED;
break;
}
}
struct detected_devices
{
bool pipewire = false;
bool speaker = false;
bool microphone = false;
};
struct device_probe
{
pipewire_ptr<pw_main_loop> loop;
int sync_seq = 0;
detected_devices devices;
static void global(
void * userdata,
uint32_t,
uint32_t,
const char * type,
uint32_t,
const spa_dict * props)
{
auto self = static_cast<device_probe *>(userdata);
if (not type or not props or std::string_view(type) != PW_TYPE_INTERFACE_Node)
return;
const char * media_class = spa_dict_lookup(props, PW_KEY_MEDIA_CLASS);
if (not media_class)
return;
if (std::string_view(media_class) == "Audio/Sink")
self->devices.speaker = true;
else if (std::string_view(media_class) == "Audio/Source")
self->devices.microphone = true;
}
static void done(void * userdata, uint32_t id, int seq)
{
auto self = static_cast<device_probe *>(userdata);
if (id == PW_ID_CORE and seq == self->sync_seq)
pw_main_loop_quit(self->loop.get());
}
static void error(void * userdata, uint32_t, int, int, const char *)
{
auto self = static_cast<device_probe *>(userdata);
pw_main_loop_quit(self->loop.get());
}
};
const pw_registry_events probe_registry_events{
.version = PW_VERSION_REGISTRY_EVENTS,
.global = &device_probe::global,
};
const pw_core_events probe_core_events{
.version = PW_VERSION_CORE_EVENTS,
.done = &device_probe::done,
.error = &device_probe::error,
};
detected_devices detect_devices()
{
init_pipewire();
device_probe probe;
probe.loop.reset(pw_main_loop_new(nullptr));
if (not probe.loop)
return {};
pw_context * context = pw_context_new(pw_main_loop_get_loop(probe.loop.get()), nullptr, 0);
if (not context)
return {};
pw_core * core = pw_context_connect(context, nullptr, 0);
if (not core)
{
pw_context_destroy(context);
return {};
}
probe.devices.pipewire = true;
pw_registry * registry = pw_core_get_registry(core, PW_VERSION_REGISTRY, 0);
if (not registry)
{
pw_core_disconnect(core);
pw_context_destroy(context);
return probe.devices;
}
spa_hook registry_listener{};
spa_hook core_listener{};
pw_registry_add_listener(registry, &registry_listener, &probe_registry_events, &probe);
pw_core_add_listener(core, &core_listener, &probe_core_events, &probe);
probe.sync_seq = pw_core_sync(core, PW_ID_CORE, 0);
if (probe.sync_seq >= 0)
pw_main_loop_run(probe.loop.get());
spa_hook_remove(&core_listener);
spa_hook_remove(&registry_listener);
pw_proxy_destroy(reinterpret_cast<pw_proxy *>(registry));
pw_core_disconnect(core);
pw_context_destroy(context);
return probe.devices;
}
std::string rate_string(uint32_t sample_rate)
{
return std::format("1/{}", sample_rate);
}
std::string latency_string(uint32_t sample_rate)
{
const uint32_t frames = std::max<uint32_t>(1, sample_rate * target_latency_ms / 1000);
return std::format("{}/{}", frames, sample_rate);
}
pw_properties * make_properties(
const char * category,
const char * role,
const char * node_name,
const char * description,
uint32_t sample_rate)
{
auto rate = rate_string(sample_rate);
auto latency = latency_string(sample_rate);
return pw_properties_new(
PW_KEY_MEDIA_TYPE,
"Audio",
PW_KEY_MEDIA_CATEGORY,
category,
PW_KEY_MEDIA_ROLE,
role,
PW_KEY_NODE_NAME,
node_name,
PW_KEY_NODE_DESCRIPTION,
description,
PW_KEY_NODE_RATE,
rate.c_str(),
PW_KEY_NODE_LATENCY,
latency.c_str(),
nullptr);
}
void throw_connect_error(const char * name, int result)
{
throw std::runtime_error(std::format("Failed to connect PipeWire {} stream: {}", name, spa_strerror(result)));
}
} // namespace
const pw_stream_events audio::speaker_events{
.version = PW_VERSION_STREAM_EVENTS,
.process = &audio::speaker_process,
};
const pw_stream_events audio::microphone_events{
.version = PW_VERSION_STREAM_EVENTS,
.process = &audio::microphone_process,
};
void audio::build_speaker(const to_headset::audio_stream_description::device & device)
{
speaker.reset(pw_stream_new_simple(
pw_thread_loop_get_loop(loop.get()),
"WiVRn",
make_properties(
"Playback",
"Game",
"wivrn-client-speaker",
"WiVRn headset audio",
device.sample_rate),
&speaker_events,
this));
if (not speaker)
throw std::runtime_error("Failed to create PipeWire speaker stream");
std::vector<uint8_t> buffer(1024);
spa_pod_builder builder = SPA_POD_BUILDER_INIT(buffer.data(), uint32_t(buffer.size()));
spa_audio_info_raw audio_info{
.format = SPA_AUDIO_FORMAT_S16,
.rate = device.sample_rate,
.channels = device.num_channels,
};
set_channel_positions(audio_info);
const spa_pod * params[] = {
spa_format_audio_raw_build(&builder, SPA_PARAM_EnumFormat, &audio_info),
};
const int result = pw_stream_connect(
speaker.get(),
PW_DIRECTION_OUTPUT,
PW_ID_ANY,
pw_stream_flags(PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_MAP_BUFFERS | PW_STREAM_FLAG_RT_PROCESS),
params,
1);
if (result < 0)
throw_connect_error("speaker", result);
spdlog::info(
"PipeWire speaker stream created: {} channels at {} Hz ({} ms target latency)",
device.num_channels,
device.sample_rate,
target_latency_ms);
}
void audio::build_microphone(const to_headset::audio_stream_description::device & device)
{
microphone.reset(pw_stream_new_simple(
pw_thread_loop_get_loop(loop.get()),
"WiVRn",
make_properties(
"Capture",
"Communication",
"wivrn-client-microphone",
"WiVRn headset microphone",
device.sample_rate),
&microphone_events,
this));
if (not microphone)
throw std::runtime_error("Failed to create PipeWire microphone stream");
std::vector<uint8_t> buffer(1024);
spa_pod_builder builder = SPA_POD_BUILDER_INIT(buffer.data(), uint32_t(buffer.size()));
spa_audio_info_raw audio_info{
.format = SPA_AUDIO_FORMAT_S16,
.rate = device.sample_rate,
.channels = device.num_channels,
};
set_channel_positions(audio_info);
const spa_pod * params[] = {
spa_format_audio_raw_build(&builder, SPA_PARAM_EnumFormat, &audio_info),
};
const int result = pw_stream_connect(
microphone.get(),
PW_DIRECTION_INPUT,
PW_ID_ANY,
pw_stream_flags(PW_STREAM_FLAG_AUTOCONNECT | PW_STREAM_FLAG_INACTIVE | PW_STREAM_FLAG_MAP_BUFFERS),
params,
1);
if (result < 0)
throw_connect_error("microphone", result);
spdlog::info(
"PipeWire microphone stream created: {} channels at {} Hz ({} ms target latency)",
device.num_channels,
device.sample_rate,
target_latency_ms);
}
audio::audio(
const wivrn::to_headset::audio_stream_description & desc,
wivrn_session & session,
xr::instance & instance) :
desc(desc), session(session), instance(instance)
{
init_pipewire();
loop.reset(pw_thread_loop_new("WiVRn audio", nullptr));
if (not loop)
throw std::runtime_error("Failed to create PipeWire thread loop");
pw_thread_loop_lock(loop.get());
const int start_result = pw_thread_loop_start(loop.get());
if (start_result < 0)
{
pw_thread_loop_unlock(loop.get());
loop.reset();
throw std::runtime_error(std::format("Failed to start PipeWire thread loop: {}", spa_strerror(start_result)));
}
try
{
if (desc.speaker)
build_speaker(*desc.speaker);
if (desc.microphone)
build_microphone(*desc.microphone);
}
catch (...)
{
speaker.reset();
microphone.reset();
pw_thread_loop_unlock(loop.get());
pw_thread_loop_stop(loop.get());
loop.reset();
throw;
}
pw_thread_loop_unlock(loop.get());
if (microphone)
microphone_thread = utils::named_thread("wivrn-mic-send", &audio::microphone_sender, this);
}
audio::~audio()
{
exiting = true;
microphone_cv.notify_all();
shutdown_pipewire();
if (microphone_thread.joinable())
microphone_thread.join();
}
void audio::shutdown_pipewire()
{
if (not loop)
return;
pw_thread_loop_lock(loop.get());
speaker.reset();
microphone.reset();
pw_thread_loop_unlock(loop.get());
pw_thread_loop_stop(loop.get());
loop.reset();
}
void audio::operator()(wivrn::audio_data && data)
{
if (not desc.speaker)
return;
const auto size = data.payload.size_bytes();
speaker_buffer_size_bytes.fetch_add(size, std::memory_order_relaxed);
if (not speaker_samples.write(std::move(data)))
speaker_buffer_size_bytes.fetch_sub(size, std::memory_order_relaxed);
}
void audio::set_mic_state(bool running)
{
if (not microphone or not loop)
return;
const bool old = mic_running.exchange(running);
if (old == running)
return;
pw_thread_loop_lock(loop.get());
const int result = pw_stream_set_active(microphone.get(), running);
pw_thread_loop_unlock(loop.get());
if (result < 0)
{
mic_running = old;
spdlog::warn("Failed to {} PipeWire microphone: {}", running ? "start" : "stop", spa_strerror(result));
}
microphone_cv.notify_one();
}
void audio::speaker_process(void * userdata)
{
auto self = static_cast<audio *>(userdata);
if (not self->speaker)
return;
pw_buffer * buffer = pw_stream_dequeue_buffer(self->speaker.get());
if (not buffer)
return;
if (not buffer->buffer or buffer->buffer->n_datas == 0)
{
pw_stream_queue_buffer(self->speaker.get(), buffer);
return;
}
auto & data = buffer->buffer->datas[0];
if (not data.data or not data.chunk or not self->desc.speaker)
{
pw_stream_queue_buffer(self->speaker.get(), buffer);
return;
}
const size_t frame_size = self->desc.speaker->num_channels * sizeof(int16_t);
if (frame_size == 0)
{
pw_stream_queue_buffer(self->speaker.get(), buffer);
return;
}
size_t num_frames = data.maxsize / frame_size;
if (buffer->requested)
num_frames = std::min<size_t>(num_frames, buffer->requested);
const size_t requested_bytes = num_frames * frame_size;
auto * output = static_cast<uint8_t *>(data.data);
size_t written = 0;
while (written < requested_bytes)
{
if (self->speaker_current.payload.empty())
{
auto next = self->speaker_samples.read();
if (not next)
break;
self->speaker_current = std::move(*next);
}
const size_t count = std::min(self->speaker_current.payload.size_bytes(), requested_bytes - written);
std::memcpy(output + written, self->speaker_current.payload.data(), count);
self->speaker_current.payload = self->speaker_current.payload.subspan(count);
written += count;
self->speaker_buffer_size_bytes.fetch_sub(count, std::memory_order_relaxed);
}
if (written < requested_bytes)
std::memset(output + written, 0, requested_bytes - written);
data.chunk->offset = 0;
data.chunk->stride = frame_size;
data.chunk->size = requested_bytes;
pw_stream_queue_buffer(self->speaker.get(), buffer);
// more than 50 ms accumulated → drop queued packets until about 30 ms remain
const size_t high_watermark = frame_size * self->desc.speaker->sample_rate * 50 / 1000;
const size_t target = frame_size * self->desc.speaker->sample_rate * 30 / 1000;
if (self->speaker_buffer_size_bytes.load(std::memory_order_relaxed) > high_watermark)
{
while (self->speaker_buffer_size_bytes.load(std::memory_order_relaxed) > target and self->speaker_samples.size() > 1)
{
auto dropped = self->speaker_samples.read();
if (not dropped)
break;
self->speaker_buffer_size_bytes.fetch_sub(dropped->payload.size_bytes(), std::memory_order_relaxed);
}
}
}
void audio::microphone_process(void * userdata)
{
auto self = static_cast<audio *>(userdata);
if (not self->microphone)
return;
pw_buffer * buffer = pw_stream_dequeue_buffer(self->microphone.get());
if (not buffer)
return;
if (not buffer->buffer or buffer->buffer->n_datas == 0)
{
pw_stream_queue_buffer(self->microphone.get(), buffer);
return;
}
auto & data = buffer->buffer->datas[0];
if (data.data and data.chunk and data.chunk->size != 0 and self->desc.microphone)
{
const size_t frame_size = self->desc.microphone->num_channels * sizeof(int16_t);
const size_t offset = std::min<size_t>(data.chunk->offset, data.maxsize);
size_t size = std::min<size_t>(data.chunk->size, data.maxsize - offset);
if (frame_size != 0)
size -= size % frame_size;
if (size != 0)
{
wivrn::audio_data packet;
packet.timestamp = self->instance.now();
packet.data.c = std::make_shared_for_overwrite<uint8_t[]>(size);
packet.payload = std::span(packet.data.c.get(), size);
std::memcpy(packet.payload.data(), static_cast<uint8_t *>(data.data) + offset, size);
self->microphone_buffer_size_bytes.fetch_add(size, std::memory_order_relaxed);
if (self->microphone_samples.write(std::move(packet)))
self->microphone_cv.notify_one();
else
self->microphone_buffer_size_bytes.fetch_sub(size, std::memory_order_relaxed);
}
}
pw_stream_queue_buffer(self->microphone.get(), buffer);
}
void audio::microphone_sender()
{
const size_t frame_size = desc.microphone ? desc.microphone->num_channels * sizeof(int16_t) : 0;
const size_t high_watermark = desc.microphone ? frame_size * desc.microphone->sample_rate * 50 / 1000 : 0;
const size_t target = desc.microphone ? frame_size * desc.microphone->sample_rate * 30 / 1000 : 0;
while (not exiting)
{
if (not mic_running)
{
while (auto dropped = microphone_samples.read())
microphone_buffer_size_bytes.fetch_sub(dropped->payload.size_bytes(), std::memory_order_relaxed);
}
else if (high_watermark != 0 and microphone_buffer_size_bytes.load(std::memory_order_relaxed) > high_watermark)
{
while (microphone_buffer_size_bytes.load(std::memory_order_relaxed) > target and microphone_samples.size() > 1)
{
auto dropped = microphone_samples.read();
if (not dropped)
break;
microphone_buffer_size_bytes.fetch_sub(dropped->payload.size_bytes(), std::memory_order_relaxed);
}
}
while (mic_running)
{
auto packet = microphone_samples.read();
if (not packet)
break;
microphone_buffer_size_bytes.fetch_sub(packet->payload.size_bytes(), std::memory_order_relaxed);
try
{
session.send_control(std::move(*packet));
}
catch (const std::exception & e)
{
if (not exiting)
spdlog::debug("Failed to send microphone audio: {}", e.what());
exiting = true;
break;
}
}
std::unique_lock lock(microphone_mutex);
microphone_cv.wait_for(lock, std::chrono::milliseconds(20), [this]() {
return exiting or microphone_samples.size() != 0;
});
}
}
void audio::get_audio_description(wivrn::from_headset::headset_info_packet & info)
{
const auto devices = detect_devices();
if (not devices.pipewire)
{
spdlog::warn("PipeWire is unavailable, disabling client audio");
return;
}
if (devices.speaker)
{
info.speaker = {
.num_channels = 2,
.sample_rate = default_sample_rate,
};
}
if (devices.microphone)
{
info.microphone = {
.num_channels = 1,
.sample_rate = default_sample_rate,
};
}
}
} // namespace wivrn::linux_audio
-99
View File
@@ -1,99 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 galister <galister-dev@pm.me>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "utils/ring_buffer.h"
#include "wivrn_packets.h"
#include <atomic>
#include <condition_variable>
#include <cstddef>
#include <memory>
#include <mutex>
#include <thread>
struct pw_main_loop;
struct pw_stream;
struct pw_stream_events;
struct pw_thread_loop;
class wivrn_session;
namespace xr
{
class instance;
}
namespace wivrn::linux_audio
{
struct pipewire_deleter
{
void operator()(pw_main_loop * loop) const noexcept;
void operator()(pw_thread_loop * loop) const noexcept;
void operator()(pw_stream * stream) const noexcept;
};
template <typename T>
using pipewire_ptr = std::unique_ptr<T, pipewire_deleter>;
class audio
{
static void speaker_process(void * userdata);
static void microphone_process(void * userdata);
static const pw_stream_events speaker_events;
static const pw_stream_events microphone_events;
void build_speaker(const to_headset::audio_stream_description::device & device);
void build_microphone(const to_headset::audio_stream_description::device & device);
void microphone_sender();
void shutdown_pipewire();
to_headset::audio_stream_description desc;
wivrn_session & session;
xr::instance & instance;
pipewire_ptr<pw_thread_loop> loop;
pipewire_ptr<pw_stream> speaker;
pipewire_ptr<pw_stream> microphone;
utils::ring_buffer<wivrn::audio_data, 100> speaker_samples;
std::atomic<size_t> speaker_buffer_size_bytes = 0;
wivrn::audio_data speaker_current;
utils::ring_buffer<wivrn::audio_data, 100> microphone_samples;
std::atomic<size_t> microphone_buffer_size_bytes = 0;
std::mutex microphone_mutex;
std::condition_variable microphone_cv;
std::atomic<bool> exiting = false;
std::atomic<bool> mic_running = false;
std::thread microphone_thread;
public:
audio(const audio &) = delete;
audio & operator=(const audio &) = delete;
audio(const wivrn::to_headset::audio_stream_description &, wivrn_session &, xr::instance &);
~audio();
void operator()(wivrn::audio_data &&);
void set_mic_state(bool running);
static void get_audio_description(wivrn::from_headset::headset_info_packet & info);
};
} // namespace wivrn::linux_audio
-108
View File
@@ -1,108 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 Sapphire <imsapphire0@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "battery.h"
#include "application.h"
#include "scene.h"
#include <chrono>
#include <magic_enum.hpp>
#include <spdlog/spdlog.h>
battery::battery(xr::instance & instance, xr::session & session) :
session(session)
{
if (instance.has_extension(XR_EXT_INTERACTION_PROFILE_BATTERY_STATE_DISPLAY_EXTENSION_NAME))
{
top_level_paths.emplace({
std::make_pair(instance.string_to_path("/user/hand/left"), device::left_controller),
std::make_pair(instance.string_to_path("/user/hand/right"), device::right_controller),
std::make_pair(instance.string_to_path("/user/gamepad"), device::gamepad),
});
}
}
void battery::poll_batteries()
{
using namespace std::chrono_literals;
auto now = std::chrono::steady_clock::now();
if (now - last_poll < 10s)
return;
last_poll = now;
spdlog::debug("Polling batteries");
std::lock_guard lock(m);
#ifndef __ANDROID__
{
battery_status status = get_hmd_battery();
if (status != statuses.at(device::head))
{
on_status_update(device::head, std::move(status));
}
}
#endif
if (top_level_paths)
{
for (auto [path, device]: *top_level_paths)
{
XrBatteryStateDisplayEXT battery_state{
.type = XR_TYPE_BATTERY_STATE_DISPLAY_EXT,
};
XrInteractionProfileState profile_state{
.type = XR_TYPE_INTERACTION_PROFILE_STATE,
.next = &battery_state,
};
try
{
CHECK_XR(xrGetCurrentInteractionProfile(session, path, &profile_state));
}
catch (std::exception & e)
{
spdlog::warn("Failed to get battery charge state for device {}: {}", magic_enum::enum_name(device), e.what());
continue;
}
std::optional<float> charge{};
if (battery_state.stateFlags & XR_BATTERY_STATE_DISPLAY_STATE_VALID_BIT_EXT)
charge = battery_state.batteryLevel;
battery_status status{
.charge = charge,
.charging = (battery_state.stateFlags & XR_BATTERY_STATE_DISPLAY_STATE_CHARGING_BIT_EXT) != 0,
};
if (status != statuses.at(device))
{
on_status_update(device, std::move(status));
}
}
}
}
void battery::on_status_update(battery::device device, battery::battery_status && new_status)
{
std::lock_guard lock(m);
if (std::shared_ptr<scene> s = application::instance().current_scene())
{
s->on_battery_update(device, new_status);
}
statuses.at(device) = std::move(new_status);
}
-87
View File
@@ -1,87 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2024 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2024 Patrick Nicolas <patricknicolas@laposte.net>
* Copyright (C) 2026 Sapphire <imsapphire0@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "xr/instance.h"
#include "xr/session.h"
#ifdef __ANDROID__
#include "jni.h"
#endif
#include <chrono>
#include <inplace_vector.hpp>
#include <magic_enum_containers.hpp>
#include <mutex>
#include <optional>
class battery
{
public:
enum device : uint8_t
{
head = 0,
left_controller,
right_controller,
gamepad,
};
struct battery_status
{
std::optional<float> charge = std::nullopt;
bool charging = false;
bool operator!=(const battery_status & other) const
{
return charge != other.charge || charging != other.charging;
}
};
battery(xr::instance & instance, xr::session & session);
#ifdef __ANDROID__
battery(xr::instance & instance, xr::session & session, jobject activity);
#endif
private:
xr::session & session;
std::optional<beman::inplace_vector::inplace_vector<std::pair<XrPath, device>, 3>> top_level_paths;
std::recursive_mutex m;
magic_enum::containers::array<device, battery_status> statuses;
// we need to poll for controller batteries, there's no XR event sent when their state changes
// linux implementation also doesn't have an event-based API for battery
std::chrono::steady_clock::time_point last_poll{};
#ifndef __ANDROID__
battery_status get_hmd_battery();
#endif
public:
void poll_batteries();
// updates statuses and sends the new battery status to the focused scene
void on_status_update(device device, battery_status && new_status);
inline battery_status get_battery_status(device device)
{
std::lock_guard lock(m);
return statuses.at(device);
};
};
-42
View File
@@ -327,12 +327,10 @@ const std::vector<config_field> & configuration::config_fields()
scalar("theme_font_scale", &configuration::theme_font_scale),
scalar("theme_background_alpha", &configuration::theme_background_alpha),
scalar("passthrough_enabled", &configuration::passthrough_enabled),
scalar("passthrough_boundary_enabled", &configuration::passthrough_boundary_enabled),
scalar("mic_unprocessed_audio", &configuration::mic_unprocessed_audio),
scalar("forward_keyboard", &configuration::forward_keyboard),
scalar("forward_mouse", &configuration::forward_mouse),
scalar("forward_gamepad", &configuration::forward_gamepad),
scalar("emulated_gamepad", &configuration::emulated_gamepad),
scalar("virtual_keyboard_layout", &configuration::virtual_keyboard_layout),
scalar("override_foveation_enable", &configuration::override_foveation_enable),
scalar("override_foveation_pitch", &configuration::override_foveation_pitch),
@@ -349,9 +347,6 @@ const std::vector<config_field> & configuration::config_fields()
scalar("codec", &configuration::codec),
scalar("bit_depth", &configuration::bit_depth),
scalar("usb_network", &configuration::usb_network),
scalar("height_offset_standing", &configuration::height_offset_standing),
scalar("height_offset_seated", &configuration::height_offset_seated),
scalar("default_posture", &configuration::default_posture),
};
return fields;
}
@@ -393,19 +388,6 @@ void configuration::save()
json << ",\"openxr_post_processing\":{\"super_sampling\":" << openxr_post_processing.super_sampling;
json << ",\"sharpening\":" << openxr_post_processing.sharpening << "}";
{
bool first = true;
json << ",\"body_parts\": {";
for (const auto & [b, name]: magic_enum::enum_entries<wivrn::from_headset::body_part_mask>())
{
if (not first)
json << ",";
first = false;
json << '"' << name << "\":" << std::boolalpha << bool(body_part_mask & std::to_underlying(b));
}
json << "}";
}
// feature flags, keyed by enum name
for (auto & [key, value]: features)
json << "," << key << ":" << std::boolalpha << value;
@@ -431,27 +413,3 @@ float configuration::get_default_stream_scale() const
return 0.3;
return 0.5;
}
float configuration::get_height_offset() const
{
std::lock_guard lock(mutex);
return default_posture == posture::seated ? height_offset_seated : height_offset_standing;
}
void configuration::set_height_offset(float value)
{
std::lock_guard lock(mutex);
(default_posture == posture::seated ? height_offset_seated : height_offset_standing) = value;
}
posture configuration::get_posture() const
{
std::lock_guard lock(mutex);
return default_posture;
}
void configuration::set_posture(posture p)
{
std::lock_guard lock(mutex);
default_posture = p;
}
-21
View File
@@ -50,12 +50,6 @@ enum class feature
body_tracking,
};
enum class posture
{
standing,
seated,
};
class configuration
{
public:
@@ -78,15 +72,12 @@ public:
uint8_t bit_depth = 10;
bool passthrough_enabled = false;
// XR_META_boundary_visibility, the boundary is always shown outside passthrough
bool passthrough_boundary_enabled = false;
bool mic_unprocessed_audio = false;
// Input forwarding, per device. Off by default; only effective if the server permits it.
bool forward_keyboard = false;
bool forward_mouse = false;
bool forward_gamepad = false;
bool emulated_gamepad = false;
std::underlying_type_t<wivrn::from_headset::body_part_mask> body_part_mask = ~0;
@@ -135,16 +126,10 @@ public:
bool check_feature(feature f) const;
void set_feature(feature f, bool state);
static constexpr float default_height_offset_standing = 0;
static constexpr float default_height_offset_seated = 0.45;
private:
mutable std::mutex mutex;
std::map<feature, bool> features;
std::optional<float> stream_scale;
float height_offset_standing = default_height_offset_standing;
float height_offset_seated = default_height_offset_seated;
posture default_posture = posture::standing;
// table of scalar settings shared by save()/load(); non-scalar settings are explicit
static const std::vector<config_field> & config_fields();
@@ -159,12 +144,6 @@ public:
float get_stream_scale() const;
float get_default_stream_scale() const;
float get_height_offset() const;
void set_height_offset(float);
posture get_posture() const;
void set_posture(posture);
uint32_t max_bitrate(bool extended) const
{
return extended ? 800'000'000u : 200'000'000u;
+13 -46
View File
@@ -20,8 +20,6 @@
#ifdef __ANDROID__
#include "decoder/android/android_decoder.h"
#elif WIVRN_USE_V4L2
#include "decoder/v4l2/v4l2_decoder.h"
#else
#include "decoder/ffmpeg/ffmpeg_decoder.h"
#endif
@@ -51,12 +49,14 @@ std::shared_ptr<wivrn::decoder> wivrn::decoder::make(
stream_index,
scene,
acc);
#elif WIVRN_USE_V4L2
return std::make_shared<wivrn::v4l2::decoder>(
device, phys_dev, vk_queue_family_index, description, stream_index, scene, acc);
#else
return std::make_shared<wivrn::ffmpeg::decoder>(
device, phys_dev, description, stream_index, scene, acc);
device,
phys_dev,
description,
stream_index,
scene,
acc);
#endif
case raw:
return std::make_shared<wivrn::raw_decoder>(
@@ -71,53 +71,20 @@ std::shared_ptr<wivrn::decoder> wivrn::decoder::make(
__builtin_unreachable();
}
static std::vector<wivrn::video_codec_capability> supported_codecs_()
static std::vector<wivrn::video_codec> supported_codecs_()
{
std::vector<wivrn::video_codec> codecs;
std::vector<wivrn::video_codec> res;
#ifdef __ANDROID__
wivrn::android::decoder::supported_codecs(codecs);
#elif WIVRN_USE_V4L2
wivrn::v4l2::decoder::supported_codecs(codecs);
wivrn::android::decoder::supported_codecs(res);
#else
wivrn::ffmpeg::decoder::supported_codecs(codecs);
wivrn::ffmpeg::decoder::supported_codecs(res);
#endif
codecs.push_back(wivrn::video_codec::raw);
std::vector<wivrn::video_codec_capability> res;
res.reserve(codecs.size());
for (auto codec: codecs)
res.push_back({.codec = codec, .supports_10bit = wivrn::decoder::supports_10bit(codec)});
res.push_back(wivrn::video_codec::raw);
return res;
}
const std::vector<wivrn::video_codec_capability> & wivrn::decoder::supported_codecs()
const std::vector<wivrn::video_codec> & wivrn::decoder::supported_codecs()
{
static std::vector<wivrn::video_codec_capability> res = supported_codecs_();
static std::vector<wivrn::video_codec> res = supported_codecs_();
return res;
}
bool wivrn::decoder::supports_10bit(wivrn::video_codec codec)
{
#ifdef __ANDROID__
return codec == wivrn::video_codec::h265 or codec == wivrn::video_codec::av1;
#elif WIVRN_USE_V4L2
switch (codec)
{
case wivrn::video_codec::h265: {
static const bool supported = wivrn::v4l2::decoder::supports_10bit(codec);
return supported;
}
case wivrn::video_codec::av1: {
static const bool supported = wivrn::v4l2::decoder::supports_10bit(codec);
return supported;
}
case wivrn::video_codec::h264:
case wivrn::video_codec::raw:
return false;
}
__builtin_unreachable();
#else
// ffmpeg
return codec == wivrn::video_codec::h265 or codec == wivrn::video_codec::av1;
#endif
}
+1 -9
View File
@@ -20,8 +20,6 @@
#include "wivrn_packets.h"
#include "wivrn_config.h"
#include <cstdint>
#include <memory>
#include <span>
@@ -48,11 +46,6 @@ public:
vk::ImageLayout & current_layout;
vk::Semaphore semaphore = nullptr;
uint64_t * semaphore_val = nullptr;
#if WIVRN_USE_V4L2
// DMA-buf images from V4L2 require queue-family ownership
// transfers between Vulkan and external engine
uint32_t foreign_queue_family = vk::QueueFamilyIgnored;
#endif
};
public:
@@ -73,7 +66,6 @@ public:
virtual vk::Sampler sampler() = 0;
static const std::vector<wivrn::video_codec_capability> & supported_codecs();
static bool supports_10bit(wivrn::video_codec codec);
static const std::vector<wivrn::video_codec> & supported_codecs();
};
} // namespace wivrn
+1 -1
View File
@@ -113,7 +113,7 @@ void shard_accumulator::push_shard(video_stream_data_shard && shard)
{
assert(current.frame_index() + 1 == next.frame_index());
auto frame_diff = shard.frame_idx - current.frame_index();
uint8_t frame_diff = shard.frame_idx - current.frame_index();
if (shard.frame_idx < current.frame_index())
{
// frame is in the past, drop it
File diff suppressed because it is too large Load Diff
-183
View File
@@ -1,183 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 galister <galister-dev@pm.me>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*/
#pragma once
#include "decoder/decoder.h"
#include "wivrn_sockets.h"
#include <cstdint>
#include <deque>
#include <exception>
#include <memory>
#include <mutex>
#include <optional>
#include <span>
#include <stop_token>
#include <string>
#include <sys/mman.h>
#include <thread>
#include <vector>
#include <vulkan/vulkan_raii.hpp>
namespace scenes
{
class stream;
}
namespace wivrn
{
class shard_accumulator;
}
namespace wivrn::v4l2
{
class decoder : public wivrn::decoder
{
private:
struct v4l2_blit_handle;
struct mapped_plane
{
void * address = nullptr;
size_t length = 0;
};
struct output_buffer
{
std::vector<mapped_plane> planes;
~output_buffer()
{
for (auto & p: planes)
if (p.address && p.address != MAP_FAILED)
munmap(p.address, p.length);
}
};
struct capture_buffer
{
std::vector<size_t> plane_lengths;
vk::raii::DeviceMemory memory = nullptr;
vk::raii::Image image = nullptr;
vk::raii::ImageView image_view = nullptr;
vk::ImageLayout current_layout = vk::ImageLayout::eUndefined;
bool held_by_vulkan = false;
};
struct pending_frame
{
uint64_t timestamp = 0;
wivrn::from_headset::feedback feedback;
wivrn::to_headset::video_stream_data_shard::view_info_t view_info;
};
struct ready_output
{
uint32_t buffer_index;
size_t bytes_used;
pending_frame pending;
};
struct assembling_frame
{
uint32_t buffer_index;
size_t bytes_used;
uint64_t frame_index;
};
vk::raii::Device & device;
vk::raii::PhysicalDevice & physical_device;
vk::raii::SamplerYcbcrConversion ycbcr_conversion = nullptr;
vk::raii::Sampler ycbcr_sampler = nullptr;
vk::Format capture_vk_format = vk::Format::eUndefined;
wivrn::fd_base fd;
std::vector<output_buffer> output_buffers;
std::vector<capture_buffer> capture_buffers;
std::vector<unsigned int> free_output_buffers;
std::deque<pending_frame> pending_frames;
std::deque<ready_output> input_queue;
std::mutex input_mutex;
std::optional<assembling_frame> assembling;
std::optional<uint64_t> dropped_frame_index;
std::mutex output_mutex;
std::deque<unsigned int> recycle_capture_queue;
std::deque<unsigned int> recycle_capture_local;
std::mutex recycle_mutex;
wivrn::fd_base wake_fd;
std::jthread worker;
std::exception_ptr worker_exception;
std::mutex worker_exception_mutex;
uint64_t next_timestamp = 1;
unsigned int queued_output_count = 0;
uint32_t capture_width = 0;
uint32_t capture_height = 0;
uint32_t capture_bytesperline = 0;
uint32_t capture_sizeimage = 0;
uint32_t capture_pixelformat = 0;
uint32_t capture_num_planes = 0;
bool output_streaming = false;
bool capture_streaming = false;
std::weak_ptr<scenes::stream> weak_scene;
shard_accumulator * accumulator;
const vk::Extent2D extent;
const wivrn::video_codec codec_type;
const uint32_t vk_queue_family_index;
void setup_device(wivrn::fd_base device_fd);
void setup_output_queue();
void setup_capture_queue();
void teardown_capture_queue();
void setup_ycbcr_sampler();
void import_capture_buffer(unsigned int index, const std::vector<size_t> & plane_lengths);
void initialize_capture_ownership();
void queue_capture_buffer(unsigned int index);
void release_capture_buffer(unsigned int index);
void recycle_capture_buffers();
void handle_events();
void reclaim_output_buffers();
void drain_capture();
void queue_ready_frames();
void queue_output_buffer(const ready_output & ready);
void abandon_assembling_frame();
void worker_loop(std::stop_token stop_token);
void wake_worker();
void rethrow_worker_exception();
void submit_capture(unsigned int capture_index, uint64_t timestamp);
pending_frame take_pending(uint64_t timestamp);
public:
decoder(vk::raii::Device & device,
vk::raii::PhysicalDevice & physical_device,
uint32_t vk_queue_family_index,
const wivrn::to_headset::video_stream_description & description,
uint8_t stream_index,
std::weak_ptr<scenes::stream> scene,
shard_accumulator * accumulator);
~decoder() override;
void push_data(std::span<std::span<const uint8_t>> data, uint64_t frame_index, bool partial) override;
void frame_completed(
const wivrn::from_headset::feedback & feedback,
const wivrn::to_headset::video_stream_data_shard::view_info_t & view_info) override;
vk::Sampler sampler() override
{
return *ycbcr_sampler;
}
static bool available_for(wivrn::video_codec codec);
static bool supports_10bit(wivrn::video_codec codec);
static void supported_codecs(std::vector<wivrn::video_codec> & result);
};
} // namespace wivrn::v4l2
-474
View File
@@ -1,474 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 galister <galister-dev@pm.me>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "foveation.h"
#include "application.h"
#include "xr/instance.h"
#include "xr/session.h"
#include "xr/system.h"
#include <algorithm>
#include <cassert>
#include <cmath>
#include <spdlog/spdlog.h>
#include <stdexcept>
namespace
{
float convergence_angle(float distance, float eye_x, float yaw)
{
const float target_x = distance * std::sin(yaw);
const float target_z = distance * std::cos(yaw);
return std::atan2(target_x - eye_x, target_z);
}
XrVector2f yaw_pitch(const XrQuaternionf & q)
{
const float sine_theta = std::clamp(-2.0f * (q.y * q.z - q.w * q.x), -1.0f, 1.0f);
const float pitch = std::asin(sine_theta);
if (std::abs(sine_theta) > 0.99999f)
{
const float scale = std::copysign(2.0f, sine_theta);
return {scale * std::atan2(-q.z, q.w), pitch};
}
return {
std::atan2(2.0f * (q.x * q.z + q.w * q.y),
q.w * q.w - q.x * q.x - q.y * q.y + q.z * q.z),
pitch};
}
float ndc_to_angle(float center, float a0, float a1)
{
const float u = std::clamp(center * 0.5f + 0.5f, 0.0f, 1.0f);
const float tangent = std::lerp(std::tan(a0), std::tan(a1), u);
return std::atan(tangent);
}
client_foveation::angles center_to_angles(const std::array<XrVector2f, 2> & center, std::span<const XrFovf> fovs)
{
assert(fovs.size() == 2);
client_foveation::angles result{};
for (size_t i = 0; i < result.size(); ++i)
{
result[i].x = ndc_to_angle(center[i].x, fovs[i].angleLeft, fovs[i].angleRight);
result[i].y = ndc_to_angle(center[i].y, fovs[i].angleUp, fovs[i].angleDown);
}
return result;
}
bool fov_equal(const XrFovf & a, const XrFovf & b, const float epsilon)
{
return std::abs(a.angleLeft - b.angleLeft) <= epsilon and
std::abs(a.angleRight - b.angleRight) <= epsilon and
std::abs(a.angleUp - b.angleUp) <= epsilon and
std::abs(a.angleDown - b.angleDown) <= epsilon;
}
client_foveation::angles target_angles(
float yaw,
float pitch,
float convergence_distance,
std::span<const XrView> views)
{
assert(views.size() == 2);
client_foveation::angles result{};
for (size_t i = 0; i < result.size(); ++i)
{
result[i].x = convergence_angle(convergence_distance, views[i].pose.position.x, yaw);
result[i].y = pitch;
}
return result;
}
std::optional<client_foveation::angles> eye_gaze_angles(
XrTime time,
XrViewStateFlags view_flags,
std::span<const XrView> views)
{
if (not(view_flags & XR_VIEW_STATE_POSITION_VALID_BIT))
return std::nullopt;
auto gaze_quat = application::instance().locate_gaze(time);
if (not gaze_quat)
return std::nullopt;
const XrVector2f gaze = yaw_pitch(*gaze_quat);
return target_angles(-gaze.x, gaze.y, client_foveation::default_convergence_distance, views);
}
} // namespace
namespace client_foveation
{
center::center(xr::instance & inst, xr::system & sys, xr::session & xr_session, vk::raii::Device & vk_device, vk::raii::CommandPool & vk_commandpool, thread_safe<vk::raii::Queue> & vk_queue, vk::Format format) :
instance(inst),
session(xr_session),
device(vk_device),
commandpool(vk_commandpool),
queue(vk_queue),
swapchain_format(format)
{
if (application::get_foveation_center_supported() and
application::get_foveation_vulkan_supported() and
inst.has_extension(XR_META_FOVEATION_EYE_TRACKED_EXTENSION_NAME) and
inst.has_extension(XR_FB_FOVEATION_EXTENSION_NAME) and
inst.has_extension(XR_FB_FOVEATION_CONFIGURATION_EXTENSION_NAME) and
inst.has_extension(XR_FB_FOVEATION_VULKAN_EXTENSION_NAME) and
inst.has_extension(XR_FB_SWAPCHAIN_UPDATE_STATE_EXTENSION_NAME) and
inst.has_extension(XR_META_VULKAN_SWAPCHAIN_CREATE_INFO_EXTENSION_NAME) and
sys.foveation_eye_tracked_properties().supportsFoveationEyeTracked)
{
xrCreateFoveationProfileFB = inst.get_proc<PFN_xrCreateFoveationProfileFB>("xrCreateFoveationProfileFB");
xrDestroyFoveationProfileFB = inst.get_proc<PFN_xrDestroyFoveationProfileFB>("xrDestroyFoveationProfileFB");
xrUpdateSwapchainFB = inst.get_proc<PFN_xrUpdateSwapchainFB>("xrUpdateSwapchainFB");
xrGetFoveationEyeTrackedStateMETA = inst.get_proc<PFN_xrGetFoveationEyeTrackedStateMETA>("xrGetFoveationEyeTrackedStateMETA");
if (xrCreateFoveationProfileFB and xrDestroyFoveationProfileFB and
xrUpdateSwapchainFB and xrGetFoveationEyeTrackedStateMETA)
{
XrFoveationEyeTrackedProfileCreateInfoMETA eye_tracked_info{
.type = XR_TYPE_FOVEATION_EYE_TRACKED_PROFILE_CREATE_INFO_META,
.flags = 0,
};
XrFoveationLevelProfileCreateInfoFB level_info{
.type = XR_TYPE_FOVEATION_LEVEL_PROFILE_CREATE_INFO_FB,
.next = &eye_tracked_info,
.level = XR_FOVEATION_LEVEL_LOW_FB,
.verticalOffset = 0,
.dynamic = XR_FOVEATION_DYNAMIC_DISABLED_FB,
};
XrFoveationProfileCreateInfoFB profile_info{
.type = XR_TYPE_FOVEATION_PROFILE_CREATE_INFO_FB,
.next = &level_info,
};
XrFoveationProfileFB raw_profile = XR_NULL_HANDLE;
XrResult profile_result = xrCreateFoveationProfileFB(session, &profile_info, &raw_profile);
if (XR_SUCCEEDED(profile_result))
foveation_profile.emplace(raw_profile, xrDestroyFoveationProfileFB);
}
}
if (foveation_profile.has_value())
spdlog::info("XR_META_foveation_eye_tracked will be used for this stream");
else if (application::get_eye_gaze_supported())
spdlog::info("Eye gaze tracking will be used for this stream");
else
spdlog::info("Static foveation will be used for this stream");
auto [flags, views] = session.locate_views(
XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO,
instance.now(),
application::space(xr::spaces::view));
(void)flags;
assert(views.size() == headset_fov.size());
for (size_t i = 0; i < headset_fov.size(); ++i)
headset_fov[i] = views[i].fov;
const auto & config = application::get_config();
set_manual_mode({
.enabled = config.override_foveation_enable,
.pitch = config.override_foveation_pitch,
.distance = config.override_foveation_distance,
});
}
// member order ensures swapchain is dropped before foveation profile
center::~center() = default;
bool center::supports_meta() const
{
return foveation_profile.has_value();
}
manual_override center::get_manual_mode() const
{
return *manual_mode_.lock();
}
void center::set_manual_mode(manual_override mode)
{
*manual_mode_.lock() = mode;
}
bool center::is_cropped(std::span<const XrFovf> submitted_fov, std::span<const bool> valid) const
{
assert(submitted_fov.size() == view_count and valid.size() == view_count);
for (size_t i = 0; i < view_count; ++i)
{
// generous epsilon of ~6° per-side to filter out false positives
if (valid[i] and not fov_equal(submitted_fov[i], headset_fov[i], 0.1f))
return true;
}
return false;
}
bool center::needs_swapchain_recreation(bool cropped) const
{
return supports_meta() and (not cropped_mode or *cropped_mode != cropped);
}
bool center::use_meta_swapchain(bool cropped) const
{
return supports_meta() and not cropped;
}
void center::set_cropped(bool cropped)
{
if (not cropped_mode or *cropped_mode != cropped)
spdlog::info("Stream FOV mode: {}", cropped ? "cropped" : "full");
cropped_mode = cropped;
}
void center::on_swapchain_recreated(bool cropped)
{
dummy_swapchain = {};
if (supports_meta() and cropped)
create_dummy_swapchain();
set_cropped(cropped);
}
bool center::update_meta_swapchain(XrSwapchain swapchain) const
{
if (not supports_meta() or not swapchain)
return false;
XrSwapchainStateFoveationFB swapchain_state{
.type = XR_TYPE_SWAPCHAIN_STATE_FOVEATION_FB,
.flags = 0,
.profile = *foveation_profile,
};
XrResult update_result = xrUpdateSwapchainFB(
swapchain,
reinterpret_cast<const XrSwapchainStateBaseHeaderFB *>(&swapchain_state));
return XR_SUCCEEDED(update_result);
}
std::optional<angles> center::meta_angles(XrSwapchain swapchain, std::span<const XrFovf> fov) const
{
if (not update_meta_swapchain(swapchain))
return {};
XrFoveationEyeTrackedStateMETA state{
.type = XR_TYPE_FOVEATION_EYE_TRACKED_STATE_META,
};
XrResult result = xrGetFoveationEyeTrackedStateMETA(session, &state);
if (XR_FAILED(result) or not(state.flags & XR_FOVEATION_EYE_TRACKED_STATE_VALID_BIT_META))
return {};
std::array<XrVector2f, view_count> ndc_center{state.foveationCenter[0], state.foveationCenter[1]};
return center_to_angles(ndc_center, fov);
}
void center::update(std::span<const XrFovf> submitted_fov, std::span<const bool> valid, XrSwapchain stream_swapchain, XrTime display_time)
{
assert(submitted_fov.size() == view_count and valid.size() == view_count);
layer_.reset();
packet_.reset();
XrSpace view_space = application::space(xr::spaces::view);
auto [view_flags, views] = session.locate_views(
XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO, display_time, view_space);
constexpr XrViewStateFlags layer_flags =
XR_VIEW_STATE_POSITION_VALID_BIT | XR_VIEW_STATE_ORIENTATION_VALID_BIT;
if (supports_meta() and cropped_mode.value_or(false) and dummy_swapchain and
views.size() == view_count and (view_flags & layer_flags) == layer_flags)
{
projection_layer layer{
.flags = XR_COMPOSITION_LAYER_BLEND_TEXTURE_SOURCE_ALPHA_BIT,
.space = view_space,
};
for (size_t i = 0; i < view_count; ++i)
{
layer.views[i] = {
.type = XR_TYPE_COMPOSITION_LAYER_PROJECTION_VIEW,
.pose = views[i].pose,
.fov = headset_fov[i],
.subImage = {
.swapchain = dummy_swapchain,
.imageRect = {
.offset = {0, 0},
.extent = {dummy_swapchain_size, dummy_swapchain_size},
},
.imageArrayIndex = uint32_t(i),
},
};
}
layer_ = layer;
}
if (views.size() != view_count or not(view_flags & XR_VIEW_STATE_POSITION_VALID_BIT))
return;
// dummy layer is always full FOV
std::array<XrFovf, view_count> effective_fov{};
for (size_t i = 0; i < view_count; ++i)
effective_fov[i] = valid[i] ? submitted_fov[i] : headset_fov[i];
const XrSwapchain meta_swapchain = cropped_mode.value_or(false) ? static_cast<XrSwapchain>(dummy_swapchain) : stream_swapchain;
const std::span<const XrFovf> meta_fov = cropped_mode.value_or(false) ? std::span<const XrFovf>(headset_fov) : std::span<const XrFovf>(effective_fov);
const auto manual = get_manual_mode();
std::optional<angles> angles;
if (manual.enabled)
{
if (supports_meta())
update_meta_swapchain(meta_swapchain);
angles = target_angles(0, manual.pitch, manual.distance, views);
}
else
{
if (supports_meta())
{
if (auto a = meta_angles(meta_swapchain, meta_fov))
angles = *a;
}
if (not angles and application::get_eye_gaze_supported())
{
if (auto a = eye_gaze_angles(display_time,
view_flags,
views))
angles = *a;
}
if (not angles)
angles = target_angles(0, default_foveation_pitch, default_convergence_distance, views);
}
// angles guaranteed to have a value at this point
packet_ = wivrn::from_headset::foveation{.angles = *angles};
}
std::optional<center::projection_layer> center::get_layer() const
{
return layer_;
}
std::optional<wivrn::from_headset::foveation> center::take_packet()
{
// A skipped render must not resend the previous frame's center.
auto result = packet_;
packet_.reset();
return result;
}
void center::create_dummy_swapchain()
{
device.waitIdle();
dummy_swapchain = xr::swapchain(
instance,
session,
device,
swapchain_format,
dummy_swapchain_size,
dummy_swapchain_size,
1,
view_count,
true,
true);
if (not update_meta_swapchain(dummy_swapchain))
throw std::runtime_error("Failed to apply eye-tracked foveation profile to dummy swapchain");
const int image_index = dummy_swapchain.acquire();
dummy_swapchain.wait();
auto clear_command_buffer = std::move(device.allocateCommandBuffers({
.commandPool = *commandpool,
.level = vk::CommandBufferLevel::ePrimary,
.commandBufferCount = 1,
})[0]);
auto clear_fence = device.createFence({});
clear_command_buffer.begin(vk::CommandBufferBeginInfo{
.flags = vk::CommandBufferUsageFlagBits::eOneTimeSubmit,
});
vk::ImageMemoryBarrier to_transfer{
.srcAccessMask = vk::AccessFlagBits::eNone,
.dstAccessMask = vk::AccessFlagBits::eTransferWrite,
.oldLayout = vk::ImageLayout::eUndefined,
.newLayout = vk::ImageLayout::eTransferDstOptimal,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = dummy_swapchain.image(image_index),
.subresourceRange = {
.aspectMask = vk::ImageAspectFlagBits::eColor,
.baseMipLevel = 0,
.levelCount = 1,
.baseArrayLayer = 0,
.layerCount = view_count,
},
};
clear_command_buffer.pipelineBarrier(
vk::PipelineStageFlagBits::eTopOfPipe,
vk::PipelineStageFlagBits::eTransfer,
{},
{},
{},
to_transfer);
clear_command_buffer.clearColorImage(
dummy_swapchain.image(image_index),
vk::ImageLayout::eTransferDstOptimal,
vk::ClearColorValue{std::array<float, 4>{0, 0, 0, 0}},
to_transfer.subresourceRange);
vk::ImageMemoryBarrier to_runtime{
.srcAccessMask = vk::AccessFlagBits::eTransferWrite,
.dstAccessMask = vk::AccessFlagBits::eMemoryRead,
.oldLayout = vk::ImageLayout::eTransferDstOptimal,
.newLayout = vk::ImageLayout::eColorAttachmentOptimal,
.srcQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.dstQueueFamilyIndex = VK_QUEUE_FAMILY_IGNORED,
.image = dummy_swapchain.image(image_index),
.subresourceRange = to_transfer.subresourceRange,
};
clear_command_buffer.pipelineBarrier(
vk::PipelineStageFlagBits::eTransfer,
vk::PipelineStageFlagBits::eAllCommands,
{},
{},
{},
to_runtime);
clear_command_buffer.end();
vk::SubmitInfo submit_info;
submit_info.setCommandBuffers(*clear_command_buffer);
queue.lock()->submit(submit_info, *clear_fence);
if (device.waitForFences(*clear_fence, VK_TRUE, UINT64_MAX) == vk::Result::eTimeout)
throw std::runtime_error("Vulkan fence timeout while clearing foveation dummy swapchain");
dummy_swapchain.release();
spdlog::info(
"Created {}x{} eye-tracked foveation dummy swapchain",
dummy_swapchain_size,
dummy_swapchain_size);
}
} // namespace client_foveation
-112
View File
@@ -1,112 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2026 galister <galister-dev@pm.me>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "utils/handle.h"
#include "utils/thread_safe.h"
#include "wivrn_packets.h"
#include "xr/swapchain.h"
#include <array>
#include <optional>
#include <span>
#include <openxr/openxr.h>
namespace xr
{
class instance;
class session;
class system;
} // namespace xr
namespace client_foveation
{
using angles = std::array<XrVector2f, 2>;
inline constexpr float default_convergence_distance = 1.0f;
// Default foveation target is 1 m forward and 10 degrees below horizontal.
inline constexpr float default_foveation_pitch = -0.17453292519943295f; // -10 degrees
struct manual_override
{
bool enabled = false;
float pitch = default_foveation_pitch;
float distance = default_convergence_distance;
};
// Unified class for static, meta and eye-gaze based foveation.
class center
{
public:
static constexpr size_t view_count = 2;
static constexpr int32_t dummy_swapchain_size = 512;
struct projection_layer
{
XrCompositionLayerFlags flags;
XrSpace space;
std::array<XrCompositionLayerProjectionView, view_count> views;
};
center(xr::instance &, xr::system &, xr::session &, vk::raii::Device &, vk::raii::CommandPool &, thread_safe<vk::raii::Queue> &, vk::Format swapchain_format);
~center();
bool supports_meta() const;
manual_override get_manual_mode() const;
void set_manual_mode(manual_override mode);
bool is_cropped(std::span<const XrFovf> submitted_fov, std::span<const bool> valid) const;
bool needs_swapchain_recreation(bool cropped) const;
bool use_meta_swapchain(bool cropped) const;
void on_swapchain_recreated(bool cropped);
void set_cropped(bool cropped);
void update(std::span<const XrFovf> submitted_fov, std::span<const bool> valid, XrSwapchain stream_swapchain, XrTime display_time);
std::optional<projection_layer> get_layer() const;
std::optional<wivrn::from_headset::foveation> take_packet();
private:
mutable thread_safe<manual_override> manual_mode_{};
xr::instance & instance;
xr::session & session;
vk::raii::Device & device;
vk::raii::CommandPool & commandpool;
thread_safe<vk::raii::Queue> & queue;
vk::Format swapchain_format;
PFN_xrCreateFoveationProfileFB xrCreateFoveationProfileFB = nullptr;
PFN_xrDestroyFoveationProfileFB xrDestroyFoveationProfileFB = nullptr;
PFN_xrUpdateSwapchainFB xrUpdateSwapchainFB = nullptr;
PFN_xrGetFoveationEyeTrackedStateMETA xrGetFoveationEyeTrackedStateMETA = nullptr;
std::optional<utils::handle<XrFoveationProfileFB>> foveation_profile;
std::array<XrFovf, view_count> headset_fov{};
std::optional<bool> cropped_mode;
xr::swapchain dummy_swapchain;
std::optional<projection_layer> layer_;
std::optional<wivrn::from_headset::foveation> packet_;
bool update_meta_swapchain(XrSwapchain swapchain) const;
std::optional<angles> meta_angles(XrSwapchain swapchain, std::span<const XrFovf> fov) const;
void create_dummy_swapchain();
};
} // namespace client_foveation
+101 -54
View File
@@ -19,8 +19,8 @@
#include "hmd_traits.h"
#include "utils/env.h"
#include "utils/overloaded.h"
#include "utils/strings.h"
#include "xr/to_string.h"
#include <boost/pfr.hpp>
@@ -29,7 +29,6 @@
#include <cstdlib>
#include <cstring>
#include <format>
#include <fstream>
#include <glm/ext/quaternion_trigonometric.hpp>
#include <limits>
#include <optional>
@@ -38,14 +37,109 @@
#include <unordered_map>
#include <spdlog/spdlog.h>
#include <openxr/openxr.h>
#ifdef __ANDROID__
#include "android/property.h"
#include "utils/env.h"
#include "utils/strings.h"
#include "utils/wrap_lambda.h"
#include <sys/system_properties.h>
static std::optional<std::string> get_property(const char * property)
{
auto info = __system_property_find(property);
if (not info)
return std::nullopt;
std::string result;
wrap_lambda cb = [&result](const char * name, const char * value, uint32_t serial) {
result = value;
};
__system_property_read_callback(info, cb.userdata_first(), cb);
return result;
}
#endif
template <typename T>
std::optional<T> env(std::string_view name);
template <>
std::optional<std::string> env(std::string_view name)
{
#ifdef __ANDROID__
auto android_sysprop_name = std::format("debug.wivrn.{}", name);
return get_property(android_sysprop_name.c_str());
#else
std::string env_name = "WIVRN_";
env_name.reserve(env_name.size() + name.size());
for (const auto & c: name)
env_name += std::toupper(c);
const char * value = std::getenv(env_name.c_str());
if (value)
return value;
return std::nullopt;
#endif
}
template <>
std::optional<uint32_t> env(std::string_view name)
{
const auto value = env<std::string>(name);
if (not value)
return std::nullopt;
try
{
const unsigned long parsed = std::stoul(*value);
if (parsed > std::numeric_limits<uint32_t>::max())
return std::nullopt;
return static_cast<uint32_t>(parsed);
}
catch (std::runtime_error & e)
{
spdlog::warn("failed to parse {} (value: {}: {}", name, *value, e.what());
return std::nullopt;
}
}
template <>
std::optional<bool> env(std::string_view name)
{
const auto value = env<std::string>(name);
if (not value)
return std::nullopt;
if (strcmp(value->c_str(), "1") == 0 || strcasecmp(value->c_str(), "true") == 0 || strcasecmp(value->c_str(), "yes") == 0 || strcasecmp(value->c_str(), "on") == 0)
return true;
if (strcmp(value->c_str(), "0") == 0 || strcasecmp(value->c_str(), "false") == 0 || strcasecmp(value->c_str(), "no") == 0 || strcasecmp(value->c_str(), "off") == 0)
return false;
return std::nullopt;
}
template <>
std::optional<std::unordered_map<std::string, std::string>> env(std::string_view name)
{
const auto values = env<std::string>(name);
if (not values)
return std::nullopt;
std::unordered_map<std::string, std::string> map;
for (auto value: utils::split(*values, ","))
{
if (auto pos = value.find('='); pos != std::string::npos)
map.insert(std::make_pair(value.substr(0, pos), value.substr(pos + 1)));
}
return map;
}
template <>
std::optional<std::unordered_set<std::string>> env(std::string_view name)
{
const auto values = env<std::string>(name);
if (not values)
return std::nullopt;
return std::unordered_set<std::string>{std::from_range, utils::split(*values, ",")};
}
void hmd_traits::init()
{
#ifndef NDEBUG
@@ -127,13 +221,11 @@ void hmd_traits::init()
else if (manufacturer == "Play For Dream" and model == "PFDM MR")
{
blacklisted_extensions.insert(XR_META_FOVEATION_EYE_TRACKED_EXTENSION_NAME);
controller_profile = "yvr-touch-v2";
}
else if (manufacturer == "Pico")
{
blacklisted_extensions.insert(XR_META_FOVEATION_EYE_TRACKED_EXTENSION_NAME);
permissions[feature::eye_gaze] = "com.picovr.permission.EYE_TRACKING";
permissions[feature::face_tracking] = "com.picovr.permission.FACE_TRACKING";
view_locate = false;
@@ -164,13 +256,6 @@ void hmd_traits::init()
// Accepts OpenXR 1.1 but doesn't actually implement it
max_openxr_api_version = XR_API_VERSION_1_0;
// The runtime auto-switches /user/hand/* between the controller profile and
// ext/hand_interaction_ext based on its own hand-vs-controller heuristic, which
// flips repeatedly while a controller is actively held, dropping controller button
// input whenever hand interaction is briefly active. The runtime can only switch to
// a profile the app suggested bindings for, so withhold the extension entirely.
blacklisted_extensions.insert(XR_EXT_HAND_INTERACTION_EXTENSION_NAME);
// Doesn't handle additive blend, so needs specific ray model
// Fixed in XR elite firmware version 2.0
bool need_htc_ray = true;
@@ -215,7 +300,6 @@ void hmd_traits::init()
}
if (manufacturer == "samsung")
{
blacklisted_extensions.insert(XR_META_FOVEATION_EYE_TRACKED_EXTENSION_NAME);
if (model == "SM-I610") // Galaxy XR
{
panel_width_override = 3552;
@@ -225,43 +309,6 @@ void hmd_traits::init()
permissions[feature::face_tracking] = "android.permission.FACE_TRACKING";
}
}
#else // not android
for (const auto & entry: std::filesystem::directory_iterator("/sys/class/drm"))
{
std::ifstream modes(entry.path() / "modes");
if (not modes)
continue;
std::string mode;
while (std::getline(modes, mode))
{
// panel modes are reported as `2*2160x2160_120` etc.
if (not mode.starts_with("2*"))
// not a HMD
continue;
const auto x = mode.find('x', 2);
if (x == std::string::npos)
continue;
try
{
panel_width_override = std::stoul(mode.substr(2, x - 2));
spdlog::info("Detected native panel mode {}, panel width {}", mode, panel_width_override);
break;
}
catch (...)
{
spdlog::warn("Failed to parse native panel mode {}", mode);
}
}
if (panel_width_override > 0)
break;
}
// frame: always returns 0,0
blacklisted_extensions.insert(XR_META_FOVEATION_EYE_TRACKED_EXTENSION_NAME);
#endif
spdlog::info("HMD traits initialized");
@@ -341,7 +388,7 @@ static XrViewConfigurationView scale_view(XrViewConfigurationView view, uint32_t
double ratio = double(width) / view.recommendedImageRectWidth;
view.recommendedImageRectWidth = width;
view.recommendedImageRectHeight *= ratio;
spdlog::debug("Using panel size: {}x{}", view.recommendedImageRectWidth, view.recommendedImageRectHeight);
spdlog::info("Using panel size: {}x{}", view.recommendedImageRectWidth, view.recommendedImageRectHeight);
return view;
}
@@ -1,9 +0,0 @@
[Desktop Entry]
Name=WiVRn
Comment=Play your PC VR games on a standalone headset
GenericName=WiVRn client
Exec=@CMAKE_INSTALL_PREFIX@/bin/wivrn
Icon=io.github.wivrn.wivrn-client
Type=Application
Categories=Network;
Keywords=VR;Virtual reality;OpenVR;OpenXR;
+4 -2
View File
@@ -16,7 +16,7 @@ public class MainActivity extends android.app.NativeActivity
@Override
public native void onActivityResult(int requestCode, int resultCode, android.content.Intent data);
public android.content.BroadcastReceiver BatteryInfoReceiver = null;
private android.content.BroadcastReceiver BatteryInfoReceiver = null;
public android.net.ConnectivityManager.NetworkCallback netcb = null;
@Override
@@ -24,7 +24,9 @@ public class MainActivity extends android.app.NativeActivity
{
super.onCreate(savedInstanceState);
this.BatteryInfoReceiver = new org.meumeu.wivrn.BroadcastReceiver();
this.BatteryInfoReceiver = new BroadcastReceiver();
this.netcb = new org.meumeu.wivrn.NetworkInfoCallback();
this.registerReceiver(this.BatteryInfoReceiver, new android.content.IntentFilter(android.content.Intent.ACTION_BATTERY_CHANGED));
}
}
-76
View File
@@ -1,76 +0,0 @@
/*
* WiVRn VR streaming
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "battery.h"
#include <chrono>
#include <filesystem>
#include <fstream>
#include <mutex>
#include <string>
namespace
{
std::optional<std::string> read_line(const std::filesystem::path & path)
{
std::ifstream file(path);
std::string line;
if (file and std::getline(file, line))
return line;
return std::nullopt;
}
std::optional<float> read_percent(const std::filesystem::path & path)
{
std::ifstream file(path);
float percent;
if (file >> percent and percent >= 0 and percent <= 100)
return percent / 100;
return std::nullopt;
}
battery::battery_status read_battery_status(const std::filesystem::path & percent_path, const std::filesystem::path & status_path)
{
auto charge = read_percent(percent_path);
if (not charge)
return {};
auto status = read_line(status_path);
return {
.charge = charge,
.charging = status == "Charging" or status == "Full",
};
}
} // namespace
battery::battery_status battery::get_hmd_battery()
{
// SteamOS on the Steam Frame: the charger daemon's percentage is what the system UI shows
const std::filesystem::path deckard = "/run/deckardcharger";
if (auto battery = read_battery_status(deckard / "battery_percent", deckard / "battery_status"); battery.charge)
return battery;
// Generic Linux: the first battery in sysfs
std::error_code ec;
for (const auto & supply: std::filesystem::directory_iterator("/sys/class/power_supply", ec))
{
if (read_line(supply.path() / "type") != "Battery")
continue;
if (auto battery = read_battery_status(supply.path() / "capacity", supply.path() / "status"); battery.charge)
return battery;
}
return {};
}
+23 -32
View File
@@ -20,13 +20,10 @@
#include "application.h"
#include "scenes/lobby.h"
#include "spdlog/spdlog.h"
#include "utils/env.h"
#include "version.h"
#include <algorithm>
#include <arpa/inet.h>
#include <netdb.h>
#include <string>
#include <sys/socket.h>
#include <sys/types.h>
@@ -41,31 +38,9 @@
#ifdef __ANDROID__
void real_main(android_app * native_app)
#else
void real_main(int argc, char ** argv)
void real_main()
#endif
{
auto log_level = env<std::string>("loglevel");
if (log_level)
{
std::transform(log_level->begin(), log_level->end(), log_level->begin(), [](char c) { return tolower(c); });
if (log_level == "trace")
spdlog::set_level(spdlog::level::trace);
else if (log_level == "debug")
spdlog::set_level(spdlog::level::debug);
else if (log_level == "info")
spdlog::set_level(spdlog::level::info);
else if (log_level == "warning")
spdlog::set_level(spdlog::level::warn);
else if (log_level == "error")
spdlog::set_level(spdlog::level::err);
else if (log_level == "critical")
spdlog::set_level(spdlog::level::critical);
else if (log_level == "off")
spdlog::set_level(spdlog::level::off);
else
spdlog::warn("Invalid value for log level: {}", *log_level);
}
if (wivrn::is_tag)
spdlog::info("Starting WiVRn version {}", wivrn::display_version());
else
@@ -80,11 +55,6 @@ void real_main(int argc, char ** argv)
info.version = VK_MAKE_VERSION(1, 0, 0);
application app(info);
#ifndef __ANDROID__
if (argc == 2)
app.set_server_uri(argv[1]);
#endif
app.push_scene<scenes::lobby>();
app.run();
@@ -132,6 +102,27 @@ int main(int argc, char * argv[])
{
spdlog::set_default_logger(spdlog::stdout_color_mt("WiVRn"));
real_main(argc, argv);
char * loglevel = getenv("WIVRN_LOGLEVEL");
if (loglevel)
{
if (!strcasecmp(loglevel, "trace"))
spdlog::set_level(spdlog::level::trace);
else if (!strcasecmp(loglevel, "debug"))
spdlog::set_level(spdlog::level::debug);
else if (!strcasecmp(loglevel, "info"))
spdlog::set_level(spdlog::level::info);
else if (!strcasecmp(loglevel, "warning"))
spdlog::set_level(spdlog::level::warn);
else if (!strcasecmp(loglevel, "error"))
spdlog::set_level(spdlog::level::err);
else if (!strcasecmp(loglevel, "critical"))
spdlog::set_level(spdlog::level::critical);
else if (!strcasecmp(loglevel, "off"))
spdlog::set_level(spdlog::level::off);
else
spdlog::warn("Invalid value for WIVRN_LOGLEVEL environment variable");
}
real_main();
}
#endif
+1
View File
@@ -77,6 +77,7 @@ glm::quat cubic_spline(const glm::quat & a, const glm::quat & vb, const glm::qua
template <auto components::node::* Field>
void apply_track(entt::registry & scene, const components::animation_track_impl<Field> & track, float current_time)
{
entt::entity target = track.target;
auto interpolation = track.interpolation;
auto field = track.field;
auto & value = scene.get<components::node>(track.target).*field;
+4 -3
View File
@@ -560,6 +560,7 @@ void imgui_context::initialize_fonts()
std::vector<imgui_context::controller_state> imgui_context::read_controllers_state(XrTime display_time)
{
float scroll_scale = io.DeltaTime * constants::gui::scroll_ratio;
size_t new_focused_controller = focused_controller;
std::vector<controller_state> new_states;
new_states.resize(controllers.size());
@@ -580,10 +581,10 @@ std::vector<imgui_context::controller_state> imgui_context::read_controllers_sta
current_aim_interaction = 1;
if (ctrl.hand)
{
if (auto hand = ctrl.hand->locate(world, display_time).joints)
if (auto joints = ctrl.hand->locate(world, display_time))
{
XrHandJointLocationEXT & index_tip = (*hand)[XR_HAND_JOINT_INDEX_TIP_EXT].first;
XrHandJointLocationEXT & palm = (*hand)[XR_HAND_JOINT_PALM_EXT].first;
XrHandJointLocationEXT & index_tip = (*joints)[XR_HAND_JOINT_INDEX_TIP_EXT].first;
XrHandJointLocationEXT & palm = (*joints)[XR_HAND_JOINT_PALM_EXT].first;
if (index_tip.locationFlags & XR_SPACE_LOCATION_POSITION_VALID_BIT)
{
+5
View File
@@ -198,6 +198,7 @@ std::vector<glm::dvec4> read_vertex_attribute_aux2(const fastgltf::Asset & asset
std::vector<glm::dvec4> output;
output.resize(accessor.count);
size_t index = 0;
switch (fastgltf::getNumComponents(accessor.type))
{
case 1:
@@ -548,6 +549,7 @@ class loader_context
fastgltf::Asset & gltf;
vk::raii::PhysicalDevice physical_device;
vk::raii::Device & device;
thread_safe<vk::raii::Queue> & queue;
image_loader loader;
const std::map<std::tuple<fastgltf::Category, size_t, std::string>, std::string> & extras;
@@ -579,6 +581,7 @@ public:
gltf(gltf),
physical_device(physical_device),
device(device),
queue(queue),
loader(device, physical_device, queue, queue_family_index),
extras(extras)
{
@@ -1077,6 +1080,7 @@ public:
break;
}
size_t count = time.count;
switch (channel.path)
{
// TODO: templatize the switch
@@ -1260,6 +1264,7 @@ static void write_cache_entry(const std::filesystem::path & path, const cache_en
{
auto mtime = std::chrono::file_clock::to_sys(std::filesystem::last_write_time(entry.filename));
auto timestamp = std::chrono::duration_cast<std::chrono::seconds>(mtime.time_since_epoch()).count();
auto size = entry.size;
json << ",\"timestamp\":" << timestamp;
}
-1
View File
@@ -584,7 +584,6 @@ void scene::remove(entt::entity entity)
void scene::on_unfocused() {}
void scene::on_focused() {}
void scene::on_xr_event(const xr::event &) {}
void scene::on_battery_update(battery::device, const battery::battery_status &) {}
bool scene::on_input_key_down(uint8_t key_code)
{
-2
View File
@@ -19,7 +19,6 @@
#pragma once
#include "battery.h"
#include "render/image_loader.h"
#include "render/scene_loader.h"
#include "render/scene_renderer.h"
@@ -210,7 +209,6 @@ public:
void set_focused(bool status);
virtual void render(const XrFrameState &) = 0;
virtual void on_xr_event(const xr::event &);
virtual void on_battery_update(battery::device device, const battery::battery_status &);
virtual bool on_input_key_down(uint8_t key_code);
virtual bool on_input_key_up(uint8_t key_code);
+7 -3
View File
@@ -19,8 +19,7 @@
#include "gui_common.h"
#include "application.h"
#include "battery.h"
#include "android/battery.h"
#include "render/ui_theme.h"
#include "render/ui_widgets.h"
@@ -38,7 +37,8 @@ float toggle_width()
std::optional<battery_indicator> battery_status_indicator(XrTime now)
{
const auto battery = application::get_battery_monitor().get_battery_status(battery::device::head);
#ifdef __ANDROID__
const auto battery = get_battery_status();
if (not battery.charge)
return std::nullopt;
@@ -82,5 +82,9 @@ std::optional<battery_indicator> battery_status_indicator(XrTime now)
.label = fmt::format("{} {}%", icon, (int)std::round(*battery.charge * 100)),
.style = style,
};
#else
(void)now;
return std::nullopt;
#endif
}
} // namespace wivrn::gui
+11 -78
View File
@@ -222,19 +222,15 @@ void settings_video(const settings_context & ctx)
auto & default_config = ctx.default_config;
const std::string disconnect_tip = ctx.in_game ? _C("tooltip for disabled settings", "Disconnect to change this setting.") : std::string{};
std::vector<setting> list;
const auto rates = ctx.session.get_refresh_rates();
if (not rates.empty())
if (const auto rates = ctx.session.get_refresh_rates(); not rates.empty())
{
const auto system_managed = rates.size() < 2;
int default_rate_index = index(rates, default_config.preferred_refresh_rate).value_or(-1) + 1;
list.push_back({
.id = "##refresh",
.label = _("Refresh rate"),
.description = system_managed
? _("WiVRn can't directly change the refresh rate on this device. See your device's settings to change the refresh rate.")
: _("Use 'auto' to select the refresh rate based on measured application performance. May cause flicker when a change happens."),
.description = _("Use 'auto' to select the refresh rate based on measured application performance. May cause flicker when a change happens."),
.ui = rates.size() < 7 ? ui_kind::segmented : ui_kind::combo,
.get_int = [&config, rates] {
for (size_t i = 0; i < rates.size(); ++i)
@@ -262,16 +258,12 @@ void settings_video(const settings_context & ctx)
opts.push_back(fmt::format("{}", int(r)));
return opts; },
.default_int = default_rate_index,
.enabled = [system_managed] { return not system_managed; },
});
}
{
auto view = ctx.system.stereo_view();
view = application::get_hmd_traits().override_view(view);
const auto width = view.recommendedImageRectWidth;
const auto height = view.recommendedImageRectHeight;
const auto width = ctx.recommended_width;
const auto height = ctx.recommended_height;
list.push_back({
.id = "##resolution",
.label = _("Render resolution"),
@@ -288,7 +280,7 @@ void settings_video(const settings_context & ctx)
});
}
if (rates.size() > 1 && ctx.instance.has_extension(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME))
if (ctx.instance.has_extension(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME))
{
list.push_back({
.id = "##spacewarp",
@@ -353,9 +345,9 @@ void settings_streaming(const settings_context & ctx)
};
std::vector<wivrn::video_codec> codecs;
for (auto capability: wivrn::decoder::supported_codecs())
if (capability.codec != wivrn::raw)
codecs.push_back(capability.codec);
for (auto c: wivrn::decoder::supported_codecs())
if (c != wivrn::raw)
codecs.push_back(c);
list.push_back({
.id = "##codec",
@@ -378,7 +370,7 @@ void settings_streaming(const settings_context & ctx)
.disabled_tooltip = disconnect_tip,
});
if (config.codec && wivrn::decoder::supports_10bit(*config.codec))
if (config.codec == wivrn::h265 or config.codec == wivrn::av1)
{
list.push_back({
.id = "##ten_bit",
@@ -490,7 +482,7 @@ void settings_post_processing(const settings_context & ctx)
o.push_back(flag_name(f));
return o; },
.title = std::move(title),
.default_int = index(flags, default_config.openxr_post_processing.*member).value_or(0),
.default_int = index(flags, config.openxr_post_processing.*member).value_or(0),
});
};
@@ -521,7 +513,6 @@ void settings_audio(const settings_context & ctx)
.disabled_tooltip = disconnect_tip,
});
#ifdef __ANDROID__
list.push_back({
.id = "##unprocessed",
.label = _C("setting name", "Unprocessed audio"),
@@ -533,7 +524,6 @@ void settings_audio(const settings_context & ctx)
.enabled = [&ctx, &config] { return not ctx.in_game and config.check_feature(feature::microphone); },
.disabled_tooltip = disconnect_tip,
});
#endif
ui::page_header(_cS("page header title", "Audio"), _cS("page header subtitle", "Microphone streamed to the PC."));
render_settings(ctx, "##audio", list);
@@ -577,19 +567,6 @@ void settings_devices(const settings_context & ctx)
.default_bool = default_config.forward_gamepad,
});
if (ctx.instance.has_extension("XR_VALVE_frame_controller_interaction"))
{
list.push_back({
.id = "##emulated_gamepad",
.label = _C("setting name", "Emulated Gamepad"),
.description = _("Double-click both grips to start using your controllers as a gamepad."),
.ui = ui_kind::toggle,
.get_bool = [&config] { return config.emulated_gamepad; },
.set_bool = [&config](bool v) { config.emulated_gamepad = v; config.save(); },
.default_bool = default_config.emulated_gamepad,
});
}
ui::page_header(_cS("page header title", "Devices"), _cS("page header subtitle", "Forward input devices to the PC."));
render_settings(ctx, "##devices", list);
@@ -602,37 +579,7 @@ bool settings_tracking(const settings_context & ctx)
auto & config = ctx.config;
auto & default_config = ctx.default_config;
const std::string disconnect_tip = ctx.in_game ? _C("tooltip for disabled settings", "Disconnect to change this setting.") : std::string{};
std::vector<setting> list, posture_items;
const posture current_posture = config.get_posture();
const bool seated = current_posture == posture::seated;
const float default_height_offset = seated ? configuration::default_height_offset_seated : configuration::default_height_offset_standing;
posture_items.push_back({
.id = "##posture",
.label = _C("setting name", "Posture"),
.description = _("Posture assumed when a stream connects."),
.ui = ui_kind::segmented,
.get_int = [seated] { return seated ? 1 : 0; },
.set_int = [&config](int v) { config.set_posture(v ? posture::seated : posture::standing); config.save(); },
.options = [] { return std::vector<std::string>{_C("posture", "Standing"), _C("posture", "Seated")}; },
.default_int = default_config.get_posture() == posture::seated ? 1 : 0,
});
posture_items.push_back({
.id = "##height_offset",
.label = _C("setting name", "Height adjustment"),
.description = seated
? _("Corrects the height reported to the PC when seated, useful for games without native seated support.")
: _("Corrects the height reported to the PC when standing, useful for a miscalibrated floor."),
.ui = ui_kind::slider,
.get_int = [&config] { return int(std::lround(config.get_height_offset() * 100)); },
.set_int = [&config](int v) { config.set_height_offset(v / 100.f); config.save(); },
.v_min = -30,
.v_max = 70,
.fmt = "%d cm",
.default_int = int(std::lround(default_height_offset * 100)),
});
std::vector<setting> list;
auto feature_toggle = [&](const char * id, std::string label, std::string desc, feature f) {
list.push_back({
@@ -722,7 +669,6 @@ bool settings_tracking(const settings_context & ctx)
ui::page_header(_cS("page header title", "Tracking"), _cS("page header subtitle", "Body and input tracking sent to the PC."));
render_settings(ctx, "##tracking", list);
render_settings(ctx, "##posture", posture_items);
return changed;
}
@@ -811,19 +757,6 @@ void settings_system(const settings_context & ctx)
});
}
if (ctx.session.boundary_visibility_supported())
{
list.push_back({
.id = "##passthrough_boundary",
.label = _C("setting name", "Enable boundary in passthrough"),
.description = _("Shows the boundary while passthrough is on. Disable to walk freely outside of it. The boundary is always shown in VR."),
.ui = ui_kind::toggle,
.get_bool = [&config] { return config.passthrough_boundary_enabled; },
.set_bool = [&ctx, &config](bool v) { config.passthrough_boundary_enabled = v; config.save(); ctx.session.set_passthrough_boundary_enabled(v); },
.default_bool = default_config.passthrough_boundary_enabled,
});
}
bool disable_instream_gui = false;
bool disable_instream_gui_popup_open = ImGui::IsPopupOpen("confirm disable in stream gui");
list.push_back({
+6 -2
View File
@@ -19,8 +19,8 @@
#pragma once
#include <cstdint>
#include <functional>
#include <optional>
class configuration;
class imgui_context;
@@ -39,12 +39,16 @@ namespace wivrn::gui
struct settings_context
{
configuration & config;
const configuration & default_config;
configuration & default_config;
xr::instance & instance;
xr::session & session;
xr::system & system;
imgui_context & imgui_ctx;
// recommended per-eye render resolution, for the resolution description
uint32_t recommended_width = 0;
uint32_t recommended_height = 0;
// streaming: connection-time settings are disabled, in-stream controls appear
bool in_game = false;
+4 -4
View File
@@ -289,13 +289,13 @@ void hand_model::add_hand(scene & scene,
}
void hand_model::apply(entt::registry & scene,
const xr::hand_tracker::joint_array * left_hand,
const xr::hand_tracker::joint_array * right_hand)
const std::optional<std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT>> & left_hand,
const std::optional<std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT>> & right_hand)
{
for (auto && [entity, hj, node]: scene.view<components::hand_joint, components::node>().each())
{
auto f = [&](const xr::hand_tracker::joint_array * joints) {
if (joints)
auto f = [&](const std::optional<std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT>> & joints) {
if (joints.has_value())
{
node.visible = true;
+2 -2
View File
@@ -37,6 +37,6 @@ void add_hand(scene & scene,
uint32_t layer_mask);
void apply(entt::registry & scene,
const xr::hand_tracker::joint_array * left_hand,
const xr::hand_tracker::joint_array * right_hand);
const std::optional<std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT>> & left_hand,
const std::optional<std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT>> & right_hand);
}; // namespace hand_model
+57 -91
View File
@@ -18,7 +18,6 @@
*/
#include "lobby.h"
#include "application.h"
#include "configuration.h"
#include "constants.h"
@@ -144,10 +143,6 @@ void scenes::lobby::move_gui(glm::vec3 head_position, glm::vec3 new_gui_position
scenes::lobby::lobby() :
scene_impl<lobby>(supported_color_formats, supported_depth_formats)
{
const auto & view = system.stereo_view();
width = view.recommendedImageRectWidth;
height = view.recommendedImageRectHeight;
spdlog::info("Using formats {} and {}", vk::to_string(swapchain_format), vk::to_string(depth_format));
if (composition_layer_depth_test_supported)
@@ -442,54 +437,57 @@ void scenes::lobby::connect(const configuration::server_data & data)
std::optional<glm::vec3> scenes::lobby::check_recenter_gesture(
xr::spaces space,
const xr::hand_tracker::joint_array & joints,
const std::optional<std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT>> & joints,
const std::pair<glm::vec3, glm::quat> & head_pose)
{
if (recentering_context and std::get<0>(*recentering_context) != space)
return std::nullopt;
const auto & palm = joints[XR_HAND_JOINT_PALM_EXT].first;
const auto palm_y = glm::rotate(glm_cast(palm.pose.orientation), glm::vec3(0, 1, 0));
for (XrHandJointEXT index: {
XR_HAND_JOINT_INDEX_PROXIMAL_EXT,
XR_HAND_JOINT_INDEX_INTERMEDIATE_EXT,
XR_HAND_JOINT_INDEX_DISTAL_EXT,
XR_HAND_JOINT_MIDDLE_PROXIMAL_EXT,
XR_HAND_JOINT_MIDDLE_INTERMEDIATE_EXT,
XR_HAND_JOINT_MIDDLE_DISTAL_EXT,
XR_HAND_JOINT_RING_PROXIMAL_EXT,
XR_HAND_JOINT_RING_INTERMEDIATE_EXT,
XR_HAND_JOINT_RING_DISTAL_EXT,
XR_HAND_JOINT_LITTLE_PROXIMAL_EXT,
XR_HAND_JOINT_LITTLE_INTERMEDIATE_EXT,
XR_HAND_JOINT_LITTLE_DISTAL_EXT,
})
if (joints)
{
const auto fingertip_y = glm::rotate(glm_cast(joints[index].first.pose.orientation), glm::vec3(0, 1, 0));
const auto & palm = (*joints)[XR_HAND_JOINT_PALM_EXT].first;
const auto palm_y = glm::rotate(glm_cast(palm.pose.orientation), glm::vec3(0, 1, 0));
if (glm::dot(palm_y, fingertip_y) < constants::lobby::recenter_cos_fingertip_angle_max)
for (XrHandJointEXT index: {
XR_HAND_JOINT_INDEX_PROXIMAL_EXT,
XR_HAND_JOINT_INDEX_INTERMEDIATE_EXT,
XR_HAND_JOINT_INDEX_DISTAL_EXT,
XR_HAND_JOINT_MIDDLE_PROXIMAL_EXT,
XR_HAND_JOINT_MIDDLE_INTERMEDIATE_EXT,
XR_HAND_JOINT_MIDDLE_DISTAL_EXT,
XR_HAND_JOINT_RING_PROXIMAL_EXT,
XR_HAND_JOINT_RING_INTERMEDIATE_EXT,
XR_HAND_JOINT_RING_DISTAL_EXT,
XR_HAND_JOINT_LITTLE_PROXIMAL_EXT,
XR_HAND_JOINT_LITTLE_INTERMEDIATE_EXT,
XR_HAND_JOINT_LITTLE_DISTAL_EXT,
})
{
recentering_context.reset();
return std::nullopt;
const auto fingertip_y = glm::rotate(glm_cast((*joints)[index].first.pose.orientation), glm::vec3(0, 1, 0));
if (glm::dot(palm_y, fingertip_y) < constants::lobby::recenter_cos_fingertip_angle_max)
{
recentering_context.reset();
return std::nullopt;
}
}
}
const auto q = glm_cast(palm.pose.orientation);
const auto x = glm_cast(palm.pose.position);
const auto q = glm_cast(palm.pose.orientation);
const auto x = glm_cast(palm.pose.position);
// Make the up vector orthogonal to forward
const glm::vec3 forward = glm::rotate(head_pose.second, glm::vec3{0, 0, -1});
const glm::vec3 up = glm::normalize(glm::vec3{0, 1, 0} - forward * glm::dot(forward, {0, 1, 0}));
// Make the up vector orthogonal to forward
const glm::vec3 forward = glm::rotate(head_pose.second, glm::vec3{0, 0, -1});
const glm::vec3 up = glm::normalize(glm::vec3{0, 1, 0} - forward * glm::dot(forward, {0, 1, 0}));
// Y is pointing to the back of the hand
if (glm::dot(q * glm::vec3(0, -1, 0), up) > constants::lobby::recenter_cos_palm_angle_min)
{
recentering_context.emplace(space, glm::vec3{}, 0);
return x + glm::rotate(q, glm::vec3{0, -constants::lobby::recenter_distance_up, -constants::lobby::recenter_distance_front});
// Y is pointing to the back of the hand
if (glm::dot(q * glm::vec3(0, -1, 0), up) > constants::lobby::recenter_cos_palm_angle_min)
{
recentering_context.emplace(space, glm::vec3{}, 0);
return x + glm::rotate(q, glm::vec3{0, -constants::lobby::recenter_distance_up, -constants::lobby::recenter_distance_front});
}
}
recentering_context.reset();
@@ -950,24 +948,11 @@ void scenes::lobby::render(const XrFrameState & frame_state)
renderdoc_begin(*vk_instance);
#endif
// Locating everything against this instead of the raw world space lets the configured
// player height offset be previewed here, the same shift a stream would apply.
if (float offset = application::get_config().get_height_offset(); not height_offset_space or offset != applied_height_offset)
{
applied_height_offset = offset;
height_offset_space = session.create_reference_space(XR_REFERENCE_SPACE_TYPE_STAGE, {{0, 0, 0, 1}, {0, -offset, 0}});
}
XrSpace world_space = height_offset_space;
XrSpace world_space = application::space(xr::spaces::world);
auto [flags, views] = session.locate_views(viewconfig, frame_state.predictedDisplayTime, world_space);
// assert(views.size() == swapchains_lobby.size());
assert(views.size() == 2); // FIXME
if (not(flags & XR_VIEW_STATE_POSITION_VALID_BIT and flags & XR_VIEW_STATE_ORIENTATION_VALID_BIT))
{
spdlog::warn("Invalid view state, skip frame");
return;
}
bool hide_left_controller = false;
bool hide_right_controller = false;
@@ -984,27 +969,27 @@ void scenes::lobby::render(const XrFrameState & frame_state)
{
auto windows = imgui_ctx->windows();
auto left = left_hand->locate(world_space, frame_state.predictedDisplayTime).joints;
auto left = left_hand->locate(world_space, frame_state.predictedDisplayTime);
if (left)
{
stick_finger_to_gui(*left, windows);
hide_left_controller = true;
}
auto right = right_hand->locate(world_space, frame_state.predictedDisplayTime).joints;
auto right = right_hand->locate(world_space, frame_state.predictedDisplayTime);
if (right)
{
stick_finger_to_gui(*right, windows);
hide_right_controller = true;
}
hand_model::apply(world, left ? &*left : nullptr, right ? &*right : nullptr);
hand_model::apply(world, left, right);
if (not new_gui_position and head_position and left)
new_gui_position = check_recenter_gesture(xr::spaces::palm_left, *left, *head_position);
if (not new_gui_position and head_position)
new_gui_position = check_recenter_gesture(xr::spaces::palm_left, left, *head_position);
if (not new_gui_position and head_position and right)
new_gui_position = check_recenter_gesture(xr::spaces::palm_right, *right, *head_position);
if (not new_gui_position and head_position)
new_gui_position = check_recenter_gesture(xr::spaces::palm_right, right, *head_position);
}
if (head_position and new_gui_position)
@@ -1144,6 +1129,15 @@ void scenes::lobby::on_focused()
{
recenter_gui = true;
auto views = system.view_configuration_views(viewconfig);
assert(views.size() == 2); // FIXME
stream_view = application::get_hmd_traits().override_view(views[0]);
width = views[0].recommendedImageRectWidth;
height = views[0].recommendedImageRectHeight;
// assert(std::ranges::all_of(views, [width](const XrViewConfigurationView & view) { return view.recommendedImageRectWidth == width; }));
// assert(std::ranges::all_of(views, [height](const XrViewConfigurationView & view) { return view.recommendedImageRectHeight == height; }));
auto & config = application::get_config();
try
@@ -1302,20 +1296,7 @@ void scenes::lobby::on_focused()
vps,
image_cache);
auto t = std::chrono::system_clock::to_time_t(std::chrono::system_clock::now());
auto tm = std::localtime(&t);
switch (tm->tm_mon)
{
case 5:
about_picture = imgui_ctx->load_texture("assets://wivrn-pride.ktx2");
break;
case 11:
about_picture = imgui_ctx->load_texture("assets://wivrn-christmas.ktx2");
break;
default:
about_picture = imgui_ctx->load_texture("assets://wivrn.ktx2");
break;
}
about_picture = imgui_ctx->load_texture("assets://wivrn.ktx2");
default_environment_screenshot = imgui_ctx->load_texture("assets://default-environment.ktx2");
@@ -1411,11 +1392,6 @@ void scenes::lobby::on_xr_event(const xr::event & event)
if (next_scene)
next_scene->on_xr_event(event);
}
void scenes::lobby::on_battery_update(battery::device device, const battery::battery_status & battery)
{
if (next_scene)
next_scene->on_battery_update(device, battery);
}
scene::meta & scenes::lobby::get_meta_scene()
{
@@ -1449,7 +1425,6 @@ scene::meta & scenes::lobby::get_meta_scene()
"/interaction_profiles/bytedance/pico4s_controller",
"/interaction_profiles/yvr/touch_controller_yvr",
"/interaction_profiles/htc/vive_focus3_controller",
"/interaction_profiles/valve/frame_controller_valve",
},
{
{"left_aim", "/user/hand/left/input/aim/pose"},
@@ -1467,15 +1442,6 @@ scene::meta & scenes::lobby::get_meta_scene()
{"recenter_right", "/user/hand/right/input/squeeze/value"},
},
},
suggested_binding{
{
"/interaction_profiles/valve/frame_controller_valve",
},
{
{"left_trigger", "/user/hand/left/input/bumper/click"},
{"right_trigger", "/user/hand/right/input/bumper/click"},
},
},
suggested_binding{
{
"/interaction_profiles/khr/simple_controller",
+2 -7
View File
@@ -81,11 +81,6 @@ class lobby : public scene_impl<lobby>
xr::face_tracker face_tracker;
// STAGE space translated by the configured player height offset, so it previews here the
// same shift a stream would apply; recreated only when the offset actually changes.
xr::space height_offset_space;
float applied_height_offset = 0;
std::string selected_item;
std::unique_ptr<utils::mapped_file> license;
@@ -95,6 +90,7 @@ class lobby : public scene_impl<lobby>
uint32_t width;
uint32_t height;
XrViewConfigurationView stream_view;
#if WIVRN_CLIENT_DEBUG_MENU
// GUI debug
@@ -256,7 +252,7 @@ class lobby : public scene_impl<lobby>
void connect(const configuration::server_data & data);
std::unique_ptr<wivrn_session> connect_to_session(wivrn_discover::service service, bool manual_connection);
std::optional<glm::vec3> check_recenter_gesture(xr::spaces space, const xr::hand_tracker::joint_array & joints, const std::pair<glm::vec3, glm::quat> & head_pose);
std::optional<glm::vec3> check_recenter_gesture(xr::spaces space, const std::optional<std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT>> & joints, const std::pair<glm::vec3, glm::quat> & head_pose);
std::optional<glm::vec3> check_recenter_action(XrTime predicted_display_time, glm::vec3 head_position);
std::optional<glm::vec3> check_recenter_gui(glm::vec3 head_position, glm::quat head_orientation);
@@ -270,7 +266,6 @@ public:
void on_unfocused() override;
void on_focused() override;
void on_xr_event(const xr::event &) override;
void on_battery_update(battery::device device, const battery::battery_status &) override;
static meta & get_meta_scene();
};
+4
View File
@@ -814,6 +814,9 @@ void scenes::lobby::gui_about()
ImGui::SetCursorPosX(win_width / 4);
ImGui::Image(about_picture, {win_width / 2, win_width / 2});
ImGui::PushFont(nullptr, constants::gui::font_size_large);
CenterTextH(std::string("Sneed'n'Chuck Edition"));
ImGui::PopFont();
}
void scenes::lobby::gui_first_run()
@@ -1115,6 +1118,7 @@ std::vector<std::pair<int, XrCompositionLayerQuad>> scenes::lobby::draw_gui(XrTi
ImGui::SetNextWindowSize({1400, 900});
ImGui::Begin("WiVRn", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove);
auto & config = application::get_config();
const float TopBarH = wivrn::ui::metrics::top_bar_height;
// Top bar: logo left, feature toggles / battery / connection status right
+2
View File
@@ -642,6 +642,8 @@ libcurl::curl_handle * scenes::lobby::parse_environment_list()
void scenes::lobby::gui_customize(XrTime predicted_display_time)
{
auto & config = application::get_config();
namespace ui = wivrn::ui;
ui::page_header(_cS("page header title", "Environment"), _cS("page header subtitle", "Choose the environment your panels float in."));
+11 -9
View File
@@ -26,7 +26,7 @@
namespace
{
wivrn::gui::settings_context lobby_settings_context(xr::instance & instance, xr::session & session, xr::system & system, imgui_context & imgui_ctx, std::optional<bool> server_hid_forwarding)
wivrn::gui::settings_context lobby_settings_context(xr::instance & instance, xr::session & session, xr::system & system, imgui_context & imgui_ctx, const XrViewConfigurationView & stream_view, std::optional<bool> server_hid_forwarding)
{
return {
.config = application::get_config(),
@@ -35,6 +35,8 @@ wivrn::gui::settings_context lobby_settings_context(xr::instance & instance, xr:
.session = session,
.system = system,
.imgui_ctx = imgui_ctx,
.recommended_width = stream_view.recommendedImageRectWidth,
.recommended_height = stream_view.recommendedImageRectHeight,
.in_game = false,
.server_hid_forwarding = server_hid_forwarding,
};
@@ -43,40 +45,40 @@ wivrn::gui::settings_context lobby_settings_context(xr::instance & instance, xr:
void scenes::lobby::gui_video()
{
wivrn::gui::settings_video(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
wivrn::gui::settings_video(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
}
void scenes::lobby::gui_streaming()
{
wivrn::gui::settings_streaming(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
wivrn::gui::settings_streaming(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
}
void scenes::lobby::gui_post_processing()
{
wivrn::gui::settings_post_processing(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
wivrn::gui::settings_post_processing(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
}
void scenes::lobby::gui_audio()
{
wivrn::gui::settings_audio(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
wivrn::gui::settings_audio(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
}
void scenes::lobby::gui_devices()
{
wivrn::gui::settings_devices(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
wivrn::gui::settings_devices(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
}
void scenes::lobby::gui_tracking()
{
wivrn::gui::settings_tracking(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
wivrn::gui::settings_tracking(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
}
void scenes::lobby::gui_system()
{
wivrn::gui::settings_system(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
wivrn::gui::settings_system(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
}
void scenes::lobby::gui_theme()
{
wivrn::gui::settings_theme(lobby_settings_context(instance, session, system, *imgui_ctx, server_hid_forwarding));
wivrn::gui::settings_theme(lobby_settings_context(instance, session, system, *imgui_ctx, stream_view, server_hid_forwarding));
}
+10
View File
@@ -316,7 +316,17 @@ virtual_keyboard::key_status virtual_keyboard::button_behavior(const ImRect & bb
if (mouse_down)
{
held = true;
float prev_held_duration = held_duration;
held_duration += g.IO.DeltaTime;
// if ((flags & ImGuiButtonFlags_Repeat) and held_duration > g.IO.KeyRepeatDelay)
// {
// int n1 = (prev_held_duration - g.IO.KeyRepeatDelay) / g.IO.KeyRepeatRate;
// int n2 = (held_duration - g.IO.KeyRepeatDelay) / g.IO.KeyRepeatRate;
//
// if (n2 != n1)
// pressed = true;
// }
}
else
{
+117 -293
View File
@@ -36,12 +36,10 @@
#include "decoder/shard_accumulator.h"
#include "inplace_vector.hpp"
#include "spdlog/spdlog.h"
#include "utils/i18n.h"
#include "utils/named_thread.h"
#include "utils/ranges.h"
#include "wivrn_packets.h"
#include <algorithm>
#include <cmath>
#include <mutex>
#include <ranges>
#include <thread>
@@ -57,29 +55,13 @@ using namespace beman::inplace_vector;
// clang-format off
static const std::unordered_map<std::string, device_id> device_ids = {
{"/user/hand/left/input/dpad_up/click", device_id::DPAD_UP_CLICK},
{"/user/hand/left/input/dpad_up/touch", device_id::DPAD_UP_TOUCH},
{"/user/hand/left/input/dpad_left/click", device_id::DPAD_LEFT_CLICK},
{"/user/hand/left/input/dpad_left/touch", device_id::DPAD_LEFT_TOUCH},
{"/user/hand/left/input/dpad_down/click", device_id::LEFT_X_CLICK},
{"/user/hand/left/input/dpad_down/touch", device_id::LEFT_X_TOUCH},
{"/user/hand/left/input/dpad_right/click", device_id::LEFT_Y_CLICK},
{"/user/hand/left/input/dpad_right/touch", device_id::LEFT_Y_TOUCH},
{"/user/hand/left/input/x/click", device_id::LEFT_X_CLICK},
{"/user/hand/left/input/x/touch", device_id::LEFT_X_TOUCH},
{"/user/hand/left/input/y/click", device_id::LEFT_Y_CLICK},
{"/user/hand/left/input/y/touch", device_id::LEFT_Y_TOUCH},
{"/user/hand/left/input/view/click", device_id::LEFT_MENU_CLICK},
{"/user/hand/left/input/view/touch", device_id::LEFT_MENU_TOUCH},
{"/user/hand/left/input/menu/click", device_id::LEFT_MENU_CLICK},
{"/user/hand/left/input/menu/touch", device_id::LEFT_MENU_TOUCH},
{"/user/hand/left/input/system/click", device_id::LEFT_SYSTEM_CLICK},
{"/user/hand/left/input/system/touch", device_id::LEFT_SYSTEM_TOUCH},
{"/user/hand/left/input/bumper/click", device_id::LEFT_BUMPER_CLICK},
{"/user/hand/left/input/bumper/touch", device_id::LEFT_BUMPER_TOUCH},
{"/user/hand/left/input/x/click", device_id::X_CLICK},
{"/user/hand/left/input/x/touch", device_id::X_TOUCH},
{"/user/hand/left/input/y/click", device_id::Y_CLICK},
{"/user/hand/left/input/y/touch", device_id::Y_TOUCH},
{"/user/hand/left/input/menu/click", device_id::MENU_CLICK},
{"/user/hand/left/input/squeeze/click", device_id::LEFT_SQUEEZE_CLICK},
{"/user/hand/left/input/squeeze/force", device_id::LEFT_SQUEEZE_FORCE},
{"/user/hand/left/input/squeeze/touch", device_id::LEFT_SQUEEZE_TOUCH},
{"/user/hand/left/input/squeeze/value", device_id::LEFT_SQUEEZE_VALUE},
{"/user/hand/left/input/trigger/value", device_id::LEFT_TRIGGER_VALUE},
{"/user/hand/left/input/trigger/click", device_id::LEFT_TRIGGER_CLICK},
@@ -112,19 +94,9 @@ static const std::unordered_map<std::string, device_id> device_ids = {
{"/user/hand/right/input/a/touch", device_id::A_TOUCH},
{"/user/hand/right/input/b/click", device_id::B_CLICK},
{"/user/hand/right/input/b/touch", device_id::B_TOUCH},
{"/user/hand/right/input/x/click", device_id::RIGHT_X_CLICK},
{"/user/hand/right/input/x/touch", device_id::RIGHT_X_TOUCH},
{"/user/hand/right/input/y/click", device_id::RIGHT_Y_CLICK},
{"/user/hand/right/input/y/touch", device_id::RIGHT_Y_TOUCH},
{"/user/hand/right/input/menu/click", device_id::RIGHT_MENU_CLICK},
{"/user/hand/right/input/menu/touch", device_id::RIGHT_MENU_TOUCH},
{"/user/hand/right/input/system/click", device_id::RIGHT_SYSTEM_CLICK},
{"/user/hand/right/input/system/touch", device_id::RIGHT_SYSTEM_TOUCH},
{"/user/hand/right/input/bumper/click", device_id::RIGHT_BUMPER_CLICK},
{"/user/hand/right/input/bumper/touch", device_id::RIGHT_BUMPER_TOUCH},
{"/user/hand/right/input/system/click", device_id::SYSTEM_CLICK},
{"/user/hand/right/input/squeeze/click", device_id::RIGHT_SQUEEZE_CLICK},
{"/user/hand/right/input/squeeze/force", device_id::RIGHT_SQUEEZE_FORCE},
{"/user/hand/right/input/squeeze/touch", device_id::RIGHT_SQUEEZE_TOUCH},
{"/user/hand/right/input/squeeze/value", device_id::RIGHT_SQUEEZE_VALUE},
{"/user/hand/right/input/trigger/value", device_id::RIGHT_TRIGGER_VALUE},
{"/user/hand/right/input/trigger/click", device_id::RIGHT_TRIGGER_CLICK},
@@ -203,12 +175,11 @@ static const std::array supported_depth_formats{
scenes::stream::stream(std::string server_name, scene & parent_scene) :
scene_impl<stream>(supported_color_formats, supported_depth_formats, parent_scene),
apps{*this, std::move(server_name)},
foveation_center{instance, system, session, device, commandpool, queue, swapchain_format}
apps{*this, std::move(server_name)}
{
const auto & view = system.stereo_view();
width = view.recommendedImageRectWidth;
height = view.recommendedImageRectHeight;
auto views = system.view_configuration_views(viewconfig);
width = views[0].recommendedImageRectWidth;
height = views[0].recommendedImageRectHeight;
}
static from_headset::visibility_mask_changed::masks get_visibility_mask(xr::instance & inst, xr::session & session, int view)
@@ -251,10 +222,22 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
.variant = application::get_messages_info().variant,
};
{
auto [flags, views] = self->session.locate_views(
XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO,
self->instance.now(),
application::space(xr::spaces::view));
assert(views.size() == info.fov.size());
for (auto [i, j]: std::views::zip(views, info.fov))
j = i.fov;
}
const auto & config = application::get_config();
{
auto view = self->system.stereo_view();
auto view = self->system.view_configuration_views(self->viewconfig)[0];
view = application::get_hmd_traits().override_view(view);
info.render_eye_width = view.recommendedImageRectWidth * config.resolution_scale;
@@ -286,7 +269,6 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
info.settings.mirror_gamepad = config.forward_gamepad;
info.settings.enabled_body_parts = config.body_part_mask;
info.battery_status = self->instance.has_extension(XR_EXT_INTERACTION_PROFILE_BATTERY_STATE_DISPLAY_EXTENSION_NAME);
info.hand_tracking = config.check_feature(feature::hand_tracking);
info.eye_gaze = config.check_feature(feature::eye_gaze);
@@ -348,8 +330,7 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
if (config.codec)
{
const bool supports_10bit = decoder::supports_10bit(*config.codec);
info.supported_codecs = {{.codec = *config.codec, .supports_10bit = supports_10bit}};
info.supported_codecs = {*config.codec};
switch (*config.codec)
{
case h264:
@@ -357,13 +338,11 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
break;
case h265:
case av1:
info.bit_depth = supports_10bit ? config.bit_depth : 8;
info.bit_depth = config.bit_depth;
}
}
else
{
info.supported_codecs = decoder::supported_codecs();
}
return info;
}());
@@ -392,6 +371,20 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
}
}
{
const auto & config = application::get_config();
self->override_foveation_enable = config.override_foveation_enable;
self->override_foveation_pitch = config.override_foveation_pitch;
self->override_foveation_distance = config.override_foveation_distance;
if (self->override_foveation_enable)
self->network_session->send_control(from_headset::override_foveation_center{
.enabled = self->override_foveation_enable,
.pitch = self->override_foveation_pitch,
.distance = self->override_foveation_distance,
});
}
self->network_thread = utils::named_thread("network_thread", &stream::process_packets, self.get());
self->command_buffer = std::move(self->device.allocateCommandBuffers({
@@ -565,10 +558,8 @@ void scenes::stream::on_focused()
}
}
menu_chord.a = get_action("menu_toggle_1").first;
menu_chord.b = get_action("menu_toggle_2").first;
gamepad_chord.a = get_action("gamepad_mode_1").first;
gamepad_chord.b = get_action("gamepad_mode_2").first;
plots_toggle_1 = get_action("plots_toggle_1").first;
plots_toggle_2 = get_action("plots_toggle_2").first;
recenter_left = get_action("recenter_left").first;
recenter_right = get_action("recenter_right").first;
gui_distance_left = get_action("gui_distance_left").first;
@@ -885,35 +876,10 @@ void scenes::stream::render(const XrFrameState & frame_state)
}
}
// Search for frame with desired display time on all decoders
// If no such frame exists, use the latest frame for each decoder
current_blit_handles = common_frame(frame_state.predictedDisplayTime);
std::array<XrPosef, view_count> pose;
std::array<XrFovf, view_count> fov{};
std::array<bool, view_count> valid_fov{};
std::array<wivrn::to_headset::foveation_parameter, view_count> foveation;
std::array<XrExtent2Di, view_count> extents;
int32_t max_width = 0;
int32_t max_height = 0;
for (size_t i = 0; i < view_count; ++i)
{
auto & blit_handle = current_blit_handles[i];
if (!blit_handle)
continue;
fov[i] = blit_handle->view_info.fov[i];
valid_fov[i] = true;
foveation[i] = blit_handle->view_info.foveation[i];
extents[i] = stream_defoveator::defoveated_size(foveation[i]);
max_width = std::max(max_width, extents[i].width);
max_height = std::max(max_height, extents[i].height);
}
if (max_width > 0 and max_height > 0)
ensure_swapchain(foveation_center.is_cropped(fov, valid_fov), max_width, max_height);
session.begin_frame();
std::array<int, view_count> image_indices;
#if WIVRN_FEATURE_RENDERDOC
renderdoc_begin(*vk_instance);
#endif
@@ -927,8 +893,13 @@ void scenes::stream::render(const XrFrameState & frame_state)
command_buffer.resetQueryPool(*query_pool, 0, size_gpu_timestamps);
command_buffer.writeTimestamp(vk::PipelineStageFlagBits::eTopOfPipe, *query_pool, 0);
// Search for frame with desired display time on all decoders
// If no such frame exists, use the latest frame for each decoder
current_blit_handles = common_frame(frame_state.predictedDisplayTime);
std::array<XrPosef, view_count> pose;
std::array<XrFovf, view_count> fov;
std::array<wivrn::to_headset::foveation_parameter, view_count> foveation;
bool use_alpha = false;
auto now = instance.now();
std::array<stream_defoveator::input, view_count> images;
for (size_t i = 0; i < view_count + use_alpha; ++i)
@@ -941,7 +912,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
continue;
}
blit_handle->feedback.blitted = now;
blit_handle->feedback.blitted = instance.now();
if (blit_handle->feedback.blitted - blit_handle->feedback.received_from_decoder > 1'000'000'000)
set_state(state::stalled);
++blit_handle->feedback.times_displayed;
@@ -949,37 +920,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
use_alpha = blit_handle->view_info.alpha;
#if WIVRN_USE_V4L2
if (blit_handle->foreign_queue_family != vk::QueueFamilyIgnored)
{
// decoder completed its write before handing us this image
// acquire ownership from the external media engine before sampling it
vk::ImageMemoryBarrier barrier{
.srcAccessMask = vk::AccessFlagBits::eNone,
.dstAccessMask = vk::AccessFlagBits::eShaderRead,
.oldLayout = blit_handle->current_layout,
.newLayout = vk::ImageLayout::eGeneral,
.srcQueueFamilyIndex = blit_handle->foreign_queue_family,
.dstQueueFamilyIndex = queue_family_index,
.image = blit_handle->image,
.subresourceRange = {
.aspectMask = vk::ImageAspectFlagBits::eColor,
.levelCount = 1,
.layerCount = 1,
},
};
command_buffer.pipelineBarrier(vk::PipelineStageFlagBits::eTopOfPipe,
vk::PipelineStageFlagBits::eFragmentShader,
{},
{},
{},
barrier);
blit_handle->current_layout = vk::ImageLayout::eGeneral;
}
else
#endif
if (blit_handle->current_layout == vk::ImageLayout::eUndefined)
if (blit_handle->current_layout == vk::ImageLayout::eUndefined)
{
vk::ImageMemoryBarrier barrier{
.srcAccessMask = vk::AccessFlagBits::eNone,
@@ -1040,18 +981,42 @@ void scenes::stream::render(const XrFrameState & frame_state)
std::ranges::any_of(current_blit_handles, [](const auto & h) { return h and h->feedback.times_displayed < 2; }) or
is_gui_interactable())
{
assert(swapchain);
// Swapchains only recreated when switching between cropped/full
// Otherwise we clamp and resize the existing one
for (size_t i = 0; i < view_count; ++i)
XrExtent2Di extents[view_count];
{
extents[i].width = std::min(extents[i].width, swapchain.width());
extents[i].height = std::min(extents[i].height, swapchain.height());
int32_t max_width = 0;
int32_t max_height = 0;
for (size_t i = 0; i < view_count; ++i)
{
extents[i] = stream_defoveator::defoveated_size(foveation[i]);
max_width = std::max(max_width, extents[i].width);
max_height = std::max(max_height, extents[i].height);
}
if (not swapchain)
setup_reprojection_swapchain(max_width, max_height);
else if (swapchain.width() < max_width or swapchain.height() < max_height)
{
// If the defoveated image is larger than the swapchain, try to reallocate one
try
{
spdlog::info("Recreating swapchain, from {}x{} to {}x{}",
swapchain.width(),
swapchain.height(),
max_width,
max_height);
setup_reprojection_swapchain(max_width, max_height);
}
catch (std::exception & e)
{
spdlog::warn("failed to increase swapchain size");
for (size_t i = 0; i < view_count; ++i)
{
extents[i].width = std::min(extents[i].width, swapchain.width());
extents[i].height = std::min(extents[i].height, swapchain.height());
}
}
}
}
foveation_center.update(fov, valid_fov, swapchain, frame_state.predictedDisplayTime);
assert(swapchain);
// defoveate the image, apply scale/bias
int image_index = swapchain.acquire();
swapchain.wait();
@@ -1085,41 +1050,6 @@ void scenes::stream::render(const XrFrameState & frame_state)
{bias, bias, bias, 0.},
image_index);
#if WIVRN_USE_V4L2
// the blit handles keep CAPTURE buffers alive until this cmd buffer's fence has completed
inplace_vector<vk::ImageMemoryBarrier, decoder_count> foreign_release_barriers;
for (const auto & handle: current_blit_handles)
{
if (handle && handle->foreign_queue_family != vk::QueueFamilyIgnored)
{
foreign_release_barriers.push_back({
.srcAccessMask = vk::AccessFlagBits::eShaderRead,
.dstAccessMask = vk::AccessFlagBits::eNone,
.oldLayout = handle->current_layout,
.newLayout = vk::ImageLayout::eGeneral,
.srcQueueFamilyIndex = queue_family_index,
.dstQueueFamilyIndex = handle->foreign_queue_family,
.image = handle->image,
.subresourceRange = {
.aspectMask = vk::ImageAspectFlagBits::eColor,
.levelCount = 1,
.layerCount = 1,
},
});
handle->current_layout = vk::ImageLayout::eGeneral;
}
}
if (!foreign_release_barriers.empty())
{
command_buffer.pipelineBarrier(vk::PipelineStageFlagBits::eFragmentShader,
vk::PipelineStageFlagBits::eBottomOfPipe,
{},
{},
{},
foreign_release_barriers);
}
#endif
command_buffer.writeTimestamp(vk::PipelineStageFlagBits::eBottomOfPipe, *query_pool, 1);
command_buffer.end();
@@ -1161,10 +1091,6 @@ void scenes::stream::render(const XrFrameState & frame_state)
render_start(use_alpha, frame_state.predictedDisplayTime);
// full-FOV dummy layer for Meta foveation, used when cropping FOV
if (auto layer = foveation_center.get_layer())
add_projection_layer(layer->flags, layer->space, layer->views);
// Add the layer with the streamed content
std::array<XrCompositionLayerProjectionView, view_count> layer_view;
for (uint32_t view = 0; view < view_count; view++)
@@ -1215,8 +1141,7 @@ void scenes::stream::render(const XrFrameState & frame_state)
{
// Keep a copy of the feedback packets as they can be modified if they're encrypted
inplace_vector<from_headset::feedback, decoder_count> feedbacks;
// +1 for optional foveation packet
inplace_vector<serialization_packet, decoder_count + 1> packets;
inplace_vector<serialization_packet, decoder_count> packets;
feedbacks.reserve(current_blit_handles.size());
packets.reserve(current_blit_handles.size());
@@ -1229,11 +1154,6 @@ void scenes::stream::render(const XrFrameState & frame_state)
wivrn_session::control_socket_t::serialize(packet, feedbacks.emplace_back(handle->feedback));
}
}
if (auto foveation_packet = foveation_center.take_packet())
{
auto & packet = packets.emplace_back();
wivrn_session::control_socket_t::serialize(packet, *foveation_packet);
}
if (not packets.empty())
{
try
@@ -1247,49 +1167,32 @@ void scenes::stream::render(const XrFrameState & frame_state)
}
}
auto show_gamepad_toast = [this, now](bool enabled) {
{
auto toast = gui_toast.lock();
toast->emplace(enabled
? _("Now emulating a gamepad. Double-click both grips to go back to using VR controllers.")
: _("No longer emulating a gamepad."),
false);
}
gui_status_last_change = now;
};
if (not application::get_config().emulated_gamepad)
{
if (gamepad_mode.exchange(false))
{
scheduled_derived_pose = now;
show_gamepad_toast(false);
spdlog::info("Controller gamepad emulation disabled due to setting change");
}
gamepad_chord.reset();
}
else if (gamepad_chord.check(now))
{
const bool enabled = not gamepad_mode.load();
gamepad_mode = enabled;
if (not enabled)
scheduled_derived_pose = now;
show_gamepad_toast(enabled);
spdlog::info("Controller gamepad mode {}", enabled ? "enabled" : "disabled");
}
read_actions();
if (application::get_config().enable_stream_gui and menu_chord.check(now))
if (application::get_config().enable_stream_gui)
{
// Arbitrary transitions can happen from network commands
// Ensure we can't have a set of 2 non interactable states
if (is_gui_interactable())
next_gui_status = stream_tab::hidden;
else if (is_interactable(stored_gui_status))
next_gui_status = stored_gui_status;
else
next_gui_status = stream_tab::applications;
XrActionStateGetInfo get_info{
.type = XR_TYPE_ACTION_STATE_GET_INFO,
.action = plots_toggle_1,
};
XrActionStateBoolean state_1{XR_TYPE_ACTION_STATE_BOOLEAN};
CHECK_XR(xrGetActionStateBoolean(session, &get_info, &state_1));
get_info.action = plots_toggle_2;
XrActionStateBoolean state_2{XR_TYPE_ACTION_STATE_BOOLEAN};
CHECK_XR(xrGetActionStateBoolean(session, &get_info, &state_2));
if (state_1.currentState and state_2.currentState and (state_1.changedSinceLastSync or state_2.changedSinceLastSync))
{
// Arbitrary transitions can happen from network commands
// Ensure we can't have a set of 2 non interactable states
if (is_gui_interactable())
next_gui_status = stream_tab::hidden;
else if (is_interactable(stored_gui_status))
next_gui_status = stored_gui_status;
else
next_gui_status = stream_tab::applications;
}
}
query_pool_filled = true;
@@ -1305,12 +1208,6 @@ void scenes::stream::setup(const to_headset::video_stream_description & descript
spdlog::info("setup, refresh rate {}", description.refresh_rate);
session.set_refresh_rate(description.refresh_rate);
battery & battery_monitor = application::get_battery_monitor();
for (auto device: magic_enum::enum_values<battery::device>())
{
on_battery_update(device, battery_monitor.get_battery_status(device));
}
std::unique_lock lock(decoder_mutex);
if (video_stream_description == description)
return;
@@ -1320,7 +1217,7 @@ void scenes::stream::setup(const to_headset::video_stream_description & descript
for (const auto & [stream_index, item]: utils::enumerate(decoders))
{
item = accumulator_images{
.decoder = std::make_unique<shard_accumulator>(device, physical_device, instance, queue_family_index, description, weak_from_this(), stream_index),
.decoder = std::make_unique<shard_accumulator>(device, physical_device, instance, queue_family_index, description, shared_from_this(), stream_index),
};
}
@@ -1328,7 +1225,7 @@ void scenes::stream::setup(const to_headset::video_stream_description & descript
defoveator->reset_pipelines();
}
void scenes::stream::setup_reprojection_swapchain(uint32_t swapchain_width, uint32_t swapchain_height, bool foveation)
void scenes::stream::setup_reprojection_swapchain(uint32_t swapchain_width, uint32_t swapchain_height)
{
assert(swapchain_width);
assert(swapchain_height);
@@ -1338,21 +1235,8 @@ void scenes::stream::setup_reprojection_swapchain(uint32_t swapchain_width, uint
auto views = system.view_configuration_views(viewconfig);
swapchain = xr::swapchain(
instance,
session,
device,
swapchain_format,
swapchain_width,
swapchain_height,
1,
views.size(),
foveation);
spdlog::info(
"Created stream swapchain: {}x{}{}",
swapchain.width(),
swapchain.height(),
foveation ? " with eye-tracked foveation" : "");
swapchain = xr::swapchain(instance, session, device, swapchain_format, swapchain_width, swapchain_height, 1, views.size());
spdlog::info("Created stream swapchain: {}x{}", swapchain.width(), swapchain.height());
for (auto view: views)
{
if (swapchain.width() > view.maxImageRectWidth or swapchain.height() > view.maxImageRectHeight)
@@ -1370,26 +1254,6 @@ void scenes::stream::setup_reprojection_swapchain(uint32_t swapchain_width, uint
swapchain.format());
}
void scenes::stream::ensure_swapchain(bool cropped, uint32_t width, uint32_t height)
{
if (!swapchain or swapchain.width() < width or swapchain.height() < height or foveation_center.needs_swapchain_recreation(cropped))
{
try
{
setup_reprojection_swapchain(width, height, foveation_center.use_meta_swapchain(cropped));
foveation_center.on_swapchain_recreated(cropped);
}
catch (std::exception & e)
{
spdlog::warn("failed to create swapchain");
}
}
else
{
foveation_center.set_cropped(cropped);
}
}
scene::meta & scenes::stream::get_meta_scene()
{
static meta m{
@@ -1406,10 +1270,8 @@ scene::meta & scenes::stream::get_meta_scene()
{"right_scroll", XR_ACTION_TYPE_VECTOR2F_INPUT},
{"right_haptic", XR_ACTION_TYPE_VIBRATION_OUTPUT},
{"menu_toggle_1", XR_ACTION_TYPE_BOOLEAN_INPUT},
{"menu_toggle_2", XR_ACTION_TYPE_BOOLEAN_INPUT},
{"gamepad_mode_1", XR_ACTION_TYPE_BOOLEAN_INPUT},
{"gamepad_mode_2", XR_ACTION_TYPE_BOOLEAN_INPUT},
{"plots_toggle_1", XR_ACTION_TYPE_BOOLEAN_INPUT},
{"plots_toggle_2", XR_ACTION_TYPE_BOOLEAN_INPUT},
{"recenter_left", XR_ACTION_TYPE_BOOLEAN_INPUT},
{"recenter_right", XR_ACTION_TYPE_BOOLEAN_INPUT},
@@ -1434,7 +1296,6 @@ scene::meta & scenes::stream::get_meta_scene()
"/interaction_profiles/bytedance/pico4s_controller",
"/interaction_profiles/yvr/touch_controller_yvr",
"/interaction_profiles/htc/vive_focus3_controller",
"/interaction_profiles/valve/frame_controller_valve",
},
{
{"left_aim", "/user/hand/left/input/aim/pose"},
@@ -1457,20 +1318,8 @@ scene::meta & scenes::stream::get_meta_scene()
{"foveation_ok", "/user/hand/right/input/a/click"},
{"foveation_cancel", "/user/hand/right/input/b/click"},
{"menu_toggle_1", "/user/hand/left/input/thumbstick/click"},
{"menu_toggle_2", "/user/hand/right/input/thumbstick/click"},
},
},
suggested_binding{
{
"/interaction_profiles/valve/frame_controller_valve",
},
{
{"left_trigger", "/user/hand/left/input/bumper/click"},
{"right_trigger", "/user/hand/right/input/bumper/click"},
{"gamepad_mode_1", "/user/hand/left/input/squeeze/click"},
{"gamepad_mode_2", "/user/hand/right/input/squeeze/click"},
{"plots_toggle_1", "/user/hand/left/input/thumbstick/click"},
{"plots_toggle_2", "/user/hand/right/input/thumbstick/click"},
},
},
suggested_binding{
@@ -1542,31 +1391,6 @@ void scenes::stream::on_xr_event(const xr::event & event)
}
}
void scenes::stream::on_battery_update(battery::device device, const battery::battery_status & battery)
{
device_id id = [&] {
switch (device)
{
case battery::device::head:
return device_id::HEAD;
case battery::device::left_controller:
return device_id::LEFT_CONTROLLER;
case battery::device::right_controller:
return device_id::RIGHT_CONTROLLER;
case battery::device::gamepad:
return device_id::GAMEPAD;
default:
assert(false);
__builtin_unreachable();
}
}();
network_session->send_control(from_headset::battery{
.device = id,
.charge = battery.charge,
.charging = battery.charging,
});
}
bool scenes::stream::forward_hid_input(from_headset::hid::input_t packet, bool device_enabled)
{
// hid_forwarding is whether the server permits it; device_enabled is the headset toggle.
+7 -38
View File
@@ -20,11 +20,8 @@
#pragma once
#include "app_launcher.h"
#include "application.h"
#include "audio/audio.h"
#include "configuration.h"
#include "decoder/shard_accumulator.h"
#include "foveation.h"
#include "render/imgui_impl.h"
#include "scene.h"
#include "scenes/input_profile.h"
@@ -81,37 +78,6 @@ private:
std::thread network_thread;
thread_safe<to_headset::tracking_control> tracking_control{};
std::array<std::atomic<interaction_profile>, 3> interaction_profiles; // left hand, right hand, gamepad
std::atomic<bool> gamepad_mode = false;
struct chord_state
{
XrAction a = XR_NULL_HANDLE;
XrAction b = XR_NULL_HANDLE;
uint32_t clicks_needed = 1;
bool both_released = false;
uint32_t clicks_done = 0;
XrTime first_click_time = 0;
void reset()
{
both_released = false;
clicks_done = 0;
first_click_time = 0;
}
// Read actions a and b and determine if they were activated together clicks_needed times in a row
bool check(XrTime now);
};
chord_state menu_chord = {};
chord_state gamepad_chord = {.clicks_needed = 2};
bool using_frame_gamepad() const
{
return gamepad_mode.load() and
interaction_profiles[0].load() == interaction_profile::valve_frame_controller_valve and
interaction_profiles[1].load() == interaction_profile::valve_frame_controller_valve;
}
std::atomic<bool> interaction_profile_changed = false;
std::atomic<XrTime> scheduled_derived_pose = 0; // Tracking thread will compute derived pose when time is reached
std::atomic<bool> recenter_requested = false;
@@ -151,7 +117,6 @@ private:
state_.compare_exchange_strong(prev, new_state);
}
client_foveation::center foveation_center;
xr::swapchain swapchain;
std::optional<audio> audio_handle;
@@ -204,6 +169,8 @@ private:
thread_safe<std::queue<std::string>> stream_error_queue;
XrAction plots_toggle_1 = XR_NULL_HANDLE;
XrAction plots_toggle_2 = XR_NULL_HANDLE;
XrAction recenter_left = XR_NULL_HANDLE;
XrAction recenter_right = XR_NULL_HANDLE;
XrAction gui_distance_left = XR_NULL_HANDLE;
@@ -221,6 +188,10 @@ private:
glm::vec3 world_gui_position;
glm::quat world_gui_orientation;
bool override_foveation_enable;
float override_foveation_pitch; // The pitch is the opposite as the height displayed in the GUI
float override_foveation_distance;
// Which controller is used for recentering and position of the GUI relative to the controller, in controller axes, during recentering
std::optional<std::tuple<xr::spaces, glm::vec3, glm::quat>> recentering_context;
void update_gui_position(xr::spaces controller, float predicted_display_period);
@@ -248,7 +219,6 @@ public:
void on_focused() override;
void on_unfocused() override;
void on_xr_event(const xr::event &) override;
void on_battery_update(battery::device device, const battery::battery_status &) override;
bool on_input_key_down(uint8_t key_code) override;
bool on_input_key_up(uint8_t key_code) override;
@@ -307,8 +277,7 @@ private:
void send_derived_pose();
void setup(const to_headset::video_stream_description &);
void setup_reprojection_swapchain(uint32_t width, uint32_t height, bool foveation);
void ensure_swapchain(bool cropped, uint32_t width, uint32_t height);
void setup_reprojection_swapchain(uint32_t width, uint32_t height);
vk::raii::QueryPool query_pool = nullptr;
bool query_pool_filled = false;
+5 -175
View File
@@ -19,170 +19,29 @@
#include "application.h"
#include "stream.h"
#include <algorithm>
#include <array>
#include <optional>
#include <ranges>
#include <spdlog/spdlog.h>
namespace
{
using wivrn::device_id;
std::optional<device_id> frame_gamepad_input(device_id id)
{
switch (id)
{
case device_id::LEFT_MENU_CLICK:
return device_id::GAMEPAD_VIEW_CLICK;
case device_id::RIGHT_MENU_CLICK:
return device_id::GAMEPAD_MENU_CLICK;
case device_id::A_CLICK:
return device_id::GAMEPAD_A_CLICK;
case device_id::B_CLICK:
return device_id::GAMEPAD_B_CLICK;
case device_id::RIGHT_X_CLICK:
return device_id::GAMEPAD_X_CLICK;
case device_id::RIGHT_Y_CLICK:
return device_id::GAMEPAD_Y_CLICK;
case device_id::DPAD_UP_CLICK:
return device_id::GAMEPAD_DPAD_UP_CLICK;
case device_id::DPAD_LEFT_CLICK:
return device_id::GAMEPAD_DPAD_LEFT_CLICK;
case device_id::LEFT_X_CLICK:
return device_id::GAMEPAD_DPAD_DOWN_CLICK;
case device_id::LEFT_Y_CLICK:
return device_id::GAMEPAD_DPAD_RIGHT_CLICK;
case device_id::LEFT_BUMPER_CLICK:
return device_id::GAMEPAD_SHOULDER_LEFT_CLICK;
case device_id::RIGHT_BUMPER_CLICK:
return device_id::GAMEPAD_SHOULDER_RIGHT_CLICK;
case device_id::LEFT_THUMBSTICK_CLICK:
return device_id::GAMEPAD_THUMBSTICK_LEFT_CLICK;
case device_id::RIGHT_THUMBSTICK_CLICK:
return device_id::GAMEPAD_THUMBSTICK_RIGHT_CLICK;
case device_id::LEFT_TRIGGER_VALUE:
return device_id::GAMEPAD_TRIGGER_LEFT_VALUE;
case device_id::RIGHT_TRIGGER_VALUE:
return device_id::GAMEPAD_TRIGGER_RIGHT_VALUE;
case device_id::LEFT_THUMBSTICK_X:
return device_id::GAMEPAD_THUMBSTICK_LEFT_X;
case device_id::RIGHT_THUMBSTICK_X:
return device_id::GAMEPAD_THUMBSTICK_RIGHT_X;
default:
return std::nullopt;
}
}
constexpr std::array frame_gamepad_ids = {
device_id::GAMEPAD_MENU_CLICK,
device_id::GAMEPAD_VIEW_CLICK,
device_id::GAMEPAD_A_CLICK,
device_id::GAMEPAD_B_CLICK,
device_id::GAMEPAD_X_CLICK,
device_id::GAMEPAD_Y_CLICK,
device_id::GAMEPAD_DPAD_UP_CLICK,
device_id::GAMEPAD_DPAD_DOWN_CLICK,
device_id::GAMEPAD_DPAD_LEFT_CLICK,
device_id::GAMEPAD_DPAD_RIGHT_CLICK,
device_id::GAMEPAD_SHOULDER_LEFT_CLICK,
device_id::GAMEPAD_SHOULDER_RIGHT_CLICK,
device_id::GAMEPAD_THUMBSTICK_LEFT_CLICK,
device_id::GAMEPAD_THUMBSTICK_RIGHT_CLICK,
device_id::GAMEPAD_TRIGGER_LEFT_VALUE,
device_id::GAMEPAD_TRIGGER_RIGHT_VALUE,
device_id::GAMEPAD_THUMBSTICK_LEFT_X,
device_id::GAMEPAD_THUMBSTICK_LEFT_Y,
device_id::GAMEPAD_THUMBSTICK_RIGHT_X,
device_id::GAMEPAD_THUMBSTICK_RIGHT_Y,
};
} // namespace
bool scenes::stream::chord_state::check(XrTime now)
{
constexpr XrDuration press_tolerance = 150'000'000; // 150ms between button presses
constexpr XrDuration click_timeout = 400'000'000; // 400ms between chord clicks
auto state_1 = application::read_action_bool(a);
auto state_2 = application::read_action_bool(b);
if (not state_1 or not state_2)
{
reset();
return false;
}
if (clicks_done != 0 and now - first_click_time > click_timeout)
clicks_done = 0;
const bool down_1 = state_1->second;
const bool down_2 = state_2->second;
if (not down_1 and not down_2)
{
both_released = true;
return false;
}
// require both inputs to be released between taps
// to avoid accidental activation
if (not(down_1 and down_2) or not both_released)
return false;
// both inputs are down
both_released = false;
const XrTime press_1 = state_1->first;
const XrTime press_2 = state_2->first;
const XrDuration press_separation = press_1 >= press_2 ? press_1 - press_2 : press_2 - press_1;
// inputs were not pressed together
if (press_separation > press_tolerance)
{
clicks_done = 0;
return false;
}
if (clicks_done == 0)
first_click_time = std::max(press_1, press_2);
++clicks_done;
if (clicks_done < clicks_needed)
return false;
reset();
return true;
}
void scenes::stream::read_actions()
{
from_headset::inputs inputs;
const bool emulating_gamepad = using_frame_gamepad();
if (not is_gui_interactable())
{
for (const auto & [id, action, action_type]: input_actions)
{
device_id output_id = id;
if (emulating_gamepad)
{
auto mapped_id = frame_gamepad_input(id);
if (not mapped_id)
continue; // No VR inputs in gamepad mode
output_id = *mapped_id;
}
switch (action_type)
{
case XR_ACTION_TYPE_BOOLEAN_INPUT: {
auto value = application::read_action_bool(action);
if (value)
inputs.values.push_back({output_id, (float)value->second, value->first});
inputs.values.push_back({id, (float)value->second, value->first});
}
break;
case XR_ACTION_TYPE_FLOAT_INPUT: {
auto value = application::read_action_float(action);
if (value)
inputs.values.push_back({output_id, value->second, value->first});
inputs.values.push_back({id, value->second, value->first});
}
break;
@@ -190,12 +49,8 @@ void scenes::stream::read_actions()
auto value = application::read_action_vec2(action);
if (value)
{
inputs.values.push_back({output_id, value->second.x, value->first});
float y = value->second.y;
if (emulating_gamepad &&
(id == device_id::LEFT_THUMBSTICK_X || id == device_id::RIGHT_THUMBSTICK_X))
y = -y;
inputs.values.push_back({(device_id)((int)output_id + 1), y, value->first});
inputs.values.push_back({id, value->second.x, value->first});
inputs.values.push_back({(device_id)((int)id + 1), value->second.y, value->first});
}
}
break;
@@ -207,15 +62,6 @@ void scenes::stream::read_actions()
}
}
if (emulating_gamepad)
{
for (auto id: frame_gamepad_ids)
{
if (std::ranges::none_of(inputs.values, [id](const auto & value) { return value.id == id; }))
inputs.values.push_back({id, 0, 0});
}
}
try
{
network_session->send_stream(std::move(inputs));
@@ -228,28 +74,12 @@ void scenes::stream::read_actions()
void scenes::stream::operator()(to_headset::haptics && haptics)
{
if (using_frame_gamepad())
{
switch (haptics.id)
{
case device_id::GAMEPAD_HAPTIC_LEFT:
case device_id::GAMEPAD_HAPTIC_LEFT_TRIGGER:
haptics.id = device_id::LEFT_CONTROLLER_HAPTIC;
break;
case device_id::GAMEPAD_HAPTIC_RIGHT:
case device_id::GAMEPAD_HAPTIC_RIGHT_TRIGGER:
haptics.id = device_id::RIGHT_CONTROLLER_HAPTIC;
break;
default:
break;
}
}
auto range = haptics_actions.equal_range(haptics.id);
for (auto it = range.first; it != range.second; ++it)
{
XrAction action = it->second.action;
float old = it->second.amplitude;
it->second.amplitude = haptics.amplitude;
it->second.amplitude = old;
// Some runtimes may be slow to process actions
// Skip it if not necessary
if (old == 0 and haptics.amplitude == 0)
+2
View File
@@ -119,6 +119,8 @@ stream_defoveator::pipeline_t & stream_defoveator::ensure_pipeline(size_t view,
target.layout = vk::raii::PipelineLayout(device, pipeline_layout_info);
const auto & vk_device_extensions = application::get_vk_device_extensions();
// Vertex shader
auto vertex_shader = load_shader(device, "reprojection.vert");
+32 -31
View File
@@ -363,6 +363,8 @@ void scenes::stream::gui_performance_metrics()
void scenes::stream::gui_compact_view()
{
const auto & metrics = global_metrics[(metrics_offset + global_metrics.size() - 1) % global_metrics.size()];
if (ImGui::BeginTable("metrics", 2))
{
auto f = [&](const char * label, float value, const char * unit) {
@@ -407,16 +409,21 @@ void scenes::stream::gui_settings(float)
.session = session,
.system = system,
.imgui_ctx = *imgui_ctx,
.recommended_width = width,
.recommended_height = height,
.in_game = true,
.server_hid_forwarding = hid_forwarding_enabled(),
.on_streaming_changed = [this] { send_settings_changed_packet(session, network_session.get(), application::get_config()); },
.enter_foveation_adjust = [this] { next_gui_status = stream_tab::foveation_settings; },
.on_foveation_override_changed = [this] {
const auto & config = application::get_config();
foveation_center.set_manual_mode({
.enabled = config.override_foveation_enable,
.pitch = config.override_foveation_pitch,
.distance = config.override_foveation_distance,
override_foveation_enable = config.override_foveation_enable;
override_foveation_pitch = config.override_foveation_pitch;
override_foveation_distance = config.override_foveation_distance;
network_session->send_control(from_headset::override_foveation_center{
.enabled = override_foveation_enable,
.pitch = override_foveation_pitch,
.distance = override_foveation_distance,
}); },
};
@@ -477,13 +484,11 @@ void scenes::stream::gui_bitrate_settings(float predicted_display_period)
void scenes::stream::gui_foveation_settings(float predicted_display_period)
{
auto override = foveation_center.get_manual_mode();
ImGui::PushFont(nullptr, constants::gui::font_size_large);
ImGui::Text("%s", _S("Use the thumbsticks to move the foveation center"));
ImGui::Text("%s", _S("Press A to save or B to cancel"));
ImGui::Text("%s", fmt::format(_F("Height {:.1f} °"), -override.pitch * 180 / M_PI).c_str());
ImGui::Text("%s", fmt::format(_F("Distance {:.2f} m"), override.distance).c_str());
ImGui::Text("%s", fmt::format(_F("Height {:.1f} °"), -override_foveation_pitch * 180 / M_PI).c_str());
ImGui::Text("%s", fmt::format(_F("Distance {:.2f} m"), override_foveation_distance).c_str());
ImGui::PopFont();
// Maximum speed 1 rad/s
@@ -492,8 +497,8 @@ void scenes::stream::gui_foveation_settings(float predicted_display_period)
// Maximum speed 2m/s @ 1m
float delta_distance = std::pow(constants::stream::gui_max_foveation_speed, application::read_action_float(foveation_distance).value_or(std::pair{0, 0}).second * predicted_display_period);
override.pitch = std::clamp<float>(override.pitch + delta_pitch, constants::stream::gui_min_foveation_pitch, constants::stream::gui_max_foveation_pitch);
override.distance = std::clamp<float>(override.distance * delta_distance, constants::stream::gui_min_foveation_distance, constants::stream::gui_max_foveation_distance);
override_foveation_pitch = std::clamp<float>(override_foveation_pitch + delta_pitch, constants::stream::gui_min_foveation_pitch, constants::stream::gui_max_foveation_pitch);
override_foveation_distance = std::clamp<float>(override_foveation_distance * delta_distance, constants::stream::gui_min_foveation_distance, constants::stream::gui_max_foveation_distance);
bool ok = application::read_action_bool(foveation_ok).value_or(std::pair{0, false}).second;
bool cancel = application::read_action_bool(foveation_cancel).value_or(std::pair{0, false}).second;
@@ -501,13 +506,12 @@ void scenes::stream::gui_foveation_settings(float predicted_display_period)
if (ok)
{
next_gui_status = stream_tab::settings;
override.enabled = true;
// Save settings
auto & config = application::get_config();
config.override_foveation_enable = override.enabled;
config.override_foveation_pitch = override.pitch;
config.override_foveation_distance = override.distance;
config.override_foveation_enable = true;
config.override_foveation_pitch = override_foveation_pitch;
config.override_foveation_distance = override_foveation_distance;
config.save();
}
else if (cancel)
@@ -516,14 +520,16 @@ void scenes::stream::gui_foveation_settings(float predicted_display_period)
// Restore settings
const auto & config = application::get_config();
override = {
.enabled = config.override_foveation_enable,
.pitch = config.override_foveation_pitch,
.distance = config.override_foveation_distance,
};
override_foveation_enable = config.override_foveation_enable;
override_foveation_pitch = config.override_foveation_pitch;
override_foveation_distance = config.override_foveation_distance;
}
foveation_center.set_manual_mode(override);
network_session->send_control(from_headset::override_foveation_center{
.enabled = override_foveation_enable,
.pitch = override_foveation_pitch,
.distance = override_foveation_distance,
});
}
void scenes::stream::gui_applications()
@@ -723,13 +729,10 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
glm::mat3 M = glm::mat3_cast(head_position->second);
switch (gui_status)
{
case stream_tab::foveation_settings: {
auto override = foveation_center.get_manual_mode();
case stream_tab::foveation_settings:
imgui_ctx->layers()[0].orientation = head_position->second;
imgui_ctx->layers()[0].position = head_position->first + M * glm::vec3{0, override.distance * sin(override.pitch), -override.distance};
imgui_ctx->layers()[0].position = head_position->first + M * glm::vec3{0, override_foveation_distance * sin(override_foveation_pitch), -override_foveation_distance};
break;
}
case stream_tab::hidden:
// Always use the same position for the GUI shortcut tip
@@ -1093,15 +1096,13 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
if (left_hand and right_hand)
{
auto left = left_hand->locate(world_space, predicted_display_time).joints;
auto right = right_hand->locate(world_space, predicted_display_time).joints;
auto left = left_hand->locate(world_space, predicted_display_time);
auto right = right_hand->locate(world_space, predicted_display_time);
if (left and
xr::hand_tracker::check_flags(*left, XR_SPACE_LOCATION_POSITION_TRACKED_BIT | XR_SPACE_LOCATION_POSITION_VALID_BIT, 0))
if (left and xr::hand_tracker::check_flags(*left, XR_SPACE_LOCATION_POSITION_TRACKED_BIT | XR_SPACE_LOCATION_POSITION_VALID_BIT, 0))
hide_left_controller = true;
if (right and
xr::hand_tracker::check_flags(*right, XR_SPACE_LOCATION_POSITION_TRACKED_BIT | XR_SPACE_LOCATION_POSITION_VALID_BIT, 0))
if (right and xr::hand_tracker::check_flags(*right, XR_SPACE_LOCATION_POSITION_TRACKED_BIT | XR_SPACE_LOCATION_POSITION_VALID_BIT, 0))
hide_right_controller = true;
}
+76 -115
View File
@@ -25,13 +25,16 @@
#include "xr/face_tracker.h"
#include "xr/fb_body_tracker.h"
#include "xr/to_string.h"
#include <glm/gtc/quaternion.hpp>
#include <magic_enum.hpp>
#include <magic_enum_containers.hpp>
#include <ranges>
#include <spdlog/spdlog.h>
#include <thread>
#ifdef __ANDROID__
#include "android/battery.h"
#endif
namespace
{
@@ -60,37 +63,6 @@ from_headset::tracking::pose locate_space(device_id device, XrSpace space, XrSpa
return {.device = device};
}
from_headset::tracking::pose make_eye_gaze_view_relative(
const from_headset::tracking::pose & gaze_pose,
const from_headset::tracking::pose & view_pose)
{
glm::quat gaze_quat(
gaze_pose.pose.orientation.w,
gaze_pose.pose.orientation.x,
gaze_pose.pose.orientation.y,
gaze_pose.pose.orientation.z);
const glm::quat view_quat(
view_pose.pose.orientation.w,
view_pose.pose.orientation.x,
view_pose.pose.orientation.y,
view_pose.pose.orientation.z);
gaze_quat = glm::conjugate(view_quat) * gaze_quat;
using flags = from_headset::pose_flags;
return {
.pose = {
.orientation = {
.x = gaze_quat.x,
.y = gaze_quat.y,
.z = gaze_quat.z,
.w = gaze_quat.w,
},
},
.device = gaze_pose.device,
.flags = uint8_t(gaze_pose.flags & view_pose.flags & ~(flags::linear_velocity_valid | flags::angular_velocity_valid)),
};
}
class locate_spaces_functor
{
std::vector<XrSpaceLocationData> locations;
@@ -186,33 +158,16 @@ public:
} // namespace
static from_headset::hand_tracking locate_hands(
xr::hand_tracker & tracker,
XrSpace space,
XrTime now,
XrTime time)
static std::optional<std::array<from_headset::hand_tracking::pose, XR_HAND_JOINT_COUNT_EXT>> locate_hands(xr::hand_tracker & hand, XrSpace space, XrTime time)
{
using hand_id = from_headset::hand_tracking::hand_id;
auto located = tracker.locate(space, time);
auto joints = hand.locate(space, time);
from_headset::hand_tracking res{
.production_timestamp = now,
.timestamp = time,
.hand = tracker.hand() == XR_HAND_LEFT_EXT ? hand_id::left : hand_id::right,
};
if (located.data_source == XR_HAND_TRACKING_DATA_SOURCE_CONTROLLER_EXT)
res.hand = tracker.hand() == XR_HAND_LEFT_EXT
? hand_id::left_controller
: hand_id::right_controller;
if (located.joints)
if (joints)
{
const auto & joints = *located.joints;
auto & poses = res.joints.emplace();
std::array<from_headset::hand_tracking::pose, XR_HAND_JOINT_COUNT_EXT> poses;
for (int i = 0; i < XR_HAND_JOINT_COUNT_EXT; i++)
{
const auto & joint = joints[i];
const auto & joint = (*joints)[i];
poses[i] = {
.position = joint.first.pose.position,
.orientation = pack(joint.first.pose.orientation),
@@ -222,9 +177,11 @@ static from_headset::hand_tracking locate_hands(
.flags = from_headset::to_pose_flags(joint.first.locationFlags, joint.second.velocityFlags),
};
}
}
return res;
return poses;
}
else
return std::nullopt;
}
template <typename T>
@@ -276,12 +233,14 @@ void scenes::stream::tracking()
#ifdef __ANDROID__
// Runtime may use JNI and needs the thread to be attached
application::instance().setup_jni();
XrTime next_battery_check = 0;
const XrDuration battery_check_interval = 30'000'000'000; // 30s
#endif
magic_enum::containers::array<device_id, XrSpace> spaces{};
const auto & config = application::get_config();
const bool eye_gaze_enabled = config.check_feature(feature::eye_gaze);
{
std::vector ids{
@@ -299,7 +258,7 @@ void scenes::stream::tracking()
ids.insert(ids.end(), {device_id::LEFT_PINCH_POSE, device_id::LEFT_POKE, device_id::RIGHT_PINCH_POSE, device_id::RIGHT_POKE});
}
if (eye_gaze_enabled)
if (config.check_feature(feature::eye_gaze))
ids.emplace_back(device_id::EYE_GAZE);
for (auto id: ids)
@@ -312,29 +271,9 @@ void scenes::stream::tracking()
}
XrSpace view_space = application::space(xr::spaces::view);
// poses sent to the PC are located against this space instead of xr::spaces::world
// directly, so the configured player height offset applies uniformly to the head, hands
// and body. It shares xr::spaces::world's STAGE origin, translated by -offset: locating a
// pose in it therefore reports that pose offset up by +offset, i.e. increases perceived
// height.
auto make_height_offset_space = [&](float offset) {
return session.create_reference_space(XR_REFERENCE_SPACE_TYPE_STAGE, {{0, 0, 0, 1}, {0, -offset, 0}});
};
float applied_height_offset = config.get_height_offset();
xr::space height_offset_space = make_height_offset_space(applied_height_offset);
XrSpace world_space = application::space(xr::spaces::world);
auto locate_eye_gaze = [&](XrTime time) {
// Eye gaze uses view pose as the origin.
if (application::get_hmd_traits().view_locate)
return locate_space(device_id::EYE_GAZE, spaces[device_id::EYE_GAZE], view_space, time);
// Pico headsets fail to locate gaze relative to view.
return make_eye_gaze_view_relative(
locate_space(device_id::EYE_GAZE, spaces[device_id::EYE_GAZE], world_space, time),
locate_space(device_id::EYE_GAZE, view_space, world_space, time));
};
XrTime t0 = instance.now();
from_headset::tracking tracking;
std::vector<from_headset::hand_tracking> hands;
std::vector<std::variant<from_headset::meta_body, from_headset::bd_body, from_headset::htc_body>> body;
@@ -352,7 +291,7 @@ void scenes::stream::tracking()
const bool body_tracking = config.check_feature(feature::body_tracking);
xr::body_tracker body_tracker;
locate_spaces_functor locate_spaces{instance, height_offset_space};
locate_spaces_functor locate_spaces{instance, world_space};
on_interaction_profile_changed({});
@@ -366,13 +305,6 @@ void scenes::stream::tracking()
{
try
{
if (float offset = config.get_height_offset(); offset != applied_height_offset)
{
applied_height_offset = offset;
height_offset_space = make_height_offset_space(applied_height_offset);
locate_spaces = locate_spaces_functor{instance, height_offset_space};
}
if (pattern_position == pattern.size())
{
// Upper limit to 200FPS
@@ -396,14 +328,10 @@ void scenes::stream::tracking()
if (hand_tracking)
{
std::array data_sources = {
XR_HAND_TRACKING_DATA_SOURCE_UNOBSTRUCTED_EXT,
XR_HAND_TRACKING_DATA_SOURCE_CONTROLLER_EXT,
};
if (std::ranges::contains(pattern, device_id::LEFT_HAND, &to_headset::tracking_control::sample::device))
{
if (not left_hand)
left_hand = session.create_hand_tracker(XR_HAND_LEFT_EXT, data_sources);
left_hand = session.create_hand_tracker(XR_HAND_LEFT_EXT);
}
else
left_hand.reset();
@@ -411,7 +339,7 @@ void scenes::stream::tracking()
if (std::ranges::contains(pattern, device_id::RIGHT_HAND, &to_headset::tracking_control::sample::device))
{
if (not right_hand)
right_hand = session.create_hand_tracker(XR_HAND_RIGHT_EXT, data_sources);
right_hand = session.create_hand_tracker(XR_HAND_RIGHT_EXT);
}
else
right_hand.reset();
@@ -470,19 +398,11 @@ void scenes::stream::tracking()
if (auto htc = std::get_if<xr::htc_body_tracker>(&body_tracker))
htc->update_active();
const bool emulating_gamepad = using_frame_gamepad();
tracking.interaction_profiles = {
interaction_profiles[0].load(),
interaction_profiles[1].load(),
interaction_profiles[2].load(),
};
if (emulating_gamepad)
{
// The server must see only a gamepad, no VR controllers
tracking.interaction_profiles[0] = interaction_profile::none;
tracking.interaction_profiles[1] = interaction_profile::none;
tracking.interaction_profiles[2] = interaction_profile::microsoft_xbox_controller;
}
tracking.production_timestamp = t0;
tracking.timestamp = t0 + pattern[pattern_position].prediction_ns;
@@ -516,7 +436,6 @@ void scenes::stream::tracking()
j.pose = i.pose;
j.fov = i.fov;
}
locate_spaces.add_space(item.device, view_space, tracking.timestamp, tracking.device_poses);
break;
case wivrn::device_id::LEFT_GRIP:
@@ -529,12 +448,36 @@ void scenes::stream::tracking()
case wivrn::device_id::LEFT_POKE:
case wivrn::device_id::RIGHT_PINCH_POSE:
case wivrn::device_id::RIGHT_POKE:
if (not emulating_gamepad)
locate_spaces.add_space(item.device, spaces[item.device], tracking.timestamp, tracking.device_poses);
locate_spaces.add_space(item.device, spaces[item.device], tracking.timestamp, tracking.device_poses);
break;
case wivrn::device_id::EYE_GAZE:
if (eye_gaze_enabled)
tracking.device_poses.push_back(locate_eye_gaze(tracking.timestamp));
// Eye gaze uses view pose as the origin
if (application::get_hmd_traits().view_locate)
tracking.device_poses.push_back(locate_space(item.device, spaces[item.device], spaces[wivrn::device_id::HEAD], tracking.timestamp));
else
{
// Pico headsets fail to locate gaze relative to view
auto gaze = locate_space(item.device, spaces[item.device], world_space, tracking.timestamp);
auto view_pose = locate_space(item.device, view_space, world_space, tracking.timestamp);
glm::quat gaze_quat(gaze.pose.orientation.w, gaze.pose.orientation.x, gaze.pose.orientation.y, gaze.pose.orientation.z);
glm::quat view_quat(view_pose.pose.orientation.w, view_pose.pose.orientation.x, view_pose.pose.orientation.y, view_pose.pose.orientation.z);
gaze_quat = glm::conjugate(view_quat) * gaze_quat;
using flags = from_headset::pose_flags;
tracking.device_poses.push_back(
from_headset::tracking::pose{
// Zero position and velocities
.pose = {
.orientation = {
.x = gaze_quat.x,
.y = gaze_quat.y,
.z = gaze_quat.z,
.w = gaze_quat.w,
},
},
.device = item.device,
.flags = uint8_t(gaze.flags & view_pose.flags & ~(flags::linear_velocity_valid | flags::angular_velocity_valid)),
});
}
break;
case wivrn::device_id::FACE:
std::visit(utils::overloaded{
@@ -548,24 +491,28 @@ void scenes::stream::tracking()
case wivrn::device_id::LEFT_HAND:
if (left_hand)
{
auto hand = locate_hands(*left_hand, height_offset_space, t0, at_time);
if (not emulating_gamepad or hand.hand != from_headset::hand_tracking::hand_id::left_controller)
hands.emplace_back(std::move(hand));
hands.emplace_back(
t0,
at_time,
from_headset::hand_tracking::left,
locate_hands(*left_hand, world_space, tracking.timestamp));
}
break;
case wivrn::device_id::RIGHT_HAND:
if (right_hand)
{
auto hand = locate_hands(*right_hand, height_offset_space, t0, at_time);
if (not emulating_gamepad or hand.hand != from_headset::hand_tracking::hand_id::right_controller)
hands.emplace_back(std::move(hand));
hands.emplace_back(
t0,
at_time,
from_headset::hand_tracking::right,
locate_hands(*right_hand, world_space, tracking.timestamp));
}
break;
case wivrn::device_id::BODY:
std::visit(utils::overloaded{
[](std::monostate &) {},
[&](auto & b) {
auto packet = b.locate_spaces(at_time, height_offset_space);
auto packet = b.locate_spaces(at_time, world_space);
packet.timestamp = at_time;
packet.production_timestamp = tracking.production_timestamp;
body.push_back(packet);
@@ -586,6 +533,21 @@ void scenes::stream::tracking()
throw;
}
#ifdef __ANDROID__
// FIXME: switch to event based
if (next_battery_check < now)
{
auto status = get_battery_status();
network_session->send_stream(from_headset::battery{
.charge = status.charge.value_or(-1),
.present = status.charge.has_value(),
.charging = status.charging,
});
next_battery_check = now + battery_check_interval;
}
#endif
if (auto fb = std::get_if<xr::fb_body_tracker>(&body_tracker); fb and fb->should_send_skeleton())
{
try
@@ -629,7 +591,7 @@ void scenes::stream::tracking()
network_session->send_stream(std::span(packets.data(), packet_count));
XrTime old = scheduled_derived_pose;
if (old and now > old and not emulating_gamepad)
if (old and now > old)
{
send_derived_pose();
scheduled_derived_pose.compare_exchange_strong(old, 0);
@@ -714,7 +676,6 @@ void scenes::stream::on_interaction_profile_changed(const XrEventDataInteraction
DO_PROFILE(yvr, touch_controller_yvr)
DO_PROFILE(samsung, odyssey_controller)
DO_PROFILE(valve, index_controller)
DO_PROFILE(valve, frame_controller_valve)
// FIXME: remove once support for pre-1.1 profiles is dropped
if (profile == "/interaction_profiles/facebook/touch_controller_pro")
-123
View File
@@ -1,123 +0,0 @@
/*
* WiVRn VR streaming
* Copyright (C) 2023 Guillaume Meunier <guillaume.meunier@centraliens.net>
* Copyright (C) 2023 Patrick Nicolas <patricknicolas@laposte.net>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "utils/strings.h"
#include <cstdint>
#include <cstring>
#include <optional>
#include <spdlog/spdlog.h>
#include <stdexcept>
#include <string>
#include <string_view>
#include <unordered_map>
#include <unordered_set>
#ifdef __ANDROID__
#include "android/property.h"
#endif
template <typename T>
std::optional<T> env(std::string_view name);
template <>
inline std::optional<std::string> env(std::string_view name)
{
#ifdef __ANDROID__
auto android_sysprop_name = std::format("debug.wivrn.{}", name);
return get_property(android_sysprop_name.c_str());
#else
std::string env_name = "WIVRN_";
env_name.reserve(env_name.size() + name.size());
for (const auto & c: name)
env_name += std::toupper(c);
const char * value = std::getenv(env_name.c_str());
if (value)
return value;
return std::nullopt;
#endif
}
template <>
inline std::optional<uint32_t> env(std::string_view name)
{
const auto value = env<std::string>(name);
if (not value)
return std::nullopt;
try
{
const unsigned long parsed = std::stoul(*value);
if (parsed > std::numeric_limits<uint32_t>::max())
return std::nullopt;
return static_cast<uint32_t>(parsed);
}
catch (std::runtime_error & e)
{
spdlog::warn("failed to parse {} (value: {}: {}", name, *value, e.what());
return std::nullopt;
}
}
template <>
inline std::optional<bool> env(std::string_view name)
{
const auto value = env<std::string>(name);
if (not value)
return std::nullopt;
if (strcmp(value->c_str(), "1") == 0 || strcasecmp(value->c_str(), "true") == 0 || strcasecmp(value->c_str(), "yes") == 0 || strcasecmp(value->c_str(), "on") == 0)
return true;
if (strcmp(value->c_str(), "0") == 0 || strcasecmp(value->c_str(), "false") == 0 || strcasecmp(value->c_str(), "no") == 0 || strcasecmp(value->c_str(), "off") == 0)
return false;
return std::nullopt;
}
template <>
inline std::optional<std::unordered_map<std::string, std::string>> env(std::string_view name)
{
const auto values = env<std::string>(name);
if (not values)
return std::nullopt;
std::unordered_map<std::string, std::string> map;
for (auto value: utils::split(*values, ","))
{
if (auto pos = value.find('='); pos != std::string::npos)
map.insert(std::make_pair(value.substr(0, pos), value.substr(pos + 1)));
}
return map;
}
template <>
inline std::optional<std::unordered_set<std::string>> env(std::string_view name)
{
const auto values = env<std::string>(name);
if (not values)
return std::nullopt;
#if defined(__cpp_lib_containers_ranges) && __cpp_lib_containers_ranges >= 202202L
return std::unordered_set<std::string>{std::from_range, utils::split(*values, ",")};
#else
std::optional<std::unordered_set<std::string>> res{std::in_place};
for (auto & val: utils::split(*values))
res->insert(std::move(val));
return res;
#endif
}
+8
View File
@@ -72,6 +72,14 @@ std::shared_ptr<shader> shader_loader::operator()(std::span<const uint32_t> spir
for (SpvReflectSpecializationConstant * variable: enumerate<SpvReflectSpecializationConstant>(spvReflectEnumerateSpecializationConstants, reflect))
specialization_constants.emplace_back(variable->constant_id, variable->name);
for (SpvReflectDescriptorSet * variable: enumerate<SpvReflectDescriptorSet>(spvReflectEnumerateDescriptorSets, reflect))
{
}
for (SpvReflectDescriptorBinding * variable: enumerate<SpvReflectDescriptorBinding>(spvReflectEnumerateDescriptorBindings, reflect))
{
}
spvReflectDestroyShaderModule(&reflect);
}
else
+16 -56
View File
@@ -26,41 +26,21 @@
#include <cassert>
#include <spdlog/spdlog.h>
xr::hand_tracker::hand_tracker(instance & inst, session & session, const XrHandTrackerCreateInfoEXT & info, std::span<XrHandTrackingDataSourceEXT> sources) :
handle(inst.get_proc<PFN_xrDestroyHandTrackerEXT>("xrDestroyHandTrackerEXT")),
hand_{info.hand}
xr::hand_tracker::hand_tracker(instance & inst, session & session, const XrHandTrackerCreateInfoEXT & info) :
handle(inst.get_proc<PFN_xrDestroyHandTrackerEXT>("xrDestroyHandTrackerEXT"))
{
auto xrCreateHandTrackerEXT = inst.get_proc<PFN_xrCreateHandTrackerEXT>("xrCreateHandTrackerEXT");
assert(xrCreateHandTrackerEXT);
xrLocateHandJointsEXT = inst.get_proc<PFN_xrLocateHandJointsEXT>("xrLocateHandJointsEXT");
if (inst.has_extension(XR_FB_HAND_TRACKING_MESH_EXTENSION_NAME))
xrGetHandMeshFB = inst.get_proc<PFN_xrGetHandMeshFB>("xrGetHandMeshFB");
if (not sources.empty() and inst.has_extension(XR_EXT_HAND_TRACKING_DATA_SOURCE_EXTENSION_NAME))
{
use_data_source = true;
XrHandTrackingDataSourceInfoEXT data_source_info{
.type = XR_TYPE_HAND_TRACKING_DATA_SOURCE_INFO_EXT,
.next = info.next,
.requestedDataSourceCount = static_cast<uint32_t>(sources.size()),
.requestedDataSources = sources.data(),
};
auto create_info = info;
create_info.next = &data_source_info;
CHECK_XR(xrCreateHandTrackerEXT(session, &create_info, &id));
}
else
{
CHECK_XR(xrCreateHandTrackerEXT(session, &info, &id));
}
CHECK_XR(xrCreateHandTrackerEXT(session, &info, &id));
}
xr::hand_tracker::located_hand xr::hand_tracker::locate(XrSpace space, XrTime time)
std::optional<std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT>> xr::hand_tracker::locate(XrSpace space, XrTime time)
{
if (!id || !xrLocateHandJointsEXT)
return {};
return std::nullopt;
XrHandJointsLocateInfoEXT info{
.type = XR_TYPE_HAND_JOINTS_LOCATE_INFO_EXT,
@@ -87,49 +67,29 @@ xr::hand_tracker::located_hand xr::hand_tracker::locate(XrSpace space, XrTime ti
.jointVelocities = joints_vel.data(),
};
XrHandTrackingDataSourceStateEXT data_source_state{
.type = XR_TYPE_HAND_TRACKING_DATA_SOURCE_STATE_EXT,
.next = &velocities,
};
XrHandJointLocationsEXT locations{
.type = XR_TYPE_HAND_JOINT_LOCATIONS_EXT,
.next = &velocities,
.jointCount = joints_pos.size(),
.jointLocations = joints_pos.data(),
};
if (use_data_source)
locations.next = &data_source_state;
CHECK_XR(xrLocateHandJointsEXT(id, &info, &locations));
located_hand res{};
if (!locations.isActive)
return std::nullopt;
if (locations.isActive)
// bail if any of the joint is invalid
if (std::ranges::any_of(joints_pos, [](const auto & loc) { return loc.locationFlags == 0; }))
return std::nullopt;
std::array<xr::hand_tracker::joint, XR_HAND_JOINT_COUNT_EXT> joints;
for (int i = 0; i < XR_HAND_JOINT_COUNT_EXT; i++)
{
res.joints.emplace();
auto & joints = *res.joints;
for (int i = 0; i < XR_HAND_JOINT_COUNT_EXT; i++)
{
if (joints_pos[i].locationFlags == 0)
{
// bail if any of the joint is invalid
res.joints.reset();
break;
}
joints[i] = {joints_pos[i], joints_vel[i]};
}
joints[i] = {joints_pos[i], joints_vel[i]};
}
if (use_data_source)
{
res.data_source = data_source_state.dataSource;
if (not data_source_state.isActive)
// returned joints are not valid
res.joints.reset();
}
return res;
return joints;
}
const xr::hand_tracker::mesh_data * xr::hand_tracker::mesh()
@@ -247,7 +207,7 @@ const xr::hand_tracker::mesh_data * xr::hand_tracker::mesh()
return &*cached_hand_mesh_fb;
}
bool xr::hand_tracker::check_flags(const joint_array & joints, XrSpaceLocationFlags position, XrSpaceVelocityFlags velocity)
bool xr::hand_tracker::check_flags(const std::array<joint, XR_HAND_JOINT_COUNT_EXT> & joints, XrSpaceLocationFlags position, XrSpaceVelocityFlags velocity)
{
return std::ranges::all_of(joints, [position, velocity](const auto & joint) {
return (joint.first.locationFlags & position) == position and (joint.second.velocityFlags & velocity) == velocity;
+3 -19
View File
@@ -22,8 +22,6 @@
#include "utils/handle.h"
#include <array>
#include <optional>
#include <span>
#include <utility>
#include <vector>
#include <openxr/openxr.h>
@@ -36,13 +34,6 @@ class hand_tracker : public utils::handle<XrHandTrackerEXT>
{
public:
using joint = std::pair<XrHandJointLocationEXT, XrHandJointVelocityEXT>;
using joint_array = std::array<joint, XR_HAND_JOINT_COUNT_EXT>;
struct located_hand
{
std::optional<joint_array> joints;
std::optional<XrHandTrackingDataSourceEXT> data_source;
};
struct mesh_data
{
@@ -60,22 +51,15 @@ public:
private:
PFN_xrLocateHandJointsEXT xrLocateHandJointsEXT{};
PFN_xrGetHandMeshFB xrGetHandMeshFB{};
bool use_data_source = false;
std::optional<mesh_data> cached_hand_mesh_fb;
bool hand_mesh_fb_fetched = false;
XrHandEXT hand_;
public:
hand_tracker(instance & inst, session & session, const XrHandTrackerCreateInfoEXT & info, std::span<XrHandTrackingDataSourceEXT> sources = {});
hand_tracker(instance & inst, session & session, const XrHandTrackerCreateInfoEXT & info);
located_hand locate(XrSpace space, XrTime time);
std::optional<std::array<joint, XR_HAND_JOINT_COUNT_EXT>> locate(XrSpace space, XrTime time);
const mesh_data * mesh();
static bool check_flags(const joint_array & joints, XrSpaceLocationFlags position, XrSpaceVelocityFlags velocity);
XrHandEXT hand() const
{
return hand_;
}
static bool check_flags(const std::array<joint, XR_HAND_JOINT_COUNT_EXT> & joints, XrSpaceLocationFlags position, XrSpaceVelocityFlags velocity);
};
} // namespace xr
-1
View File
@@ -45,7 +45,6 @@ union event
XrEventDataPassthroughStateChangedFB passthrough_state_changed;
XrEventDataVisibilityMaskChangedKHR visibility_mask_changed;
XrEventDataUserPresenceChangedEXT user_presence_changed;
XrEventDataBoundaryVisibilityChangedMETA boundary_visibility_changed;
};
class instance : public utils::handle<XrInstance, xrDestroyInstance>
{
+4 -49
View File
@@ -60,9 +60,6 @@ xr::session::session(xr::instance & inst, xr::system & sys, vk::raii::Instance &
if (inst.has_extension(XR_EXT_PERFORMANCE_SETTINGS_EXTENSION_NAME))
xrPerfSettingsSetPerformanceLevelEXT = inst.get_proc<PFN_xrPerfSettingsSetPerformanceLevelEXT>("xrPerfSettingsSetPerformanceLevelEXT");
if (inst.has_extension(XR_META_BOUNDARY_VISIBILITY_EXTENSION_NAME) and sys.boundary_visibility_properties().supportsBoundaryVisibility)
xrRequestBoundaryVisibilityMETA = inst.get_proc<PFN_xrRequestBoundaryVisibilityMETA>("xrRequestBoundaryVisibilityMETA");
}
std::vector<XrReferenceSpaceType> xr::session::get_reference_spaces() const
@@ -99,7 +96,7 @@ xr::space xr::session::create_action_space(XrAction action, const XrPosef & pose
return s;
}
xr::hand_tracker xr::session::create_hand_tracker(XrHandEXT hand, std::span<XrHandTrackingDataSourceEXT> sources, XrHandJointSetEXT hand_joint_set)
xr::hand_tracker xr::session::create_hand_tracker(XrHandEXT hand, XrHandJointSetEXT hand_joint_set)
{
return {
*inst,
@@ -109,9 +106,7 @@ xr::hand_tracker xr::session::create_hand_tracker(XrHandEXT hand, std::span<XrHa
.next = nullptr,
.hand = hand,
.handJointSet = hand_joint_set,
},
sources,
};
}};
}
std::vector<vk::Format> xr::session::get_swapchain_formats() const
@@ -163,12 +158,8 @@ void xr::session::end_frame(XrTime display_time, const std::vector<XrComposition
.layers = layers.data(),
};
{
auto lock = queue->lock();
CHECK_XR(xrEndFrame(id, &end_info));
}
update_boundary_visibility();
auto lock = queue->lock();
CHECK_XR(xrEndFrame(id, &end_info));
}
void xr::session::begin_session(XrViewConfigurationType view_config)
@@ -387,42 +378,6 @@ void xr::session::disable_passthrough()
passthrough.emplace<std::monostate>();
}
void xr::session::set_passthrough_boundary_enabled(bool enabled)
{
passthrough_boundary_enabled = enabled;
boundary_request_failed = false;
}
void xr::session::on_boundary_visibility_changed(XrBoundaryVisibilityMETA v)
{
runtime_boundary_visibility = v;
}
// the runtime only allows suppression while passthrough is shown and restores
// the boundary when it stops, so this re-requests every time passthrough comes back
void xr::session::update_boundary_visibility()
{
if (not xrRequestBoundaryVisibilityMETA)
return;
auto v = not passthrough_boundary_enabled and not std::holds_alternative<std::monostate>(passthrough)
? XR_BOUNDARY_VISIBILITY_SUPPRESSED_META
: XR_BOUNDARY_VISIBILITY_NOT_SUPPRESSED_META;
if (v == runtime_boundary_visibility)
return;
if (auto res = xrRequestBoundaryVisibilityMETA(id, v); res == XR_SUCCESS)
{
runtime_boundary_visibility = v;
boundary_request_failed = false;
}
else if (not boundary_request_failed)
{
spdlog::warn("Boundary visibility change failed: {}", xr::to_string(res));
boundary_request_failed = true;
}
}
void xr::session::set_performance_level(XrPerfSettingsDomainEXT domain, XrPerfSettingsLevelEXT level)
{
if (xrPerfSettingsSetPerformanceLevelEXT)
+1 -15
View File
@@ -48,13 +48,6 @@ class session : public utils::handle<XrSession, xrDestroySession>
PFN_xrPerfSettingsSetPerformanceLevelEXT xrPerfSettingsSetPerformanceLevelEXT = nullptr;
PFN_xrRequestBoundaryVisibilityMETA xrRequestBoundaryVisibilityMETA = nullptr;
XrBoundaryVisibilityMETA runtime_boundary_visibility = XR_BOUNDARY_VISIBILITY_NOT_SUPPRESSED_META;
bool passthrough_boundary_enabled = true;
bool boundary_request_failed = false;
void update_boundary_visibility();
public:
session() = default;
session(instance &, system &, vk::raii::Instance &, vk::raii::PhysicalDevice &, vk::raii::Device &, thread_safe<vk::raii::Queue> & queue, int queue_family_index);
@@ -62,7 +55,7 @@ public:
std::vector<XrReferenceSpaceType> get_reference_spaces() const;
space create_reference_space(XrReferenceSpaceType ref, const XrPosef & pose = {{0, 0, 0, 1}, {0, 0, 0}});
space create_action_space(XrAction action, const XrPosef & pose = {{0, 0, 0, 1}, {0, 0, 0}});
hand_tracker create_hand_tracker(XrHandEXT hand, std::span<XrHandTrackingDataSourceEXT> sources = {}, XrHandJointSetEXT hand_joint_set = XR_HAND_JOINT_SET_DEFAULT_EXT);
hand_tracker create_hand_tracker(XrHandEXT hand, XrHandJointSetEXT hand_joint_set = XR_HAND_JOINT_SET_DEFAULT_EXT);
std::vector<vk::Format> get_swapchain_formats() const;
@@ -106,12 +99,5 @@ public:
}
void set_performance_level(XrPerfSettingsDomainEXT, XrPerfSettingsLevelEXT);
bool boundary_visibility_supported() const
{
return xrRequestBoundaryVisibilityMETA;
}
void set_passthrough_boundary_enabled(bool);
void on_boundary_visibility_changed(XrBoundaryVisibilityMETA);
};
} // namespace xr
+5 -48
View File
@@ -21,7 +21,6 @@
#include "application.h"
#include "details/enumerate.h"
#include "session.h"
#include <spdlog/spdlog.h>
xr::swapchain::swapchain(
xr::instance & inst,
@@ -31,9 +30,7 @@ xr::swapchain::swapchain(
int32_t width,
int32_t height,
int sample_count,
uint32_t array_size,
bool foveation,
bool transfer_dst) :
uint32_t array_size) :
width_(width),
height_(height),
sample_count_(sample_count),
@@ -58,24 +55,8 @@ xr::swapchain::swapchain(
break;
}
if (transfer_dst)
usage_flags |= XR_SWAPCHAIN_USAGE_TRANSFER_DST_BIT;
XrVulkanSwapchainCreateInfoMETA vulkan_create_info{
.type = XR_TYPE_VULKAN_SWAPCHAIN_CREATE_INFO_META,
.additionalCreateFlags = VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_QCOM,
.additionalUsageFlags = 0,
};
XrSwapchainCreateInfoFoveationFB foveation_create_info{
.type = XR_TYPE_SWAPCHAIN_CREATE_INFO_FOVEATION_FB,
.next = &vulkan_create_info,
.flags = XR_SWAPCHAIN_CREATE_FOVEATION_FRAGMENT_DENSITY_MAP_BIT_FB,
};
XrSwapchainCreateInfo create_info{
.type = XR_TYPE_SWAPCHAIN_CREATE_INFO,
.next = foveation ? &foveation_create_info : nullptr,
.createFlags = 0,
.usageFlags = usage_flags,
.format = static_cast<VkFormat>(format),
@@ -89,35 +70,11 @@ xr::swapchain::swapchain(
CHECK_XR(xrCreateSwapchain(s, &create_info, &id));
if (foveation)
{
auto [images, foveation_images] =
details::enumerate2<XrSwapchainImageVulkanKHR, XrSwapchainImageFoveationVulkanFB>(
xrEnumerateSwapchainImages, id);
auto images = details::enumerate<XrSwapchainImageVulkanKHR>(xrEnumerateSwapchainImages, id);
images_.reserve(images.size());
for (auto & image: images)
images_.push_back(image.image);
spdlog::debug("XR_FB_foveation: enumerated {} color images and {} FDM images", images.size(), foveation_images.size());
for (size_t i = 0; i < foveation_images.size(); ++i)
{
const auto & fdm = foveation_images[i];
spdlog::debug(
" {}. FDM image @ {}x{}",
i,
fdm.width,
fdm.height);
}
}
else
{
auto images = details::enumerate<XrSwapchainImageVulkanKHR>(xrEnumerateSwapchainImages, id);
images_.reserve(images.size());
for (auto & image: images)
images_.push_back(image.image);
}
images_.reserve(images.size());
for (auto & image: images)
images_.push_back(image.image);
}
int xr::swapchain::acquire()
+1 -3
View File
@@ -53,9 +53,7 @@ public:
int32_t width,
int32_t height,
int sample_count = 1,
uint32_t array_size = 1,
bool foveation = false,
bool transfer_dst = false);
uint32_t array_size = 1);
int32_t width() const
{
-40
View File
@@ -53,10 +53,6 @@ xr::system::system(xr::instance & inst, XrFormFactor formfactor)
body_tracker = xr::body_tracker_supported(inst, *this);
face_tracker = xr::face_tracker_supported(inst, *this);
auto views = view_configuration_views(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO);
assert(views.size() == 2);
stereo_view_ = views[0];
}
XrGraphicsRequirementsVulkan2KHR xr::system::graphics_requirements() const
@@ -121,24 +117,6 @@ XrSystemEyeGazeInteractionPropertiesEXT xr::system::eye_gaze_interaction_propert
return eye_gaze_prop;
}
XrSystemFoveationEyeTrackedPropertiesMETA xr::system::foveation_eye_tracked_properties() const
{
if (!id)
throw std::invalid_argument("this");
XrSystemFoveationEyeTrackedPropertiesMETA foveation_prop{
.type = XR_TYPE_SYSTEM_FOVEATION_EYE_TRACKED_PROPERTIES_META,
};
XrSystemProperties prop{
.type = XR_TYPE_SYSTEM_PROPERTIES,
.next = &foveation_prop,
};
CHECK_XR(xrGetSystemProperties(*inst, id, &prop));
return foveation_prop;
}
XrSystemUserPresencePropertiesEXT xr::system::user_presence_properties() const
{
if (!id)
@@ -264,24 +242,6 @@ XrSystemBodyTrackingPropertiesBD xr::system::bd_body_tracking_properties() const
return body_tracking_prop;
}
XrSystemBoundaryVisibilityPropertiesMETA xr::system::boundary_visibility_properties() const
{
if (!id)
throw std::invalid_argument("this");
XrSystemBoundaryVisibilityPropertiesMETA boundary_prop{
.type = XR_TYPE_SYSTEM_BOUNDARY_VISIBILITY_PROPERTIES_META,
};
XrSystemProperties prop{
.type = XR_TYPE_SYSTEM_PROPERTIES,
.next = &boundary_prop,
};
CHECK_XR(xrGetSystemProperties(*inst, id, &prop));
return boundary_prop;
}
xr::passthrough_type xr::system::passthrough_supported() const
{
if (utils::contains(environment_blend_modes(XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO), XR_ENVIRONMENT_BLEND_MODE_ALPHA_BLEND))
-7
View File
@@ -66,7 +66,6 @@ class system
passthrough_type passthrough;
body_tracker_type body_tracker;
face_tracker_type face_tracker;
XrViewConfigurationView stereo_view_;
public:
system() = default;
@@ -86,7 +85,6 @@ public:
XrSystemProperties properties() const;
XrSystemHandTrackingPropertiesEXT hand_tracking_properties() const;
XrSystemEyeGazeInteractionPropertiesEXT eye_gaze_interaction_properties() const;
XrSystemFoveationEyeTrackedPropertiesMETA foveation_eye_tracked_properties() const;
XrSystemUserPresencePropertiesEXT user_presence_properties() const;
XrSystemFaceTrackingPropertiesANDROID android_face_tracking_properties() const;
XrSystemFaceTrackingProperties2FB fb_face_tracking2_properties() const;
@@ -94,7 +92,6 @@ public:
XrSystemBodyTrackingPropertiesFB fb_body_tracking_properties() const;
XrSystemPropertiesBodyTrackingFullBodyMETA meta_body_tracking_properties() const;
XrSystemBodyTrackingPropertiesBD bd_body_tracking_properties() const;
XrSystemBoundaryVisibilityPropertiesMETA boundary_visibility_properties() const;
bool hand_tracking_supported() const;
bool hand_mesh_fb_supported() const;
@@ -107,10 +104,6 @@ public:
vk::raii::Device create_device(vk::raii::PhysicalDevice & pdev, vk::DeviceCreateInfo & create_info) const;
std::vector<XrViewConfigurationType> view_configurations() const;
const XrViewConfigurationView & stereo_view() const
{
return stereo_view_;
}
XrViewConfigurationProperties view_configuration_properties(XrViewConfigurationType) const;
std::vector<XrViewConfigurationView> view_configuration_views(XrViewConfigurationType) const;
std::vector<XrEnvironmentBlendMode> environment_blend_modes(XrViewConfigurationType) const;
+5 -3
View File
@@ -8,7 +8,7 @@ if (NOT (GIT_TAG OR GIT_DESC OR GIT_COMMIT))
OUTPUT_VARIABLE GIT_TAG
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET
)
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
endif()
if (GIT_TAG)
@@ -23,7 +23,8 @@ else()
COMMAND ${GIT_EXECUTABLE} describe --tags --always
OUTPUT_VARIABLE GIT_DESC
OUTPUT_STRIP_TRAILING_WHITESPACE
)
ERROR_QUIET
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
message(STATUS "Setting version to ${GIT_DESC} from git")
else()
message(STATUS "Setting version to ${GIT_DESC} from parameters")
@@ -33,7 +34,8 @@ else()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse HEAD
OUTPUT_VARIABLE GIT_COMMIT
)
ERROR_QUIET
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
string(STRIP "${GIT_COMMIT}" GIT_COMMIT)
endif()
-1
View File
@@ -2,7 +2,6 @@ if (WIVRN_USE_SYSTEM_BOOST)
add_library(Boost::pfr ALIAS Boost::headers)
else()
set(BOOST_INCLUDE_LIBRARIES locale url pfr iostreams)
set(BOOST_LOCALE_ENABLE_ICU OFF)
FetchContent_MakeAvailable(boost)
endif()
+1 -1
View File
@@ -237,7 +237,7 @@ std::unordered_map<std::string, application> list_applications()
application{
.name = std::move(app.name),
.exec = cmd + app.url,
.icon_path = std::move(app.icon),
.icon_path = steam.get_icon(app.appid),
});
}
}
+1 -1
View File
@@ -507,10 +507,10 @@ void decrypt_context::decrypt_in_place(std::span<std::span<uint8_t>> text)
std::vector<uint8_t> pbkdf2(std::string pass, std::string salt, std::span<uint8_t> secret, size_t size)
{
pass.append((char *)secret.data(), secret.size());
std::array params{
OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SALT, salt.data(), salt.size()),
OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_PASSWORD, pass.data(), pass.size()),
OSSL_PARAM_construct_octet_string(OSSL_KDF_PARAM_SECRET, secret.data(), secret.size()),
OSSL_PARAM_construct_end(),
};
+136 -273
View File
@@ -27,7 +27,6 @@
#include <fstream>
#include <iostream>
#include <nlohmann/json.hpp>
#include <unordered_set>
namespace
{
@@ -65,7 +64,6 @@ public:
}
std::vector<std::string> string_table();
std::vector<std::string> string_table(uint32_t count);
auto tellg()
{
@@ -102,15 +100,6 @@ std::vector<std::string> binary_reader::string_table()
return res;
}
std::vector<std::string> binary_reader::string_table(uint32_t count)
{
std::vector<std::string> res;
res.reserve(count);
for (size_t i = 0; i < count; ++i)
res.emplace_back(read<std::string>());
return res;
}
template <typename T>
void read_dict(binary_reader & in, T & visitor, const std::vector<std::string> * string_table = nullptr)
{
@@ -185,155 +174,17 @@ std::optional<uint32_t> guess_steam_userid(const std::filesystem::path & root)
}
}
std::unordered_set<uint64_t> installed_appids(std::filesystem::path root)
} // namespace
void read_steam_icons(std::filesystem::path path, std::unordered_map<uint32_t, wivrn::steam::icon> & icons)
{
std::unordered_set<uint64_t> res;
try
{
wivrn::vdf::root vdf(root / "config/libraryfolders.vdf");
using values_t = std::vector<wivrn::vdf::keyvalue>;
if (vdf.key != "libraryfolders")
return {};
for (const auto & kv: std::get<values_t>(vdf.value))
{
for (const auto & [appid, _]: std::get<values_t>(kv["apps"].value))
{
uint64_t val;
if (std::from_chars(appid.data.begin(), appid.data.end(), val).ec == std::errc())
res.emplace(val);
}
}
}
catch (...)
{}
return res;
}
std::unordered_set<uint64_t> owned_appids(std::filesystem::path localconfig)
{
wivrn::vdf::root localconfig_vdf(localconfig);
using values_t = std::vector<wivrn::vdf::keyvalue>;
if (localconfig_vdf.key != "UserLocalConfigStore")
return {};
std::unordered_set<uint64_t> res;
for (const auto & [k, entries]: std::get<values_t>(localconfig_vdf["Software"]["Valve"]["Steam"]["apps"].value))
{
uint64_t val;
if (std::from_chars(k.data.begin(), k.data.end(), val).ec == std::errc())
res.emplace(val);
}
return res;
}
struct app_data
{
enum section
{
common,
other,
};
std::vector<enum section> section;
wivrn::steam::application current{};
std::string clienticon;
std::string linuxclienticon;
bool VR = false;
void clear()
{
section.clear();
current.icon.clear();
current.name.clear();
current.url.clear();
clienticon.clear();
linuxclienticon.clear();
VR = false;
section.push_back(section::other);
}
void begin_dict(const std::string & key)
{
if (key == "common")
section.push_back(section::common);
else
section.push_back(section::other);
}
void end_dict()
{
section.pop_back();
}
void on_string(const std::string & key, std::string && val)
{
switch (section.back())
{
case common:
if (strcasecmp(key.c_str(), "clienticon") == 0)
clienticon = std::move(val);
else if (strcasecmp(key.c_str(), "linuxclienticon") == 0)
linuxclienticon = std::move(val);
else if (strcasecmp(key.c_str(), "name") == 0)
current.name[""] = std::move(val);
break;
case other:
break;
}
}
void on_uint32_t(const std::string & key, uint32_t val)
{
switch (section.back())
{
case common:
if (key == "openvrsupport")
VR = val;
break;
case other:
break;
}
}
};
bool is_appid_magic(uint32_t magic)
{
return (magic & 0xff'ff'ff'00) == 0x07'56'44'00;
}
void try_parse_application(std::vector<wivrn::steam::application> & out, std::filesystem::path root, uint32_t app_id, binary_reader & in, app_data & v, const std::vector<std::string> * string_table)
{
try
{
v.clear();
read_dict(in, v, string_table);
if (v.VR)
{
auto & item = out.emplace_back(std::move(v.current));
item.appid = app_id;
item.url = std::format("steam://launch/{}/VR", app_id);
if (auto icon_path = root / "steam/games" / (v.clienticon + ".ico"); std::filesystem::exists(icon_path))
item.icon = icon_path;
else if (auto icon_path = root / "steam/games" / (v.linuxclienticon + ".zip"); std::filesystem::exists(icon_path))
item.icon = icon_path;
}
}
catch (...)
{
// Ignore errors
}
}
// TODO: Remove when v42 appinfo is used in stable Steam Client
std::vector<wivrn::steam::application> read_appinfo_pre_v42(std::filesystem::path root, std::unordered_set<uint64_t> const & appids)
{
binary_reader in{std::ifstream{root / "appcache/appinfo.vdf"}};
binary_reader in{std::ifstream{path}};
uint32_t magic = in.read<uint32_t>();
if (!is_appid_magic(magic))
if ((magic & 0xff'ff'ff'00) != 0x07'56'44'00)
throw std::runtime_error{"Wrong magic number"};
in.discard(4); // universe
auto universe = in.read<uint32_t>();
int version = magic & 0xff;
@@ -344,9 +195,28 @@ std::vector<wivrn::steam::application> read_appinfo_pre_v42(std::filesystem::pat
string_table = in.string_table();
string_table_ptr = &string_table;
}
std::vector<wivrn::steam::application> res;
app_data v;
struct V
{
wivrn::steam::icon current{};
void begin_dict(const std::string & key)
{
}
void end_dict()
{
}
void on_string(const std::string & key, std::string && val)
{
if (strcasecmp(key.c_str(), "clienticon") == 0)
current.clienticon = std::move(val);
else if (strcasecmp(key.c_str(), "linuxclienticon") == 0)
current.linuxclienticon = std::move(val);
}
void on_uint32_t(const std::string & key, uint32_t val)
{
}
};
while (true)
{
@@ -367,112 +237,25 @@ std::vector<wivrn::steam::application> read_appinfo_pre_v42(std::filesystem::pat
+ 4 // checksum
+ 1 // type
);
if (appids.contains(app_id))
try
{
try_parse_application(res, root, app_id, in, v, string_table_ptr);
V v;
read_dict(in, v, string_table_ptr);
if (not(v.current.clienticon.empty() and v.current.linuxclienticon.empty()))
icons.emplace(app_id, std::move(v.current));
}
catch (...)
{
// Ignore errors
}
in.seekg(pos + size_data);
}
return res;
}
std::vector<wivrn::steam::application> read_appinfo_v42(std::filesystem::path root, std::unordered_set<uint64_t> const & appids)
{
std::vector<wivrn::steam::application> res;
for (auto const & entry: std::filesystem::directory_iterator(root / "appcache/appinfo"))
{
try
{
if (auto extension = entry.path().extension(); extension != ".vdf")
throw std::runtime_error{"Improper file extension"};
binary_reader in{std::ifstream{entry.path()}};
// https://github.com/xPaw/SteamAppInfo/blob/master/README.md#shard-header
uint32_t magic = in.read<uint32_t>();
if (!is_appid_magic(magic))
throw std::runtime_error{"Wrong magic number"};
int version = magic & 0xff;
if (version < 42)
throw std::runtime_error{std::format("Invalid version {}", version)};
in.discard(4 // universe
+ 4 // shard_index
+ 4 // shard_count
);
auto index_count = in.read<uint32_t>();
auto index_size = in.read<uint32_t>();
auto string_table_count = in.read<uint32_t>();
auto string_table_size = in.read<uint32_t>();
in.discard(4 // data_size
+ 4 // index_crc
+ 4 // header_crc
);
size_t index_data_pos = in.tellg();
size_t string_table_pos = index_data_pos + index_size;
size_t data_pos = string_table_pos + string_table_size;
in.seekg(string_table_pos);
std::vector<std::string> string_table = in.string_table(string_table_count);
// https://github.com/xPaw/SteamAppInfo/blob/master/README.md#index-entry-repeated
in.seekg(index_data_pos);
app_data v;
for (uint32_t i = 0; i < index_count; i++)
{
auto app_id = in.read<uint32_t>();
if (app_id == 0)
break;
auto data_offset = in.read<uint32_t>();
in.discard(4); // data_size
auto remaining = in.read<uint32_t>();
auto next = (size_t)in.tellg() + remaining;
if (appids.contains(app_id))
{
in.seekg(data_pos + data_offset);
in.discard(20); // SHA-1 of the bin data
try_parse_application(res, root, app_id, in, v, &string_table);
}
in.seekg(next);
}
}
catch (std::exception & e)
{
std::cerr << "Failed to read appinfo shard " << entry.path().filename() << ": " << e.what() << std::endl;
}
}
return res;
}
std::vector<wivrn::steam::application> read_appinfo(std::filesystem::path root, std::unordered_set<uint64_t> const & appids)
{
std::error_code ec;
if (std::filesystem::exists(root / "appcache/appinfo.vdf", ec))
{
return read_appinfo_pre_v42(root, appids);
}
else if (std::filesystem::is_directory(root / "appcache/appinfo", ec))
{
return read_appinfo_v42(root, appids);
}
throw std::runtime_error("No appinfos found in appcache");
}
} // namespace
void read_steam_shortcuts(
const std::filesystem::path & path,
std::vector<wivrn::steam::application> & apps)
std::vector<wivrn::steam::application> & apps,
std::unordered_map<uint32_t, std::filesystem::path> & icons)
{
if (not std::filesystem::exists(path))
return;
@@ -487,9 +270,11 @@ void read_steam_shortcuts(
struct V
{
std::vector<wivrn::steam::application> & apps;
std::unordered_map<uint32_t, std::filesystem::path> & icons;
int depth = 0;
wivrn::steam::application current{};
std::filesystem::path icon;
bool VR = false;
void begin_dict(const std::string & key)
@@ -498,6 +283,7 @@ void read_steam_shortcuts(
if (depth == 1)
{
current = decltype(current){};
icon.clear();
VR = false;
}
}
@@ -508,6 +294,8 @@ void read_steam_shortcuts(
{
if (VR)
{
if (not icon.empty())
icons[current.appid] = std::move(icon);
// ¯\_(ツ)_/¯
current.appid = (current.appid << 32) | 0x02000000;
current.url = std::format("steam://rungameid/{}", current.appid);
@@ -522,7 +310,7 @@ void read_steam_shortcuts(
if (strcasecmp(key.c_str(), "AppName") == 0)
current.name[""] = std::move(val);
else if (strcasecmp(key.c_str(), "icon") == 0 and not val.empty())
current.icon = std::move(val);
icon = std::move(val);
}
}
void on_uint32_t(const std::string & key, uint32_t val)
@@ -535,7 +323,7 @@ void read_steam_shortcuts(
VR = val;
}
}
} v{apps};
} v{apps, icons};
read_dict(in, v);
}
@@ -583,21 +371,67 @@ std::vector<wivrn::steam> wivrn::steam::find_installations()
std::vector<wivrn::steam::application> wivrn::steam::list_applications()
{
std::vector<wivrn::steam::application> res;
const auto installed = installed_appids(root);
// Steam games, from VR manifest
try
{
std::ifstream manifest(root / "config/steamapps.vrmanifest");
nlohmann::json json = nlohmann::json::parse(manifest);
for (auto & i: json["applications"])
{
try
{
// Steam games have an url launch
// shortcuts may be in this file, or may not...
if (i["launch_type"] != "url")
continue;
std::string app_key = i["app_key"];
const char prefix[] = "steam.app.";
if (not app_key.starts_with(prefix))
continue;
application app{
.appid = stoul(app_key.substr(strlen(prefix))),
.url = i["url"],
};
for (auto [locale, items]: i["strings"].items())
{
if (auto it = items.find("name"); it != items.end())
app.name[locale] = *it;
}
if (not app.name.contains(""))
{
auto it = app.name.find("en_us");
if (it == app.name.end())
it = app.name.begin();
if (it != app.name.end())
app.name[""] = it->second;
else
continue; // skip unnamed app
}
res.push_back(std::move(app));
}
catch (std::exception & e)
{
std::cerr << "Failed to parse Steam VR manifest: " << e.what() << std::endl;
}
}
}
catch (std::exception & e)
{
}
// Shortcuts
if (default_userid)
{
try
{
auto const & config = root / "userdata" / std::to_string(*default_userid) / "config";
auto ids = owned_appids(config / "localconfig.vdf");
std::erase_if(ids, [&](auto id) { return not installed.contains(id); });
res = read_appinfo(root, ids);
read_steam_shortcuts(config / "shortcuts.vdf", res);
read_steam_shortcuts(root / "userdata" / std::to_string(*default_userid) / "config/shortcuts.vdf", res, shortcut_icons);
}
catch (std::exception & e)
{
std::cerr << "Listing Steam applications failed (user id " << *default_userid << "): " << e.what() << std::endl;
}
}
else
@@ -607,24 +441,53 @@ std::vector<wivrn::steam::application> wivrn::steam::list_applications()
for (auto const & entry: std::filesystem::directory_iterator{root / "userdata", ec})
try
{
auto const & config = entry.path() / "config";
auto ids = owned_appids(config / "localconfig.vdf");
std::erase_if(ids, [&](auto id) { return not installed.contains(id); });
auto tmp = read_appinfo(root, ids);
res.insert(res.end(),
std::make_move_iterator(tmp.begin()),
std::make_move_iterator(tmp.end()));
read_steam_shortcuts(config / "shortcuts.vdf", res);
read_steam_shortcuts(entry.path() / "config/shortcuts.vdf", res, shortcut_icons);
}
catch (std::exception & e)
{
std::cerr << "Listing Steam applications failed (" << entry.path().filename() << "): " << e.what() << std::endl;
}
}
return res;
}
std::optional<std::filesystem::path> wivrn::steam::get_icon(uint64_t appid)
{
if (appid & 0x02000000)
{
// Shortcut
auto it = shortcut_icons.find(appid >> 32);
if (it != shortcut_icons.end())
return it->second;
return {};
}
if (not icons)
{
icons.emplace();
try
{
read_steam_icons(root / "appcache/appinfo.vdf", *icons);
}
catch (...)
{}
}
auto it = icons->find(appid);
if (it == icons->end())
return {};
auto icon_path = root / "steam/games" / (it->second.clienticon + ".ico");
if (std::filesystem::exists(icon_path))
return icon_path;
icon_path = root / "steam/games" / (it->second.linuxclienticon + ".zip");
if (std::filesystem::exists(icon_path))
return icon_path;
return {};
}
std::string wivrn::steam::get_steam_command() const
{
if (flatpak)
+8 -1
View File
@@ -35,13 +35,19 @@ public:
// localised names, with empty locale for default
std::unordered_map<std::string, std::string> name;
std::string url;
std::filesystem::path icon;
};
struct icon
{
std::string clienticon;
std::string linuxclienticon;
};
private:
std::filesystem::path root;
bool flatpak;
std::optional<uint32_t> default_userid;
std::optional<std::unordered_map<uint32_t, icon>> icons;
std::unordered_map<uint32_t, std::filesystem::path> shortcut_icons;
steam(std::filesystem::path root, bool flatpak);
@@ -49,6 +55,7 @@ public:
static std::vector<steam> find_installations();
std::vector<application> list_applications();
std::optional<std::filesystem::path> get_icon(uint64_t app_id);
std::string get_steam_command() const;
};
+5 -23
View File
@@ -19,7 +19,6 @@
#include "vdf.h"
#include <boost/iostreams/device/mapped_file.hpp>
#include <format>
#include <iostream>
namespace
@@ -133,31 +132,14 @@ bool wivrn::vdf::string::operator==(const char * b) const
return *b == '\0';
}
wivrn::vdf::keyvalue const & wivrn::vdf::keyvalue::operator[](const char * key) const
{
for (auto const & kv: std::get<std::vector<keyvalue>>(value))
{
if (kv.key == key)
return kv;
}
throw std::out_of_range{std::format("no key {}", key)};
}
wivrn::vdf::root::root(const std::filesystem::path & file)
{
try
{
boost::iostreams::mapped_file_source in{file};
opaque = in;
boost::iostreams::mapped_file in{file};
opaque = in;
const char * pos = in.begin();
key = read_string(pos, in.end());
value = read_value(pos, in.end());
}
catch (std::exception & e)
{
throw std::runtime_error(std::format("failed to parse {}: {}", file.native(), e.what()));
}
const char * pos = in.begin();
key = read_string(pos, in.end());
value = read_value(pos, in.end());
}
void dump(const wivrn::vdf::keyvalue & kv, int depth)
-2
View File
@@ -40,8 +40,6 @@ struct keyvalue
{
string key;
std::variant<string, std::vector<keyvalue>> value;
keyvalue const & operator[](const char *) const;
};
struct root : public keyvalue
-1
View File
@@ -32,7 +32,6 @@ static const int64_t max_extrapolation_ns = 80'000'000;
#cmakedefine01 WIVRN_USE_VAAPI
#cmakedefine01 WIVRN_USE_VULKAN_ENCODE
#cmakedefine01 WIVRN_USE_X264
#cmakedefine01 WIVRN_USE_V4L2
#cmakedefine01 WIVRN_USE_PIPEWIRE
+25 -60
View File
@@ -40,7 +40,7 @@
namespace wivrn
{
static constexpr int protocol_revision = 2;
static constexpr int protocol_revision = 1;
enum class device_id : uint8_t
{
@@ -61,23 +61,13 @@ enum class device_id : uint8_t
RIGHT_GRIP, // /user/hand/right/input/grip/pose
RIGHT_AIM, // /user/hand/right/input/aim/pose
RIGHT_PALM, // /user/hand/right/palm_ext/pose
DPAD_UP_CLICK, // /user/hand/left/input/dpad_up/click
DPAD_UP_TOUCH, // /user/hand/left/input/dpad_up/touch
DPAD_LEFT_CLICK, // /user/hand/left/input/dpad_left/click
DPAD_LEFT_TOUCH, // /user/hand/left/input/dpad_left/touch
LEFT_X_CLICK, // /user/hand/left/input/x/click or /user/hand/left/input/dpad_down/click
LEFT_X_TOUCH, // /user/hand/left/input/x/touch or /user/hand/left/input/dpad_down/touch
LEFT_Y_CLICK, // /user/hand/left/input/y/click or /user/hand/left/input/dpad_right/click
LEFT_Y_TOUCH, // /user/hand/left/input/y/touch or /user/hand/left/input/dpad_right/touch
LEFT_MENU_CLICK, // /user/hand/left/input/{menu,view}/click
LEFT_MENU_TOUCH, // /user/hand/left/input/{menu,view}/touch
LEFT_SYSTEM_CLICK, // /user/hand/left/input/system/click
LEFT_SYSTEM_TOUCH, // /user/hand/left/input/system/touch
LEFT_BUMPER_CLICK, // /user/hand/left/input/bumper/click
LEFT_BUMPER_TOUCH, // /user/hand/left/input/bumper/touch
X_CLICK, // /user/hand/left/input/x/click
X_TOUCH, // /user/hand/left/input/x/touch
Y_CLICK, // /user/hand/left/input/y/click
Y_TOUCH, // /user/hand/left/input/y/touch
MENU_CLICK, // /user/hand/left/input/menu/click
LEFT_SQUEEZE_CLICK, // /user/hand/left/input/squeeze/click
LEFT_SQUEEZE_FORCE, // /user/hand/left/input/squeeze/force
LEFT_SQUEEZE_TOUCH, // /user/hand/left/input/squeeze/touch
LEFT_SQUEEZE_VALUE, // /user/hand/left/input/squeeze/value
LEFT_TRIGGER_CLICK, // /user/hand/left/input/trigger/click
LEFT_TRIGGER_VALUE, // /user/hand/left/input/trigger/value
@@ -111,19 +101,9 @@ enum class device_id : uint8_t
A_TOUCH, // /user/hand/right/input/a/touch
B_CLICK, // /user/hand/right/input/b/click
B_TOUCH, // /user/hand/right/input/b/touch
RIGHT_X_CLICK, // /user/hand/right/input/x/click
RIGHT_X_TOUCH, // /user/hand/right/input/x/touch
RIGHT_Y_CLICK, // /user/hand/right/input/y/click
RIGHT_Y_TOUCH, // /user/hand/right/input/y/touch
RIGHT_MENU_CLICK, // /user/hand/right/input/menu/click
RIGHT_MENU_TOUCH, // /user/hand/right/input/menu/touch
RIGHT_SYSTEM_CLICK, // /user/hand/right/input/system/click
RIGHT_SYSTEM_TOUCH, // /user/hand/right/input/system/touch
RIGHT_BUMPER_CLICK, // /user/hand/right/input/bumper/click
RIGHT_BUMPER_TOUCH, // /user/hand/right/input/bumper/touch
SYSTEM_CLICK, // /user/hand/right/input/system/click
RIGHT_SQUEEZE_CLICK, // /user/hand/right/input/squeeze/click
RIGHT_SQUEEZE_FORCE, // /user/hand/right/input/squeeze/force
RIGHT_SQUEEZE_TOUCH, // /user/hand/right/input/squeeze/touch
RIGHT_SQUEEZE_VALUE, // /user/hand/right/input/squeeze/value
RIGHT_TRIGGER_CLICK, // /user/hand/right/input/trigger/click
RIGHT_TRIGGER_VALUE, // /user/hand/right/input/trigger/value
@@ -154,14 +134,10 @@ enum class device_id : uint8_t
RIGHT_GRASP_VALUE, // /user/hand/right/input/grasp_ext/value
RIGHT_GRASP_READY, // /user/hand/right/input/grasp_ext/ready_ext
EYE_GAZE, // /user/eyes_ext/input/gaze_ext/pose
LEFT_CONTROLLER, // identify controller
RIGHT_CONTROLLER, // identify controller
LEFT_HAND = LEFT_CONTROLLER, // identify hand tracking
RIGHT_HAND = RIGHT_CONTROLLER, // identify hand tracking
BODY, // identify body tracking
FACE, // identify face tracking
GAMEPAD, // identify gamepad
LEFT_HAND, // identify hand tracking
RIGHT_HAND, // identify hand tracking
BODY, // identify body tracking
FACE, // identify face tracking
// Gamepad, microsoft/xbox_controller profile (/user/gamepad)
GAMEPAD_MENU_CLICK, // /user/gamepad/input/menu/click
@@ -214,7 +190,6 @@ enum class interaction_profile : uint8_t
yvr_touch_controller_yvr,
samsung_odyssey_controller,
valve_index_controller,
valve_frame_controller_valve,
};
enum video_codec
@@ -226,14 +201,6 @@ enum video_codec
raw,
};
struct video_codec_capability
{
video_codec codec;
bool supports_10bit;
bool operator==(const video_codec_capability &) const = default;
};
enum class stream_tab : uint8_t
{
hidden,
@@ -350,7 +317,7 @@ struct headset_info_packet
};
std::optional<audio_description> speaker;
std::optional<audio_description> microphone;
bool battery_status; // supports XR_EXT_interaction_profile_battery_state_display, for reporting controller/gamepad battery status
std::array<XrFovf, 2> fov;
bool hand_tracking;
bool eye_gaze;
bool palm_pose;
@@ -360,8 +327,8 @@ struct headset_info_packet
body_type body_tracking;
// htc body only
uint32_t num_generic_trackers;
std::vector<video_codec_capability> supported_codecs; // from preferred to least preferred
std::optional<uint8_t> bit_depth; // explicit preference
std::vector<video_codec> supported_codecs; // from preferred to least preferred
std::optional<uint8_t> bit_depth;
std::string system_name;
// Used for the application list
@@ -404,11 +371,6 @@ inline uint8_t to_pose_flags(XrSpaceLocationFlags location_flags, XrSpaceVelocit
return flags;
}
struct foveation
{
std::array<XrVector2f, 2> angles; // Per-eye x/y view angles in radians
};
struct tracking
{
enum state_flags : uint8_t
@@ -489,10 +451,6 @@ struct hand_tracking
{
left,
right,
// with data_source
left_controller,
right_controller,
};
struct pose
{
@@ -673,8 +631,8 @@ struct feedback
struct battery
{
device_id device;
std::optional<float> charge;
float charge;
bool present;
bool charging;
};
@@ -700,6 +658,13 @@ struct stream_tab_changed
stream_tab tab;
};
struct override_foveation_center
{
bool enabled;
float pitch;
float distance;
};
struct get_application_list
{
std::string language;
@@ -750,13 +715,13 @@ using packets = std::variant<
session_state_changed,
user_presence_changed,
stream_tab_changed,
override_foveation_center,
get_application_list,
start_app,
get_running_applications,
set_active_application,
hid::input,
stop_application,
foveation>;
stop_application>;
} // namespace from_headset
namespace to_headset
@@ -68,17 +68,6 @@
<content_rating type="oars-1.1" />
<releases>
<release version="26.11" date="2026-11-28">
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v26.11</url>
<description>
<ul>
<li>Initial support for Steam Frame</li>
<li>Use vulkan video encode by default on all GPU</li>
<li>Experimental AV1 support for vulkan video encode, only if manually configured</li>
<li>Don't show boundary/guardian by default</li>
</ul>
</description>
</release>
<release version="26.9" date="2026-09-12">
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v26.9</url>
<description>
+3
View File
@@ -56,6 +56,9 @@
<property name="SpeakerSampleRate" type="u" access="read"/>
<property name="MicChannels" type="u" access="read"/>
<property name="MicSampleRate" type="u" access="read"/>
<property name="FieldOfView" type="a(dddd)" access="read">
<annotation name="org.qtproject.QtDBus.QtTypeName" value="QList&lt;field_of_view&gt;"/>
</property>
<property name="HandTracking" type="b" access="read"/>
<property name="EyeGaze" type="b" access="read"/>
<property name="FaceTracking" type="b" access="read"/>
+11 -11
View File
@@ -4,13 +4,13 @@
## Compile
From your checkout directory
From your checkout directory, with automatic detection of encoders
```bash
cmake -B build-server . -GNinja -DWIVRN_BUILD_CLIENT=OFF -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build build-server
```
By default, all encoders are enabled. It is possible to disable them at build time with the following options:
It is possible to disable specific encoders, by adding options
```
-DWIVRN_USE_NVENC=OFF
-DWIVRN_USE_VAAPI=OFF
@@ -18,10 +18,14 @@ By default, all encoders are enabled. It is possible to disable them at build ti
-DWIVRN_USE_X264=OFF
```
wivrnctl is an optional tool enabled by default and the only part that requires libsystemd/libelogind.
It can be disabled with
Force specific audio backends
```
-DWIVRN_USE_WIVRNCTL=OFF
-DWIVRN_USE_PIPEWIRE=ON
```
Systemd service and pretty hostname support
```
-DWIVRN_USE_SYSTEMD=ON
```
Lighthouse driver support for use with lighthouse-tracked devices
@@ -29,11 +33,7 @@ Lighthouse driver support for use with lighthouse-tracked devices
-DWIVRN_FEATURE_STEAMVR_LIGHTHOUSE=ON
```
For a few dependencies it is possible to select system or embedded versions, check `WIVRN_USE_SYSTEM_xxx` in case you are missing dependencies.
For more advanced options, check [CMakeLists.txt](../CMakeLists.txt).
For the Flatpak, see [flatpak](flatpak.md).
Additionally, if your environment requires absolute paths inside the OpenXR runtime manifest, you can add `-DWIVRN_OPENXR_MANIFEST_TYPE=absolute` to the build configuration.
## Profiling / tracing build
@@ -52,7 +52,7 @@ See [profiling](profiling.md) for how to run the server with tracing and capture
# Dashboard
The WiVRn dashboard requires Qt6, Kirigami, and the WiVRn server.
The WiVRn dashboard requires Qt6, and the WiVRn server.
## Compile
+6 -6
View File
@@ -1,6 +1,6 @@
# Configurable items
Configuration is split between headset and server. Headset contains most configuration, while server has system specific items such as encoders and paths.
Configuration is done on server side.
Files are read from
- `/usr/share/wivrn/config.json` (where `/usr` is selected at configure time with `CMAKE_INSTALL_PREFIX`)
- `/etc/wivrn/config.json`
@@ -13,9 +13,9 @@ If you installed WiVRn from a flatpack, the config is in `$HOME/.var/app/io.gith
All elements are optional and have default values.
## `bit-depth`
Default value: 10-bit if supported by the selected codec, encoder and decoder. 8-bit otherwise.
Default value: `8` (bits)
Bit depth of the video. 8-bit is supported by all encoders. 10-bit is supported by `vulkan`, `vaapi` and `nvenc` with `h265` or `av1` codecs.
Bit depth of the video. 8-bit is supported by all encoders. 10-bit is supported by `vaapi` and `nvenc` encoders using `h265` or `av1`.
## `encoder`
The encoder to use, either a single string or object applied to all streams, or a list of string or objects with values for left, right and alpha.
@@ -24,13 +24,13 @@ When a string it is used, it is equivalent to the `encoder` item of the object.
WiVRn encodes each eye separately, and the alpha channel as one for both eyes. Each stream is processed independently, this may use resources more effectively and reduce latency.
### `encoder`
Default value, in order: `vulkan` if supported, `nvenc` on Nvidia GPU, `vaapi` on all other GPU, else `x264`.
Default value: `vulkan` if supported, `nvenc` if Nvidia GPU and compiled with nvenc, `vaapi` for all other GPU when compiled with ffmpeg, else `x264`.
Identifier of the encoder, one of
* `x264`: software encoding
* `nvenc`: Nvidia hardware encoding
* `vaapi`: AMD/Intel hardware encoding
* `vulkan`: Vulkan Video encode, cross-vendor hardware encoding
* `vulkan`: for any GPU that supports vulkan video encode
### `codec`
Default value: best supported by both headset and encoder of `av1`, `h264`, `h265`.
@@ -39,7 +39,7 @@ One of `h264`, `h265`, `av1`, `raw`.
Not all encoders support every codec:
- `x264` encoder only supports `h264` codec
- `vulkan` encoder supports `h264`, `h265` and `av1` codecs, but `av1` is never selected automatically: it must be requested by setting `encoder` to `vulkan`
- `vulkan` encoder supports `h264` and `h265` codecs
- `raw` encoder only supports `raw` codec
- `nvenc` and `vaapi` support all codecs, except `raw`
-11
View File
@@ -1,11 +0,0 @@
# Flatpak maintenance
The manifest template is `flatpak/io.github.wivrn.wivrn.yml.in`. All remote sources are archives pinned with a sha256, downloaded from the project's official host: a release tarball, or an archive of the official repository. Do not use third-party mirrors or `type: git` sources. Get a sha256 with `curl -L <url> | sha256sum`.
| When | Do |
|---|---|
| Updating monado | Update `monado-rev`. Nothing else. |
| Updating xrizer | Update the commit in its archive URL and its sha256. The cargo sources are regenerated by `tools/gen_flatpak_manifest.py`. |
| Updating OpenComposite | Also update the `libs/openxr-sdk`, `libs/glm` and `libs/libunwind` archives to its submodule commits: `curl "https://gitlab.com/api/v4/projects/znixian%2FOpenOVR/repository/tree?path=libs&ref=<commit>"` (entries of type `commit`). |
| Updating the KDE runtime | Update the `flatpak-github-actions:kde-<version>` container tag in [Build.yml](../.github/workflows/Build.yml) to match `runtime-version`. |
| Updating any other dependency | Update its URL and sha256. |
Generated
+9 -9
View File
@@ -5,11 +5,11 @@
"nixpkgs-lib": "nixpkgs-lib"
},
"locked": {
"lastModified": 1790898470,
"narHash": "sha256-zTwuwezD0w3hpga6a6P8emidzAZFyWqlNeRBlpWOOl8=",
"lastModified": 1787559586,
"narHash": "sha256-onL0VLf9vPllmT0H/OlURIU5r5t5WIEl7t4tVNKT0Nw=",
"owner": "hercules-ci",
"repo": "flake-parts",
"rev": "024633cd702b10285db5cb19b40ad48d2399ba60",
"rev": "9d0d87172c374f89da73c1cfe6d81ae62feac1f1",
"type": "github"
},
"original": {
@@ -20,11 +20,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1792094642,
"narHash": "sha256-zp8ToDMnqZcu4o4IH9pdwXFXGp7yLm/M0dEnNWnyd7I=",
"lastModified": 1787498568,
"narHash": "sha256-9i/VTdusq/+NM/tz+J1Re+ojkMB8MBf0QshnYfzHz30=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "fe13242281a67641c0102cdb1087f0ebe586c7df",
"rev": "56c02bc00adcf003215cc4bd996d6efaf4cff188",
"type": "github"
},
"original": {
@@ -36,11 +36,11 @@
},
"nixpkgs-lib": {
"locked": {
"lastModified": 1790477367,
"narHash": "sha256-oujbxmVKDhci2E4EM3KyAbRUgp5/IsCoiA/LfEF7OOk=",
"lastModified": 1785031560,
"narHash": "sha256-OmshNvn2vupOFpYinLUu+1Dnpu4n7Q5N3ggGVNHpkUI=",
"owner": "nix-community",
"repo": "nixpkgs.lib",
"rev": "f7cd230690d9fc982d06129f9189b101fddcfa3b",
"rev": "0e79af5e3d4dcfcd676ab5ba3f95d2e3352e078c",
"type": "github"
},
"original": {
+90 -106
View File
@@ -2,119 +2,103 @@
inputs.nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
inputs.flake-parts.url = "github:hercules-ci/flake-parts";
outputs =
inputs@{ nixpkgs, flake-parts, ... }:
outputs = inputs@{ nixpkgs, flake-parts, ... }:
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [ "x86_64-linux" ];
perSystem =
{ lib, pkgs, ... }:
let
# Extra build inputs only inside the devShell.
devBuildInputs = [
# for client build
pkgs.curl
pkgs.ktx-tools
];
# Tools used for development work (clangd, clang-format)
devTools = [
pkgs.clang-tools
pkgs.gdb
pkgs.ktx-tools
];
# Extra build inputs not yet in the nixpkgs recipe.
extraBuildInputs = [
# XRT_FEATURE_DEBUG_GUI requires SDL2
pkgs.sdl2-compat
perSystem = { lib, pkgs, ... }: let
# Tools used for development work (clangd, clang-format)
devTools = [
pkgs.clang-tools
pkgs.gdb
pkgs.ktx-tools
];
# Extra build inputs not yet in the nixpkgs recipe.
extraBuildInputs = [
# XRT_FEATURE_DEBUG_GUI requires SDL2
pkgs.sdl2-compat
pkgs.libpng
pkgs.kdePackages.kirigami-addons
];
extraNativeBuildInputs = [
pkgs.ninja
pkgs.util-linux
];
pkgs.libpng
pkgs.kdePackages.kirigami-addons
package = pkgs.enableDebugging (
pkgs.wivrn.overrideAttrs (
finalAttrs: oldAttrs: {
# Filter the directories and files we don't need to keep to avoid needless rebuilds
src = lib.cleanSourceWith {
filter =
name: type:
let
baseName = baseNameOf (toString name);
in
(lib.cleanSourceFilter name type)
&& !(
(
type == "directory"
&& (baseName == ".direnv" || baseName == ".cxx" || lib.hasPrefix "build" baseName)
)
|| baseName == ".envrc"
);
src = ./.;
};
version = "next";
# for client build
pkgs.curl
pkgs.ktx-tools
];
extraNativeBuildInputs = [
pkgs.util-linux
];
# 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;
separateDebugInfo = false;
monado = pkgs.applyPatches {
inherit (oldAttrs.monado) patches postPatch;
# Force a refetch when the monado rev changes.
src = pkgs.testers.invalidateFetcherByDrvHash pkgs.fetchFromGitLab {
inherit (oldAttrs.monado.src) owner repo;
domain = "gitlab.freedesktop.org";
# Keep in sync with CMakeLists.txt monado rev
rev = lib.strings.trim (builtins.readFile ./monado-rev);
# Nix will output the correct hash when it doesn't match
hash = "sha256-yGkuD2jAG/ACSGkH1Cz8o23wHLtEqtNCUe2kS5OyC68=";
};
};
buildInputs = oldAttrs.buildInputs ++ extraBuildInputs;
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ extraNativeBuildInputs;
cmakeFlags = (lib.filter (flag: !lib.hasInfix "GIT_" flag) oldAttrs.cmakeFlags) ++ [
(lib.cmakeFeature "GIT_DESC" "nightly")
(lib.cmakeFeature "GIT_COMMIT" "nightly")
];
}
)
);
in
{
formatter = pkgs.nixfmt;
packages = {
default = package;
dissector = package.overrideAttrs (oldAttrs: {
pname = "wivrn-dissector";
cmakeFlags = (lib.filter (flag: !(lib.hasPrefix "-DWIVRN_BUILD" flag)) oldAttrs.cmakeFlags) ++ [
(lib.cmakeBool "WIVRN_BUILD_CLIENT" false)
(lib.cmakeBool "WIVRN_BUILD_SERVER" false)
(lib.cmakeBool "WIVRN_BUILD_DASHBOARD" false)
(lib.cmakeBool "WIVRN_BUILD_WIVRNCTL" false)
(lib.cmakeBool "WIVRN_BUILD_DISSECTOR" true)
];
buildInputs = oldAttrs.buildInputs ++ [
(pkgs.symlinkJoin {
name = "wireshark-dev-out-combined";
paths = [
pkgs.wireshark.out
pkgs.wireshark.dev
];
})
];
preFixup = null;
});
package = pkgs.enableDebugging (pkgs.wivrn.overrideAttrs (finalAttrs: oldAttrs: {
# Filter the directories and files we don't need to keep to avoid needless rebuilds
src = lib.cleanSourceWith {
filter = name: type: let
baseName = baseNameOf (toString name);
in
(lib.cleanSourceFilter name type) &&
!(
(type == "directory" && (
baseName == ".direnv"
|| baseName == ".cxx"
|| lib.hasPrefix "build" baseName))
|| baseName == ".envrc"
);
src = ./.;
};
devShells.default = package.overrideAttrs (oldAttrs: {
buildInputs = oldAttrs.buildInputs ++ devBuildInputs;
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ devTools;
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;
separateDebugInfo = false;
monado = pkgs.applyPatches {
inherit (oldAttrs.monado) patches postPatch;
# Force a refetch when the monado rev changes.
src = pkgs.testers.invalidateFetcherByDrvHash pkgs.fetchFromGitLab {
inherit (oldAttrs.monado.src) owner repo;
domain = "gitlab.freedesktop.org";
# Keep in sync with CMakeLists.txt monado rev
rev = lib.strings.trim (builtins.readFile ./monado-rev);
# Nix will output the correct hash when it doesn't match
hash = "sha256-3+bdxyXHuaweT/K+Jwh428XNMuZUd1tL2bdFBRIZ/Po=";
};
};
buildInputs = oldAttrs.buildInputs ++ extraBuildInputs;
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ extraNativeBuildInputs;
cmakeFlags = (oldAttrs.cmakeFlags or []) ++ [
(lib.cmakeFeature "GIT_DESC" "nightly")
(lib.cmakeFeature "GIT_COMMIT" "nightly")
];
}));
in {
packages = {
default = package;
dissector = package.overrideAttrs (oldAttrs: {
pname = "wivrn-dissector";
cmakeFlags = (lib.filter (flag: !(lib.hasPrefix "-DWIVRN_BUILD" flag)) oldAttrs.cmakeFlags) ++ [
(lib.cmakeBool "WIVRN_BUILD_CLIENT" false)
(lib.cmakeBool "WIVRN_BUILD_SERVER" false)
(lib.cmakeBool "WIVRN_BUILD_DASHBOARD" false)
(lib.cmakeBool "WIVRN_BUILD_WIVRNCTL" false)
(lib.cmakeBool "WIVRN_BUILD_DISSECTOR" true)
];
buildInputs = oldAttrs.buildInputs ++ [
(pkgs.symlinkJoin {
name = "wireshark-dev-out-combined";
paths = [
pkgs.wireshark.out
pkgs.wireshark.dev
];
})
];
preFixup = null;
});
};
devShells.default = package.overrideAttrs (oldAttrs: {
nativeBuildInputs = oldAttrs.nativeBuildInputs ++ devTools;
});
};
};
}
+2 -1
View File
@@ -210,7 +210,8 @@ CT_SYSROOT_DIR_PREFIX=""
CT_WANTS_STATIC_LINK=y
CT_WANTS_STATIC_LINK_CXX=y
# CT_STATIC_TOOLCHAIN is not set
# CT_SHOW_CT_VERSION is not set
CT_SHOW_CT_VERSION=y
CT_TOOLCHAIN_PKGVERSION=""
CT_TOOLCHAIN_BUGURL=""
#
+2 -1
View File
@@ -189,7 +189,8 @@ CT_SYSROOT_DIR_PREFIX=""
CT_WANTS_STATIC_LINK=y
CT_WANTS_STATIC_LINK_CXX=y
# CT_STATIC_TOOLCHAIN is not set
# CT_SHOW_CT_VERSION is not set
CT_SHOW_CT_VERSION=y
CT_TOOLCHAIN_PKGVERSION=""
CT_TOOLCHAIN_BUGURL=""
#
+42 -55
View File
@@ -67,16 +67,13 @@ cleanup:
- '*.la'
- '*.cmake'
# Sources are sha256-pinned archives, not git, so flatpak-builder reuses
# downloads and unchanged module builds from .flatpak-builder. CI caches that
# directory plus the monado archive, keyed on this file, ct-ng configs and monado-rev.
modules:
- name: crosstool
buildsystem: autotools
sources:
- type: archive
url: https://github.com/crosstool-ng/crosstool-ng/archive/620b909cd0713f68084378b63cf61b5232757b90.tar.gz
sha256: d109c9315c0ae0cbb7622d540b1f395b663243371413bbecba03e800c5caa18b
- type: git
url: https://github.com/crosstool-ng/crosstool-ng.git
commit: 620b909cd0713f68084378b63cf61b5232757b90
- type: shell
commands:
# Make the build lighter:
@@ -97,11 +94,9 @@ modules:
config-opts:
- --disable-md2man
sources:
- type: archive
url: https://github.com/RsyncProject/rsync/releases/download/v3.4.1/rsync-3.4.1.tar.gz
mirror-urls:
- https://download.samba.org/pub/rsync/src/rsync-3.4.1.tar.gz
sha256: 2924bcb3a1ed8b551fc101f740b9f0fe0a202b115027647cf69850d65fd88c52
- type: git
url: https://github.com/RsyncProject/rsync.git
commit: 3305a7a063ab0167cab5bf7029da53abaa9fdb6e
cleanup:
- '*'
@@ -214,9 +209,10 @@ modules:
- --disable-manpages
- --disable-static
sources:
- type: archive
url: https://github.com/avahi/avahi/releases/download/v0.8/avahi-0.8.tar.gz
sha256: 060309d7a333d38d951bc27598c677af1796934dbd98e1024e7ad8de798fedda
- type: git
url: https://github.com/avahi/avahi.git
tag: v0.8
commit: f060abee2807c943821d88839c013ce15db17b58
cleanup:
- /share/locale
- /share/runtime/locale
@@ -227,9 +223,9 @@ modules:
config-opts:
- --enable-shared
sources:
- type: archive
url: https://code.videolan.org/videolan/x264/-/archive/31e19f92f00c7003fa115047ce50978bc98c3a0d/x264-31e19f92f00c7003fa115047ce50978bc98c3a0d.tar.gz
sha256: d053c9d86988d6bc78237ca5205865c5ddf99c98ef4cd9927eec8f6d388f6dd9
- type: git
url: https://code.videolan.org/videolan/x264.git
commit: 31e19f92f00c7003fa115047ce50978bc98c3a0d
cleanup:
- /bin/x264
@@ -255,9 +251,10 @@ modules:
- /bin/ffplay
- /bin/ffprobe
sources:
- type: archive
url: https://ffmpeg.org/releases/ffmpeg-7.1.4.tar.xz
sha256: 71f4aac3573ed9060489cb62526a6c7dda815ae10993789611acd7be9fa9fbf4
- type: git
url: https://gitlab.com/freedesktop-sdk/mirrors/ffmpeg/ffmpeg.git
tag: n7.1.4
commit: 9abe92e3af7fa7becc8f7f742b1457b4c28220a6
- name: eigen3
buildsystem: cmake-ninja
@@ -265,9 +262,10 @@ modules:
- -DBUILD_TESTING=OFF
builddir: true
sources:
- type: archive
url: https://gitlab.com/libeigen/eigen/-/archive/5.0.1/eigen-5.0.1.tar.gz
sha256: e9c326dc8c05cd1e044c71f30f1b2e34a6161a3b6ecf445d56b53ff1669e3dec
- type: git
url: https://gitlab.com/libeigen/eigen.git
tag: 5.0.1
commit: bc3b39870ecb690a623a3f49149a358b95c5781d
cleanup:
- '*'
@@ -276,9 +274,10 @@ modules:
config-opts:
- -DJSON_BuildTests=OFF
sources:
- type: archive
url: https://github.com/nlohmann/json/releases/download/v3.12.0/json.tar.xz
sha256: 42f6e95cad6ec532fd372391373363b62a14af6d771056dbfc86160e6dfff7aa
- type: git
url: https://github.com/nlohmann/json.git
tag: v3.12.0
commit: 55f93686c01528224f448c19128836e7df245f72
- name: cli11
buildsystem: cmake-ninja
@@ -288,9 +287,10 @@ modules:
- -DCLI11_BUILD_TESTS=OFF
- -DCLI11_BUILD_EXAMPLES=OFF
sources:
- type: archive
url: https://github.com/CLIUtils/CLI11/archive/refs/tags/v2.6.2.tar.gz
sha256: c6ea6b2e5608b3ea8617999bd5f47420c71b2ebdb8dc4767c1034d1da5785711
- type: git
url: https://github.com/CLIUtils/CLI11
tag: v2.6.2
commit: 37bb6edc5317e99af72ef48405e65d9ca5218861
cleanup:
- '*'
@@ -314,22 +314,9 @@ modules:
- -DUSE_SYSTEM_OPENXR=OFF
- -DUSE_SYSTEM_GLM=OFF
sources:
- type: archive
url: https://gitlab.com/znixian/OpenOVR/-/archive/cff07db75c4823afe93ed7027b03d5f7bc86f164/OpenOVR-cff07db75c4823afe93ed7027b03d5f7bc86f164.tar.gz
sha256: d7ac1b9b12b3681414370be301909789ccdbb948412689780b2dec8cd47070bf
# git submodules of OpenOVR at the commit above
- type: archive
url: https://github.com/KhronosGroup/OpenXR-SDK/archive/91a8a8d9d70f4b469bca0726122c3b5a6096010e.tar.gz
dest: libs/openxr-sdk
sha256: 3b615f994adfa6184c6ff3b1b6af24965048ea1ddd3c3cf15c2b042282e74c05
- type: archive
url: https://github.com/g-truc/glm/archive/bf71a834948186f4097caa076cd2663c69a10e1e.tar.gz
dest: libs/glm
sha256: 70ad78e872c145f0164d54da833b651914c184edc65958906937b9739fb8fb1b
- type: archive
url: https://github.com/libunwind/libunwind/archive/f27f6a860335fc6c8107702dbde4b215ea74b164.tar.gz
dest: libs/libunwind
sha256: 3beb15d894759234dcb568f9d2be8b6ddc04c5d112836772e99884c58a07a285
- type: git
url: https://gitlab.com/znixian/OpenOVR.git
commit: cff07db75c4823afe93ed7027b03d5f7bc86f164
- name: xrizer
buildsystem: simple
@@ -354,13 +341,13 @@ modules:
RUSTFLAGS: -C linker=/app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc
build-commands:
- cargo --offline fetch --manifest-path Cargo.toml --verbose
- cargo xbuild --release -F static-openxr
- cargo xbuild --release
- mkdir /app/xrizer
- cp -rL target/release/bin/ /app/xrizer/
sources:
- type: archive
url: https://github.com/Supreeeme/xrizer/archive/a1216c7b53fb562a5bc4de473163e97a483042af.tar.gz
sha256: d75bb0a301bcafb57e94ca56b9ea6ccbe847f3db9181d7fb61bffccb26a40c88
- type: git
url: https://github.com/Supreeeme/xrizer.git
commit: be664bb93eebdd82336d00230154bacc6f8b9765
- xrizer-gen-src.json
- name: wivrn-library
@@ -402,9 +389,9 @@ modules:
- WIVRN_SRC1
WIVRN_SRC2
WIVRN_SRC3
- type: archive
url: MONADO_URL
sha256: MONADO_SHA256
- type: git
url: https://gitlab.freedesktop.org/monado/monado
commit: MONADO_COMMIT
dest: deps/monado-src
- type: shell
commands:
@@ -442,9 +429,9 @@ modules:
url: BOOST_URL
dest: deps/boost-src
sha256: BOOST_SHA256
- type: archive
url: MONADO_URL
sha256: MONADO_SHA256
- type: git
url: https://gitlab.freedesktop.org/monado/monado
commit: MONADO_COMMIT
dest: deps/monado-src
- type: shell
commands:
File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 158 KiB

+108 -130
View File
@@ -128,19 +128,19 @@ msgstr "ADB ist nicht installiert"
#, kde-format
msgid "Connect a headset and make sure developer mode is enabled"
msgstr ""
"Verbinde ein Headset und stelle sicher, dass der Entwicklermodus aktiviert "
"ist"
"Verbinde ein Headset und stelle sicher, dass die Entwickleroptionen "
"aktiviert sind"
#: dashboard/qml/ApkInstallPage.qml:51 dashboard/qml/WizardPage.qml:204
#, kde-format
msgid ""
"Follow the instructions in the <a "
"href=\"https://github.com/WiVRn/WiVRn/blob/master/docs/building.md#client-"
"headset\">documentation</a> to build your own client."
"Follow the instructions in the <a href=\"https://github.com/WiVRn/WiVRn/blob/"
"master/docs/building.md#client-headset\">documentation</a> to build your own "
"client."
msgstr ""
"Folge den Anweisungen in der <a "
"href=\"https://github.com/WiVRn/WiVRn/blob/master/docs/building.md#client-"
"headset\">Dokumentation</a>, um deinen eigenen Client zu bauen."
"Folge den Anleitungen in der <a href=\"https://github.com/WiVRn/WiVRn/blob/"
"master/docs/building.md#client-headset\">Dokumentation</a>, um einen eigenen "
"Client zu bauen"
#: dashboard/qml/ConnectUsbDialog.qml:11
#, kde-format
@@ -241,8 +241,7 @@ msgstr "Starte die WiVRn App auf dem Headset und verwende diesen PIN: %1"
#, kde-format
msgid "Enable pairing to allow your headset to connect to this computer"
msgstr ""
"Aktiviere die Kopplung, damit dein Headset sich mit diesem Computer "
"verbinden kann"
"Aktiviere Koppeln, damit sich das Headset mit diesem Computer verbinden kann"
#: dashboard/qml/HeadsetsPage.qml:171 dashboard/qml/TroubleshootPage.qml:45
#, kde-format
@@ -274,7 +273,9 @@ msgstr "Beende WiVRn"
msgid ""
"The WiVRn server is active.\n"
"Closing the window will terminate it."
msgstr "Der WiVRn-Server ist aktiv. Das Schließen des Fensters beendet ihn."
msgstr ""
"Der WiVRn Server ist aktiv.\n"
"Das Schließen dieses Fensters wird ihn beenden."
#: dashboard/qml/Main.qml:142
#, kde-format
@@ -302,8 +303,8 @@ msgstr "Firewall blockiert möglicherweise Port 9757"
msgid ""
"NVIDIA GPUs require at least driver version 565.77, current version is %1"
msgstr ""
"NVIDIA-GPUs benötigen mindestens Treiberversion 565.77, aktuelle Version ist"
" %1"
"NVIDIA-GPUs benötigen mindestens die Treiber-Version 565.77, jetzige Version "
"ist %1"
#: dashboard/qml/Main.qml:185
#, kde-format
@@ -314,8 +315,8 @@ msgstr "Mehr Infos"
#, kde-format
msgid "Vulkan drivers cannot be found, you may need to run \"flatpak update\""
msgstr ""
"Vulkan-Treiber wurden nicht gefunden, du musst eventuell „flatpak update“ "
"ausführen"
"Vulkan Treiber können nicht gefunden werden, möglicherweise muss \"Flatpak "
"Update\" ausgeführt werden"
#: dashboard/qml/Main.qml:193
#, kde-format
@@ -328,8 +329,8 @@ msgid ""
"Use the Mesa (radv) driver for AMD GPUs\n"
"Hardware encoding with vaapi does not work with AMDVLK and AMDGPU-PRO"
msgstr ""
"Verwende den Mesa-Treiber (radv) für AMD-GPUs Hardware-Encoding mit vaapi "
"funktioniert nicht mit AMDVLK und AMDGPU-PRO"
"Verwende Mesa (radv) Treiber für AMD-GPUs\n"
"Hardware-Encoding mit Vaapi funktioniert nicht mit AMDVLK und AMDGPU-PRO"
#: dashboard/qml/Main.qml:209
#, kde-format
@@ -337,27 +338,27 @@ msgid ""
"No OpenVR compatibility detected, Steam games won't be able to load VR.\n"
"Install xrizer or OpenComposite."
msgstr ""
"Keine OpenVR-Kompatibilität erkannt, Steam-Spiele können VR nicht laden. "
"Installiere xrizer oder OpenComposite."
"Keine Kompatibilität mit OpenVR gefunden, Steam Spiele werden nicht mit VR "
"starten können.\n"
"Installiere Xrizer oder OpenComposite"
#: dashboard/qml/Main.qml:217
#, kde-format
msgid "Steam is installed as a snap. Snaps are not compatible with WiVRn."
msgstr ""
"Steam ist als Snap installiert. Snaps sind nicht mit WiVRn kompatibel."
msgstr "Steam ist als Snap installiert. Snaps sind nicht mit WiVRn kompatibel."
#: dashboard/qml/Main.qml:225
#, kde-format
msgid ""
"Steam is installed as a flatpak but does not have sufficient permissions."
msgstr ""
"Steam ist als Flatpak installiert, hat aber nicht die erforderlichen "
"Berechtigungen."
"Steam ist als Flatpak installiert und hat nicht die nötigen Berechtigungen."
#: dashboard/qml/Main.qml:240
#, kde-format
msgid "Restart the server for configuration changes to take effect"
msgstr "Starte den Server neu, damit Konfigurationsänderungen wirksam werden"
msgstr ""
"Starte den Server neu, damit die Änderungen der Konfiguration wirksam werden"
#: dashboard/qml/Main.qml:246
#, kde-format
@@ -429,7 +430,9 @@ msgstr "Verbinden (Kabelgebunden)"
#: dashboard/qml/Main.qml:383 dashboard/qml/WizardPage.qml:339
#, kde-format
msgid "No headset is connected or your headset is not in developer mode"
msgstr "Kein Headset verbunden oder dein Headset ist nicht im Entwicklermodus"
msgstr ""
"Kein Headset ist verbunden oder die Entwickleroptionen im Headset sind "
"deaktiviert"
#: dashboard/qml/Main.qml:404
#, kde-format
@@ -528,7 +531,9 @@ msgstr "x264 (Software Encoding)"
#: dashboard/qml/SettingsPage.qml:79
#, kde-format
msgid "\"Auto\" will use hardware acceleration if it is available"
msgstr "„Auto“ verwendet Hardware-Beschleunigung, falls verfügbar"
msgstr ""
"\"Automatisch\" wird Hardware Beschleunigung verwenden, sofern diese "
"verfügbar ist"
#: dashboard/qml/SettingsPage.qml:89
#, kde-format
@@ -553,20 +558,18 @@ msgstr "Systemkonfigurationen beim Start überprüfen"
#: dashboard/qml/SettingsPage.qml:114
#, kde-format
msgid "Expose forwarded input devices via uinput"
msgstr "Leitet Eingabegeräte über uinput weiter"
msgstr ""
#: dashboard/qml/SettingsPage.qml:117
#, kde-format
msgid ""
"Replicate mouse, keyboard and gamepad connected to the headset as virtual devices on PC.\n"
"Replicated devices will appear as if they were plugged to the PC, some keys may be reserved by the headset OS and not be available. Gamepad is also available without virtual devices for applications that access it through OpenXR."
"Replicate mouse, keyboard and gamepad connected to the headset as virtual "
"devices on PC.\n"
"Replicated devices will appear as if they were plugged to the PC, some keys "
"may be reserved by the headset OS and not be available. Gamepad is also "
"available without virtual devices for applications that access it through "
"OpenXR."
msgstr ""
"Bildet Maus, Tastatur und Gamepad, die am Headset angeschlossen sind, als "
"virtuelle Geräte auf dem PC ab. Weitergeleitete Geräte erscheinen, als wären"
" sie am PC angeschlossen; einige Tasten können vom Headset-Betriebssystem "
"belegt sein und sind dann nicht verfügbar. Das Gamepad ist auch ohne "
"virtuelle Geräte für Anwendungen verfügbar, die über OpenXR darauf "
"zugreifen."
#: dashboard/qml/SettingsPage.qml:122
#, kde-format
@@ -586,10 +589,11 @@ msgid ""
"Devices must be be powered on before connecting to WiVRn.\n"
"An external tool such as motoc is needed for calibration."
msgstr ""
"Ermöglicht die Verwendung von Lighthouse-basierten Controllern und Trackern."
" Erfordert eine installierte SteamVR-Installation. Geräte müssen vor der "
"Verbindung mit WiVRn eingeschaltet sein. Für die Kalibrierung ist ein "
"externes Werkzeug wie motoc erforderlich."
"Erlaubt die Nutzung von Basisstationen-basierten Controllern und Trackern.\n"
"SteamVR muss installiert sein.\n"
"Geräte müssen eingeschaltet sein bevor eine Verbindung mit WiVRn hergestellt "
"wird.\n"
"Für die Kalibrierung wird ein externes Tool wie Motoc benötigt."
#: dashboard/qml/SettingsPage.qml:140
#, kde-format
@@ -645,14 +649,15 @@ msgid ""
"For Steam games, right click on the game in Steam, go in Properties > "
"General and paste this in \"Launch options\":"
msgstr ""
"Bei Steam-Spielen: Rechtsklick auf das Spiel in Steam, zu Eigenschaften > "
"Allgemein gehen und dies bei „Startoptionen“ einfügen:"
"Für Steam Spiele, klicke rechts auf das Spiel in Steam, gehe zu "
"Einstellungen >Allgemein und füge das Folgende in \"Startoptionen\" ein:"
#: dashboard/qml/SteamLaunchOptions.qml:20
#, kde-format
msgid "Paste this in the Steam launch options for the app you want to start"
msgstr ""
"Füge dies in die Steam-Startoptionen der App ein, die du starten möchtest"
"Füge das für das Spiel, welches du starten möchtest, in die Steam "
"Startoptionen ein"
#: dashboard/qml/SteamLaunchOptions.qml:26
#, kde-format
@@ -673,11 +678,11 @@ msgstr "Ich kann die WiVRn-App nicht auf dem Headset finden"
#: dashboard/qml/TroubleshootPage.qml:21 dashboard/qml/WizardPage.qml:353
#, kde-format
msgid ""
"If you installed WiVRn over USB on a Meta or Pico headset, the app is in the"
" \"unknown sources\" section."
"If you installed WiVRn over USB on a Meta or Pico headset, the app is in the "
"\"unknown sources\" section."
msgstr ""
"Wenn du WiVRn über USB auf einem Meta- oder Pico-Headset installiert hast, "
"findest du die App im Abschnitt „Unbekannte Quellen“."
"Wenn du WiVRn über USB auf einem Meta oder Pico Headset installiert hast, "
"dann findet sich die App in \"Unbekannte Quellen\"."
#: dashboard/qml/TroubleshootPage.qml:24
#, kde-format
@@ -688,8 +693,7 @@ msgstr "Ich kann den Computer nicht in der WiVRn-App sehen"
#, kde-format
msgid "If you have a firewall, make sure that port 5353/UDP is open."
msgstr ""
"Wenn du eine Firewall verwendest, stelle sicher, dass Port 5353/UDP offen "
"ist."
"Wenn eine Firewall aktiv ist, stelle sicher, dass Port 5353/UDP offen ist."
#: dashboard/qml/TroubleshootPage.qml:28
#, kde-format
@@ -702,8 +706,8 @@ msgid ""
"If you have a firewall, make sure that port 9757 is open both for TCP and "
"UDP."
msgstr ""
"Wenn du eine Firewall verwendest, stelle sicher, dass Port 9757 sowohl für "
"TCP als auch für UDP offen ist."
"Wenn eine Firewall aktiv ist, stelle sicher, dass Port 9757 für TCP und UPD "
"offen ist."
#: dashboard/qml/TroubleshootPage.qml:32
#, kde-format
@@ -718,13 +722,13 @@ msgstr "Ich habe den Fehler \"Inkompatibler WiVRn Server\" auf meinem Headset"
#: dashboard/qml/TroubleshootPage.qml:37
#, kde-format
msgid ""
"<p>The version of the headset app and the server on your computer must "
"match.</p><ul><li>The headset app version is in the \"About\" "
"page</li><li>The server version is <b>%1</b></li></ul>"
"<p>The version of the headset app and the server on your computer must match."
"</p><ul><li>The headset app version is in the \"About\" page</li><li>The "
"server version is <b>%1</b></li></ul>"
msgstr ""
"<p>Die Version der Headset-App und die des Servers auf deinem Computer "
"müssen übereinstimmen.</p><ul><li>Die Version der Headset-App findest du auf"
" der Seite „Über“</li><li>Die Serverversion ist <b>%1</b></li></ul>"
"<p>Die Version der Headset-App und des Servers auf dem Computer müssen "
"gleich sein.</p><ul><li>Die Version der Headset-App ist in der \"Über "
"WiVRn\" Seite</li><li> Die Version des Servers ist <b>%1</b></li></ul>"
#: dashboard/qml/TroubleshootPage.qml:40
#, kde-format
@@ -737,9 +741,9 @@ msgid ""
"If you have reinstalled the server or the client or if you want to connect "
"another headset, you must enable pairing before connecting."
msgstr ""
"Wenn du den Server oder den Client neu installiert hast oder ein weiteres "
"Headset verbinden möchtest, musst du vor dem Verbinden die Kopplung "
"aktivieren."
"Wenn der Server oder der Client neu installiert wurde, oder wenn ein anderes "
"Headset verbunden werden soll, dann muss Koppeln vor dem Verbinden aktiviert "
"werden."
#: dashboard/qml/TroubleshootPage.qml:41
#, kde-format
@@ -762,8 +766,8 @@ msgid ""
"When the headset is connected, select \"WiVRn\" as the default audio output "
"device for applications to use it."
msgstr ""
"Wenn das Headset verbunden ist, wähle „WiVRn“ als Standard-"
"Audioausgabegerät, damit Anwendungen es verwenden."
"Wenn das Headset verbunden ist, dann wähle \"WiVRn\" als die Standard-"
"Audioausgabe aus, damit Programme diese verwenden können."
#: dashboard/qml/TroubleshootPage.qml:61
#, kde-format
@@ -773,13 +777,12 @@ msgstr "Manche Spiele können nicht starten oder haben Eingabeprobleme"
#: dashboard/qml/TroubleshootPage.qml:62
#, kde-format
msgid ""
"For game specific issues, check on <a "
"href=\"https://db.vronlinux.org/\">vronlinux DB</a> if there are known bugs "
"or workarounds."
"For game specific issues, check on <a href=\"https://db.vronlinux.org/"
"\">vronlinux DB</a> if there are known bugs or workarounds."
msgstr ""
"Prüfe bei Spielspezifischen Problemen in der <a "
"href=\"https://db.vronlinux.org/\">vronlinux DB</a>, ob bekannte Fehler oder"
" Workarounds existieren."
"Für Probleme mit einzelnen Spielen, gehe zu <a href=\"https://"
"db.vronlinux.org/\">vronlinux DB</a>, um herauszufinden ob es bereits Bugs "
"oder Workarounds gibt."
#: dashboard/qml/TroubleshootPage.qml:79
#, kde-format
@@ -814,8 +817,8 @@ msgid ""
"This wizard will help you set up WiVRn on your headset and connect it to "
"your computer."
msgstr ""
"Dieser Assistent hilft dir, WiVRn auf deinem Headset einzurichten und es mit"
" deinem Computer zu verbinden."
"Dieser Einrichtungsassistent hilft dir, um WiVRn auf diesem Computer und dem "
"Headset einzurichten."
#: dashboard/qml/WizardPage.qml:83 dashboard/qml/WizardPage.qml:258
#: dashboard/qml/WizardPage.qml:418 dashboard/qml/WizardPage.qml:455
@@ -836,12 +839,13 @@ msgstr "Befolge den folgenden Anweisungen des Herstellers:"
#: dashboard/qml/WizardPage.qml:142
#, kde-format
msgid ""
"In order to use WiVRn, you will have to install the client app on your headset.\n"
"In order to use WiVRn, you will have to install the client app on your "
"headset.\n"
"You can either install it from the Meta store or directly over USB."
msgstr ""
"Um WiVRn zu verwenden, musst du die Client-App auf deinem Headset "
"installieren. Du kannst sie entweder aus dem Meta Store installieren oder "
"direkt über USB."
"Um WiVRn zu nutzen, muss die Client-App auf einem Headset installiert "
"werden.\n"
"Die App kann entweder vom Meta Store oder direkt über USB installiert werden."
#: dashboard/qml/WizardPage.qml:148
#, kde-format
@@ -854,8 +858,8 @@ msgid ""
"For the Quest 2, 3, 3S, and Pro, you can get the app from the <a "
"href=\"https://www.meta.com/experiences/7959676140827574/\">Meta store</a>."
msgstr ""
"Für Quest 2, 3, 3S und Pro gibt es die App im <a "
"href=\"https://www.meta.com/experiences/7959676140827574/\">Meta Store</a>."
"Für Quest 2, 3, 3S, und Pro, ist die App im <a href=\"https://www.meta.com/"
"experiences/7959676140827574/\">Meta store</a> erhältlich."
#: dashboard/qml/WizardPage.qml:164
#, kde-format
@@ -863,8 +867,8 @@ msgid ""
"A newer release is available: %1 → %2, the client app on the Meta store may "
"not be compatible."
msgstr ""
"Eine neuere Version ist verfügbar: %1 → %2; die Client-App im Meta Store ist"
" möglicherweise nicht kompatibel."
"Eine neue Version ist erhältlich: %1 → %2, die Client-App im Meta Store ist "
"möglicherweise nicht kompatibel."
#: dashboard/qml/WizardPage.qml:171
#, kde-format
@@ -872,7 +876,7 @@ msgid ""
"This is a nightly build, the client app on the Meta store may not be "
"compatible."
msgstr ""
"Dies ist ein Nightly-Build; die Client-App im Meta Store ist möglicherweise "
"Dies ist ein nightly build, die Client-App im Meta Store ist möglicherweise "
"nicht kompatibel."
#: dashboard/qml/WizardPage.qml:181
@@ -890,11 +894,12 @@ msgstr "Installiere über USB"
#, kde-format
msgid ""
"<p>No headset detected. Make sure that:\n"
"<ul><li>The ADB udev rules are installed</li><li>The headset is in <a href=\"#\">developer mode</a></li></ul></p>"
"<ul><li>The ADB udev rules are installed</li><li>The headset is in <a "
"href=\"#\">developer mode</a></li></ul></p>"
msgstr ""
"<p>Kein Headset erkannt. Stelle sicher, dass: <ul><li>Die ADB-udev-Regeln "
"installiert sind</li><li>Das Headset im <a href=\"#\">Entwicklermodus</a> "
"ist</li></ul></p>"
"<p>Kein Headset gefunden. Stelle sicher:\n"
"<ul><li>Die ADB udev Regeln sind installiert</li><li>Das Headset hat "
"aktivierte <a href=\"#\">Entwickleroptionen</a></li></ul></p>"
#: dashboard/qml/WizardPage.qml:295
#, kde-format
@@ -904,11 +909,11 @@ msgstr "Wichtige Informationen"
#: dashboard/qml/WizardPage.qml:301
#, kde-format
msgid ""
"WiVRn entirely replaces SteamVR, you should not start SteamVR while WiVRn is"
" running."
"WiVRn entirely replaces SteamVR, you should not start SteamVR while WiVRn is "
"running."
msgstr ""
"WiVRn ersetzt SteamVR vollständig; du solltest SteamVR nicht starten, "
"während WiVRn läuft."
"WiVRn ersetzt SteamVR komplett. Daher sollte SteamVR nicht gestartet werden, "
"während WiVRn aktiv ist."
#: dashboard/qml/WizardPage.qml:313
#, kde-format
@@ -918,16 +923,17 @@ msgstr "Starte die WiVRn-App auf dem Headset"
#: dashboard/qml/WizardPage.qml:319
#, kde-format
msgid ""
"To connect over WiFi, start the WiVRn app on your headset, connect to \"%1\""
" and enter PIN \"%2\"."
"To connect over WiFi, start the WiVRn app on your headset, connect to \"%1\" "
"and enter PIN \"%2\"."
msgstr ""
"Um dich über WLAN zu verbinden, starte die WiVRn-App auf deinem Headset, "
"verbinde dich mit „%1“ und gib die PIN „%2“ ein."
"Um eine Verbindung über WiFi aufzubauen, starte die WiVRn-App auf dem "
"Headset, verbinde zu \"%1\", und gib den PIN \"%2\" ein."
#: dashboard/qml/WizardPage.qml:326
#, kde-format
msgid "To connect over USB, click on \"Connect by USB\"."
msgstr "Um dich über USB zu verbinden, klicke auf „Verbinden per USB“."
msgstr ""
"Um eine Verbindung über USB aufzubauen, klicke auf \"Per USB verbinden\"."
#: dashboard/qml/WizardPage.qml:329
#, kde-format
@@ -945,9 +951,9 @@ msgid ""
"If the server is not visible or the connection fails, check that ports 5353 "
"(UDP) and 9757 (TCP and UDP) are open in your firewall."
msgstr ""
"Wenn der Server nicht sichtbar ist oder die Verbindung fehlschlägt, prüfe, "
"ob die Ports 5353 (UDP) und 9757 (TCP und UDP) in deiner Firewall offen "
"sind."
"Falls der Server nicht sichtbar ist oder die Verbindung fehlschlägt, stelle "
"sicher, dass die Ports 5353 (UDP) und 9757 (TCP und UPD) in der Firewall "
"offen sind."
#: dashboard/qml/WizardPage.qml:371
#, kde-format
@@ -970,8 +976,8 @@ msgid ""
"To connect another headset, make sure pairing is enabled in the dashboard "
"before connecting."
msgstr ""
"Um ein weiteres Headset zu verbinden, stelle sicher, dass die Kopplung im "
"Dashboard aktiviert ist, bevor du dich verbindest."
"Um ein anderes Headset zu verbinden, stelle sicher, dass Koppeln im "
"Dashboard aktiviert ist, bevor eine Verbindung aufgebaut wird."
#: dashboard/qml/WizardPage.qml:423 dashboard/qml/WizardPage.qml:460
#, kde-format
@@ -993,45 +999,17 @@ msgstr "Xrizer"
msgid "Open Composite"
msgstr "Open Composite"
msgid "Clamp extrapolation for SteamVR tracked devices"
msgstr "Extrapolation für SteamVR-getrackte Geräte begrenzen"
msgid "SteamVR max pose extrapolation"
msgstr "SteamVR maximale Posen-Extrapolation"
msgid "%1ms"
msgstr "%1ms"
msgid ""
"Maximum time in milliseconds that poses may be extrapolated ahead for "
"SteamVR tracked devices. Tune this value if you experience jittery or wobbly"
" tracking."
msgstr ""
"Maximale Zeit in Millisekunden, um die Posen für SteamVR-getrackte Geräte "
"extrapoliert werden. Passen Sie diesen Wert an, wenn das Tracking zitterig "
"oder wackelig wirkt."
msgid "SteamVR joystick deadzone"
msgstr "SteamVR Joystick-Totzone"
msgid ""
"Deadzone to apply to joysticks on lighthouse-tracked controllers, such as Index.\n"
"For standalone controllers, deadzones may be adjusted via the headset's system settings."
msgstr ""
"Totzone für die Joysticks von Lighthouse-getrackten Controllern wie dem Index.\n"
"Bei Standalone-Controllern kann die Totzone über die Systemeinstellungen des Headsets angepasst werden."
#, kde-format
#~ msgid "Forward keyboard & mouse from headset"
#~ msgstr "Tastatur- und Mauseingaben vom Headset weiterleiten"
#, kde-format
#~ msgid ""
#~ "Keyboard and mouse connected to the client will act as if connected to the "
#~ "server. Client OS may reserve specific keys and combinations, which cannot "
#~ "be forwarded."
#~ "Keyboard and mouse connected to the client will act as if connected to "
#~ "the server. Client OS may reserve specific keys and combinations, which "
#~ "cannot be forwarded."
#~ msgstr ""
#~ "Tastaturen und Mäuse, die mit dem Client verbunden sind werden sich so "
#~ "verhalten, als ob sie mit dem Server verbunden wären. Das Betriebssystem des"
#~ " Clients behält sich möglicherweise bestimmte Tasten und Tastenkombinationen"
#~ " vor, welche nicht weitergeleitet werden können."
#~ "verhalten, als ob sie mit dem Server verbunden wären. Das Betriebssystem "
#~ "des Clients behält sich möglicherweise bestimmte Tasten und "
#~ "Tastenkombinationen vor, welche nicht weitergeleitet werden können."
+157 -218
View File
File diff suppressed because it is too large Load Diff
+188 -271
View File
File diff suppressed because it is too large Load Diff
+190 -275
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More