Compare commits

...
Author SHA1 Message Date
Vindicus999 122011e930 Merge remote-tracking branch 'upstream/master' 2025-11-12 01:49:50 +00:00
Sapphire 015b242e27 Allow changing refresh rate during stream 2025-11-11 22:09:04 +01:00
Sapphire 68f6bf5e48 Update gradle 2025-11-11 22:09:04 +01:00
galister 2063cae3ae keyboard & mouse forwarding 2025-11-11 21:12:01 +01:00
Patrick Nicolas efde4bf247 Remove byte counters from sockets 2025-11-11 21:12:01 +01:00
Vindicus999 f2b5bd506a Merge remote-tracking branch 'upstream/master' 2025-11-11 01:50:44 +00:00
perillamintandPatrick Nicolas ffd5cf882a Initial Galaxy XR port (#585)
Co-authored-by: Patrick Nicolas <patricknicolas@laposte.net>
2025-11-10 22:19:21 +01:00
Patrick Nicolas d79ee4c43b Fix use system freetype 2025-11-10 20:46:37 +01:00
Patrick Nicolas 286278dde0 update libktx in CI 2025-11-10 20:46:37 +01:00
Patrick Nicolas c1be3d08af Allow system libktx for Linux client 2025-11-10 20:46:37 +01:00
Patrick Nicolas c83956748d Update libktx, use binary version on Android build 2025-11-10 20:46:37 +01:00
Patrick Nicolas 09031b9aa5 prepare 25.11.1 release 2025-11-10 18:44:06 +01:00
Vindicus999 b8ca0b524f Merge remote-tracking branch 'upstream/master' 2025-11-10 01:54:04 +00:00
Patrick Nicolas 1d481f7b77 Fix dashboard crash with empty configuration 2025-11-09 23:45:27 +01:00
ZokuTe 87d024e78b Add Simplified Chinese translation (#594) 2025-11-09 16:26:48 +01:00
Patola b1a325c102 Better PT_br translation (#593) 2025-11-09 09:08:43 +01:00
Luna 5337af4c56 fix typo on AV_PROFILE_AV1_MAIN definition 2025-11-09 09:07:51 +01:00
Vindicus999 eb156e82a0 Merge remote-tracking branch 'upstream/master' 2025-11-09 01:52:46 +00:00
Patrick Nicolas 793b0c8d81 Update description in metainfo 2025-11-08 12:29:08 +01:00
Patrick Nicolas 99b883d747 prepare v25.11 release 2025-11-08 11:18:55 +01:00
Guillaume Meunier 39d50479b1 Tweak some numbers 2025-11-08 11:15:46 +01:00
Patrick Nicolas 0ffd998896 Fix race condition on ipc_server init 2025-11-08 09:16:09 +01:00
Vindicus999 9ebac86b75 Merge remote-tracking branch 'upstream/master' 2025-11-08 01:42:51 +00:00
Patrick Nicolas 391f69ba17 force sustained high level in lobby 2025-11-07 20:29:28 +01:00
49 changed files with 3018 additions and 192 deletions
+5 -4
View File
@@ -182,15 +182,15 @@ jobs:
- name: Install dependencies
run: |
sudo apt-get update && sudo apt-get install libvulkan-dev libcjson-dev libx264-dev libavcodec-dev libavutil-dev libswscale-dev libavfilter-dev libbsd-dev libavahi-client-dev libeigen3-dev glslang-tools libudev-dev libwayland-dev libx11-xcb-dev libxrandr-dev libxcb-randr0-dev libgl-dev libglx-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libsystemd-dev libva-dev libxcb-glx0-dev gettext libfontconfig-dev libboost-all-dev librsvg2-bin libssl-dev sway grim mesa-vulkan-drivers wayland-protocols fonts-noto-cjk fonts-roboto libcurl4-openssl-dev
sudo apt-get update && sudo apt-get install libvulkan-dev libcjson-dev libx264-dev libavcodec-dev libavutil-dev libswscale-dev libavfilter-dev libbsd-dev libavahi-client-dev libeigen3-dev glslang-tools libudev-dev libwayland-dev libx11-xcb-dev libxrandr-dev libxcb-randr0-dev libgl-dev libglx-dev mesa-common-dev libgl1-mesa-dev libglu1-mesa-dev libsystemd-dev libva-dev libxcb-glx0-dev gettext libfontconfig-dev libboost-all-dev librsvg2-bin libssl-dev sway grim mesa-vulkan-drivers wayland-protocols fonts-noto-cjk fonts-roboto libcurl4-openssl-dev libharfbuzz-dev libfreetype-dev
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
wget https://github.com/KhronosGroup/KTX-Software/releases/download/v4.4.2/KTX-Software-4.4.2-Linux-x86_64.deb
sudo dpkg --install KTX-Software-4.4.2-Linux-x86_64.deb
npm install --global @gltf-transform/cli@4.1.1
- name: install server dependencies
run: >
sudo apt-get update && sudo apt-get install libavahi-glib-dev nlohmann-json3-dev libpulse-dev xz-utils libpipewire-0.3-dev libcli11-dev qt6-base-dev qt6-tools-dev libcap-dev pkexec libnotify-dev librsvg2-dev libarchive-dev
sudo apt-get update && sudo apt-get install libavahi-glib-dev nlohmann-json3-dev xz-utils libpipewire-0.3-dev libcli11-dev libcap-dev pkexec libnotify-dev librsvg2-dev libarchive-dev
- name: Configure CMake
run: >
@@ -199,6 +199,7 @@ jobs:
-DCMAKE_INSTALL_PREFIX=/usr
-DWIVRN_USE_SYSTEM_OPENXR=OFF
--preset everything
-DWIVRN_USE_PULSEAUDIO=OFF
-DWIVRN_BUILD_DASHBOARD=OFF
-DWIVRN_BUILD_DISSECTOR=OFF
+20
View File
@@ -47,6 +47,9 @@
<uses-permission android:name="com.oculus.permission.FACE_TRACKING" />
<uses-permission android:name="com.picovr.permission.FACE_TRACKING" />
<uses-permission android:name="com.oculus.permission.BODY_TRACKING" />
<uses-permission android:name="android.permission.EYE_TRACKING_FINE" />
<uses-permission android:name="android.permission.FACE_TRACKING" />
<uses-permission android:name="android.permission.HAND_TRACKING" />
<!-- Required for XR_FB_render_model -->
<uses-feature android:name="com.oculus.feature.RENDER_MODEL" android:required="false" />
@@ -62,6 +65,12 @@
<uses-feature android:name="wave.feature.lipexpression" android:required="false" />
<uses-feature android:name="wave.feature.tracker" android:required="false" />
<!-- See https://developer.android.com/develop/xr/get-started -->
<uses-feature android:name="android.software.xr.api.openxr" android:version="0x00010000" android:required="true" />
<uses-feature android:name="android.hardware.xr.input.controller" android:required="false" />
<uses-feature android:name="android.hardware.xr.input.hand_tracking" android:required="false" />
<uses-feature android:name="android.hardware.xr.input.eye_tracking" android:required="false" />
<application
android:allowBackup="false"
android:hasCode="true"
@@ -71,6 +80,9 @@
<profileable android:shell="true" />
<!-- https://developer.android.com/develop/xr/get-started#uses-native-library_openxr -->
<uses-native-library android:name="libopenxr.google.so" android:required="false" />
<meta-data android:name="pvr.app.type" android:value="vr" />
<meta-data android:name="pvr.sdk.version" android:value="OpenXR" />
<meta-data android:name="picovr.software.eye_tracking" android:value="true" />
@@ -91,6 +103,14 @@
<!-- https://developers.meta.com/horizon/documentation/native/android/mobile-passthrough-loading-screens -->
<meta-data android:name="com.oculus.ossplash.background" android:value="passthrough-contextual"/>
<!-- https://developer.android.com/develop/xr/get-started#xr_activity_start_mode_full_space_unmanaged -->
<property
android:name="android.window.PROPERTY_XR_ACTIVITY_START_MODE"
android:value="XR_ACTIVITY_START_MODE_FULL_SPACE_UNMANAGED" />
<property
android:name="android.window.PROPERTY_XR_BOUNDARY_TYPE_RECOMMENDED"
android:value="XR_BOUNDARY_TYPE_LARGE" />
<!-- The activity is the built-in NativeActivity framework class. -->
<!-- launchMode is set to singleTask because there should never be multiple copies of the app running. -->
<!-- Theme.Black.NoTitleBar.Fullscreen gives solid black instead of a (bad stereoscopic) gradient on app transition. -->
+9 -5
View File
@@ -26,9 +26,11 @@ include(GNUInstallDirs)
option(WIVRN_USE_SYSTEM_FREETYPE "Use system FreeType" ON)
option(WIVRN_USE_SYSTEM_BOOST "Use system Boost headers" ON)
option(WIVRN_USE_SYSTEM_OPENXR "Use system OpenXR headers" ON)
option(WIVRN_USE_SYSTEM_LIBKTX "Use system KTX-Software library" ON)
option(WIVRN_USE_SYSTEMD "Use libsystemd" ON)
option(WIVRN_COMPRESS_GLB "Compress textures in GLB files with gltf-transform" OFF)
option(WIVRN_USE_ANDROID_VALIDATION_LAYER "Download the android version of the Vulkan validation layer" OFF)
option(WIVRN_USE_ANDROID_BIN_LIBKTX "Download the prebuilt libktx for android" OFF)
option(WIVRN_BUILD_CLIENT "Build WiVRn client" OFF)
option(WIVRN_BUILD_SERVER "Build WiVRn server" ON)
option(WIVRN_BUILD_SERVER_LIBRARY "Build OpenXR library for WiVRn server" ${WIVRN_BUILD_SERVER})
@@ -205,6 +207,9 @@ if (WIVRN_BUILD_CLIENT AND NOT ANDROID)
find_package(OpenXR 1.1.48 REQUIRED)
endif()
if (WIVRN_USE_SYSTEM_LIBKTX)
find_package(Ktx REQUIRED)
endif()
endif()
if(ANDROID)
@@ -245,11 +250,10 @@ FetchContent_Declare(spdlog EXCLUDE_FROM_ALL SYSTEM URL https://github.co
URL_HASH SHA256=15a04e69c222eb6c01094b5c7ff8a249b36bb22788d72519646fb85feb267e67)
FetchContent_Declare(stb EXCLUDE_FROM_ALL SYSTEM URL https://github.com/nothings/stb/archive/013ac3beddff3dbffafd5177e7972067cd2b5083.zip
URL_HASH SHA256=b7f476902bbef1b30f8ecc2d9d95c459c32302c8b559d09b589b5955463b7af8)
file(GLOB LIBKTX_PATCHES CONFIGURE_DEPENDS patches/libktx/*)
set(KTX_GIT_VERSION_FULL "v4.4.0")
FetchContent_Declare(libktx EXCLUDE_FROM_ALL SYSTEM URL https://github.com/KhronosGroup/KTX-Software/archive/refs/tags/${KTX_GIT_VERSION_FULL}.tar.gz
URL_HASH SHA256=3585d76edcdcbe3a671479686f8c81c1c10339f419e4b02a9a6f19cc6e4e0612
PATCH_COMMAND ${CMAKE_CURRENT_LIST_DIR}/patches/apply.sh ${LIBKTX_PATCHES}
set(KTX_VERSION "4.4.2")
set(KTX_VERSION_FULL "v${KTX_VERSION}")
FetchContent_Declare(libktx EXCLUDE_FROM_ALL SYSTEM URL https://github.com/KhronosGroup/KTX-Software/archive/refs/tags/${KTX_VERSION_FULL}.tar.gz
URL_HASH SHA256=9412cb45045a503005acd47d98f9e8b47154634a50b4df21e17a1dfa8971d323
)
FetchContent_Declare(implot EXCLUDE_FROM_ALL SYSTEM URL https://github.com/epezent/implot/archive/3da8bd34299965d3b0ab124df743fe3e076fa222.zip
URL_HASH SHA256=e9b439a94aa6f09fcf12ed9c2cd784efe5e99e96242122aa683e690b29f7a59f)
+2 -1
View File
@@ -4,7 +4,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.12.1'
classpath 'com.android.tools.build:gradle:8.13.0'
}
}
@@ -127,6 +127,7 @@ android {
'-DCMAKE_EXPORT_COMPILE_COMMANDS=ON',
'-DWIVRN_USE_SYSTEM_BOOST=OFF',
'-DWIVRN_USE_SYSTEM_FREETYPE=OFF',
'-DWIVRN_USE_ANDROID_BIN_LIBKTX=ON',
'-DWIVRN_BUILD_CLIENT=ON',
'-DWIVRN_BUILD_SERVER=OFF',
'-DWIVRN_BUILD_SERVER_LIBRARY=OFF',
+15 -1
View File
@@ -11,7 +11,21 @@ set(SPIRV_REFLECT_EXECUTABLE OFF)
set(SPIRV_REFLECT_STATIC_LIB ON)
set(SPIRV_REFLECT_INSTALL OFF)
FetchContent_MakeAvailable(simdjson spdlog glm fastgltf imgui stb implot uni-algo entt libktx spirv-reflect)
FetchContent_MakeAvailable(simdjson spdlog glm fastgltf imgui stb implot uni-algo entt spirv-reflect)
if(ANDROID AND WIVRN_USE_ANDROID_BIN_LIBKTX)
file(DOWNLOAD
https://github.com/KhronosGroup/KTX-Software/releases/download/${KTX_VERSION_FULL}/KTX-Software-${KTX_VERSION}-Android.zip
${CMAKE_BINARY_DIR}/KTX-Software-${KTX_VERSION}-Android.zip
EXPECTED_HASH SHA256=9f84a395f37a185e2e21e77cfd3893e67271b616edf5feb39125f09ab4c06b29
)
file(ARCHIVE_EXTRACT INPUT ${CMAKE_BINARY_DIR}/KTX-Software-${KTX_VERSION}-Android.zip DESTINATION ${CMAKE_BINARY_DIR})
add_library(ktx INTERFACE)
target_link_libraries(ktx INTERFACE ${CMAKE_BINARY_DIR}/KTX-Software-${KTX_VERSION}-Android/${ANDROID_ABI}/lib/libktx.so)
target_include_directories(ktx INTERFACE ${CMAKE_BINARY_DIR}/KTX-Software-${KTX_VERSION}-Android/${ANDROID_ABI}/include)
elseif(WIVRN_USE_SYSTEM_LIBKTX AND NOT ANDROID)
else()
FetchContent_MakeAvailable(libktx)
endif()
include(FreetypeHarfbuzz)
include(CompileGLSL)
+427
View File
@@ -0,0 +1,427 @@
#include "hid.h"
#include "scene.h"
#include <spdlog/spdlog.h>
#define NUM_KEYCODES 226
/// Maps Android KeyCodes to Linux key event codes
static const int KEYCODE_TO_VK[NUM_KEYCODES] = {
0, // KEYCODE_UNKNOWN
0, // KEYCODE_SOFT_LEFT
0, // KEYCODE_SOFT_RIGHT
0, // KEYCODE_HOME
0, // KEYCODE_BACK
0, // KEYCODE_CALL
0, // KEYCODE_ENDCALL
KEY_0, // KEYCODE_0
KEY_1, // KEYCODE_1
KEY_2, // KEYCODE_2
KEY_3, // KEYCODE_3
KEY_4, // KEYCODE_4
KEY_5, // KEYCODE_5
KEY_6, // KEYCODE_6
KEY_7, // KEYCODE_7
KEY_8, // KEYCODE_8
KEY_9, // KEYCODE_9
0, // KEYCODE_STAR
0, // KEYCODE_POUND
KEY_UP, // KEYCODE_DPAD_UP
KEY_DOWN, // KEYCODE_DPAD_DOWN
KEY_LEFT, // KEYCODE_DPAD_LEFT
KEY_RIGHT, // KEYCODE_DPAD_RIGHT
0, // KEYCODE_DPAD_CENTER
// there's no way to discern between BT keyboard & device buttons using NDK,
// so having these mapped consumes all events from the HMD volume rocker.
// alternatively, move the handling to stream.cpp
0, // KEYCODE_VOLUME_UP // KEY_VOLUMEUP
0, // KEYCODE_VOLUME_DOWN // KEY_VOLUMEDOWN
0, // KEYCODE_POWER - device power button, do not consume
0, // KEYCODE_CAMERA
0, // KEYCODE_CLEAR
KEY_A, // KEYCODE_A
KEY_B, // KEYCODE_B
KEY_C, // KEYCODE_C
KEY_D, // KEYCODE_D
KEY_E, // KEYCODE_E
KEY_F, // KEYCODE_F
KEY_G, // KEYCODE_G
KEY_H, // KEYCODE_H
KEY_I, // KEYCODE_I
KEY_J, // KEYCODE_J
KEY_K, // KEYCODE_K
KEY_L, // KEYCODE_L
KEY_M, // KEYCODE_M
KEY_N, // KEYCODE_N
KEY_O, // KEYCODE_O
KEY_P, // KEYCODE_P
KEY_Q, // KEYCODE_Q
KEY_R, // KEYCODE_R
KEY_S, // KEYCODE_S
KEY_T, // KEYCODE_T
KEY_U, // KEYCODE_U
KEY_V, // KEYCODE_V
KEY_W, // KEYCODE_W
KEY_X, // KEYCODE_X
KEY_Y, // KEYCODE_Y
KEY_Z, // KEYCODE_Z
KEY_COMMA, // KEYCODE_COMMA
KEY_DOT, // KEYCODE_PERIOD
KEY_LEFTALT, // KEYCODE_ALT_LEFT
KEY_RIGHTALT, // KEYCODE_ALT_RIGHT
KEY_LEFTSHIFT, // KEYCODE_SHIFT_LEFT
KEY_RIGHTSHIFT, // KEYCODE_SHIFT_RIGHT
KEY_TAB, // KEYCODE_TAB
KEY_SPACE, // KEYCODE_SPACE
0, // KEYCODE_SYM
KEY_WWW, // KEYCODE_EXPLORER
KEY_MAIL, // KEYCODE_ENVELOPE
KEY_ENTER, // KEYCODE_ENTER
KEY_BACKSPACE, // KEYCODE_DEL
KEY_GRAVE, // KEYCODE_GRAVE
KEY_MINUS, // KEYCODE_MINUS
KEY_EQUAL, // KEYCODE_EQUALS
KEY_LEFTBRACE, // KEYCODE_LEFT_BRACKET
KEY_RIGHTBRACE, // KEYCODE_RIGHT_BRACKET
KEY_BACKSLASH, // KEYCODE_BACKSLASH
KEY_SEMICOLON, // KEYCODE_SEMICOLON
KEY_APOSTROPHE, // KEYCODE_APOSTROPHE
KEY_SLASH, // KEYCODE_SLASH
0, // KEYCODE_AT
0, // KEYCODE_NUM
0, // KEYCODE_HEADSETHOOK
0, // KEYCODE_FOCUS
KEY_EQUAL, // KEYCODE_PLUS
KEY_MENU, // KEYCODE_MENU
0, // KEYCODE_NOTIFICATION
KEY_SEARCH, // KEYCODE_SEARCH
KEY_PLAYPAUSE, // KEYCODE_MEDIA_PLAY_PAUSE
KEY_STOPCD, // KEYCODE_MEDIA_STOP
KEY_NEXTSONG, // KEYCODE_MEDIA_NEXT
KEY_PREVIOUSSONG, // KEYCODE_MEDIA_PREVIOUS
KEY_REWIND, // KEYCODE_MEDIA_REWIND
KEY_FASTFORWARD, // KEYCODE_MEDIA_FAST_FORWARD
KEY_MUTE, // KEYCODE_MUTE
KEY_PAGEUP, // KEYCODE_PAGE_UP
KEY_PAGEDOWN, // KEYCODE_PAGE_DOWN
0, // KEYCODE_PICTSYMBOLS
0, // KEYCODE_SWITCH_CHARSET
0, // KEYCODE_BUTTON_A
0, // KEYCODE_BUTTON_B
0, // KEYCODE_BUTTON_C
0, // KEYCODE_BUTTON_X
0, // KEYCODE_BUTTON_Y
0, // KEYCODE_BUTTON_Z
0, // KEYCODE_BUTTON_L1
0, // KEYCODE_BUTTON_R1
0, // KEYCODE_BUTTON_L2
0, // KEYCODE_BUTTON_R2
0, // KEYCODE_BUTTON_THUMBL
0, // KEYCODE_BUTTON_THUMBR
0, // KEYCODE_BUTTON_START
0, // KEYCODE_BUTTON_SELECT
0, // KEYCODE_BUTTON_MODE
KEY_ESC, // KEYCODE_ESCAPE
KEY_DELETE, // KEYCODE_FORWARD_DEL
KEY_LEFTCTRL, // KEYCODE_CTRL_LEFT
KEY_RIGHTCTRL, // KEYCODE_CTRL_RIGHT
KEY_CAPSLOCK, // KEYCODE_CAPS_LOCK
KEY_SCROLLLOCK, // KEYCODE_SCROLL_LOCK
KEY_LEFTMETA, // KEYCODE_META_LEFT
KEY_RIGHTMETA, // KEYCODE_META_RIGHT
0, // KEYCODE_FUNCTION
KEY_SYSRQ, // KEYCODE_SYSRQ
KEY_PAUSE, // KEYCODE_BREAK
KEY_HOME, // KEYCODE_MOVE_HOME
KEY_END, // KEYCODE_MOVE_END
KEY_INSERT, // KEYCODE_INSERT
KEY_FORWARD, // KEYCODE_FORWARD
KEY_PLAYCD, // KEYCODE_MEDIA_PLAY
KEY_PAUSECD, // KEYCODE_MEDIA_PAUSE
KEY_CLOSECD, // KEYCODE_MEDIA_CLOSE
KEY_EJECTCD, // KEYCODE_MEDIA_EJECT
KEY_RECORD, // KEYCODE_MEDIA_RECORD
KEY_F1, // KEYCODE_F1
KEY_F2, // KEYCODE_F2
KEY_F3, // KEYCODE_F3
KEY_F4, // KEYCODE_F4
KEY_F5, // KEYCODE_F5
KEY_F6, // KEYCODE_F6
KEY_F7, // KEYCODE_F7
KEY_F8, // KEYCODE_F8
KEY_F9, // KEYCODE_F9
KEY_F10, // KEYCODE_F10
KEY_F11, // KEYCODE_F11
KEY_F12, // KEYCODE_F12
KEY_NUMLOCK, // KEYCODE_NUM_LOCK
KEY_KP0, // KEYCODE_NUMPAD_0
KEY_KP1, // KEYCODE_NUMPAD_1
KEY_KP2, // KEYCODE_NUMPAD_2
KEY_KP3, // KEYCODE_NUMPAD_3
KEY_KP4, // KEYCODE_NUMPAD_4
KEY_KP5, // KEYCODE_NUMPAD_5
KEY_KP6, // KEYCODE_NUMPAD_6
KEY_KP7, // KEYCODE_NUMPAD_7
KEY_KP8, // KEYCODE_NUMPAD_8
KEY_KP9, // KEYCODE_NUMPAD_9
KEY_KPSLASH, // KEYCODE_NUMPAD_DIVIDE
KEY_KPASTERISK, // KEYCODE_NUMPAD_MULTIPLY
KEY_KPMINUS, // KEYCODE_NUMPAD_SUBTRACT
KEY_KPPLUS, // KEYCODE_NUMPAD_ADD
KEY_KPDOT, // KEYCODE_NUMPAD_DOT
KEY_KPCOMMA, // KEYCODE_NUMPAD_COMMA
KEY_KPENTER, // KEYCODE_NUMPAD_ENTER
KEY_KPEQUAL, // KEYCODE_NUMPAD_EQUALS
KEY_KPLEFTPAREN, // KEYCODE_NUMPAD_LEFT_PAREN
KEY_KPRIGHTPAREN, // KEYCODE_NUMPAD_RIGHT_PAREN
KEY_MUTE, // KEYCODE_VOLUME_MUTE
0, // KEYCODE_INFO
0, // KEYCODE_CHANNEL_UP
0, // KEYCODE_CHANNEL_DOWN
0, // KEYCODE_ZOOM_IN
0, // KEYCODE_ZOOM_OUT
0, // KEYCODE_TV
0, // KEYCODE_WINDOW
0, // KEYCODE_GUIDE
0, // KEYCODE_DVR
KEY_BOOKMARKS, // KEYCODE_BOOKMARK
0, // KEYCODE_CAPTIONS
0, // KEYCODE_SETTINGS
0, // KEYCODE_TV_POWER
0, // KEYCODE_TV_INPUT
0, // KEYCODE_STB_POWER
0, // KEYCODE_STB_INPUT
0, // KEYCODE_AVR_POWER
0, // KEYCODE_AVR_INPUT
0, // KEYCODE_PROG_RED
0, // KEYCODE_PROG_GREEN
0, // KEYCODE_PROG_YELLOW
0, // KEYCODE_PROG_BLUE
0, // KEYCODE_APP_SWITCH
0, // KEYCODE_BUTTON_1
0, // KEYCODE_BUTTON_2
0, // KEYCODE_BUTTON_3
0, // KEYCODE_BUTTON_4
0, // KEYCODE_BUTTON_5
0, // KEYCODE_BUTTON_6
0, // KEYCODE_BUTTON_7
0, // KEYCODE_BUTTON_8
0, // KEYCODE_BUTTON_9
0, // KEYCODE_BUTTON_10
0, // KEYCODE_BUTTON_11
0, // KEYCODE_BUTTON_12
0, // KEYCODE_BUTTON_13
0, // KEYCODE_BUTTON_14
0, // KEYCODE_BUTTON_15
0, // KEYCODE_BUTTON_16
KEY_LANGUAGE, // KEYCODE_LANGUAGE_SWITCH
0, // KEYCODE_MANNER_MODE
0, // KEYCODE_3D_MODE
0, // KEYCODE_CONTACTS
KEY_CALENDAR, // KEYCODE_CALENDAR
0, // KEYCODE_MUSIC
KEY_CALC, // KEYCODE_CALCULATOR
KEY_ZENKAKUHANKAKU, // KEYCODE_ZENKAKU_HANKAKU
0, // KEYCODE_EISU
KEY_MUHENKAN, // KEYCODE_MUHENKAN
KEY_HENKAN, // KEYCODE_HENKAN
KEY_KATAKANAHIRAGANA, // KEYCODE_KATAKANA_HIRAGANA
KEY_YEN, // KEYCODE_YEN
KEY_RO, // KEYCODE_RO
KEY_KATAKANAHIRAGANA, // KEYCODE_KANA
KEY_ASSISTANT, // KEYCODE_ASSIST
KEY_BRIGHTNESSDOWN, // KEYCODE_BRIGHTNESS_DOWN
KEY_BRIGHTNESSUP, // KEYCODE_BRIGHTNESS_UP
0, // KEYCODE_MEDIA_AUDIO_TRACK
KEY_SLEEP, // KEYCODE_SLEEP
KEY_WAKEUP, // KEYCODE_WAKEUP
};
uint8_t key_code_to_vk(int16_t key_code)
{
if (key_code < 0 || key_code >= NUM_KEYCODES)
return 0;
return KEYCODE_TO_VK[key_code];
}
bool android_hid::input_handler::handle_input(scene * current_scene, AInputEvent * event)
{
const int32_t type = AInputEvent_getType(event);
const int32_t src = AInputEvent_getSource(event);
const int32_t dev = AInputEvent_getDeviceId(event);
if (type == AINPUT_EVENT_TYPE_KEY)
{
int32_t flags = AKeyEvent_getFlags(event);
if ((flags & AKEY_EVENT_FLAG_SOFT_KEYBOARD) != 0)
return false; // ignore soft keyboards
if ((src & AINPUT_SOURCE_KEYBOARD) == 0)
return false; // event is not from keyboard
int32_t keycode = AKeyEvent_getKeyCode(event);
int32_t action = AKeyEvent_getAction(event);
bool pressed;
switch (action)
{
case AKEY_EVENT_ACTION_DOWN:
pressed = true;
break;
case AKEY_EVENT_ACTION_UP:
pressed = false;
break;
default:
return false;
}
uint8_t vk = key_code_to_vk(keycode);
if (vk == 0)
return false;
if (pressed)
return current_scene->on_input_key_down(vk);
else
return current_scene->on_input_key_up(vk);
}
if (type == AINPUT_EVENT_TYPE_MOTION)
{
// don't care about absolute mouse due to mapping difficulties
if ((src & AINPUT_SOURCE_MOUSE_RELATIVE) == 0)
return false;
int32_t actionMasked = AMotionEvent_getAction(event) & AMOTION_EVENT_ACTION_MASK;
switch (actionMasked)
{
case AMOTION_EVENT_ACTION_HOVER_MOVE: // mouse move with no buttons pressed
case AMOTION_EVENT_ACTION_MOVE: { // mouse move with buttons pressed
float x = AMotionEvent_getX(event, 0);
float y = AMotionEvent_getY(event, 0);
return current_scene->on_input_mouse_move(x, y);
}
case AMOTION_EVENT_ACTION_BUTTON_PRESS:
case AMOTION_EVENT_ACTION_BUTTON_RELEASE: {
uint32_t buttons = (uint32_t)AMotionEvent_getButtonState(event);
auto button_diff = buttons ^ buttons_before;
bool ret_val = false;
for (uint8_t i = 0; i < 3; ++i)
{
auto i_shifted = (1u << i);
if ((button_diff & i_shifted) != 0)
{
if ((buttons & i_shifted) != 0)
ret_val = current_scene->on_input_button_down(i);
else
ret_val = current_scene->on_input_button_up(i);
}
}
buttons_before = buttons;
return ret_val;
}
case AMOTION_EVENT_ACTION_SCROLL: {
float h = AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_HSCROLL, 0);
float v = AMotionEvent_getAxisValue(event, AMOTION_EVENT_AXIS_VSCROLL, 0);
return current_scene->on_input_scroll(h, v);
}
default:
return false;
}
}
return false;
}
bool try_clear_exception(JNIEnv * env, const char * where)
{
if (env->ExceptionCheck())
{
spdlog::error("[pointer_capture] Exception at {}", where);
env->ExceptionDescribe(); // logs to logcat
env->ExceptionClear();
return true;
}
return false;
}
void make_decor_view_call(ANativeActivity * activity, const char * method_name)
{
if (!activity || !activity->vm || !activity->env || !activity->clazz)
{
spdlog::error("[pointer_capture] Invalid ANativeActivity* or missing VM/Activity");
return;
}
JNIEnv * env = activity->env;
jobject act = activity->clazz;
jclass clsActivity = env->GetObjectClass(act);
jclass clsWindow = 0;
jobject window = 0;
jclass clsView = 0;
jobject decor = 0;
do
{
if (try_clear_exception(env, "GetObjectClass(Activity)") || not clsActivity)
break; // goto cleanup
jmethodID midGetWindow = env->GetMethodID(clsActivity, "getWindow", "()Landroid/view/Window;");
if (try_clear_exception(env, "Activity.getWindow() method lookup") || not midGetWindow)
break; // goto cleanup
window = env->CallObjectMethod(act, midGetWindow);
if (try_clear_exception(env, "Activity.getWindow() call") || not window)
break; // goto cleanup
clsWindow = env->GetObjectClass(window);
if (try_clear_exception(env, "GetObjectClass(Window)") || not clsWindow)
break; // goto cleanup
jmethodID midGetDecor = env->GetMethodID(clsWindow, "getDecorView", "()Landroid/view/View;");
if (try_clear_exception(env, "Window.getDecorView() method lookup") || not midGetDecor)
break; // goto cleanup
decor = env->CallObjectMethod(window, midGetDecor);
if (try_clear_exception(env, "Window.getDecorView() call") || not decor)
break; // goto cleanup
clsView = env->GetObjectClass(decor);
if (try_clear_exception(env, "GetObjectClass(DecorView)") || not clsView)
break; // goto cleanup
jmethodID midAction = env->GetMethodID(clsView, method_name, "()V");
if (try_clear_exception(env, "View method lookup") || not midAction)
break; // goto cleanup
env->CallVoidMethod(decor, midAction);
if (try_clear_exception(env, "View method call"))
break; // goto cleanup
spdlog::info("[pointer_capture] {}() invoked successfully", method_name);
} while (false);
// cleanup
if (clsView)
env->DeleteLocalRef(clsView);
if (decor)
env->DeleteLocalRef(decor);
if (clsWindow)
env->DeleteLocalRef(clsWindow);
if (window)
env->DeleteLocalRef(window);
if (clsActivity)
env->DeleteLocalRef(clsActivity);
}
void android_hid::request_pointer_capture(ANativeActivity * activity)
{
make_decor_view_call(activity, "requestPointerCapture");
}
void android_hid::release_pointer_capture(ANativeActivity * activity)
{
make_decor_view_call(activity, "releasePointerCapture");
}
+24
View File
@@ -0,0 +1,24 @@
#pragma once
#include "scene.h"
#include <android_native_app_glue.h>
#include <cstdint>
#include <linux/input-event-codes.h>
#include <mutex>
#include <vector>
namespace android_hid
{
void request_pointer_capture(ANativeActivity * activity);
void release_pointer_capture(ANativeActivity * activity);
class input_handler
{
uint32_t buttons_before = 0;
public:
bool handle_input(scene * current_scene, AInputEvent * event);
};
} // namespace android_hid
+20
View File
@@ -1504,6 +1504,26 @@ application::application(application_info info) :
}
};
// capture pointer to receive relative mouse events
app_info.native_app->activity->callbacks->onWindowFocusChanged = [](ANativeActivity * activity, int has_focus) {
if (has_focus)
android_hid::request_pointer_capture(activity);
else
android_hid::release_pointer_capture(activity);
};
app_info.native_app->onInputEvent = [](android_app * app, AInputEvent * event) {
auto app_instance = static_cast<application *>(app->userData);
std::unique_lock _{app_instance->scene_stack_lock};
if (!app_instance->scene_stack.empty())
{
auto scene = app_instance->scene_stack.back();
return app_instance->input_handler.handle_input(scene.get(), event) ? 1 : 0;
}
return 0;
};
wifi = wifi_lock::make_wifi_lock(app_info.native_app->activity->clazz);
// Initialize the loader for this platform
+3
View File
@@ -20,6 +20,7 @@
#pragma once
#ifdef __ANDROID__
#include "android/hid.h"
#include <android_native_app_glue.h>
#endif
@@ -81,6 +82,8 @@ class application : public singleton<application>
#ifdef __ANDROID__
ANativeWindow * native_window = nullptr;
bool resumed = false;
android_hid::input_handler input_handler{};
#endif
static inline const char engine_name[] = "No engine";
+5 -4
View File
@@ -27,7 +27,7 @@
namespace constants::gui
{
// Minimum distance between a GUI layer and a fingertip/controller to register a click
constexpr float min_pointer_distance = -0.02;
constexpr float min_controller_distance = -0.02;
// Font to use (desktop only)
constexpr const char font_name[] = "Noto Sans";
@@ -43,9 +43,10 @@ constexpr float scroll_ratio = 10;
constexpr float trigger_click_thd = 0.8;
// Thresholds on the distance between the fingertip and GUI layers (positive: in front of the GUI, negative: behind the GUI)
constexpr float fingertip_distance_hovering_thd = 0.15; // Max distance to have the cursor hovering
constexpr float fingertip_distance_touching_thd = -0.01; // Max distance to register a click
constexpr float fingertip_distance_stick_thd = -0.02; // Max distance where the fingertip is moved to be on the GUI
constexpr float fingertip_distance_hovering_thd = 0.15; // Max distance to have the cursor hovering
constexpr float fingertip_distance_touching_thd_hi = -0.01; // Distance to register a click
constexpr float fingertip_distance_touching_thd_lo = -0.15; // Distance to register a click
constexpr float fingertip_distance_stick_thd = -0.02; // Max distance where the fingertip is moved to be on the GUI
// Minimum scroll value to enable a controller
constexpr float scroll_value_thd = 0.01;
+34
View File
@@ -103,6 +103,11 @@ static model guess_model_()
if (model == "VIVE XR Series")
return model::htc_vive_xr_elite;
}
if (manufacturer == "samsung")
{
if (model == "SM-I610")
return model::samsung_galaxy_xr;
}
spdlog::info("Unknown model, manufacturer={}, model={}, device={}", manufacturer, model, device);
#endif
@@ -165,6 +170,8 @@ XrViewConfigurationView override_view(XrViewConfigurationView view, model m)
return scale_view(view, 2448);
case model::htc_vive_xr_elite:
return scale_view(view, 1920);
case model::samsung_galaxy_xr:
return scale_view(view, 3552);
case model::lynx_r1:
case model::unknown:
return view;
@@ -191,6 +198,7 @@ bool need_srgb_conversion(model m)
case model::htc_vive_focus_3:
case model::htc_vive_focus_vision:
case model::htc_vive_xr_elite:
case model::samsung_galaxy_xr:
case model::unknown:
return true;
}
@@ -204,6 +212,27 @@ const char * permission_name(feature f)
case feature::microphone:
return "android.permission.RECORD_AUDIO";
case feature::hand_tracking:
switch (guess_model())
{
case model::samsung_galaxy_xr:
return "android.permission.HAND_TRACKING";
case model::oculus_quest:
case model::oculus_quest_2:
case model::meta_quest_pro:
case model::meta_quest_3:
case model::meta_quest_3s:
case model::pico_neo_3:
case model::pico_4:
case model::pico_4s:
case model::pico_4_pro:
case model::pico_4_enterprise:
case model::htc_vive_focus_3:
case model::htc_vive_focus_vision:
case model::htc_vive_xr_elite:
case model::lynx_r1:
case model::unknown:
break;
}
return nullptr;
case feature::eye_gaze:
switch (guess_model())
@@ -220,6 +249,8 @@ const char * permission_name(feature f)
case model::pico_4_pro:
case model::pico_4_enterprise:
return "com.picovr.permission.EYE_TRACKING";
case model::samsung_galaxy_xr:
return "android.permission.EYE_TRACKING_FINE";
case model::htc_vive_focus_3:
case model::htc_vive_focus_vision:
case model::htc_vive_xr_elite:
@@ -243,6 +274,8 @@ const char * permission_name(feature f)
case model::pico_4_pro:
case model::pico_4_enterprise:
return "com.picovr.permission.FACE_TRACKING";
case model::samsung_galaxy_xr:
return "android.permission.FACE_TRACKING";
case model::htc_vive_focus_3:
case model::htc_vive_focus_vision:
case model::htc_vive_xr_elite:
@@ -294,6 +327,7 @@ std::string controller_name()
case model::htc_vive_focus_vision:
case model::htc_vive_xr_elite:
return "htc-vive-focus-3";
case model::samsung_galaxy_xr:
case model::lynx_r1:
case model::unknown:
return "generic-trigger-squeeze";
+1
View File
@@ -41,6 +41,7 @@ enum class model
htc_vive_xr_elite,
htc_vive_focus_vision,
lynx_r1,
samsung_galaxy_xr,
unknown
};
+5 -2
View File
@@ -237,7 +237,10 @@ std::vector<std::pair<ImVec2, float>> imgui_context::ray_plane_intersection(cons
// => ray_start.z + distance × ray_dir.z = 0
float distance = -ray_start.z / ray_dir.z;
if (distance < constants::gui::min_pointer_distance)
if (distance < constants::gui::min_controller_distance and in.source == ImGuiMouseSource_VRController)
continue;
if (distance < constants::gui::fingertip_distance_touching_thd_lo and in.source == ImGuiMouseSource_VRHandTracking)
continue;
coord.x = ray_start.x + distance * ray_dir.x;
@@ -625,7 +628,7 @@ std::vector<imgui_context::controller_state> imgui_context::read_controllers_sta
if (state.hover_distance < constants::gui::fingertip_distance_hovering_thd)
state.fingertip_hovering = true;
if (state.hover_distance < constants::gui::fingertip_distance_touching_thd)
if (state.hover_distance < constants::gui::fingertip_distance_touching_thd_hi and state.hover_distance > constants::gui::fingertip_distance_touching_thd_lo)
state.fingertip_touching = true;
}
}
+26
View File
@@ -18,6 +18,7 @@
*/
#include "scene.h"
#include "application.h"
#include "render/scene_components.h"
#include "utils/contains.h"
@@ -611,3 +612,28 @@ void scene::remove(entt::entity entity)
void scene::on_unfocused() {}
void scene::on_focused() {}
void scene::on_xr_event(const xr::event &) {}
bool scene::on_input_key_down(uint8_t key_code)
{
return false;
}
bool scene::on_input_key_up(uint8_t key_code)
{
return false;
}
bool scene::on_input_mouse_move(float x, float y)
{
return false;
}
bool scene::on_input_button_down(uint8_t button)
{
return false;
}
bool scene::on_input_button_up(uint8_t button)
{
return false;
}
bool scene::on_input_scroll(float h, float v)
{
return false;
}
+7
View File
@@ -213,6 +213,13 @@ public:
virtual void render(const XrFrameState &) = 0;
virtual void on_xr_event(const xr::event &);
virtual bool on_input_key_down(uint8_t key_code);
virtual bool on_input_key_up(uint8_t key_code);
virtual bool on_input_mouse_move(float x, float y);
virtual bool on_input_button_down(uint8_t button);
virtual bool on_input_button_up(uint8_t button);
virtual bool on_input_scroll(float h, float v);
entt::registry world;
std::shared_ptr<entt::registry> load_gltf(const std::filesystem::path & path, std::function<void(float)> progress_cb = {});
+3
View File
@@ -1328,6 +1328,9 @@ void scenes::lobby::on_focused()
setup_passthrough();
session.set_refresh_rate(application::get_config().preferred_refresh_rate.value_or(0));
multicast = application::get_wifi_lock().get_multicast_lock();
session.set_performance_level(XR_PERF_SETTINGS_DOMAIN_CPU_EXT, XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT);
session.set_performance_level(XR_PERF_SETTINGS_DOMAIN_GPU_EXT, XR_PERF_SETTINGS_LEVEL_SUSTAINED_HIGH_EXT);
}
void scenes::lobby::setup_passthrough()
+2
View File
@@ -1143,6 +1143,8 @@ void scenes::lobby::gui_first_run()
CenterTextH(_("Welcome to WiVRn"));
ImGui::PopFont();
config.set_feature(feature::hand_tracking, true);
while (optional_feature_index < optional_features.size() and
(not optional_features[optional_feature_index].supported or
config.check_feature(optional_features[optional_feature_index].f)))
+34 -5
View File
@@ -232,11 +232,7 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
if (config.preferred_refresh_rate and (config.preferred_refresh_rate == 0 or utils::contains(info.available_refresh_rates, *config.preferred_refresh_rate)))
{
info.preferred_refresh_rate = *config.preferred_refresh_rate;
if (info.preferred_refresh_rate == 0)
info.available_refresh_rates = {
std::ranges::lower_bound(info.available_refresh_rates, config.minimum_refresh_rate),
info.available_refresh_rates.end(),
};
info.minimum_refresh_rate = config.minimum_refresh_rate.value_or(0);
}
else
{
@@ -1302,3 +1298,36 @@ void scenes::stream::on_xr_event(const xr::event & event)
break;
}
}
bool scenes::stream::forward_hid_input(from_headset::hid::input_t packet)
{
if (not hid_forwarding)
return false;
network_session->send_control(from_headset::hid::input{packet});
return true;
}
bool scenes::stream::on_input_key_down(uint8_t key_code)
{
return forward_hid_input(from_headset::hid::key_down{key_code});
}
bool scenes::stream::on_input_key_up(uint8_t key_code)
{
return forward_hid_input(from_headset::hid::key_up{key_code});
}
bool scenes::stream::on_input_mouse_move(float x, float y)
{
return forward_hid_input(from_headset::hid::mouse_move{x, y});
}
bool scenes::stream::on_input_button_down(uint8_t button)
{
return forward_hid_input(from_headset::hid::button_down{button});
}
bool scenes::stream::on_input_button_up(uint8_t button)
{
return forward_hid_input(from_headset::hid::button_up{button});
}
bool scenes::stream::on_input_scroll(float h, float v)
{
return forward_hid_input(from_headset::hid::mouse_scroll{h, v});
}
+11 -1
View File
@@ -81,6 +81,7 @@ private:
std::array<std::atomic<interaction_profile>, 2> interaction_profiles; // left and right hand
std::atomic<bool> interaction_profile_changed = false;
std::atomic<bool> recenter_requested = false;
std::atomic<bool> hid_forwarding = false;
std::atomic<XrDuration> display_time_phase = 0;
std::atomic<XrDuration> display_time_period = 0;
XrTime last_display_time = 0;
@@ -173,6 +174,8 @@ private:
stream(std::string server_name, scene & parent_scene);
bool forward_hid_input(from_headset::hid::input_t);
public:
~stream();
@@ -187,6 +190,13 @@ public:
void on_unfocused() override;
void on_xr_event(const xr::event &) override;
bool on_input_key_down(uint8_t key_code) override;
bool on_input_key_up(uint8_t key_code) override;
bool on_input_mouse_move(float x, float y) override;
bool on_input_button_down(uint8_t button) override;
bool on_input_button_up(uint8_t button) override;
bool on_input_scroll(float h, float v) override;
void operator()(to_headset::crypto_handshake &&) {};
void operator()(to_headset::pin_check_2 &&) {};
void operator()(to_headset::pin_check_4 &&) {};
@@ -301,7 +311,7 @@ private:
void accumulate_metrics(XrTime predicted_display_time, const std::vector<std::shared_ptr<wivrn::shard_accumulator::blit_handle>> & blit_handles, const gpu_timestamps & timestamps);
void gui_performance_metrics();
void gui_compact_view();
void gui_settings();
void gui_settings(float predicted_display_period);
void gui_foveation_settings(float predicted_display_period);
void gui_applications();
void draw_gui(XrTime predicted_display_time, XrDuration predicted_display_period);
+71 -2
View File
@@ -26,6 +26,7 @@
#include "imgui.h"
#include "imgui_internal.h"
#include "implot.h"
#include "utils/contains.h"
#include "utils/i18n.h"
#include "utils/ranges.h"
#include <IconsFontAwesome6.h>
@@ -382,13 +383,81 @@ void scenes::stream::gui_compact_view()
}
}
static void send_settings_changed_packet(xr::session & session, wivrn_session * network, const configuration & config, float predicted_display_period)
{
const auto & refresh_rates = session.get_refresh_rates();
from_headset::settings_changed packet{};
if (config.preferred_refresh_rate and (config.preferred_refresh_rate == 0 or utils::contains(refresh_rates, *config.preferred_refresh_rate)))
{
packet.preferred_refresh_rate = *config.preferred_refresh_rate;
packet.minimum_refresh_rate = config.minimum_refresh_rate.value_or(0);
}
else
{
packet.preferred_refresh_rate = predicted_display_period;
}
network->send_control(std::move(packet));
}
std::string openxr_post_processing_flag_name(XrCompositionLayerSettingsFlagsFB flag); // TODO declaration in a .h file
void scenes::stream::gui_settings()
void scenes::stream::gui_settings(float predicted_display_period)
{
auto & config = application::get_config();
ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(20, 20));
if (instance.has_extension(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME))
{
const auto & refresh_rates = session.get_refresh_rates();
if (not refresh_rates.empty())
{
float active_rate = config.preferred_refresh_rate.value_or(refresh_rates.back());
if (ImGui::BeginCombo(_S("Refresh rate"), active_rate ? fmt::format("{}", active_rate).c_str() : _cS("automatic refresh rate", "Automatic")))
{
if (ImGui::Selectable(_cS("automatic refresh rate", "Automatic"), config.preferred_refresh_rate == 0, ImGuiSelectableFlags_SelectOnRelease))
{
session.set_refresh_rate(0);
config.preferred_refresh_rate = 0;
send_settings_changed_packet(session, network_session.get(), config, predicted_display_period);
config.save();
}
if (ImGui::IsItemHovered())
imgui_ctx->tooltip(_("Select refresh rate based on measured application performance.\nMay cause flicker when a change happens."));
for (float rate: refresh_rates)
{
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == config.preferred_refresh_rate, ImGuiSelectableFlags_SelectOnRelease))
{
session.set_refresh_rate(rate);
config.preferred_refresh_rate = rate;
send_settings_changed_packet(session, network_session.get(), config, predicted_display_period);
config.save();
}
}
ImGui::EndCombo();
}
imgui_ctx->vibrate_on_hover();
if (config.preferred_refresh_rate == 0 and refresh_rates.size() > 2)
{
float min_rate = config.minimum_refresh_rate.value_or(refresh_rates.front());
if (ImGui::BeginCombo(_S("Minimum refresh rate"), fmt::format("{}", min_rate).c_str()))
{
for (float rate: refresh_rates | std::views::take(refresh_rates.size() - 1))
{
if (ImGui::Selectable(fmt::format("{}", rate).c_str(), rate == config.minimum_refresh_rate, ImGuiSelectableFlags_SelectOnRelease))
{
config.minimum_refresh_rate = rate;
send_settings_changed_packet(session, network_session.get(), config, predicted_display_period);
config.save();
}
}
ImGui::EndCombo();
}
imgui_ctx->vibrate_on_hover();
}
}
}
if (application::get_openxr_post_processing_supported())
{
ImGui::Text("%s", _S("OpenXR post-processing"));
@@ -845,7 +914,7 @@ void scenes::stream::draw_gui(XrTime predicted_display_time, XrDuration predicte
case gui_status::settings:
ImGui::SetCursorPos({tab_width + 20, 20});
ImGui::BeginChild("Main", ImVec2(ImGui::GetWindowSize().x - ImGui::GetCursorPosX(), 0));
gui_settings();
gui_settings(predicted_display_period * 1.e-9f);
ImGui::EndChild();
break;
+4 -1
View File
@@ -556,7 +556,7 @@ void scenes::stream::tracking()
e.code().value() != XR_ERROR_TIME_INVALID)
throw;
}
}
} // end prediction loop
XrDuration busy_time = t.count();
// Target: polling between 1 and 5ms, with 20% busy time
@@ -658,6 +658,9 @@ void scenes::stream::operator()(to_headset::tracking_control && packet)
if (audio_handle)
audio_handle->set_mic_state(packet.enabled[m]);
auto n = size_t(wivrn::to_headset::tracking_control::id::hid_input);
hid_forwarding = packet.enabled[n];
*locked = packet;
locked->min_offset = std::min(locked->min_offset, locked->max_offset);
}
+14 -9
View File
@@ -46,6 +46,9 @@ private:
control_socket_t control;
stream_socket_t stream;
std::atomic<uint64_t> bytes_sent_ = 0;
std::atomic<uint64_t> bytes_received_ = 0;
template <typename T>
void handshake(T address, bool tcp_only, crypto::key & headset_keypair, std::function<std::string(int fd)> pin_enter);
@@ -60,16 +63,16 @@ public:
template <typename T>
void send_control(T && packet)
{
control.send(std::forward<T>(packet));
bytes_sent_ += control.send(std::forward<T>(packet));
}
template <typename T>
void send_stream(T && packet)
{
if (stream)
stream.send(std::forward<T>(packet));
bytes_sent_ += stream.send(std::forward<T>(packet));
else
control.send(std::forward<T>(packet));
bytes_sent_ += control.send(std::forward<T>(packet));
}
template <typename T>
@@ -81,9 +84,9 @@ public:
fds[1].events = POLLIN;
fds[1].fd = control.get_fd();
while (auto packet = stream.receive_pending())
while (auto packet = stream.receive_pending(&bytes_received_))
std::visit(std::forward<T>(visitor), std::move(*packet));
while (auto packet = control.receive_pending())
while (auto packet = control.receive_pending(&bytes_received_))
std::visit(std::forward<T>(visitor), std::move(*packet));
int r = ::poll(fds, std::size(fds), timeout.count());
@@ -98,14 +101,16 @@ public:
if (fds[0].revents & POLLIN)
{
auto packet = stream.receive();
auto packet = stream.receive(&bytes_received_);
if (packet)
{
std::visit(std::forward<T>(visitor), std::move(*packet));
}
}
if (fds[1].revents & POLLIN)
{
auto packet = control.receive();
auto packet = control.receive(&bytes_received_);
if (packet)
std::visit(std::forward<T>(visitor), std::move(*packet));
}
@@ -115,11 +120,11 @@ public:
uint64_t bytes_received() const
{
return control.bytes_received() + stream.bytes_received();
return bytes_received_;
}
uint64_t bytes_sent() const
{
return control.bytes_sent() + stream.bytes_sent();
return bytes_sent_;
}
};
+1 -1
View File
@@ -1,5 +1,5 @@
if (USE_SYSTEM_FREETYPE)
if (WIVRN_USE_SYSTEM_FREETYPE)
find_package(Freetype REQUIRED)
find_package(harfbuzz REQUIRED)
+54
View File
@@ -221,6 +221,8 @@ struct headset_info_packet
uint32_t recommended_eye_height;
std::vector<float> available_refresh_rates;
float preferred_refresh_rate;
// for automatic
float minimum_refresh_rate;
struct audio_description
{
uint8_t num_channels;
@@ -245,6 +247,13 @@ struct headset_info_packet
std::string variant;
};
struct settings_changed
{
float preferred_refresh_rate;
// for automatic
float minimum_refresh_rate;
};
struct handshake
{
// Sending this on TCP means connection will be TCP only
@@ -391,6 +400,47 @@ struct inputs
std::vector<input_value> values;
};
struct hid
{
struct button_down
{
uint8_t button;
};
struct button_up
{
uint8_t button;
};
struct mouse_move
{
float x;
float y;
};
struct mouse_scroll
{
float h;
float v;
};
struct key_down
{
uint8_t key;
};
struct key_up
{
uint8_t key;
};
using input_t = std::variant<button_down, button_up, mouse_move, mouse_scroll, key_down, key_up>;
struct input
{
input_t input_data;
};
};
struct timesync_response
{
XrTime query;
@@ -472,11 +522,13 @@ struct stop_application
uint32_t id;
};
// when changing this, also make sure there are handlers in wivrn_session, etc. or compilation will fail
using packets = std::variant<
crypto_handshake,
pin_check_1,
pin_check_3,
headset_info_packet,
settings_changed,
feedback,
audio_data,
handshake,
@@ -497,6 +549,7 @@ using packets = std::variant<
start_app,
get_running_applications,
set_active_application,
hid::input,
stop_application>;
} // namespace from_headset
@@ -671,6 +724,7 @@ struct tracking_control
right_hand,
face,
generic_tracker,
hid_input,
battery,
microphone,
+5
View File
@@ -288,6 +288,11 @@ public:
return size;
}
size_t wire_size()
{
return initial_buffer.size_bytes();
}
template <typename T>
void deserialize(T & v)
{
+18 -22
View File
@@ -266,8 +266,6 @@ std::pair<wivrn::deserialization_packet, sockaddr_in6> wivrn::UDP::receive_from_
if (received < 0)
throw std::system_error{errno, std::generic_category()};
bytes_received_ += received;
std::span message{buffer.get(), (size_t)received};
if (encrypted)
@@ -346,8 +344,6 @@ wivrn::deserialization_packet wivrn::UDP::receive_raw()
for (int i = received - 1; i >= 0; --i)
{
bytes_received_ += mmsgs[i].msg_len;
std::span<uint8_t> message{(uint8_t *)iovecs[i].iov_base, mmsgs[i].msg_len};
assert(message.data() != nullptr);
@@ -376,7 +372,7 @@ wivrn::deserialization_packet wivrn::UDP::receive_raw()
__builtin_unreachable();
}
void wivrn::UDP::send_raw(serialization_packet && packet)
size_t wivrn::UDP::send_raw(serialization_packet && packet)
{
thread_local std::vector<iovec> iovecs;
iovecs.clear();
@@ -399,23 +395,21 @@ void wivrn::UDP::send_raw(serialization_packet && packet)
}
for (const auto & span: data)
{
iovecs.emplace_back(span.data(), span.size());
bytes_sent_ += span.size();
}
if (::writev(fd, iovecs.data(), iovecs.size()) < 0)
throw std::system_error{errno, std::generic_category()};
if (ssize_t sent = ::writev(fd, iovecs.data(), iovecs.size()); sent >= 0)
return sent;
throw std::system_error{errno, std::generic_category()};
}
void wivrn::UDP::send_many_raw(std::span<serialization_packet> packets)
size_t wivrn::UDP::send_many_raw(std::span<serialization_packet> packets)
{
thread_local std::vector<iovec> iovecs;
thread_local std::vector<mmsghdr> mmsgs;
thread_local std::vector<uint64_t> iv_counters;
if (packets.empty())
return;
return 0;
iovecs.clear();
mmsgs.clear();
@@ -423,6 +417,7 @@ void wivrn::UDP::send_many_raw(std::span<serialization_packet> packets)
iv_counters.reserve(packets.size());
size_t sent = 0;
for (serialization_packet & packet: packets)
{
std::vector<std::span<uint8_t>> & data = packet;
@@ -444,7 +439,7 @@ void wivrn::UDP::send_many_raw(std::span<serialization_packet> packets)
for (const auto & span: data)
{
iovecs.emplace_back(span.data(), span.size_bytes());
bytes_sent_ += span.size();
sent += span.size();
}
if (encrypted)
@@ -462,6 +457,7 @@ void wivrn::UDP::send_many_raw(std::span<serialization_packet> packets)
// sendmmsg may not send all messages, just consider them as lost for UDP
if (sendmmsg(fd, mmsgs.data(), mmsgs.size(), 0) < 0)
throw std::system_error{errno, std::generic_category()};
return sent;
}
wivrn::deserialization_packet wivrn::TCP::receive_raw()
@@ -503,8 +499,6 @@ wivrn::deserialization_packet wivrn::TCP::receive_raw()
if (received_size == 0)
throw socket_shutdown{};
bytes_received_ += received_size;
if (decrypter)
{
std::span<uint8_t> received_data{&*data.end(), (size_t)received_size};
@@ -547,8 +541,9 @@ wivrn::deserialization_packet wivrn::TCP::receive_pending()
return deserialization_packet{buffer, span};
}
void wivrn::TCP::send_raw(serialization_packet && packet)
size_t wivrn::TCP::send_raw(serialization_packet && packet)
{
size_t total_sent = 0;
thread_local std::vector<iovec> iovecs;
iovecs.clear();
@@ -589,7 +584,7 @@ void wivrn::TCP::send_raw(serialization_packet && packet)
if (sent < 0)
throw std::system_error{errno, std::generic_category()};
bytes_sent_ += sent;
total_sent += sent;
// iov fully consumed
while (hdr.msg_iovlen > 0 and sent >= hdr.msg_iov[0].iov_len)
@@ -599,20 +594,20 @@ void wivrn::TCP::send_raw(serialization_packet && packet)
--hdr.msg_iovlen;
}
if (hdr.msg_iovlen == 0)
return;
return total_sent;
hdr.msg_iov[0].iov_base = (void *)((uintptr_t)hdr.msg_iov[0].iov_base + sent);
hdr.msg_iov[0].iov_len -= sent;
}
}
void wivrn::TCP::send_many_raw(std::span<serialization_packet> packets)
size_t wivrn::TCP::send_many_raw(std::span<serialization_packet> packets)
{
thread_local std::vector<iovec> iovecs;
thread_local std::vector<uint32_t> sizes;
thread_local std::vector<std::span<uint8_t>> spans;
if (packets.empty())
return;
return 0;
iovecs.clear();
sizes.clear();
@@ -652,6 +647,7 @@ void wivrn::TCP::send_many_raw(std::span<serialization_packet> packets)
encrypter.encrypt_in_place(spans);
}
size_t total_sent = 0;
while (true)
{
ssize_t sent = ::sendmsg(fd, &hdr, MSG_NOSIGNAL);
@@ -662,7 +658,7 @@ void wivrn::TCP::send_many_raw(std::span<serialization_packet> packets)
if (sent < 0)
throw std::system_error{errno, std::generic_category()};
bytes_sent_ += sent;
total_sent += sent;
// iov fully consumed
while (hdr.msg_iovlen > 0 and sent >= hdr.msg_iov[0].iov_len)
@@ -672,7 +668,7 @@ void wivrn::TCP::send_many_raw(std::span<serialization_packet> packets)
--hdr.msg_iovlen;
}
if (hdr.msg_iovlen == 0)
return;
return total_sent;
hdr.msg_iov[0].iov_base = (void *)((uintptr_t)hdr.msg_iov[0].iov_base + sent);
hdr.msg_iov[0].iov_len -= sent;
}
+16 -19
View File
@@ -68,8 +68,6 @@ protected:
int fd = -1;
fd_base(const fd_base &) = delete;
std::atomic<uint64_t> bytes_sent_ = 0;
std::atomic<uint64_t> bytes_received_ = 0;
public:
fd_base() = default;
@@ -89,14 +87,9 @@ public:
return fd != -1;
}
uint64_t bytes_sent() const
operator int() const
{
return bytes_sent_;
}
uint64_t bytes_received() const
{
return bytes_received_;
return fd;
}
};
@@ -122,8 +115,8 @@ public:
deserialization_packet receive_raw();
deserialization_packet receive_pending();
std::pair<wivrn::deserialization_packet, sockaddr_in6> receive_from_raw();
void send_raw(serialization_packet && packet);
void send_many_raw(std::span<serialization_packet> packets);
size_t send_raw(serialization_packet && packet);
size_t send_many_raw(std::span<serialization_packet> packets);
void connect(in6_addr address, int port);
void connect(in_addr address, int port);
@@ -157,8 +150,8 @@ public:
deserialization_packet receive_raw();
deserialization_packet receive_pending();
void send_raw(serialization_packet && packet);
void send_many_raw(std::span<serialization_packet> packets);
size_t send_raw(serialization_packet && packet);
size_t send_many_raw(std::span<serialization_packet> packets);
void set_aes_key_and_ivs(std::span<std::uint8_t, 16> key, std::span<std::uint8_t, 16> recv_iv, std::span<std::uint8_t, 16> send_iv);
};
@@ -220,20 +213,24 @@ public:
Socket(std::forward<Args>(args)...)
{}
std::optional<ReceivedType> receive_pending()
std::optional<ReceivedType> receive_pending(std::atomic<uint64_t> * size = nullptr)
{
deserialization_packet packet = ((Socket *)this)->receive_pending();
if (packet.empty())
return {};
if (size)
size->fetch_add(packet.wire_size());
return packet.deserialize<ReceivedType>();
}
std::optional<ReceivedType> receive()
std::optional<ReceivedType> receive(std::atomic<uint64_t> * size = nullptr)
{
deserialization_packet packet = this->receive_raw();
if (packet.empty())
return {};
if (size)
size->fetch_add(packet.wire_size());
return packet.deserialize<ReceivedType>();
}
@@ -249,16 +246,16 @@ public:
}
template <details::not_lvalue_reference T>
void send(T && data)
size_t send(T && data)
{
thread_local serialization_packet p;
serialize(p, data);
this->send_raw(std::move(p));
return this->send_raw(std::move(p));
}
void send(std::span<serialization_packet> packets)
size_t send(std::span<serialization_packet> packets)
{
this->send_many_raw(packets);
return this->send_many_raw(packets);
}
};
+36 -17
View File
@@ -8,28 +8,26 @@
<description>
<p>WiVRn allows you to run your VR games from your PC and play them from a standalone headset.</p>
<p>You will need to install the WiVRn client on your headset from the Meta Store or by following the wizard in the application.</p>
<p>Works with the WiVRn client app on standalone headsets, available as an APK and on the Meta Store.</p>
<p>Features:</p>
<ul>
<li>Supports OpenXR and OpenVR applications through xrizer or OpenComposite</li>
<li>Controller tracking, hand tracking, eye gaze tracking, body tracking as supported by the headset</li>
<li>Audio streaming and microphone</li>
<li>Low latency video streaming with H264 / HEVC / AV1 compression</li>
<li>Hardware accelerated compression with Vulkan video encode, VAAPI or NVENC</li>
<li>Software compression with x264</li>
</ul>
<p>Supported headsets:</p>
<ul>
<li>Meta Quest 1</li>
<li>Meta Quest 2</li>
<li>Meta Quest 3</li>
<li>Meta Quest 3S</li>
<li>Meta Quest Pro</li>
<li>Meta Quest 1, 2, 3, 3S, pro</li>
<li>Pico Neo 4</li>
<li>HTC Vive Focus 3</li>
<li>HTC Vive XR Elite</li>
</ul>
<p>Features:</p>
<ul>
<li>Supports OpenXR and OpenVR applications</li>
<li>Controller tracking, hand tracking, eye gaze tracking (if supported by the headset)</li>
<li>Audio streaming and microphone</li>
<li>Video streaming with H264 / HEVC / AV1 compression</li>
<li>Hardware accelerated compression with VAAPI or NVENC</li>
<li>Software compression with x264</li>
<li>HTC Vive Focus 3, XR Elite</li>
</ul>
<p>For desktop streaming, check out wlx-overlay-s.</p>
</description>
<developer id="io.github.wivrn.wivrn">
<name>Guillaume Meunier, Patrick Nicolas et al</name>
@@ -69,6 +67,27 @@
<content_rating type="oars-1.1" />
<releases>
<release version="25.11.1" date="2025-11-10">
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v25.11.1</url>
<description>
<ul>
<li>Fixed a dashboard crash when configuration is empty</li>
</ul>
</description>
</release>
<release version="25.11" date="2025-11-08">
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v25.11</url>
<description>
<ul>
<li>10-bit encoding support for AV1 and h.265</li>
<li>H.265 encoding on Vulkan video backend</li>
<li>Firewall configuration for ufw and firewalld</li>
<li>Customizable lobby environment</li>
<li>Running application management during stream</li>
<li>Default to lower power states on headset</li>
</ul>
</description>
</release>
<release version="25.9" date="2025-09-17">
<url type="details">https://github.com/WiVRn/WiVRn/releases/tag/v25.9</url>
<description>
+12
View File
@@ -230,6 +230,16 @@ Kirigami.ScrollablePage {
id: show_system_checks
text: i18n("Check system configuration on start")
}
RowLayout {
visible: config.hid_forwarding_supported
Controls.CheckBox {
id: hid_forwarding
text: i18n("Forward keyboard & mouse from headset")
}
Kirigami.ContextualHelpButton {
toolTipText: i18n("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.")
}
}
Controls.CheckBox {
id: debug_gui
text: i18n("Enable debug window")
@@ -389,6 +399,7 @@ Kirigami.ScrollablePage {
config.debugGui = debug_gui.checked;
config.steamVrLh = steamvr_lh.checked;
config.hidForwarding = hid_forwarding.checked;
}
function load() {
@@ -400,6 +411,7 @@ Kirigami.ScrollablePage {
debug_gui.checked = config.debugGui;
steamvr_lh.checked = config.steamVrLh;
hid_forwarding.checked = config.hidForwarding;
openvr_combobox.load()
+44 -1
View File
@@ -25,6 +25,7 @@
#include <QList>
#include <QObject>
#include <cassert>
#include <fcntl.h>
#include <nlohmann/json.hpp>
#include <qqmlintegration.h>
@@ -120,6 +121,7 @@ void Settings::emitAllChanged()
openvrChanged();
debugGuiChanged();
steamVrLhChanged();
hidForwardingChanged();
}
void Settings::load(const wivrn_server * server)
@@ -129,12 +131,15 @@ void Settings::load(const wivrn_server * server)
{
auto conf = server->jsonConfiguration();
m_jsonSettings = nlohmann::json::parse(conf.toUtf8());
if (not m_jsonSettings.is_object())
m_jsonSettings = nlohmann::json::object();
emitAllChanged();
}
catch (std::exception & e)
{
qWarning() << "Cannot read configuration: " << e.what();
restore_defaults();
m_jsonSettings = nlohmann::json::object();
emitAllChanged();
return;
}
}
@@ -381,6 +386,22 @@ void Settings::set_application(const QString & value)
applicationChanged();
}
bool Settings::hidForwarding() const
{
auto it = m_jsonSettings.find("hid-forwarding");
if (it != m_jsonSettings.end() and it->is_boolean())
return *it;
return false;
}
void Settings::set_hidForwarding(const bool & value)
{
auto old = hidForwarding();
m_jsonSettings["hid-forwarding"] = value;
if (old != value)
hidForwardingChanged();
}
bool Settings::debugGui() const
{
// Advanced options (debug window, steamvr_lh)
@@ -501,6 +522,7 @@ void Settings::restore_defaults()
m_jsonSettings.erase("scale");
m_jsonSettings.erase("bitrate");
m_jsonSettings.erase("application");
m_jsonSettings.erase("hid-forwarding");
m_jsonSettings.erase("debug-gui");
m_jsonSettings.erase("use-steamvr-lh");
m_jsonSettings.erase("tcp-only");
@@ -529,5 +551,26 @@ bool Settings::steamvr_lh() const
return false;
#endif
}
bool Settings::hid_forwarding() const
{
// only called from the UI thread → no locking needed
static std::optional<bool> can_open_uinput;
if (can_open_uinput.has_value())
return can_open_uinput.value();
can_open_uinput = false;
constexpr std::array paths = {"/dev/uinput", "/dev/input/uinput"};
for (const char * p: paths)
{
int fd = ::open(p, O_WRONLY | O_NONBLOCK);
if (fd >= 0)
{
::close(fd);
can_open_uinput = true;
break;
}
}
return can_open_uinput.value();
}
#include "moc_settings.cpp"
+4
View File
@@ -72,10 +72,12 @@ public:
Q_PROPERTY(QString application READ application WRITE set_application NOTIFY applicationChanged)
Q_PROPERTY(QString openvr READ openvr WRITE set_openvr NOTIFY openvrChanged)
Q_PROPERTY(bool hidForwarding READ hidForwarding WRITE set_hidForwarding NOTIFY hidForwardingChanged)
Q_PROPERTY(bool debugGui READ debugGui WRITE set_debugGui NOTIFY debugGuiChanged)
Q_PROPERTY(bool steamVrLh READ steamVrLh WRITE set_steamVrLh NOTIFY steamVrLhChanged)
Q_PROPERTY(bool flatpak READ flatpak CONSTANT)
Q_PROPERTY(bool hid_forwarding_supported READ hid_forwarding CONSTANT)
Q_PROPERTY(bool debug_gui_supported READ debug_gui CONSTANT)
Q_PROPERTY(bool steamvr_lh_supported READ steamvr_lh CONSTANT)
@@ -86,6 +88,7 @@ public:
SETTER_GETTER_NOTIFY(int, bitrate)
SETTER_GETTER_NOTIFY(float, scale)
SETTER_GETTER_NOTIFY(QString, application)
SETTER_GETTER_NOTIFY(bool, hidForwarding)
SETTER_GETTER_NOTIFY(bool, debugGui)
SETTER_GETTER_NOTIFY(bool, steamVrLh)
SETTER_GETTER_NOTIFY(bool, tcpOnly)
@@ -108,6 +111,7 @@ public:
bool flatpak() const;
bool debug_gui() const;
bool steamvr_lh() const;
bool hid_forwarding() const;
static encoder_name encoder_id_from_string(std::string_view s);
static video_codec codec_id_from_string(std::string_view s);
+7
View File
@@ -212,6 +212,13 @@ If unset, WiVRn will autodetect the path of such a tool as usual (see [the Steam
If set to an null, WiVRn will not manage the OpenVR configuration.
## `hid-forwarding`
Default value: `false`
Only available when the `uinput` kernel module is loaded and the user has write access.
Enables the forwarding of keyboard and mouse input from the client to the server.
## `debug-gui`
Default value: `false`
+4 -5
View File
@@ -12,14 +12,14 @@ msgstr ""
"Project-Id-Version: WiVRn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-11-06 10:54+0100\n"
"PO-Revision-Date: 2025-11-06 13:15+0100\n"
"PO-Revision-Date: 2025-11-09 03:04+0100\n"
"Last-Translator: Claudio Sampaio (Patola) <patola@gmail.com>\n"
"Language-Team: Portuguese <>\n"
"Language: pt_BR\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Lokalize 25.08.2\n"
"X-Generator: Lokalize 25.08.3\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
#: client/scene.cpp:72
@@ -227,13 +227,12 @@ msgstr "Resolução maior que {}x{} pode não ser suportada pelo headset"
#: client/scenes/lobby_gui.cpp:672
msgid "High power mode"
msgstr "Modo de alta energia"
msgstr "Modo de alta potência"
#: client/scenes/lobby_gui.cpp:675
msgid "Increase power usage to allow higher resolution and refresh rate"
msgstr ""
"Aumenta o uso de energia para permitir resolução e taxa de atualização mais al"
"tas"
"Aumenta a potência para permitir resolução e taxa de atualização mais altas"
#: client/scenes/lobby_gui.cpp:681
msgid "Enable microphone"
+986
View File
@@ -0,0 +1,986 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the WiVRn-dashboard package.
# Jayden Ha <jayden@jaydenha.uk>, 2025.
# BERADQ <adqber123@outlook.com>, 2025.
#
msgid ""
msgstr ""
"Project-Id-Version: WiVRn-dashboard\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-11-06 19:45+0800\n"
"PO-Revision-Date: 2025-11-09 23:01+0800\n"
"Last-Translator: BERADQ <adqber123@outlook.com>\n"
"Language-Team: Chinese (China)\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Gtranslator 49.0\n"
"Plural-Forms: nplurals=1; plural=0;\n"
#: dashboard/apk_installer.cpp:137
#, kde-format
msgid "Cannot save APK file: %1"
msgstr "无法保存 APK 文件: %1"
#: dashboard/apk_installer.cpp:171
#, kde-format
msgid "Downloading APK: %1 MB / %2 MB"
msgstr "正在下载 APK: %1 MB / %2 MB"
#: dashboard/apk_installer.cpp:173
#, kde-format
msgid "Downloading APK: %1 MB"
msgstr "正在下载 APK: %1 MB"
#: dashboard/apk_installer.cpp:182
#, kde-format
msgid "Download cancelled"
msgstr "下载已取消"
#: dashboard/apk_installer.cpp:198
#, kde-format
msgid "Cannot download APK: %1"
msgstr "无法下载 APK: %1"
#: dashboard/apk_installer.cpp:221
#, kde-format
msgid "Installing APK"
msgstr "正在安装 APK"
#: dashboard/apk_installer.cpp:225
#, kde-format
msgid "adb failed to start: %1"
msgstr "adb 启动失败: %1"
#: dashboard/apk_installer.cpp:235
#, kde-format
msgid "adb exited abnormally: %1"
msgstr "adb 异常终止: %1"
#: dashboard/apk_installer.cpp:243
#, kde-format
msgid "The 'adb install' command failed: exit code %1"
msgstr "'adb install' 执行失败: 终止代码 %1"
#: dashboard/apk_installer.cpp:248
#, kde-format
msgid "Installation successful"
msgstr "安装成功"
#: dashboard/main.cpp:27 dashboard/qml/Main.qml:12
#, kde-format
msgid "WiVRn dashboard"
msgstr "WiVRn 控制面板"
#: dashboard/qml/ApkInstallPage.qml:12 dashboard/qml/WizardPage.qml:137
#, kde-format
msgid "Install the WiVRn app on your headset"
msgstr "在您的头显上安装 WiVRn 应用程序"
#: dashboard/qml/ApkInstallPage.qml:41 dashboard/qml/WizardPage.qml:157
#: dashboard/qml/WizardPage.qml:192
#, kde-format
msgid "Checking latest release..."
msgstr "正在检查最新版本..."
#: dashboard/qml/ApkInstallPage.qml:43 dashboard/qml/WizardPage.qml:198
#, kde-format
msgid "No APK is available for this version"
msgstr "此版本无预编译 APK"
#: dashboard/qml/ApkInstallPage.qml:45 dashboard/qml/Main.qml:302
#: dashboard/qml/Main.qml:387 dashboard/qml/WizardPage.qml:211
#, kde-format
msgid "ADB is not installed"
msgstr "未安装 ADB"
#: dashboard/qml/ApkInstallPage.qml:47
#, kde-format
msgid "Connect a headset and make sure developer mode is enabled"
msgstr "连接头显并确认已启用开发者模式"
#: 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."
msgstr ""
"请按照 <a href=\"https://github.com/WiVRn/WiVRn/blob/master/docs/"
"building.md#client-headset\">文档</a>中的说明构建您自己的客户端。"
#: dashboard/qml/ApkInstallPage.qml:65 dashboard/qml/HeadsetsPage.qml:183
#: dashboard/qml/HeadsetStatsPage.qml:36 dashboard/qml/TroubleshootPage.qml:67
#, kde-format
msgctxt "go back to the home page"
msgid "Back"
msgstr "返回"
#: dashboard/qml/ConnectUsbDialog.qml:11
#, kde-format
msgid "Select your headset"
msgstr "选择您的头显"
#: dashboard/qml/DeviceCard.qml:46
#, kde-format
msgid "WiVRn is already installed on this device"
msgstr "此设备已安装 WiVRn"
#: dashboard/qml/DeviceCard.qml:54
#, kde-format
msgid "Reinstall WiVRn"
msgstr "重新安装 WiVRn"
#: dashboard/qml/DeviceCard.qml:54
#, kde-format
msgid "Install WiVRn"
msgstr "安装 WiVRn"
#: dashboard/qml/HeadsetsPage.qml:12 dashboard/qml/Main.qml:392
#, kde-format
msgid "Headsets"
msgstr "头显"
#: dashboard/qml/HeadsetsPage.qml:29
#, kde-format
msgid "Last connection: %1 second ago"
msgid_plural "Last connection: %1 seconds ago"
msgstr[0] "上次连接时间:%1 秒前"
#: dashboard/qml/HeadsetsPage.qml:31
#, kde-format
msgid "Last connection: %1 minute ago"
msgid_plural "Last connection: %1 minutes ago"
msgstr[0] "上次连接时间:%1 分鐘前"
#: dashboard/qml/HeadsetsPage.qml:33
#, kde-format
msgid "Last connection: %1 hour ago"
msgid_plural "Last connection: %1 hours ago"
msgstr[0] "上次连接时间:%1 小時前"
#: dashboard/qml/HeadsetsPage.qml:35
#, kde-format
msgid "Last connection: %1 day ago"
msgid_plural "Last connection: %1 days ago"
msgstr[0] "上次连接时间:%1 天前"
#: dashboard/qml/HeadsetsPage.qml:40
#, kde-format
msgid "Rename headset"
msgstr "重命名头显"
#: dashboard/qml/HeadsetsPage.qml:48 dashboard/qml/HeadsetsPage.qml:116
#, kde-format
msgid "Rename"
msgstr "重命名"
#: dashboard/qml/HeadsetsPage.qml:55 dashboard/qml/WizardPage.qml:38
#: dashboard/qml/WizardPage.qml:88 dashboard/qml/WizardPage.qml:263
#: dashboard/qml/WizardPage.qml:327 dashboard/qml/WizardPage.qml:411
#, kde-format
msgid "Cancel"
msgstr "取消"
#: dashboard/qml/HeadsetsPage.qml:64
#, kde-format
msgid "Headset name…"
msgstr "头显名称…"
#: dashboard/qml/HeadsetsPage.qml:128
#, kde-format
msgid "Remove"
msgstr "移除"
#: dashboard/qml/HeadsetsPage.qml:143
#, kde-format
msgid "Pairing enabled, PIN: %1"
msgstr "配对已启用,身份识别码:%1"
#: dashboard/qml/HeadsetsPage.qml:148 dashboard/qml/TroubleshootPage.qml:50
#, kde-format
msgid "Disable pairing"
msgstr "停用配对"
#: dashboard/qml/HeadsetsPage.qml:166
#, kde-format
msgid "Start the WiVRn app on your headset and use the PIN: %1"
msgstr "在您的头显上启动 WiVRn 应用程序,并使用身份识别码:%1"
#: dashboard/qml/HeadsetsPage.qml:166
#, kde-format
msgid "Enable pairing to allow your headset to connect to this computer"
msgstr "启用配对以允许您的头显连接至此计算机"
#: dashboard/qml/HeadsetsPage.qml:171 dashboard/qml/TroubleshootPage.qml:45
#, kde-format
msgid "Enable pairing"
msgstr "启用配对"
#: dashboard/qml/HeadsetsPage.qml:191
#, kde-format
msgid "Pair a new headset"
msgstr "配对新的头显"
#: dashboard/qml/HeadsetStatsPage.qml:12
#, kde-format
msgid "Headset statistics"
msgstr "头显统计信息"
#: dashboard/qml/Main.qml:121
#, kde-format
msgid "Avahi daemon is not installed"
msgstr "Avahi 守护进程未安装"
#: dashboard/qml/Main.qml:129
#, kde-format
msgid "Avahi daemon is not started"
msgstr "Avahi 守护进程未启用"
#: dashboard/qml/Main.qml:136 dashboard/qml/Main.qml:151
#: dashboard/qml/Main.qml:165
#, kde-format
msgid "Fix it"
msgstr "修复"
#: dashboard/qml/Main.qml:144
#, kde-format
msgid "The server does not have CAP_SYS_NICE capabilities"
msgstr "服务器没有 CAP_SYS_NICE 权限"
#: dashboard/qml/Main.qml:159
#, kde-format
msgid "Firewall may not allow port 9757"
msgstr "防火墙可能禁止了端口 9757"
#: dashboard/qml/Main.qml:174
#, kde-format
msgid "The CAP_SYS_NICE capability will be used when the server is restarted"
msgstr "CAP_SYS_NICE 权限将在服务器重新启动时生效"
#: dashboard/qml/Main.qml:180
#, kde-format
msgctxt "restart the server"
msgid "Restart now"
msgstr "立即重新启动"
#: dashboard/qml/Main.qml:191
#, kde-format
msgid ""
"NVIDIA GPUs require at least driver version 565.77, current version is %1"
msgstr "NVIDIA 显卡至少需要驱动程序版本 565.77,目前版本为 %1"
#: dashboard/qml/Main.qml:197
#, kde-format
msgid "More info"
msgstr "更多信息"
#: dashboard/qml/Main.qml:205
#, kde-format
msgid ""
"Use the Mesa (radv) driver for AMD GPUs\n"
"Hardware encoding with vaapi does not work with AMDVLK and AMDGPU-PRO"
msgstr ""
"AMD 显卡请使用 Mesa (radv) 驱动程序\n"
"使用 vaapi 的硬件编码不适用于 AMDVLK 和 AMDGPU-PRO"
#: dashboard/qml/Main.qml:213
#, kde-format
msgid ""
"No OpenVR compatibility detected, Steam games won't be able to load VR.\n"
"Install xrizer or OpenComposite."
msgstr ""
"系统未检测到 OpenVR 兼容层,Steam 平台上的 VR 游戏无法正常加载。\n"
"请安装 xrizer 或 OpenComposite"
#: dashboard/qml/Main.qml:222
#, kde-format
msgid "Server failed to start"
msgstr "服务器启动失败"
#: dashboard/qml/Main.qml:228 dashboard/qml/TroubleshootPage.qml:85
#, kde-format
msgid "Open server logs"
msgstr "开启服务器日志"
#: dashboard/qml/Main.qml:257
#, kde-format
msgctxt "whether the server is running, displayed in front of a checkbox"
msgid "Running"
msgstr "运行中"
#: dashboard/qml/Main.qml:272
#, kde-format
msgctxt "whether pairing is enabled, displayed in front of a checkbox"
msgid "Pairing"
msgstr "配对中"
#: dashboard/qml/Main.qml:285
#, kde-format
msgid "PIN: %1"
msgstr "身份识别码: %1"
#: dashboard/qml/Main.qml:293 dashboard/qml/WizardPage.qml:374
#, kde-format
msgid "Connect by USB"
msgstr "通过 USB 连接"
#: dashboard/qml/Main.qml:304
#, kde-format
msgid "No headset is connected or your headset is not in developer mode"
msgstr "没有检测到头显,或您的头显未启用开发者模式"
#: dashboard/qml/Main.qml:312
#, kde-format
msgid "Disconnect"
msgstr "断开连接"
#: dashboard/qml/Main.qml:329
#, kde-format
msgctxt "automatically started application"
msgid "Application"
msgstr "应用程序"
#: dashboard/qml/Main.qml:350
#, kde-format
msgid "Steam information"
msgstr "Steam 信息"
#: dashboard/qml/Main.qml:371
#, kde-format
msgid "Wizard"
msgstr "向导"
#: dashboard/qml/Main.qml:378
#, kde-format
msgid "Install the app"
msgstr "安装应用程序"
#: dashboard/qml/Main.qml:399 dashboard/qml/SettingsPage.qml:14
#, kde-format
msgid "Settings"
msgstr "设置"
#: dashboard/qml/Main.qml:406 dashboard/qml/TroubleshootPage.qml:10
#, kde-format
msgid "Troubleshoot"
msgstr "疑难解答"
#: dashboard/qml/SelectGame.qml:14
#, kde-format
msgctxt "don't start an application automatically"
msgid "None"
msgstr "无"
#: dashboard/qml/SelectGame.qml:20
#, kde-format
msgctxt "choose a custom application to start"
msgid "Custom"
msgstr "自定义"
#: dashboard/qml/SelectGame.qml:76
#, kde-format
msgctxt "browse a file to choose the application to start"
msgid "Browse"
msgstr "浏览"
#: dashboard/qml/SettingsPage.qml:35
#, kde-format
msgctxt "automatic foveation setup"
msgid "Manual foveation"
msgstr "手动注视点渲染"
#: dashboard/qml/SettingsPage.qml:41
#, kde-format
msgid "Foveation strength:"
msgstr "注视点渲染强度:"
#: dashboard/qml/SettingsPage.qml:57
#, kde-format
msgid "%1 %"
msgstr "%1 %"
#: dashboard/qml/SettingsPage.qml:63
#, kde-format
msgid ""
"A stronger foveation makes the image sharper in the center than in the "
"periphery and makes the decoding faster. This is better for fast paced "
"games.\n"
"\n"
"A weaker foveation gives a uniform sharpness in the whole image.\n"
"\n"
"The recommended values are between 20% and 50% for headsets without eye "
"tracking and between 50% and 70% for headsets with eye tracking."
msgstr ""
"更强的注视点渲染会使画面中心比周边更清晰,并加快解码速度。这更适合快节奏的游"
"戏。\n"
"\n"
"较弱的注视点渲染可在整个画面中提供一致的清晰度。\n"
"\n"
"对于没有眼动追踪的头显,建议值在 20% 到 50% 之间,对于有眼动追踪的头显,建议"
"值在 50% 到 70% 之间。"
#: dashboard/qml/SettingsPage.qml:69
#, kde-format
msgctxt "weaker foveation"
msgid "Weaker"
msgstr "较弱"
#: dashboard/qml/SettingsPage.qml:80
#, kde-format
msgctxt "stronger foveation"
msgid "Stronger"
msgstr "较强"
#: dashboard/qml/SettingsPage.qml:90
#, kde-format
msgid "Bitrate:"
msgstr "码率:"
#: dashboard/qml/SettingsPage.qml:94 dashboard/qml/SettingsPage.qml:96
#, kde-format
msgctxt "bitrate"
msgid "%1 Mbit/s"
msgstr "%1 Mbit/s"
#: dashboard/qml/SettingsPage.qml:108
#, kde-format
msgid "The current encoder configuration is not supported"
msgstr "不支持当前编码配置"
#: dashboard/qml/SettingsPage.qml:113
#, kde-format
msgid "Reset"
msgstr "重置"
#: dashboard/qml/SettingsPage.qml:120
#, kde-format
msgid "Encoder:"
msgstr "编码:"
#: dashboard/qml/SettingsPage.qml:126
#, kde-format
msgctxt "automatic encoder setup"
msgid "Auto"
msgstr "自动"
#: dashboard/qml/SettingsPage.qml:130
#, kde-format
msgid "nvenc (NVIDIA GPUs)"
msgstr "nvenc (NVIDIA GPUs)"
#: dashboard/qml/SettingsPage.qml:134
#, kde-format
msgid "vaapi (AMD and Intel GPUs)"
msgstr "vaapi (AMD 和 Intel GPUs)"
#: dashboard/qml/SettingsPage.qml:138
#, kde-format
msgid "Vulkan (Any modern GPU)"
msgstr "Vulkan (任何现代 GPU)"
#: dashboard/qml/SettingsPage.qml:142
#, kde-format
msgid "x264 (software encoding)"
msgstr "x264 (软件编码器)"
#: dashboard/qml/SettingsPage.qml:159
#, kde-format
msgid "\"Auto\" will use hardware acceleration if it is available"
msgstr "\"自动\" 将在可用时优先使用硬件编码"
#: dashboard/qml/SettingsPage.qml:164
#, kde-format
msgid "Codec:"
msgstr "编码器:"
#: dashboard/qml/SettingsPage.qml:170
#, kde-format
msgctxt "automatic codec setup"
msgid "Auto"
msgstr "自动"
#: dashboard/qml/SettingsPage.qml:174
#, kde-format
msgid "H.264"
msgstr "H.264"
#: dashboard/qml/SettingsPage.qml:178
#, kde-format
msgid "H.265"
msgstr "H.265"
#: dashboard/qml/SettingsPage.qml:182
#, kde-format
msgid "AV1"
msgstr "AV1"
#: dashboard/qml/SettingsPage.qml:210
#, kde-format
msgid "10-bits"
msgstr "10 位编码"
#: dashboard/qml/SettingsPage.qml:215
#, kde-format
msgid ""
"10-bit encoding improves image quality but is not supported by all codecs "
"and hardware"
msgstr "10 位编码可以提升图像质量,但并非所有编解码器和硬件都支持"
#: dashboard/qml/SettingsPage.qml:225
#, kde-format
msgid "Advanced options"
msgstr "进阶选项"
#: dashboard/qml/SettingsPage.qml:231
#, kde-format
msgid "Check system configuration on start"
msgstr "在启动时检查系统设置"
#: dashboard/qml/SettingsPage.qml:235
#, kde-format
msgid "Enable debug window"
msgstr "启用 Debug 窗口"
#: dashboard/qml/SettingsPage.qml:242
#, kde-format
msgid "Enable SteamVR tracked devices support"
msgstr "启用 SteamVR 追踪设备支持"
#: dashboard/qml/SettingsPage.qml:245
#, kde-format
msgid ""
"Allows the use of lighthouse-based controllers and trackers.\n"
"Requires SteamVR to be installed.\n"
"Devices must be be powered on before connecting to WiVRn.\n"
"An external tool such as motoc is needed for calibration."
msgstr ""
"允许使用 Lighthouse 基站追踪的控制器和追踪器。\n"
"需要安装 SteamVR。\n"
"设备必须在连接到 WiVRn 之前开启电源。\n"
"校准需要额外工具,例如 motoc。"
#: dashboard/qml/SettingsPage.qml:253
#, kde-format
msgid "Custom adb location"
msgstr "自定义 adb 位置"
#: dashboard/qml/SettingsPage.qml:264
#, kde-format
msgid "Adb location:"
msgstr "adb 位置:"
#: dashboard/qml/SettingsPage.qml:273
#, kde-format
msgctxt "browse a file to choose the adb binary"
msgid "Browse"
msgstr "浏览"
#: dashboard/qml/SettingsPage.qml:283
#, kde-format
msgid "Default"
msgstr "默认"
#: dashboard/qml/SettingsPage.qml:297
#, kde-format
msgctxt "set a custom OpenVR compatibility library"
msgid "Custom"
msgstr "自定义"
#: dashboard/qml/SettingsPage.qml:302
#, kde-format
msgid "Disabled"
msgstr "已停用"
#: dashboard/qml/SettingsPage.qml:310
#, kde-format
msgid "OpenVR compatibility library:"
msgstr "OpenVR 兼容层:"
#: dashboard/qml/SettingsPage.qml:336
#, kde-format
msgid "Library path, excluding bin/linux64/vrclient.so"
msgstr "兼容层路径,不包含 bin/linux64/vrclient.so"
#: dashboard/qml/SteamLaunchOptions.qml:8
#, kde-format
msgid ""
"For Steam games, right click on the game in Steam, go in Properties > "
"General and paste this in \"Launch options\":"
msgstr ""
"对于 Steam 游戏,在 Steam 中右键点击游戏,前往「属性」>「通用」,然后将此文本"
"粘贴到「启动选项」中:"
#: dashboard/qml/SteamLaunchOptions.qml:20
#, kde-format
msgid "Paste this in the Steam launch options for the app you want to start"
msgstr "将其粘贴到您要启动的应用程序的 Steam 启动选项中"
#: dashboard/qml/SteamLaunchOptions.qml:26
#, kde-format
msgctxt "copy text to the clipboard"
msgid "Copy"
msgstr "复制"
#: dashboard/qml/SteamLaunchOptions.qml:30
#, kde-format
msgid "Copied Steam launch command"
msgstr "已复制 Steam 自动指令"
#: dashboard/qml/TroubleshootPage.qml:20
#, kde-format
msgid "I cannot find the WiVRn app on my headset"
msgstr "我在我的头显上找不到 WiVRn 应用程序。"
#: dashboard/qml/TroubleshootPage.qml:21 dashboard/qml/WizardPage.qml:388
#, kde-format
msgid ""
"If you installed WiVRn over USB on a Meta headset, the app is in the "
"\"unknown sources\" section."
msgstr ""
"如果您通过 USB 在 Meta 头显上安裝了 WiVRn,该应用程序将在「未知来源」中。"
#: dashboard/qml/TroubleshootPage.qml:24
#, kde-format
msgid "I cannot see my computer in the WiVRn app"
msgstr "我在 WiVRn 应用程序中看不到我的计算机。"
#: dashboard/qml/TroubleshootPage.qml:25
#, kde-format
msgid "If you have a firewall, make sure that port 5353/UDP is open."
msgstr "如果你有防火墙,请确保端口 5353/UDP 是开放的。"
#: dashboard/qml/TroubleshootPage.qml:28
#, kde-format
msgid "Connecting remains stuck on \"Connection to ...\""
msgstr "连接过程一直停留在 \"正在连接到 …\""
#: dashboard/qml/TroubleshootPage.qml:29 dashboard/qml/TroubleshootPage.qml:33
#, kde-format
msgid ""
"If you have a firewall, make sure that port 9757 is open both for TCP and "
"UDP."
msgstr "如果你有防火墙,请确保端口 9757 在 TCP 和 UDP 下都是开放的。"
#: dashboard/qml/TroubleshootPage.qml:32
#, kde-format
msgid "Connection fails with \"no route to host\""
msgstr "连接失败,错误信息为 \"no route to host\""
#: dashboard/qml/TroubleshootPage.qml:36
#, kde-format
msgid "I have an \"Incompatible WiVRn server\" error on my headset"
msgstr "我在头显上遇到「不兼容的 WiVRn 服务器」错误"
#: 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>"
msgstr ""
"<p>头显应用程序与计算机上服务器的版本必须一致。</p><ul><li>头显应用程序版本位"
"于\"关于\"页面</li><li>服务器版本是<b>%1</b></li></ul>"
#: dashboard/qml/TroubleshootPage.qml:40
#, kde-format
msgid "I have a \"Pairing is disabled\" error"
msgstr "我遇到「配对已停用」错误"
#: dashboard/qml/TroubleshootPage.qml:41
#, kde-format
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 ""
"如果您已重新安装服务器或客户端,或如果您想连接另一个头显,您必须在连接前启用"
"配对。"
#: dashboard/qml/TroubleshootPage.qml:41
#, kde-format
msgid "Pairing is currently enabled with PIN %1."
msgstr "目前已启用配对,身份识别码为 %1。"
#: dashboard/qml/TroubleshootPage.qml:41
#, kde-format
msgid "Pairing is currently disabled."
msgstr "目前已停用配对"
#: dashboard/qml/TroubleshootPage.qml:57
#, kde-format
msgid "I have no sound on my headset"
msgstr "我的头显没有声音"
#: dashboard/qml/TroubleshootPage.qml:58 dashboard/qml/WizardPage.qml:441
#, kde-format
msgid ""
"When the headset is connected, select \"WiVRn\" as the default audio output "
"device for applications to use it."
msgstr "连接头显后,选择 \"WiVRn\" 作为应用程序的预设音频输出设备。"
#: dashboard/qml/TroubleshootPage.qml:75
#, kde-format
msgid "Report an issue"
msgstr "反馈问题"
#: dashboard/qml/TroubleshootPage.qml:80
#, kde-format
msgid "Ask on Discord"
msgstr "在 Discord 上提问"
#: dashboard/qml/WizardPage.qml:14
#, kde-format
msgid "Getting started"
msgstr "入门指南"
#: dashboard/qml/WizardPage.qml:29 dashboard/qml/WizardPage.qml:78
#: dashboard/qml/WizardPage.qml:253 dashboard/qml/WizardPage.qml:317
#: dashboard/qml/WizardPage.qml:401 dashboard/qml/WizardPage.qml:448
#: dashboard/qml/WizardPage.qml:485
#, kde-format
msgid "Back"
msgstr "返回"
#: dashboard/qml/WizardPage.qml:64
#, kde-format
msgid "Welcome to WiVRn"
msgstr "欢迎使用 WiVRn"
#: dashboard/qml/WizardPage.qml:69
#, kde-format
msgid ""
"This wizard will help you set up WiVRn on your headset and connect it to "
"your computer."
msgstr "向导将帮助您在头显上设置 WiVRn,并将其连接到您的计算机。"
#: dashboard/qml/WizardPage.qml:83 dashboard/qml/WizardPage.qml:258
#: dashboard/qml/WizardPage.qml:322 dashboard/qml/WizardPage.qml:453
#: dashboard/qml/WizardPage.qml:490
#, kde-format
msgid "Next"
msgstr "下一步"
#: dashboard/qml/WizardPage.qml:112
#, kde-format
msgid "How to enable developer mode"
msgstr "如何启用开发者模式"
#: dashboard/qml/WizardPage.qml:119
#, kde-format
msgid "Follow the manufacturer's instructions below:"
msgstr "请按照以下设备提供商的说明操作:"
#: 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"
"You can either install it from the Meta store or directly over USB."
msgstr ""
"为了使用 WiVRn,您需要在头显上安装客户端应用。\n"
"您可以从 Meta 商店安装,也可以直接通过 USB 安装。"
#: dashboard/qml/WizardPage.qml:148
#, kde-format
msgid "Install from the Meta store"
msgstr "从 Meta 商店安装"
#: dashboard/qml/WizardPage.qml:152
#, kde-format
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 ""
"对于 Quest 2、3、3S 和 Pro,您可以从 <a href=\"https://www.meta.com/"
"experiences/7959676140827574/\">Meta 商店</a>获取应用程序."
#: dashboard/qml/WizardPage.qml:164
#, kde-format
msgid ""
"A newer release is available: %1 → %2, the client app on the Meta store may "
"not be compatible."
msgstr "有新版本可用:%1 → %2,Meta 商店上的客户端应用程序可能不兼容。"
#: dashboard/qml/WizardPage.qml:171
#, kde-format
msgid ""
"This is a nightly build, the client app on the Meta store may not be "
"compatible."
msgstr "这是一个每日构建版本,Meta 商店上的客户端应用程序可能不兼容。"
#: dashboard/qml/WizardPage.qml:181
#, kde-format
msgctxt "displayed between 'meta store' and 'install over USB' in the wizard"
msgid "Or"
msgstr "或"
#: dashboard/qml/WizardPage.qml:187
#, kde-format
msgid "Install over USB"
msgstr "通过 USB 安装"
#: dashboard/qml/WizardPage.qml:219
#, 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>"
msgstr ""
"<p>未检测到头显。请确认:\n"
"<ul><li>已安裝 ADB udev 规则</li><li>头显已启用 <a href=\"#\">开发者模式</"
"a></li></ul></p>"
#: dashboard/qml/WizardPage.qml:280
#, kde-format
msgid "Select the application you want to start"
msgstr "选择您要启动的应用程序"
#: dashboard/qml/WizardPage.qml:286
#, kde-format
msgid ""
"The application you choose will be started automatically when you connect "
"your headset."
msgstr "当您连接至头显时,您选择的应用程序将会自动启动。"
#: dashboard/qml/WizardPage.qml:301
#, kde-format
msgid "Important information"
msgstr "重要信息"
#: dashboard/qml/WizardPage.qml:308
#, kde-format
msgid ""
"WiVRn entirely replaces SteamVR, you should not start SteamVR while WiVRn is "
"running."
msgstr "WiVRn 完全取代了 SteamVR,在 WiVRn 运行时,請勿啟動 SteamVR"
#: dashboard/qml/WizardPage.qml:359
#, kde-format
msgid "Start the WiVRn app on your headset"
msgstr "在您的头显上启动 WiVRn 应用程序"
#: dashboard/qml/WizardPage.qml:364
#, kde-format
msgid ""
"To connect over WiFi, start the WiVRn app on your headset, connect to \"%1\" "
"and enter PIN \"%2\"."
msgstr ""
"要通过 WiFi 连接,请在您的头显上启动 WiVRn 应用程序,连接至 \"%1\" 并输入身份"
"识别码 \"%2\"。"
#: dashboard/qml/WizardPage.qml:371
#, kde-format
msgid "To connect over USB, click on \"Connect by USB\"."
msgstr "要通过 USB 连接,请点击 \"通过 USB 连接\"。"
#: dashboard/qml/WizardPage.qml:384
#, kde-format
msgid "Troubleshooting"
msgstr "疑难解答"
#: dashboard/qml/WizardPage.qml:393
#, kde-format
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 ""
"如果服务器不可见或连接失败,请检查防火墙中端口 5353(UDP)和 9757(TCP 和 "
"UDP)是否开放。"
#: dashboard/qml/WizardPage.qml:406
#, kde-format
msgid "Skip"
msgstr "跳过"
#: dashboard/qml/WizardPage.qml:426
#, kde-format
msgid "Connection established"
msgstr "已建立连接"
#: dashboard/qml/WizardPage.qml:431
#, kde-format
msgid "Your headset is now connected."
msgstr "已连接您的头显。"
#: dashboard/qml/WizardPage.qml:436 dashboard/qml/WizardPage.qml:478
#, kde-format
msgid ""
"To connect another headset, make sure pairing is enabled in the dashboard "
"before connecting."
msgstr "如果要连接其他头显,请确保在连接之前在控制面板中启用配对。"
#: dashboard/qml/WizardPage.qml:458 dashboard/qml/WizardPage.qml:495
#, kde-format
msgid "Finish"
msgstr "完成"
#: dashboard/qml/WizardPage.qml:473
#, kde-format
msgid "Finished"
msgstr "已完成"
#: dashboard/wivrn_server.cpp:594
#, kde-format
msgid "xrizer"
msgstr "xrizer"
#: dashboard/wivrn_server.cpp:595
#, kde-format
msgid "Open Composite"
msgstr "Open Composite"
#, kde-format
#~ msgid "No precompiled APK is available for this version"
#~ msgstr "此版本没有预编译 APK 可用"
#, kde-format
#~ msgid "Encoder layout:"
#~ msgstr "编码器布局:"
#, kde-format
#~ msgctxt "encoder preset"
#~ msgid "Automatic"
#~ msgstr "自动"
#, kde-format
#~ msgctxt "encoder preset"
#~ msgid "Manual"
#~ msgstr "手动"
#, kde-format
#~ msgctxt "encoder preset"
#~ msgid "Default preset"
#~ msgstr "预设"
#, kde-format
#~ msgctxt "encoder preset"
#~ msgid "Low latency preset"
#~ msgstr "低延迟预设"
#, kde-format
#~ msgctxt "encoder preset"
#~ msgid "Safe preset"
#~ msgstr "兼容预设"
#, kde-format
#~ msgid ""
#~ "To add a new encoder, split an existing encoder by clicking near an "
#~ "edge.\n"
#~ "Drag an edge to resize or remove encoders."
#~ msgstr ""
#~ "要新增编码器,请从边缘附近拖动以分割编码器。\n"
#~ "拖拽边缘调整编码器大小,拖转边缘至边缘以移除编码器。"
#, kde-format
#~ msgid "Vulkan (Vulkan Video)"
#~ msgstr "Vulkan (Vulkan Video)"
#, kde-format
#~ msgid ""
#~ "If the server is not visible or the connection fails, check that port "
#~ "5353 (UDP) and 9757 (TCP and UDP) are open in your firewall."
#~ msgstr ""
#~ "如果服务器不可见或连接失败,请检查您的防火墙是否开放了端口 5353 (UDP) 和 "
#~ "9757 (TCP 和 UDP)。"
+755
View File
@@ -0,0 +1,755 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the WiVRn package.
# Jayden Ha <jayden@jaydenha.uk>, 2025.
# BERADQ <adqber123@outlook.com>, 2025.
#
msgid ""
msgstr ""
"Project-Id-Version: WiVRn\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-11-08 18:15+0800\n"
"PO-Revision-Date: 2025-11-09 23:02+0800\n"
"Last-Translator: BERADQ <adqber123@outlook.com>\n"
"Language-Team: Chinese (China)\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Gtranslator 49.0\n"
#: client/scene.cpp:72
msgid "No supported swapchain format"
msgstr "不支持的交换链格式"
#: client/scenes/app_launcher.cpp:128
msgid "Connected to WiVRn server"
msgstr "已连接到 WiVRn 服务器"
#: client/scenes/app_launcher.cpp:130
#, c++-format
msgid "Connected to {}"
msgstr "已连接到 {}"
#: client/scenes/app_launcher.cpp:136
msgid "Start an application on the server to start streaming."
msgstr "在服务器端启动应用程序来开始串流。"
#: client/scenes/app_launcher.cpp:146
msgid "Start an application on your computer or select one to start streaming."
msgstr "在您的计算机上启动应用程序,或是选择一个来开始串流。"
#: client/scenes/app_launcher.cpp:148
#, c++-format
msgid "Start an application on {} or select one to start streaming."
msgstr "在 {} 上启动应用程序,或是选择一个来开始串流。"
#: client/scenes/lobby.cpp:230
msgid "Incompatible WiVRn server: no protocol field in TXT"
msgstr "不兼容的 WiVRn 服务器: TXT 中没有协议字段"
#: client/scenes/lobby.cpp:233
#, c++-format
msgid "Incompatible WiVRn server protocol (client: {}, server: {})"
msgstr "不兼容的 WiVRn 服务器协议(客户端: {},服务器: {})"
#: client/scenes/lobby.cpp:248
#, c++-format
msgid "Cannot resolve hostname: {}"
msgstr "无法解析主机名: {}"
#: client/scenes/lobby.cpp:335 client/scenes/lobby.cpp:341
#, c++-format
msgid "Cannot connect to {} ({}): {}"
msgstr "无法连接至 {} ({}): {}"
#: client/scenes/lobby.cpp:424
msgid "Waiting for connection"
msgstr "等待连接"
#: client/scenes/lobby.cpp:1304
msgid "Passthrough"
msgstr "透视"
#: client/scenes/lobby.cpp:1316
msgid "Default environment"
msgstr "默认环境"
#: client/scenes/lobby_gui.cpp:99
msgctxt "openxr_post_processing"
msgid "Normal"
msgstr "正常"
#: client/scenes/lobby_gui.cpp:102
msgctxt "openxr_post_processing"
msgid "Quality"
msgstr "画质"
#: client/scenes/lobby_gui.cpp:104
msgctxt "openxr_post_processing"
msgid "Disabled"
msgstr "已停用"
#: client/scenes/lobby_gui.cpp:112 client/scenes/lobby_gui.cpp:256
#: client/scenes/stream_gui.cpp:900
msgid "Disconnect"
msgstr "终止连接"
#: client/scenes/lobby_gui.cpp:132 client/scenes/lobby_gui_customize.cpp:653
#: client/scenes/lobby_gui_customize.cpp:744
#: client/scenes/lobby_gui_customize.cpp:800 client/scenes/stream_gui.cpp:896
msgid "Close"
msgstr "关闭"
#: client/scenes/lobby_gui.cpp:138
msgid "Connection"
msgstr "连接"
#: client/scenes/lobby_gui.cpp:140
#, c++-format
msgid "Connection to {}"
msgstr "连接至 {}"
#: client/scenes/lobby_gui.cpp:170
msgid "PIN"
msgstr "身份识别码"
#: client/scenes/lobby_gui.cpp:192
msgid "Input the PIN displayed on the dashboard"
msgstr "请输入控制面板上显示的身份识别码"
#: client/scenes/lobby_gui.cpp:282
msgid "Name"
msgstr "名"
#: client/scenes/lobby_gui.cpp:293
msgid "Address"
msgstr "服务器地址"
#: client/scenes/lobby_gui.cpp:302
msgid "Port"
msgstr "端口"
#: client/scenes/lobby_gui.cpp:310
msgid "TCP only"
msgstr "仅限 TCP"
#: client/scenes/lobby_gui.cpp:317 client/scenes/lobby_gui_customize.cpp:555
#: client/scenes/stream_gui.cpp:864
msgid "Cancel"
msgstr "取消"
#: client/scenes/lobby_gui.cpp:331
msgid "Save"
msgstr "保存"
#: client/scenes/lobby_gui.cpp:384
msgid ""
"Start a WiVRn server on your\n"
"local network"
msgstr ""
"在您的局域网中启动\n"
"WiVRn 服务器"
#: client/scenes/lobby_gui.cpp:416
msgid "Autoconnect"
msgstr "自动连接"
#: client/scenes/lobby_gui.cpp:442
msgid "Connect"
msgstr "连接"
#: client/scenes/lobby_gui.cpp:452 client/wivrn_client.cpp:186
msgid "Incompatible server version"
msgstr "服务器版本不兼容"
#: client/scenes/lobby_gui.cpp:454
msgid "Server not available"
msgstr "服务器不可用"
#: client/scenes/lobby_gui.cpp:536
msgctxt "language selection, replace with the name of the language"
msgid "English"
msgstr "中文"
#: client/scenes/lobby_gui.cpp:550
msgid "Language"
msgstr "语言"
#: client/scenes/lobby_gui.cpp:550 client/scenes/lobby_gui.cpp:552
msgid "System language"
msgstr "系统语言"
#: client/scenes/lobby_gui.cpp:577
msgid "Refresh rate"
msgstr "刷新率"
#: client/scenes/lobby_gui.cpp:577 client/scenes/lobby_gui.cpp:579
msgctxt "automatic refresh rate"
msgid "Automatic"
msgstr "自动"
#: client/scenes/lobby_gui.cpp:586
msgid ""
"Select refresh rate based on measured application performance.\n"
"May cause flicker when a change happens."
msgstr ""
"根据测量的应用程序性能选择刷新率。\n"
"更改时可能会造成闪烁。"
#: client/scenes/lobby_gui.cpp:603
msgid "Minimum refresh rate"
msgstr "最低刷新率"
#: client/scenes/lobby_gui.cpp:629
msgid "Foveation level"
msgstr "注视点渲染等级"
#: client/scenes/lobby_gui.cpp:651
msgid "Resolution scale"
msgstr "分辨率缩放比例"
#: client/scenes/lobby_gui.cpp:655
#, c-format, c++-format
msgid "%d%% - {}x{} per eye"
msgstr "%d%% - 单眼 {}x{}"
#: client/scenes/lobby_gui.cpp:666
#, c++-format
msgid "Resolution larger than {}x{} may not be supported by the headset"
msgstr "分辨率高于 {}x{} 可能不被头显支持"
#: client/scenes/lobby_gui.cpp:672
msgid "High power mode"
msgstr "高耗电模式"
#: client/scenes/lobby_gui.cpp:675
msgid "Increase power usage to allow higher resolution and refresh rate"
msgstr "增加功耗以支持更高的分辨率和刷新率"
#: client/scenes/lobby_gui.cpp:681
msgid "Enable microphone"
msgstr "启用麦克风"
#: client/scenes/lobby_gui.cpp:690
msgid "Unprocessed Microphone Audio"
msgstr "未处理的麦克风音频"
#: client/scenes/lobby_gui.cpp:696
msgid "Force disable audio filters, such as noise cancellation"
msgstr "强制停用音频滤波器,如降噪"
#: client/scenes/lobby_gui.cpp:703
msgid "Enable hand tracking"
msgstr "启用手部追踪"
#: client/scenes/lobby_gui.cpp:709 client/scenes/lobby_gui.cpp:721
#: client/scenes/lobby_gui.cpp:733 client/scenes/lobby_gui.cpp:750
#: client/scenes/lobby_gui_customize.cpp:540
msgid "This feature is not supported by your headset"
msgstr "您的头显不支持此功能"
#: client/scenes/lobby_gui.cpp:715
msgid "Enable eye tracking"
msgstr "启用眼动追踪"
#: client/scenes/lobby_gui.cpp:727
msgid "Enable face tracking"
msgstr "启用面部追踪"
#: client/scenes/lobby_gui.cpp:741
msgid "Enable body tracking"
msgstr "启用身体追踪"
#: client/scenes/lobby_gui.cpp:755
msgid ""
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
"tracking settings,\n"
"otherwise body data will be guessed from controller and headset positions"
msgstr ""
"需要在 Quest 运动追踪设置中启用「手部和身体追踪」,\n"
"否则身体数据将根据手柄和头显的位置进行猜测"
#: client/scenes/lobby_gui.cpp:765
msgid "Enable lower body tracking"
msgstr "启用下半身追踪"
#: client/scenes/lobby_gui.cpp:771
msgid ""
"Estimate lower body joint positions using Generative Legs\n"
"Requires 'Hand and body tracking' to be enabled in the Quest movement "
"tracking settings"
msgstr ""
"使用 Generative Legs 猜测下半身关节位置\n"
"需要在 Quest 运动追踪设置中启用「手部和身体追踪」"
#: client/scenes/lobby_gui.cpp:774
msgid "Enable hip tracking"
msgstr "启用臀部(腰部)追踪"
#: client/scenes/lobby_gui.cpp:780
msgid ""
"Only takes affect with lower body tracking enabled\n"
"May be desired when using another source of hip tracking"
msgstr ""
"仅在启用下半身追踪时生效\n"
"在使用其他臀部追踪时可能需要此功能"
#: client/scenes/lobby_gui.cpp:788
msgid "Enable in-stream window"
msgstr "启用串流中窗口"
#: client/scenes/lobby_gui.cpp:791
msgid ""
"Enables the configuration window to be shown while the game is streaming.\n"
"If enabled, the window is activated by pressing both thumbsticks."
msgstr ""
"在游戏串流期间启用配置窗口显示\n"
"若启用此功能,同时按下两只摇杆,将会显示该窗口。"
#: client/scenes/lobby_gui.cpp:805 client/scenes/stream_gui.cpp:394
msgid "OpenXR post-processing"
msgstr "OpenXR 后处理"
#: client/scenes/lobby_gui.cpp:809 client/scenes/stream_gui.cpp:398
msgid "Supersampling"
msgstr "超采样"
#: client/scenes/lobby_gui.cpp:829 client/scenes/stream_gui.cpp:419
msgid ""
"Reduce flicker for high contrast edges.\n"
"Useful when the input resolution is high compared to the headset display"
msgstr ""
"减少高对比度边缘的闪烁。\n"
"当输入分辨率高于头显原生分辨率时很有用"
#: client/scenes/lobby_gui.cpp:834 client/scenes/stream_gui.cpp:424
msgid "Sharpening"
msgstr "锐化"
#: client/scenes/lobby_gui.cpp:854 client/scenes/stream_gui.cpp:445
msgid ""
"Improve clarity of high contrast edges and counteract blur.\n"
"Useful when the input resolution is low compared to the headset display"
msgstr ""
"改善高对比边缘的清晰度并抵消模糊。\n"
"当输入分辨率低于头显原生分辨率时很有用"
#: client/scenes/lobby_gui.cpp:1038 client/scenes/lobby_gui.cpp:1046
#: client/scenes/stream_gui.cpp:171 client/scenes/stream_gui.cpp:373
msgid "CPU time"
msgstr "CPU 时间"
#: client/scenes/lobby_gui.cpp:1042
msgid "CPU time [ms]"
msgstr "CPU 时间 [ms]"
#: client/scenes/lobby_gui.cpp:1052 client/scenes/lobby_gui.cpp:1060
#: client/scenes/stream_gui.cpp:173 client/scenes/stream_gui.cpp:374
msgid "GPU time"
msgstr "GPU 时间"
#: client/scenes/lobby_gui.cpp:1056
msgid "GPU time [ms]"
msgstr "GPU 时间 [ms]"
#: client/scenes/lobby_gui.cpp:1120
msgid "Enable the microphone?"
msgstr "是否启用麦克风?"
#: client/scenes/lobby_gui.cpp:1125
msgid "Enable eye tracking?"
msgstr "是否启用眼动追踪?"
#: client/scenes/lobby_gui.cpp:1130
msgid "Enable face tracking?"
msgstr "是否启用面部追踪?"
#: client/scenes/lobby_gui.cpp:1135
msgid "Enable body tracking?"
msgstr "是否启用身体追踪?"
#: client/scenes/lobby_gui.cpp:1143
msgid "Welcome to WiVRn"
msgstr "欢迎使用 WiVRn"
#: client/scenes/lobby_gui.cpp:1167
msgid "Yes"
msgstr "是"
#: client/scenes/lobby_gui.cpp:1174
msgid "No"
msgstr "否"
#: client/scenes/lobby_gui.cpp:1193 client/scenes/lobby_gui.cpp:1834
msgid "Licenses"
msgstr "许可证"
#: client/scenes/lobby_gui.cpp:1468
msgid "Microphone is enabled"
msgstr "麦克风已启用"
#: client/scenes/lobby_gui.cpp:1469
msgid "Microphone is disabled"
msgstr "麦克风已停用"
#: client/scenes/lobby_gui.cpp:1478
msgid "Hand tracking is enabled"
msgstr "手部追踪已启用"
#: client/scenes/lobby_gui.cpp:1479
msgid "Hand tracking is disabled"
msgstr "手部追踪已停用"
#: client/scenes/lobby_gui.cpp:1488
msgid "Eye tracking is enabled"
msgstr "眼动追踪已启用"
#: client/scenes/lobby_gui.cpp:1489
msgid "Eye tracking is disabled"
msgstr "眼动追踪已停用"
#: client/scenes/lobby_gui.cpp:1499
msgid "Face tracking is enabled"
msgstr "面部追踪已启用"
#: client/scenes/lobby_gui.cpp:1500
msgid "Face tracking is disabled"
msgstr "面部追踪已停用"
#: client/scenes/lobby_gui.cpp:1510
msgid "Body tracking is enabled"
msgstr "身体追踪已启用"
#: client/scenes/lobby_gui.cpp:1511
msgid "Body tracking is disabled"
msgstr "身体追踪已停用"
#: client/scenes/lobby_gui.cpp:1527
msgid "Add server"
msgstr "新增服务器"
#: client/scenes/lobby_gui.cpp:1813
msgid "Server list"
msgstr "服务器列表"
#: client/scenes/lobby_gui.cpp:1816 client/scenes/stream_gui.cpp:881
msgid "Settings"
msgstr "设置"
#: client/scenes/lobby_gui.cpp:1819
msgid "Post-processing"
msgstr "后处理"
#: client/scenes/lobby_gui.cpp:1822
msgid "Customize"
msgstr "自定义"
#: client/scenes/lobby_gui.cpp:1826
msgid "Debug"
msgstr "Debug"
#: client/scenes/lobby_gui.cpp:1831
msgid "About"
msgstr "关于"
#: client/scenes/lobby_gui.cpp:1837
msgid "Exit"
msgstr "退出"
#: client/scenes/lobby_gui.cpp:1854
msgid ""
"Press the grip button or put your palm up\n"
"to move the main window"
msgstr ""
"按下抓握键,或手掌向上\n"
"以移动主窗口"
#: client/scenes/lobby_gui.cpp:1856
msgid "Press the grip button to move the main window"
msgstr "按下抓握键以移动主窗口"
#: client/scenes/lobby_gui_customize.cpp:363
#, c++-format
msgid "Author: {}"
msgstr "作者: {}"
#: client/scenes/lobby_gui_customize.cpp:367
#, c++-format
msgid "Size: {:.1f} MB"
msgstr "大小: {:.1f} MB"
#: client/scenes/lobby_gui_customize.cpp:447
msgid "Delete this model"
msgstr "删除此模型"
#: client/scenes/lobby_gui_customize.cpp:483
#: client/scenes/lobby_gui_customize.cpp:689
#, c++-format
msgid "HTTP error {} when downloading {}"
msgstr "发生了 HTTP 错误 {} 于下载 {} 时"
#: client/scenes/lobby_gui_customize.cpp:491
#: client/scenes/lobby_gui_customize.cpp:697
#, c++-format
msgid ""
"Curl error when downloading {}\n"
"{}: {}"
msgstr ""
"Curl 下载时发生错误 {}\n"
"{}:{}"
#: client/scenes/lobby_gui_customize.cpp:552
#, c-format
msgid "Really delete %s?"
msgstr "真的要删除 %s 吗?"
#: client/scenes/lobby_gui_customize.cpp:556
msgid "Delete"
msgstr "删除"
#: client/scenes/lobby_gui_customize.cpp:637
#, c++-format
msgid "Cannot load environment: {}"
msgstr "无法加载环境: {}"
#: client/scenes/lobby_gui_customize.cpp:645
msgid "Loading environment"
msgstr "环境加载中"
#: client/scenes/lobby_gui_customize.cpp:724
msgid "Download more environments"
msgstr "下载更多环境"
#: client/scenes/lobby_gui_customize.cpp:732
msgid "Open local glTF model"
msgstr "打开本地 glTF 模型"
#: client/scenes/stream_gui.cpp:173
msgid "Reproject"
msgstr "重投影"
#: client/scenes/stream_gui.cpp:174
msgid "Blit"
msgstr "位块"
#: client/scenes/stream_gui.cpp:176
msgid "Network"
msgstr "网络"
#: client/scenes/stream_gui.cpp:176 client/scenes/stream_gui.cpp:371
msgid "Download"
msgstr "下載"
#: client/scenes/stream_gui.cpp:177 client/scenes/stream_gui.cpp:372
msgid "Upload"
msgstr "上传"
#: client/scenes/stream_gui.cpp:246
#, c++-format
msgid "Decoder {}"
msgstr "解码器 {}"
#: client/scenes/stream_gui.cpp:258
msgid "Timings [ms]"
msgstr "时间信息 [ms]"
#: client/scenes/stream_gui.cpp:318
msgid "Encode"
msgstr "编码"
#: client/scenes/stream_gui.cpp:319
msgid "Send"
msgstr "发送"
#: client/scenes/stream_gui.cpp:320
msgid "Receive"
msgstr "接收"
#: client/scenes/stream_gui.cpp:321
msgid "Decode"
msgstr "解码"
#: client/scenes/stream_gui.cpp:322
msgid "Blitted"
msgstr "已传输位块"
#: client/scenes/stream_gui.cpp:323
msgid "Displayed"
msgstr "已显示"
#: client/scenes/stream_gui.cpp:324
msgid "Predicted"
msgstr "已预测"
#: client/scenes/stream_gui.cpp:344
#, c++-format
msgid "Estimated motion to photons latency: {}ms"
msgstr "预计运动到光子延迟: {}毫秒"
#: client/scenes/stream_gui.cpp:351
msgid "Press the grip button to move the window"
msgstr "按下抓握键来移动窗口"
#: client/scenes/stream_gui.cpp:353 client/scenes/stream_gui.cpp:824
msgid "Press both thumbsticks to display the WiVRn window"
msgstr "同时按下两侧摇杆以显示 WiVRn 窗口"
#: client/scenes/stream_gui.cpp:375
msgid "Motion to photon latency"
msgstr "从动作到显示的延迟"
#: client/scenes/stream_gui.cpp:452
msgid "Foveation center override"
msgstr "注视点渲染位置覆盖"
#: client/scenes/stream_gui.cpp:455
msgid "Enable"
msgstr "启用"
#: client/scenes/stream_gui.cpp:463 client/scenes/stream_gui.cpp:510
#, c++-format
msgid "Height {:.1f} deg"
msgstr "高度 {:.1f} 度"
#: client/scenes/stream_gui.cpp:464 client/scenes/stream_gui.cpp:511
#, c++-format
msgid "Distance {:.2f} m"
msgstr "距离 {:.2f} 米"
#: client/scenes/stream_gui.cpp:465
msgid "Default"
msgstr "默认"
#: client/scenes/stream_gui.cpp:476
msgid "Change"
msgstr "变更"
#: client/scenes/stream_gui.cpp:508
msgid "Use the thumbsticks to move the foveation center"
msgstr "使用摇杆移动注视点中心"
#: client/scenes/stream_gui.cpp:509
msgid "Press A to save or B to cancel"
msgstr "按下 A 保存或 B 取消"
#: client/scenes/stream_gui.cpp:567
msgid "Running XR applications:"
msgstr "运行 XR 应用程序中:"
#: client/scenes/stream_gui.cpp:584
msgid "Overlays"
msgstr "叠加层"
#: client/scenes/stream_gui.cpp:623
msgid "Request to quit, may be ignored by the application"
msgstr "退出请求可能会被应用程序忽略"
#: client/scenes/stream_gui.cpp:626
msgid "Start"
msgstr "启动"
#: client/scenes/stream_gui.cpp:878
msgid "Stats"
msgstr "统计"
#: client/scenes/stream_gui.cpp:884
msgid "Applications"
msgstr "应用程序"
#: client/scenes/stream_gui.cpp:890
msgid "Statistics overlay"
msgstr "统计数据叠加"
#: client/scenes/stream_gui.cpp:893
msgid "Compact view"
msgstr "概览"
#: client/wivrn_client.cpp:98 client/wivrn_client.cpp:202
msgid "Timeout"
msgstr "超时"
#: client/wivrn_client.cpp:149
msgid "Incorrect PIN"
msgstr "身份识别码错误"
#: client/wivrn_client.cpp:153
msgid "Unable to check PIN"
msgstr "无法验证身份识别码"
#: client/wivrn_client.cpp:182
msgid "Pairing is disabled on server"
msgstr "服务器上已停用配对"
#~ msgid "Enable video passthrough in lobby"
#~ msgstr "在待机区启用透视 (Passthrough)"
#~ msgid "Enable Snapdragon Game Super Resolution"
#~ msgstr "啟用 Snapdragon 遊戲超級解析度"
#~ msgid ""
#~ "On this headset, this setting has been fully superseded by the native "
#~ "Sharpening setting above.\n"
#~ "Only enable if you know what you're doing."
#~ msgstr ""
#~ "在此頭戴式顯示器上,此設定已被上方的原生「銳利化」設定完全取代。\n"
#~ "僅在您了解自己在做什麼時啟用。"
#~ msgid ""
#~ "Client-side upscaling and sharpening, adds a performance cost on the "
#~ "headset"
#~ msgstr "用戶端向上取樣和銳利化,會增加頭戴式顯示器的效能負擔"
#~ msgid "Upscaling factor"
#~ msgstr "向上取樣係數"
#~ msgid "Use edge direction"
#~ msgstr "使用邊緣方向"
#~ msgid "Adds an additional performance cost"
#~ msgstr "會增加額外的效能負擔"
#~ msgid "Edge threshold"
#~ msgstr "邊緣閾值"
#, c++-format
#~ msgid "Recommended: {:.1f}"
#~ msgstr "推薦:{:.1f}"
#~ msgid "Edge sharpness"
#~ msgstr "邊緣銳利度"
#~ msgid "Video stream interrupted"
#~ msgstr "影片串流中斷"
#~ msgid ""
#~ "Connection ready\n"
#~ "Start a VR application on your computer"
#~ msgstr ""
#~ "連線已就緒\n"
#~ "請在您的電腦上啟動 VR 應用程式"
#, c++-format
#~ msgid ""
#~ "Connection ready\n"
#~ "Start a VR application on {}"
#~ msgstr ""
#~ "連線已就緒\n"
#~ "請在 {} 上啟動 VR 應用程式"
#~ msgid "Show performance metrics"
#~ msgstr "顯示效能指標"
#~ msgid "Overlay can be toggled by pressing both thumbsticks"
#~ msgstr "同時按下兩個拇指搖桿可以切換覆蓋層"
#~ msgid ""
#~ "Press A or X or put your palm up\n"
#~ "to move the main window"
#~ msgstr ""
#~ "按下 A 或 X 鍵,或將手掌向上\n"
#~ "即可移動主視窗"
#~ msgid "Press A or X to move the main window"
#~ msgstr "按下 A 或 X 鍵即可移動主視窗"
@@ -1,49 +0,0 @@
From f3f6b3b6988a9bc13448b720f17ed3543da7600e Mon Sep 17 00:00:00 2001
From: alex <alexge50.x@gmail.com>
Date: Wed, 16 Apr 2025 06:36:45 +0100
Subject: [PATCH] GCC14/C++23 compatibility fix (#1014)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes the following error, when compiling with GCC 14, using
`-std=c++23`:
```
<>/basisu/encoder/basisu_kernels_sse.cpp:41:
<>/basisu/encoder/cppspmd_sse.h: In member function ‘cppspmd_sse41::spmd_kernel::vfloat& cppspmd_sse41::spmd_kernel::store(vfloat&&, const vfloat&)’:
<>/basisu/encoder/cppspmd_sse.h:496:24: error: cannot bind non-const lvalue reference of type ‘cppspmd_sse41::spmd_kernel::vfloat&’ to an rvalue of type ‘cppspmd_sse41::spmd_kernel::vfloat’
496 | return dst;
| ^~~
<>/basisu/encoder/cppspmd_sse.h: In member function ‘cppspmd_sse41::spmd_kernel::vfloat& cppspmd_sse41::spmd_kernel::store_all(vfloat&&, const vfloat&)’:
<>/basisu/encoder/cppspmd_sse.h:508:24: error: cannot bind non-const lvalue reference of type ‘cppspmd_sse41::spmd_kernel::vfloat&’ to an rvalue of type ‘cppspmd_sse41::spmd_kernel::vfloat’
508 | return dst;
| ^~~
```
---
external/basisu/encoder/cppspmd_sse.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/external/basisu/encoder/cppspmd_sse.h b/external/basisu/encoder/cppspmd_sse.h
index 030824b7d0..0c77a2d8c7 100644
--- a/external/basisu/encoder/cppspmd_sse.h
+++ b/external/basisu/encoder/cppspmd_sse.h
@@ -493,7 +493,7 @@ struct spmd_kernel
CPPSPMD_FORCE_INLINE vfloat& store(vfloat&& dst, const vfloat& src)
{
dst.m_value = blendv_mask_ps(dst.m_value, src.m_value, _mm_castsi128_ps(m_exec.m_mask));
- return dst;
+ return { dst };
}
CPPSPMD_FORCE_INLINE vfloat& store_all(vfloat& dst, const vfloat& src)
@@ -505,7 +505,7 @@ struct spmd_kernel
CPPSPMD_FORCE_INLINE vfloat& store_all(vfloat&& dst, const vfloat& src)
{
dst.m_value = src.m_value;
- return dst;
+ return { dst };
}
// Linear ref to floats
+1
View File
@@ -104,6 +104,7 @@ if (WIVRN_BUILD_SERVER)
driver/wivrn_htc_face_tracker.cpp
driver/wivrn_generic_tracker.cpp
driver/wivrn_foveation.cpp
driver/wivrn_uinput.cpp
driver/pose_list.cpp
driver/view_list.cpp
driver/hand_joints_list.cpp
+3
View File
@@ -195,6 +195,9 @@ configuration::configuration()
}
}
if (auto it = json.find("hid-forwarding"); it != json.end())
hid_forwarding = *it;
if (auto it = json.find("debug-gui"); it != json.end())
debug_gui = *it;
+1
View File
@@ -63,6 +63,7 @@ struct configuration
std::vector<std::string> application;
bool debug_gui = false;
bool use_steamvr_lh = false;
bool hid_forwarding = false;
bool tcp_only = false;
service_publication publication = service_publication::avahi;
+1 -1
View File
@@ -113,7 +113,7 @@ public:
std::optional<from_headset::packets> poll_control(int timeout);
const wivrn::from_headset::headset_info_packet & info() const
wivrn::from_headset::headset_info_packet & info()
{
return info_packet;
}
+80 -31
View File
@@ -21,12 +21,12 @@
#include "accept_connection.h"
#include "application.h"
#include "configuration.h"
#include "driver/app_pacer.h"
#include "main/comp_compositor.h"
#include "main/comp_main_interface.h"
#include "main/comp_target.h"
#include "server/ipc_server.h"
#include "target_instance_wivrn.h"
#include "util/u_builders.h"
#include "util/u_logging.h"
#include "util/u_system.h"
@@ -55,7 +55,6 @@
#include <vulkan/vulkan.h>
#if WIVRN_FEATURE_STEAMVR_LIGHTHOUSE
#include "configuration.h"
#include "steamvr_lh_interface.h"
#endif
@@ -141,7 +140,7 @@ bool wivrn::tracking_control_t::set_enabled(to_headset::tracking_control::id id,
return changed;
}
wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection, instance & inst, u_system & system) :
wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection, u_system & system) :
xrt_system_devices{
.get_roles = [](xrt_system_devices * self, xrt_system_roles * out_roles) { return ((wivrn_session *)self)->get_roles(out_roles); },
.feature_inc = [](xrt_system_devices * self, xrt_device_feature_type f) { return ((wivrn_session *)self)->feature_inc(f); },
@@ -149,7 +148,6 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
.destroy = [](xrt_system_devices * self) { delete ((wivrn_session *)self); },
},
connection(std::move(connection)),
inst(inst),
xrt_system(system),
hmd(this, get_info()),
left_controller(0, &hmd, this),
@@ -295,6 +293,24 @@ wivrn::wivrn_session::wivrn_session(std::unique_ptr<wivrn_connection> connection
system_name += " on WiVRn";
strlcpy(xrt_system.base.properties.name, system_name.c_str(), std::size(xrt_system.base.properties.name));
}
if (configuration().hid_forwarding)
{
try
{
uinput_handler.emplace();
tracking_control.set_enabled(to_headset::tracking_control::id::hid_input, true);
}
catch (...)
{
U_LOG_W("Could not initialize keyboard & mouse forwarding");
U_LOG_W("Ensure that the uinput kernel module is loaded and your user is in the input group.");
wivrn_ipc_socket_monado->send(from_monado::server_error{
.where = "Could not initialize keyboard & mouse forwarding",
.message = "Ensure that the uinput kernel module is loaded and your user is in the input group.",
});
}
}
}
wivrn_session::~wivrn_session()
@@ -308,7 +324,6 @@ wivrn_session::~wivrn_session()
}
xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connection> connection,
instance & inst,
u_system & system,
xrt_system_devices ** out_xsysd,
xrt_space_overseer ** out_xspovrs,
@@ -317,7 +332,7 @@ xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connecti
std::unique_ptr<wivrn_session> self;
try
{
self.reset(new wivrn_session(std::move(connection), inst, system));
self.reset(new wivrn_session(std::move(connection), system));
}
catch (std::exception & e)
{
@@ -355,11 +370,22 @@ xrt_result_t wivrn::wivrn_session::create_session(std::unique_ptr<wivrn_connecti
self->feedback_csv.open(dump_file);
}
self->thread = std::jthread([s = self.get()](auto stop_token) { return s->run(stop_token); });
*out_xsysd = self.release();
return XRT_SUCCESS;
}
void wivrn_session::start(ipc_server * server)
{
assert(not thread);
mnd_ipc_server = server;
thread = std::jthread([this](auto stop_token) { return run(stop_token); });
}
void wivrn_session::stop()
{
thread = std::jthread();
}
clock_offset wivrn_session::get_offset()
{
return offset_est.get_offset();
@@ -381,6 +407,12 @@ void wivrn_session::operator()(from_headset::headset_info_packet &&)
U_LOG_W("unexpected headset info packet, ignoring");
}
void wivrn_session::operator()(from_headset::settings_changed && settings)
{
connection->info().preferred_refresh_rate = settings.preferred_refresh_rate;
connection->info().minimum_refresh_rate = settings.minimum_refresh_rate;
}
static xrt_device_name get_name(interaction_profile profile)
{
switch (profile)
@@ -574,6 +606,24 @@ void wivrn_session::operator()(from_headset::inputs && inputs)
right_controller.set_inputs(inputs, offset);
}
void wivrn_session::operator()(from_headset::hid::input && e)
{
try
{
if (uinput_handler)
uinput_handler->handle_input(e);
}
catch (const std::exception & e)
{
wivrn_ipc_socket_monado->send(from_monado::server_error{
.where = "HID forwarding error",
.message = e.what(),
});
U_LOG_E("HID forwarding error: %s", e.what());
uinput_handler.reset();
}
}
void wivrn_session::operator()(from_headset::timesync_response && timesync)
{
offset_est.add_sample(timesync);
@@ -671,6 +721,7 @@ void wivrn_session::operator()(from_headset::visibility_mask_changed && mask)
void wivrn_session::operator()(from_headset::session_state_changed && event)
{
assert(server);
U_LOG_I("Session state changed: %s", xr::to_string(event.state));
bool visible, focused;
switch (event.state)
@@ -688,13 +739,13 @@ void wivrn_session::operator()(from_headset::session_state_changed && event)
focused = false;
break;
}
scoped_lock lock(inst.server->global_state.lock);
for (auto & t: inst.server->threads)
scoped_lock lock(mnd_ipc_server->global_state.lock);
for (auto & t: mnd_ipc_server->threads)
{
if (t.ics.server_thread_index < 0 or t.ics.xc == nullptr)
continue;
bool current = t.ics.client_state.session_overlay or
inst.server->global_state.active_client_index == t.ics.server_thread_index;
mnd_ipc_server->global_state.active_client_index == t.ics.server_thread_index;
xrt_syscomp_set_state(system_compositor, t.ics.xc, visible and current, focused and current);
}
}
@@ -785,9 +836,10 @@ void wivrn_session::operator()(const from_headset::start_app & request)
void wivrn_session::operator()(const from_headset::get_running_applications &)
{
scoped_lock lock(inst.server->global_state.lock);
assert(server);
scoped_lock lock(mnd_ipc_server->global_state.lock);
to_headset::running_applications msg{};
for (auto & t: inst.server->threads)
for (auto & t: mnd_ipc_server->threads)
{
if (t.ics.server_thread_index < 0 or t.ics.xc == nullptr)
continue;
@@ -801,7 +853,7 @@ void wivrn_session::operator()(const from_headset::get_running_applications &)
.name = std::string(tmp.data()),
.id = t.ics.client_state.id,
.overlay = t.ics.client_state.session_overlay,
.active = t.ics.server_thread_index == inst.server->global_state.active_client_index,
.active = t.ics.server_thread_index == mnd_ipc_server->global_state.active_client_index,
});
}
connection->send_control(std::move(msg));
@@ -809,16 +861,18 @@ void wivrn_session::operator()(const from_headset::get_running_applications &)
void wivrn_session::operator()(const from_headset::set_active_application & req)
{
ipc_server_set_active_client(inst.server, req.id);
ipc_server_update_state(inst.server);
assert(server);
ipc_server_set_active_client(mnd_ipc_server, req.id);
ipc_server_update_state(mnd_ipc_server);
// Send a refreshed application list
(*this)(from_headset::get_running_applications{});
}
void wivrn_session::operator()(const from_headset::stop_application & req)
{
scoped_lock lock(inst.server->global_state.lock);
for (auto & t: inst.server->threads)
assert(server);
scoped_lock lock(mnd_ipc_server->global_state.lock);
for (auto & t: mnd_ipc_server->threads)
{
if (t.ics.client_state.id == req.id)
{
@@ -854,23 +908,17 @@ struct refresh_rate_adjuster
{
std::chrono::seconds period{10};
std::chrono::steady_clock::time_point next = std::chrono::steady_clock::now() + period;
bool enabled;
pacing_app_factory & pacers;
const from_headset::headset_info_packet & info;
from_headset::headset_info_packet & info;
float last = 0;
refresh_rate_adjuster(const from_headset::headset_info_packet & info, pacing_app_factory & pacers) :
enabled(info.preferred_refresh_rate == 0 and info.available_refresh_rates.size() > 1),
refresh_rate_adjuster(from_headset::headset_info_packet & info, pacing_app_factory & pacers) :
pacers(pacers),
info(info)
{
if (enabled)
U_LOG_I("Automatic refresh rate adjustment enabled");
}
info(info) {}
void adjust(wivrn_connection & cnx)
{
if (not enabled or std::chrono::steady_clock::now() < next)
if (info.preferred_refresh_rate != 0 or info.available_refresh_rates.size() < 2 or std::chrono::steady_clock::now() < next)
return;
// Maximum refresh rate the application can reach
@@ -880,7 +928,7 @@ struct refresh_rate_adjuster
auto requested = info.available_refresh_rates.back();
for (auto rate: info.available_refresh_rates)
{
if (rate < app_rate * (rate == last ? 1. : 0.9))
if (rate > info.minimum_refresh_rate and rate < app_rate * (rate == last ? 1. : 0.9))
requested = rate;
}
if (requested != last)
@@ -900,7 +948,7 @@ struct refresh_rate_adjuster
void wivrn_session::run(std::stop_token stop)
{
refresh_rate_adjuster refresh(get_info(), app_pacers);
refresh_rate_adjuster refresh(connection->info(), app_pacers);
while (not stop.stop_requested())
{
try
@@ -1021,15 +1069,16 @@ void wivrn_session::reconnect()
void wivrn_session::poll_session_loss()
{
assert(server);
auto locked = session_loss.lock();
auto now = os_monotonic_get_ns();
if (locked->empty())
return;
auto it = locked->begin();
scoped_lock lock(inst.server->global_state.lock);
scoped_lock lock(mnd_ipc_server->global_state.lock);
while (it != locked->end() and it->first <= now)
{
for (auto & t: inst.server->threads)
for (auto & t: mnd_ipc_server->threads)
{
if (t.ics.client_state.id == it->second)
{
+11 -5
View File
@@ -28,6 +28,7 @@
#include "wivrn_hmd.h"
#include "wivrn_ipc.h"
#include "wivrn_packets.h"
#include "wivrn_uinput.h"
#include "xrt/xrt_results.h"
#include "xrt/xrt_system.h"
#include <atomic>
@@ -38,6 +39,7 @@
#include <shared_mutex>
#include <thread>
struct ipc_server;
struct u_system;
struct xrt_space_overseer;
struct xrt_system_compositor;
@@ -45,7 +47,6 @@ union xrt_session_event;
namespace wivrn
{
class instance;
class wivrn_eye_tracker;
class wivrn_fb_face2_tracker;
class wivrn_htc_face_tracker;
@@ -95,10 +96,10 @@ class wivrn_session : public xrt_system_devices
{
friend wivrn_comp_target_factory;
std::unique_ptr<wivrn_connection> connection;
instance & inst;
pacing_app_factory app_pacers;
u_system & xrt_system;
ipc_server * mnd_ipc_server;
xrt_space_overseer * space_overseer;
xrt_system_compositor * system_compositor;
@@ -125,6 +126,7 @@ class wivrn_session : public xrt_system_devices
std::unique_ptr<wivrn_fb_face2_tracker> fb_face2_tracker;
std::unique_ptr<wivrn_htc_face_tracker> htc_face_tracker;
std::vector<std::unique_ptr<wivrn_generic_tracker>> generic_trackers;
std::optional<wivrn_uinput> uinput_handler;
std::shared_mutex comp_target_mutex;
wivrn_comp_target * comp_target;
@@ -141,21 +143,23 @@ class wivrn_session : public xrt_system_devices
std::jthread thread;
wivrn_session(std::unique_ptr<wivrn_connection> connection, instance &, u_system &);
wivrn_session(std::unique_ptr<wivrn_connection> connection, u_system &);
public:
~wivrn_session();
static xrt_result_t create_session(std::unique_ptr<wivrn_connection> connection,
instance & instance,
u_system & system,
xrt_system_devices ** out_xsysd,
xrt_space_overseer ** out_xspovrs,
xrt_system_compositor ** out_xsysc);
void start(ipc_server *);
void stop();
clock_offset get_offset();
bool connected();
const from_headset::headset_info_packet & get_info()
const from_headset::headset_info_packet & get_info() const
{
return connection->info();
};
@@ -180,6 +184,7 @@ public:
void operator()(from_headset::pin_check_1 &&) {}
void operator()(from_headset::pin_check_3 &&) {}
void operator()(from_headset::headset_info_packet &&);
void operator()(from_headset::settings_changed &&);
void operator()(from_headset::handshake &&) {}
void operator()(from_headset::trackings &&);
void operator()(const from_headset::tracking &);
@@ -187,6 +192,7 @@ public:
void operator()(from_headset::hand_tracking &&);
void operator()(from_headset::body_tracking &&);
void operator()(from_headset::inputs &&);
void operator()(from_headset::hid::input && e);
void operator()(from_headset::timesync_response &&);
void operator()(from_headset::feedback &&);
void operator()(from_headset::battery &&);
+189
View File
@@ -0,0 +1,189 @@
#include "wivrn_uinput.h"
#include "utils/overloaded.h"
#include <array>
#include <cerrno>
#include <cstdio>
#include <cstring>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <system_error>
#include <unistd.h>
#include <linux/input-event-codes.h>
#include <linux/uinput.h>
namespace
{
wivrn::fd_base open_uinput_or_throw()
{
constexpr std::array paths = {"/dev/uinput", "/dev/input/uinput"};
for (const char * p: paths)
{
int fd = ::open(p, O_WRONLY | O_NONBLOCK);
if (fd >= 0)
return fd;
if (errno != ENOENT) // exists but inaccessbile
throw std::system_error(errno, std::generic_category(), "error while opening uinput");
}
throw std::runtime_error("no uinput device found");
}
void write_or_throw(int fd, const void * buf, size_t n)
{
auto res = ::write(fd, buf, n);
if (res < 0)
throw std::system_error(errno, std::generic_category(), "error during write");
if (res != n)
throw std::runtime_error("byte count mismatch while writing to uinput");
}
void fill_ids(uinput_user_dev & uidev, uint16_t product) noexcept
{
std::memset(&uidev, 0, sizeof(uidev));
uidev.id.bustype = 0x03;
uidev.id.vendor = 0x4711;
uidev.id.product = product;
uidev.id.version = 5;
}
void emit_ev(int fd, uint16_t type, uint16_t code, int32_t value)
{
struct input_event ev;
std::memset(&ev, 0, sizeof(ev));
gettimeofday(&ev.time, nullptr);
ev.type = type;
ev.code = code;
ev.value = value;
write_or_throw(fd, &ev, sizeof(ev));
}
void syn(int fd)
{
emit_ev(fd, EV_SYN, SYN_REPORT, 0);
}
void ioctl_or_throw(int fd, unsigned long op)
{
auto n = ioctl(fd, op);
if (n < 0)
throw std::system_error(errno, std::generic_category(), "ioctl error");
}
void ioctl_or_throw(int fd, unsigned long op, unsigned long int arg)
{
auto n = ioctl(fd, op, arg);
if (n < 0)
throw std::system_error(errno, std::generic_category(), "ioctl error");
}
} // namespace
wivrn_uinput::wivrn_uinput()
{
init_keyboard();
init_mouse();
};
void wivrn_uinput::handle_input(wivrn::from_headset::hid::input & e)
{
std::visit(utils::overloaded{
[this](const wivrn::from_headset::hid::key_down & e) {
send_key(e.key, true);
},
[this](const wivrn::from_headset::hid::key_up & e) {
send_key(e.key, false);
},
[this](const wivrn::from_headset::hid::button_down & e) {
send_button(e.button, true);
},
[this](const wivrn::from_headset::hid::button_up & e) {
send_button(e.button, false);
},
[this](const wivrn::from_headset::hid::mouse_scroll & e) {
mouse_scroll(e.v, e.h);
},
[this](const wivrn::from_headset::hid::mouse_move & e) {
mouse_move_relative(e.x, e.y);
},
},
e.input_data);
}
void wivrn_uinput::send_key(uint16_t key, bool down)
{
emit_ev(kbd_fd, EV_KEY, key, down ? 1 : 0);
syn(kbd_fd);
}
/// 0: left, 1: right, 2: middle
void wivrn_uinput::send_button(uint16_t mouse_button, bool down)
{
mouse_button += BTN_MOUSE;
emit_ev(mouse_fd, EV_KEY, mouse_button, down ? 1 : 0);
syn(mouse_fd);
}
void wivrn_uinput::mouse_move_relative(int16_t x, int16_t y)
{
if (x)
emit_ev(mouse_fd, EV_REL, REL_X, x);
if (y)
emit_ev(mouse_fd, EV_REL, REL_Y, y);
syn(mouse_fd);
}
void wivrn_uinput::mouse_scroll(int16_t vertical, int16_t horizontal)
{
if (vertical)
emit_ev(mouse_fd, EV_REL, REL_WHEEL, vertical);
if (horizontal)
emit_ev(mouse_fd, EV_REL, REL_HWHEEL, horizontal);
syn(mouse_fd);
}
void wivrn_uinput::init_keyboard()
{
kbd_fd = open_uinput_or_throw();
int fd = kbd_fd.get_fd();
ioctl_or_throw(fd, UI_SET_EVBIT, EV_KEY);
ioctl_or_throw(fd, UI_SET_EVBIT, EV_REP);
// enable all KEY_* to allow arbitrary key codes
for (int code = 1; code <= KEY_MAX; ++code)
ioctl_or_throw(fd, UI_SET_KEYBIT, code);
uinput_user_dev uidev;
fill_ids(uidev, 0x0840);
std::snprintf(uidev.name, sizeof(uidev.name), "WiVRn Keyboard");
write_or_throw(fd, &uidev, sizeof(uidev));
ioctl_or_throw(fd, UI_DEV_CREATE);
}
void wivrn_uinput::init_mouse()
{
mouse_fd = open_uinput_or_throw();
int fd = mouse_fd.get_fd();
ioctl_or_throw(fd, UI_SET_EVBIT, EV_KEY);
ioctl_or_throw(fd, UI_SET_EVBIT, EV_REL);
// buttons
ioctl_or_throw(fd, UI_SET_KEYBIT, BTN_LEFT);
ioctl_or_throw(fd, UI_SET_KEYBIT, BTN_RIGHT);
ioctl_or_throw(fd, UI_SET_KEYBIT, BTN_MIDDLE);
// relative motion + wheels
ioctl_or_throw(fd, UI_SET_RELBIT, REL_X);
ioctl_or_throw(fd, UI_SET_RELBIT, REL_Y);
ioctl_or_throw(fd, UI_SET_RELBIT, REL_WHEEL);
ioctl_or_throw(fd, UI_SET_RELBIT, REL_HWHEEL);
uinput_user_dev uidev;
fill_ids(uidev, 0x0839);
std::snprintf(uidev.name, sizeof(uidev.name), "WiVRn Mouse");
write_or_throw(fd, &uidev, sizeof(uidev));
ioctl_or_throw(fd, UI_DEV_CREATE);
}
+24
View File
@@ -0,0 +1,24 @@
#include "wivrn_packets.h"
#include "wivrn_sockets.h"
#include <cstdint>
class wivrn_uinput
{
public:
wivrn_uinput();
void handle_input(wivrn::from_headset::hid::input &);
private:
void init_keyboard();
void init_mouse();
void send_key(uint16_t key, bool down);
void send_button(uint16_t mouse_button, bool down);
void mouse_move_relative(int16_t x, int16_t y);
void mouse_scroll(int16_t vertical, int16_t horizontal);
wivrn::fd_base kbd_fd;
wivrn::fd_base mouse_fd;
};
+1 -1
View File
@@ -48,7 +48,7 @@ extern "C"
#define AV_PROFILE_H264_CONSTRAINED_BASELINE FF_PROFILE_H264_CONSTRAINED_BASELINE
#define AV_PROFILE_HEVC_MAIN_10 FF_PROFILE_HEVC_MAIN_10
#define AV_PROFILE_HEVC_MAIN FF_PROFILE_HEVC_MAIN
#define AV_PROFILE_AV1_MAIN FF_ROFILE_AV1_MAIN
#define AV_PROFILE_AV1_MAIN FF_PROFILE_AV1_MAIN
#endif
namespace wivrn
+3 -2
View File
@@ -17,6 +17,7 @@
*/
#include "ipc_server_cb.h"
#include "driver/wivrn_session.h"
#include "target_instance_wivrn.h"
#include "utils/method.h"
@@ -29,13 +30,13 @@ void ipc_server_cb::init_failed(xrt_result res)
void ipc_server_cb::mainloop_entering(ipc_server * server, xrt_instance * xrt_inst)
{
auto inst = static_cast<wivrn::instance *>(xrt_inst);
inst->server = server;
inst->set_ipc_server(server);
}
void ipc_server_cb::mainloop_leaving(ipc_server * server, xrt_instance * xrt_inst)
{
auto inst = static_cast<wivrn::instance *>(xrt_inst);
inst->server = nullptr;
inst->set_ipc_server(nullptr);
}
ipc_server_cb::ipc_server_cb() :
+4 -1
View File
@@ -512,10 +512,13 @@ gboolean control_received(gint fd, GIOCondition condition, gpointer user_data)
{
std::visit(utils::overloaded{
[&](const wivrn::from_headset::headset_info_packet & info) {
on_headset_info_packet(std::get<wivrn::from_headset::headset_info_packet>(*packet));
on_headset_info_packet(info);
inhibitor.emplace();
wivrn_server_set_headset_connected(dbus_server, true);
},
[&](const wivrn::from_headset::settings_changed & settings) {
wivrn_server_set_preferred_refresh_rate(dbus_server, settings.preferred_refresh_rate);
},
[&](const wivrn::from_headset::start_app & request) {
const auto & apps = list_applications();
if (auto it = apps.find(request.app_id); it != apps.end())
+12 -1
View File
@@ -48,11 +48,13 @@ xrt_result_t instance::create_system(
struct xrt_system_compositor * xsysc = NULL;
auto res = wivrn::wivrn_session::create_session(
std::move(connection),
*this,
*u_sys,
out_xsysd,
out_xspovrs,
out_xsysc);
if (res != XRT_SUCCESS)
return res;
session = (wivrn_session *)*out_xsysd;
u_system_set_system_compositor(u_sys, *out_xsysc);
return res;
}
@@ -73,6 +75,15 @@ instance::instance() :
{
}
void instance::set_ipc_server(ipc_server * server)
{
assert(session);
if (server)
session->start(server);
else
session->stop();
}
} // namespace wivrn
xrt_result_t
xrt_instance_create(struct xrt_instance_info * ii, struct xrt_instance ** out_xinst)
+4 -1
View File
@@ -23,6 +23,7 @@
namespace wivrn
{
class wivrn_session;
class instance : public xrt_instance
{
xrt_result_t create_system(
@@ -33,9 +34,11 @@ class instance : public xrt_instance
xrt_result_t get_prober(xrt_prober **);
wivrn_session * session = nullptr;
public:
ipc_server * server = nullptr;
using base = xrt_instance;
instance();
void set_ipc_server(ipc_server *);
};
} // namespace wivrn