Add VITURE XR controls, head tracking, and SteamVR (#732)

* Add VITURE glasses support: hardware control, 3D, head tracking

Glasses get their own controller over the MCU (permission, 120 Hz default, brightness, volume, sunblock, 2D/3D) and the game moves onto them when plugged in. The IMU drives Cardboard head tracking and the SteamVR driver. 3D falls back to one eye's view on phones that can't send the 3840x1080 signal. Options open from a glasses button in game and on the Steam page.

* Drop the glasses settings like Steam's: Play-style button, Settings lip, tabs

* Hang the glasses Settings lip over the top of the button

* Space glasses MCU commands so the IMU rate sticks, fit fixed resolutions to the glasses

* Keep Steam alive with SteamVR registered, run SteamVR at the glasses' rate, keep the glasses lip on top

* Fit VR games on the glasses: full view, seated origin at the head, pad hands reach with the d-pad

* Let the pad hands reach a metre out so buttons with deep colliders press

* Show every VR frame in order at 120 fps: wait for SteamVR's GPU work, present only finished copies, skip the grace on idle shared counters

* Glasses: SteamVR starts and stops with them, closer view with a field of view setting, Recenter on the pad

* Glasses: SteamVR field of view defaults to 90°

* VR pad hands: sticks move and aim the hands, left stick click switches the sticks to the game, d-pad pulls a held hand

* Glasses: Play SteamVR beside the glasses button instead of starting SteamVR with them, pad hands drawn as Index controllers and off while other VR controllers are connected, glasses sheet tabs sized like Steam's

* Track glasses mode, refresh-aware glasses window, align Play SteamVR with Play Steam

* Fix 3D on the glasses: full-res SteamVR presenter, revert VR 3D at session end, coalesce vsync ticks, no session restart after end

* Address review: glasses output after installs and session end, VR revert retry, display fallback, presenter swapchain retry, agent hex checks, drawer bumpers, glasses translations, docs

* Harden VITURE stereo negotiation and output refresh tracking

* Localize stereo recovery feedback and record Astra reconnect tests

* Improve test failure diagnostics and refresh Astra firmware findings

* Handle VITURE docks separately and reject truncated USB frames

* Glasses: remember a 3D fallback per model, docks as display only, VR timing fixes

- A 3D attempt that ends at the 640x480 fallback is remembered for that glasses
  model, so Play SteamVR no longer blacks out the glasses after every restart;
  Retry clears it and "3D for VR games" stays reachable
- A VITURE Mobile Dock on its own no longer counts as glasses; through a dock
  Play SteamVR is hidden and the sheet shows the output and why there is no control
- HDR is probed on the glasses when the session starts there
- Glasses frames with a mismatched checksum are marked in the status frame log
- SteamVR layer and driver vblank counters stay monotonic across refresh changes;
  one-eye render scale applies from activation and on mono/3D switches
- Compositor binds announce the refresh clients were last told; the presenter
  retries a failed first swapchain
- Dead strings and helpers removed; docs updated

* Glasses: drop USB frames with a bad checksum

* Glasses: count frames dropped for a bad checksum

* Feat/viture xr (#907)

* Add RayNeo Air and GT support to the XR glasses pipeline

* Add RayNeo Air and GT support to the XR glasses pipeline

* Checkpoint glasses tracking, calibration, and SteamVR launch integration

* Checkpoint glasses tracking, calibration, and SteamVR launch integration

* Add XREAL 1S support and correct GT and Pro 2 tracking

* Add XREAL 1S support and correct GT and Pro 2 tracking

* Fix mirrored glasses tracking and recover SteamVR after device loss

* Fix mirrored glasses tracking and recover SteamVR after device loss

* Document confirmed XREAL 1S brightness control

* Document confirmed XREAL 1S brightness control

* Fix SteamVR glasses defaults and rendering controls

* Fix SteamVR glasses defaults and rendering controls

* chore: keep only the 3 newest session log folders (#852)

* chore: add agent comment rules (#748)

Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>

* Fix SteamVR polling, VITURE checksums, and fence tracking

Keep manual SteamVR launches polled, discard corrupt VITURE packets, and retire Vulkan fences out of order without blocking submissions at a fixed capacity. Preserve the contiguous completion watermark used by the presenter.

Fix optional Windows launcher configuration and audited helper staging. Add Android, Windows, and native tracker regression coverage.

* Fix SteamVR polling, VITURE checksums, and fence tracking

Keep manual SteamVR launches polled, discard corrupt VITURE packets, and retire Vulkan fences out of order without blocking submissions at a fixed capacity. Preserve the contiguous completion watermark used by the presenter.

Fix optional Windows launcher configuration and audited helper staging. Add Android, Windows, and native tracker regression coverage.

* fix: wireless ADB page names the child-process switch the way Android shows it (#848)

* l10n: refresh stale and untranslated strings in es, fr, ko, ru (#850)

* l10n: refresh stale and untranslated strings in es, fr, ko, ru

- mode_added_art_hint: now mentions Steam then SteamGridDB (all four locales).
- wincomp_needs_installer / wincomp_installers_note: es and ko still described
  the old "coming soon" behaviour; align with the current English text.
- summary_remove_game: was still English in all four locales.

Machine-assisted translation; native-speaker review is welcome.

* l10n(es): say registro, not grabación, for the missing installer record

---------

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>

* fix: a failed cloud save recovery no longer ends the app (#846)

The cloud-recovery thread started at every app start had nothing to
catch an error, so one went to CrashHandler, which halts the process
with status 2. In unit tests the thread can outlive the test that
started it, fail on the torn-down preferences, and take the whole test
run down. The error is now logged and the thread ends.

Co-authored-by: Kirk <12691869+KirkPatrickJunsay@users.noreply.github.com>

* fix: an interrupted Linux runtime download resumes instead of starting again (#847)

* fix: an interrupted Linux runtime download resumes instead of starting again

installOnce() asked the downloader to resume but always deleted the archive in its finally block, so the next attempt began at zero. The archive is now named after the release version and checksum, a failed download keeps what it fetched, and archives of other releases (and the old fixed name) are removed. A checksum or extraction failure still deletes the file.

* test: Downloader resumes a cut-off download from the bytes it kept

Starts a socket server that promises the whole file, hangs up part way and then answers a Range request, and checks that the second downloadFile call resumes with the right offset and ends with identical bytes.

* fix: a resumed download discards a 206 that does not start where the kept bytes end

Downloader appended every 206 response to the partial file without
looking at Content-Range. A server or proxy that answers a Range request
with a different offset would leave a corrupt file. Check that the range
starts at the kept length; otherwise delete the partial file and start
again without a Range header.

Adds a test with a server that answers the Range request from offset 0.

---------

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>

* l10n: German, French, Spanish, Italian, Portuguese and Russian for the zRAM, reset-settings and store free-space strings (#849)

* l10n: German, French, Spanish, Italian, Portuguese and Russian for the zRAM, reset-settings and store free-space strings

Adds the strings values-de, values-it and values-pt were missing (14 each) and the six that values-fr, values-es and values-ru were missing. Machine-assisted drafts that follow each file's existing register and terms; native review is welcome.

* l10n: correct missing active swap translations

---------

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>
Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>

* fix: droiddeckctl reaches variant-package builds (recover #842) (#854)

fix: droiddeckctl reaches builds shipped under a variant package

The provider authority and the start Activity's component were fixed to
com.droiddeck.launcher, so droiddeckctl could not talk to the antutu,
ludashi or pubg builds from tools/release/variants.txt. DROIDDECK_PACKAGE
now picks the package; the Activity's class name stays the same in every
variant.

Co-authored-by: angelrenefm <17342133+angelrenefm@users.noreply.github.com>

* feat: droiddeckctl reports on-screen pacing (recover #843) (#855)

feat: droiddeckctl pacing reports the frames that reached the screen

Reads SurfaceFlinger's timestats for the game's layer (or the session's
SurfaceView) over a capture: frames on screen, fps on screen, the
present-to-present histogram and how many intervals were off the usual
cadence. Records split by a refresh-rate change are summed. A game's own fps
counter counts frames handed over, so it can't show dropped or doubled frames.

Co-authored-by: angelrenefm <17342133+angelrenefm@users.noreply.github.com>

* fix: Steam can restart more than twice in a session (#754)

* fix: Steam can restart more than twice in a session

Every exit 42 counted toward the cap that stops an update which will
not install, and the count was never cleared, so the third restart of
a session ended it however far apart they were. A client that ran for
a minute before asking is not that loop: the count starts again.

* fix: measure the client's run time as it exits

The time spent collecting logs and checking FEX after the client exits
counted toward its run, so a slow cleanup could make a quick exit 42
look like a long one and clear the count.

---------

Co-authored-by: Kirk <12691869+KirkPatrickJunsay@users.noreply.github.com>
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>

* fix: the front end keeps its page when the Fold is folded or unfolded (#832)

* fix: the front end keeps its page when the Fold is folded or unfolded

MainActivity, FileManagerActivity, FilePickerActivity and StoreLoginActivity did not declare the screen-size configuration changes, so folding or unfolding a foldable recreated them and dropped their in-memory state. They now handle orientation, screenSize, screenLayout, smallestScreenSize and density themselves, like SessionActivity already does. uiMode is left out on purpose.

* fix: store login keeps rebuilding its toolbar when the display density changes

StoreLoginActivity builds its toolbar in code with dp-to-pixel values taken at creation time and has no onConfigurationChanged. It no longer declares density in configChanges, so a density change recreates it as before this PR. Size and layout changes are still handled in place.

---------

Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>

* Release pointer buttons without replaying stale motion (#803)

* Fix cursor warping on native touch down

* Preserve input cleanup without replaying stale pointer motion

---------

Co-authored-by: siyuan.qsy <siyuan.qsy@alibaba-inc.com>

* l10n: translate the strings added since #284 into zh-CN, zh-HK, zh-TW and ja (#539)

* l10n: translate the 184 strings added since #284 (zh-CN/HK/TW, ja)

The stores, cloud saves, Windows components, Steam touch, desktop
removal and background-downloads strings landed after #284's
translation snapshot, so every one of them fell back to English.
Translate all 184 into Simplified Chinese, Traditional Chinese
(Taiwan and Hong Kong) and Japanese, keeping each locale file's own
vocabulary (工作階段/會話, 解除安裝/卸載, 元件/組件, 設定).

Also fix four Hong Kong strings that kept the simplified 着色器.

* l10n(zh): fix stale and ambiguous strings found in review

Severe: summary_remove_game was untranslated English in all three
files; mode_added_art_hint, wincomp_installers_note and
wincomp_needs_installer still described the pre-#480/#492 English.

Also: distinguish the Setup wizard from Android system settings in
zh-HK/zh-TW (初始設定 / 系統設定 / Android 設定), unify library as
收藏庫, component as 組件 in zh-HK, session as 會話 in zh-HK, account
as 帳戶 in zh-HK, Trending as 趋势/趨勢, Forget as 清除, reword the
re-applied-at-launch, action-failed and already-in-Games strings, and
play as 執行/開啟遊戲 in zh-TW/zh-HK.

* l10n(ja): fix stale and ambiguous strings found in review

---------

Co-authored-by: Dantalian <Dantalian-dev@users.noreply.github.com>
Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>

* Rebuild and verify Windows VR runtime components

* Rebuild and verify Windows VR runtime components

* Add top, bottom, and centered picture positions for Steam sessions (#871)

* fix: dependency scan ignores folders above the game folder (#859)

* DroidDeck-Proton: get releases from the Droid-Deck org repo

DroidDeck-Proton is now built and released on Droid-Deck/DroidDeck-Proton
(11-9.1 is Latest there), so the Components page, the update check and the
guest installer read releases from the org repo instead of The412Banner's.

* feat: low-latency controller and touch toggles in the session drawer (#808)

* fix: SteamGridDB lookups no longer stick as "no match" after a failure; add a search to the art chooser (#876)

* feat: Steam home wall fills from the signed-in library instead of store picks (#878)

* test: cover GPU family and support classification (#880)

* Fix local builds on Linux failing after the first Comet build (#866)

* feat: sort the store library and installed tabs, and switch between card and list views (#798)

* feat: three-finger tap toggles Steam's on-screen keyboard in game mode (#782)

* fix: keep Quest-patched Turnip as the auto default (#853)

* Fix deploy_local.sh and droiddeckctl not finding a phone connected over wireless debugging (#864)

* fix: keep proot sessions alive when the kernel loses fork events (#457)

* fix(quest): correct desktop and Steam display corruption across sessions (#733)

fix(quest): stabilize desktop and Steam layer presentation

Keep Quest SDR scenes and the black backdrop off the Android Vulkan swapchain regardless of session order or HDR preferences. Only report the first frame after client content is submitted.

Add backdrop lifecycle and first-frame regression coverage. Record the user's successful Quest 3 Test 2 result.

Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>

* fix: keep SteamVR syscall hooks and report Steam crashes (#905)

* fix: preserve SteamVR syscall hooks

* fix: report Steam crashes through gamescope

* fix: honor glasses pacing and resolution in SteamVR launches

---------

Co-authored-by: connor g <connorsspam1992@gmail.com>
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
Co-authored-by: Yassine Gherbi <y.gherbi.dev@gmail.com>
Co-authored-by: Resul Övür <92828257+ovurrsl@users.noreply.github.com>
Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>
Co-authored-by: Kirk <kirtoy.junsay@gmail.com>
Co-authored-by: Kirk <12691869+KirkPatrickJunsay@users.noreply.github.com>
Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>
Co-authored-by: angelrenefm <17342133+angelrenefm@users.noreply.github.com>
Co-authored-by: asdf17128 <asdf17128@gmail.com>
Co-authored-by: siyuan.qsy <siyuan.qsy@alibaba-inc.com>
Co-authored-by: Dantalian <wsu091227@qq.com>
Co-authored-by: Dantalian <Dantalian-dev@users.noreply.github.com>
Co-authored-by: The412Banner <the412banner@users.noreply.github.com>
Co-authored-by: The412Banner <205237651+The412Banner@users.noreply.github.com>
Co-authored-by: FX1922 <120828496+FX192@users.noreply.github.com>
Co-authored-by: Muaz Kadan <32595066+muazkadan@users.noreply.github.com>
Co-authored-by: kingokksa <47888451+kingokksa@users.noreply.github.com>
Co-authored-by: Jamie Schenker <jam1esch3nk3r@gmail.com>
Co-authored-by: Jagger15 <jagger2333@live.com>

* Glasses: keep a pending 2D restore and the SteamVR recovery offer, show Play SteamVR only with a picture

* Translate the glasses calibration, XREAL and SteamVR recovery strings

* SteamVR recovery: give a finished teardown time to collect logs before restarting

* Credit the projects the XR glasses support builds on

* Joy-Cons: SteamVR hands from their gyro while SteamVR runs, one combined pad otherwise

* Headsets: settings badge on Play SteamVR instead of a top-right button, both shown only once connected

* Hand tracking: camera-tracked Joy-Cons and bare hands in SteamVR, drawn as white gloves

- Joy-Con movement from the accelerometer (report reordering, per-Joy-Con calibration, zero-velocity updates)
- MediaPipe pose and hand landmarks from the device camera, placement check, per-hand Kalman filter with the Joy-Con
- No controller connected: bare camera hands with Quest-style gestures, 1€ filtered, rendered as a white glove model built from a distance field
- SteamVR safe mode cleared before each start so one crash no longer blocks the driver

---------

Co-authored-by: MaxsTechReview <6025299+maxjivi05@users.noreply.github.com>
Co-authored-by: informalTechCode <informaltechyt@gmail.com>
Co-authored-by: connor g <connorsspam1992@gmail.com>
Co-authored-by: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com>
Co-authored-by: Yassine Gherbi <y.gherbi.dev@gmail.com>
Co-authored-by: Resul Övür <92828257+ovurrsl@users.noreply.github.com>
Co-authored-by: ovurrsl <ovurrsl@users.noreply.github.com>
Co-authored-by: Kirk <kirtoy.junsay@gmail.com>
Co-authored-by: Kirk <12691869+KirkPatrickJunsay@users.noreply.github.com>
Co-authored-by: xXJsonDeruloXx <danielhimebauch@gmail.com>
Co-authored-by: angelrenefm <17342133+angelrenefm@users.noreply.github.com>
Co-authored-by: asdf17128 <asdf17128@gmail.com>
Co-authored-by: siyuan.qsy <siyuan.qsy@alibaba-inc.com>
Co-authored-by: Dantalian <wsu091227@qq.com>
Co-authored-by: Dantalian <Dantalian-dev@users.noreply.github.com>
Co-authored-by: The412Banner <the412banner@users.noreply.github.com>
Co-authored-by: The412Banner <205237651+The412Banner@users.noreply.github.com>
Co-authored-by: FX1922 <120828496+FX192@users.noreply.github.com>
Co-authored-by: Muaz Kadan <32595066+muazkadan@users.noreply.github.com>
Co-authored-by: kingokksa <47888451+kingokksa@users.noreply.github.com>
Co-authored-by: Jamie Schenker <jam1esch3nk3r@gmail.com>
Co-authored-by: Jagger15 <jagger2333@live.com>
This commit is contained in:
221 files changed
+24369 -491

No files matched your search

+21 -7
View File
@@ -26,14 +26,14 @@ and reports every run.
Player controls and observations work over authorized ADB on any build: `state`, `start`, `stop`,
`resume`, `wait`, `launch`, `quit`, `focus`, `input`, `ui`, `logs`, `screenshot`, `record`, `pacing`,
`displays`, `wake`, and `access`.
`displays`, `wake`, `glasses` (except `glasses raw`), and `access`.
**Setup > Diagnostics > Debugging tools** is off by default in every build, including debug builds.
It enables `run`, `guest`, `cdp`, all `env` operations, `override`, and `prefs`. The toggle switches
directly without a confirmation dialog. The bridge refuses to change it through `ui` or preference
writes. The existing preference key, `setting-agent-commands` test tag, JSON command names, and
`AGENT_COMMANDS_DISABLED` error code are unchanged. Refusals exit 7; `droiddeckctl access` reports
whether commands are enabled.
It enables `run`, `guest`, `cdp`, all `env` operations, `override`, `prefs`, and `glasses raw`. The
toggle switches directly without a confirmation dialog. The bridge refuses to change it through `ui`
or preference writes. The existing preference key, `setting-agent-commands` test tag, JSON command
names, and `AGENT_COMMANDS_DISABLED` error code are unchanged. Refusals exit 7; `droiddeckctl access`
reports whether commands are enabled.
Disabling the toggle clears queued and persistent agent environment settings and installed binary
overrides. Disabled settings cannot apply at the next session start. Already running commands and
@@ -80,6 +80,7 @@ artifact or file error, 7 debugging tools disabled.
tools/droiddeckctl state
tools/droiddeckctl start steam --wait
tools/droiddeckctl start steam --wait --reuse
tools/droiddeckctl start steam --steamvr --wait
tools/droiddeckctl start desktop
tools/droiddeckctl run /usr/bin/foo -- arg1 arg2
tools/droiddeckctl wait ready|idle|failed
@@ -122,8 +123,21 @@ tools/droiddeckctl record ./clip.mp4 --seconds 8 --display 0
tools/droiddeckctl pacing --seconds 30
tools/droiddeckctl displays
tools/droiddeckctl wake
tools/droiddeckctl glasses status
tools/droiddeckctl glasses set refreshHz 120
tools/droiddeckctl glasses set 3d on
tools/droiddeckctl glasses simulate --seconds 6 --yaw 15
tools/droiddeckctl glasses stop-simulate
tools/droiddeckctl glasses mode 0x34
tools/droiddeckctl glasses raw 0x0007
```
Glasses status reports `deviceMode` from the MCU separately from `sbs`, which
requires a physical stereo display mode. `switching3d` marks the bounded
confirmation window. A successful mode-command reply alone does not confirm 3D.
`badFrames` counts reports and IMU packets dropped for a bad checksum.
`xr-frame` captures both app eye textures while SteamVR is open, saving `left.png`,
`right.png` and `capture.json` with the matching source frame, projection poses,
FOV and dimensions. It works over wired or wireless authorized ADB.
@@ -154,7 +168,7 @@ mode except the desktop).
`state` returns `schema`, `build`, `appVersion`, `runtime {installed, version}`,
`agent {guest, guestFocus, commands}` and `session`:
- `id`, `phase`, `running`, `mode`, `program`, `steamUi`, `steamUrl`, `suspended`, `pip`,
- `id`, `phase`, `running`, `mode`, `program`, `steamUi`, `steamUrl`, `steamVr`, `suspended`, `pip`,
`firstFrame`, `output` [w, h], `refreshHz`, `lastTransitionAt`, `guestPid`, `installing`
- `logDir`, `eventsFile`, `artifactsAvailable`, `artifactsComplete`, `failure {code, message, status}`
- `focus`: gamescope's focus as the guest agent last published it, or null:
+319 -12
View File
@@ -61,7 +61,8 @@ switches the picture to side-by-side and runs SteamVR with three DroidDeck piece
1. **`driver_droiddeck.so`**, an OpenVR driver with one HMD:
- pose: the shared head pose file (3DoF, standing height);
- projection: exactly the frustum the Cardboard pass samples, with identity distortion (the app does
the lens);
the lens). A new frustum mid-run (the glasses' SteamVR field of view) goes out with
`SetDisplayProjectionRaw` and `VREvent_LensDistortionChanged`;
- a proximity sensor that reads "worn" while Cardboard mode is on. Without it SteamVR takes a still
headset (a phone on a table) for an unused one, enters standby after a few seconds, and the
compositor stops submitting frames;
@@ -96,15 +97,20 @@ switches the picture to side-by-side and runs SteamVR with three DroidDeck piece
Turnip/KGSL cannot export. The layer creates it unshared and hands out a memfd holding a 64-bit
counter instead. Every process with the semaphore keeps a real local one, and a poller thread
carries values both ways (reached locally: up into the counter; seen in the counter: signalled
locally from the host), so GPU waits work as written, a poll period late. Waits on an imported
binary semaphore, which cannot be bridged that way, are dropped. With the semaphores dropped
locally from the host), so GPU waits work as written, a poll period late. An imported binary
semaphore cannot be bridged that way, and its import is refused. With the semaphores dropped
outright (the first version) the dashboard showed torn, half-drawn tiles;
- Turnip on KGSL does not defer a submit that waits on a timeline value nobody has signalled yet:
`vkQueueSubmit` blocks until it is. SteamVR's client waits on a compositor value that the
compositor signals only after the client has submitted and said so, which deadlocked every app
before its first frame (`helloxr`'s swapchain acquire, DXVK's submit thread in a Proton game).
A submit's wait on an imported shared value that is neither reached nor queued in that process
gets 3 ms for the other process to reach it, then is dropped;
gets 3 ms for the other process to reach it, then is dropped. On a counter that has not moved for
100 ms it is dropped at once: Angry Birds VR waits on two such values a frame, and the grace cost
its submit thread 6 ms a frame and held it at 60 fps. Keeping these waits stops a Proton game
before its first frame (Angry Birds VR stayed on SteamVR's loading card). While a Quest
session's frame socket (`/run/droiddeck/droiddeck-xr-frames`) exists, every wait is kept, as the
Quest path was built and tested with them;
- Steam's web helper has the semaphore bridge whenever SteamVR is installed: its GPU process
outlives SteamVR runs, and one started without the layer crashed when SteamVR showed Steam's
overlays, until Steam quit;
@@ -118,7 +124,13 @@ switches the picture to side-by-side and runs SteamVR with three DroidDeck piece
(values up to 3) submitted on them.
3. **`droiddeck-steamvr`**, the guest helper (`status | install | start | stop`), which the app drives
through the guest agent's fixed `vr` request (no agent commands needed). It also supplies an `xset`
stand-in, because the dashboard's web helper checks the X server with it.
stand-in, because the dashboard's web helper checks the X server with it. Before every start it
removes SteamVR's crash marker (`config/vrserver_crash_timestamp.txt`, written when vrserver
crashes) and clears `driver_droiddeck.blocked_by_safe_mode`: after a crash early in a run SteamVR
starts in safe mode and blocks every add-on driver, so a single crash left the glasses blank on
every later launch (`HmdNotFound`). The driver also stops its pose, vsync and presenter threads
if vrserver exits without deactivating it, since a running `std::thread` destroyed at exit aborts
the process.
Imported eye textures carry the same format list SteamVR's mutable sRGB images do. With it Turnip keeps
UBWC compression on, and an import that disagreed read compressed data as garbage.
@@ -136,20 +148,315 @@ Verified on the AYN Thor (SD 8 Gen 2, Turnip): SteamVR 2.17.10 starts with the D
the compositor runs driver-direct at about 60 fps, the dashboard (Steam's library in VR, with the
controller's laser) shows cleanly in both eyes at the panel's resolution while Steam keeps running, and
a pose written to the shared file turns SteamVR's view. Started from the drawer button through the agent.
Once a headset (VITURE, RayNeo or XREAL glasses) is connected and under DroidDeck's control, the
Steam page shows **Play SteamVR** at the top left, with a **Settings** badge that drops that headset's
settings from the top; before that neither appears. Play SteamVR starts Steam and then SteamVR
(installing it first if needed) once the glasses show a picture, and SteamVR stops when the glasses
are unplugged. **Play Steam** never starts it: while SteamVR runs, Steam keeps its own window in front
of flat games. Through a VITURE Mobile Dock the glasses are only a display: the dock does not pass
their controls or head tracking to the phone, so the Steam page shows neither, and only the session
drawer's glasses page (output and **Game on glasses**) applies.
SteamVR defaults to 2D output: a single eye fills the glasses while head tracking remains active.
Enable **3D (side-by-side)** manually or opt into **3D for VR games** in the glasses controls for stereo. Automatic
switching waits until SteamVR reports that it is running; starting or installing it does not change
the display mode. A saved **3D for VR games** preference is retained.
With **Game on glasses** off, SteamVR keeps the glasses' picture settings and IMU while Android
mirrors the phone output to the glasses. Turning off the dedicated display must not turn off the
renderer/HMD proximity flag: SteamVR otherwise reports the headset as taken off and enters standby,
freezing the view on both displays. Without a glasses display or an enabled phone VR viewer, SteamVR
uses a single-eye phone preview with the phone's tracking preference. These effective rendering
settings last only while SteamVR runs; the saved Cardboard setting is unchanged.
Verified on the VITURE Pro 2 with Game on glasses off: live glasses IMU, roughly 60 fps beyond
the previous standby point, and user-confirmed updating images and correct head tracking on both
screens. The rendering regression tests cover mirrored/dedicated parity and phone fallback.
A separate freeze occurred after swapping Pro 2 for GT Max and restarting SteamVR in the same
DroidDeck process (2026-10-14, session 52): GT Max board `0x41` kept streaming poses and the HMD
stayed active, but `vrcompositor` reported `vkerror=-4` (`VK_ERROR_DEVICE_LOST`) from 17:18:53.
Restarting the Steam session alone reproduced it (sessions 53/54). Restarting DroidDeck itself
cleared it; session 55 continued rendering with live GT Max tracking for over a minute without
new device-loss errors. This is a recovery workaround, not a confirmed permanent fix; retained
graphics state across restarts is a hypothesis. Frame counters alone do not prove recovery:
the presenter can keep presenting an old SteamVR image while the compositor reports device loss.
### Joy-Con controllers
Nintendo Joy-Cons paired over Bluetooth become SteamVR hands while SteamVR runs, and stay an ordinary
game pad otherwise. It needs Android 12 or later (motion sensors on an `InputDevice`) and a kernel whose
`hid-nintendo` driver reports the IMU (Android common kernel `android14-6.1` or newer; older 5.x GKI
builds expose the buttons only). A Joy-Con without motion sensors stays a game pad.
**Controller settings > Joy-Cons as VR controllers** (on by default) turns it off.
`input/JoyConVr.kt` takes a Joy-Con once SteamVR reports that it is running. It reads the Joy-Con's
gyroscope and accelerometer on a thread of its own. A Mahony filter turns them into an orientation,
and the gyro bias is learned while the Joy-Con rests. Each IMU report carries three samples every
10 ms. On the tested kernel they arrive newest first and about four in ten reports repeat the
previous report's newest sample, while the kernel's timestamps run about twice as fast in an uneven
3.3/3.3/13.3 ms pattern. `JoyConReports` collects a report's samples, learns their order from the
repeats, drops the repeated one and times the rest from the report's arrival (report interval divided
by new samples). That cut the gyro's error from 13 to 48 degrees per movement to about 2 to 3.
The accelerometer also measures movement. Linux removes the gyro's offset but not the
accelerometer's (one Joy-Con read 10.08 m/s² lying still, the other 9.51), so `JoyConAccelCalibration`
learns offset and scale by fitting a sphere to the readings of a Joy-Con resting in at least five
different positions; it happens on its own while you play and is saved per Joy-Con. `JoyConMotion`
takes gravity away in the world frame, integrates what is left into a velocity and a displacement,
sets the velocity to zero whenever the Joy-Con is still, and leaks it away quickly once a movement
lasts longer than a second, so the displacement holds for short lifts, pushes and punches and cannot
run away. It also keeps a second velocity that is never zeroed and only leaks over 30 s, the plain
integral of the acceleration, for camera tracking. The pose, displacement, both velocities, buttons,
stick and battery go to a 224-byte seqlocked file, `joycon_shm.h`, at
`/run/droiddeck/droiddeck-joycon`. The game pad no longer sees that Joy-Con;
it gets it back when SteamVR stops, the Joy-Con disconnects or the setting is turned off.
The driver adds a left and a right Index controller (`knuckles`, Valve's Index input profile and
models) when the first Joy-Con appears. The pad hand on that side switches off. A Joy-Con cannot
measure where it is, only how it turns and how it speeds up. Without the camera, Google VR's arm model
places the hand from its orientation and the head, and the measured displacement moves the hand on
top of that before it settles back over 0.6 s (1.5 s while the trigger or grip is held, at most
35 cm away), so a quick lift or punch shows but a slow sideways drift does not. With camera hand
tracking (below) the camera places the hand instead. Its pointing direction is the Index controller's
aim pose. Its heading is matched to the head when it connects. Holding Home (right) or Capture
(left) for 0.8 s matches it again, with a short buzz; point the Joy-Con where you look first. A short
press is the system button. A hand that sends nothing for 500 ms disconnects.
| Index | Left Joy-Con | Right Joy-Con |
|--------------|------------------|----------------|
| Trigger | ZL | ZR |
| Grip | L, SL, SR | R, SL, SR |
| A | down, right | A, B |
| B | up, left, minus | X, Y, plus |
| Thumbstick | stick, click | stick, click |
| System | Capture (press) | Home (press) |
The fingers follow the buttons on a simulated hand: the index finger curls with the trigger, the
other three with the grip, the thumb when it is on the stick or a face button. SteamVR's haptic
events go to that hand's Joy-Con through `@droiddeck-rumble` (slots `0x100` and `0x101`) and respect
the rumble setting.
Outside SteamVR two Joy-Cons are combined into one player: left stick, D-pad, L, ZL, minus and Capture
from the left one, the face buttons, right stick, R, ZR, plus and Home from the right. Face buttons
keep their positions (Nintendo X is the top button, Y on Xbox). SL and SR are shoulder buttons on a lone
Joy-Con and are ignored while two are combined. A combined pair splits rumble the way a pad does,
strong to the left and weak to the right. A lone Joy-Con plays the stronger of the two.
#### Camera hand tracking
The device's camera can watch the player so each Joy-Con hand sits where the real hand is, including
lifting, lowering, reaching and moving sideways. With no controller connected it tracks bare hands
instead (below). It needs Android 12 or later. The first time a headset connects, DroidDeck asks whether to use the camera. On a device
with cameras on both sides it offers the back one (usually sharper and wider) or the front one; with
cameras on one side only it uses those without asking. Android's camera permission is requested
right after. **Headset sheet > Head tracking > Hand tracking** turns it on or off, switches the
camera, asks for the permission again and opens the placement check.
When camera tracking is on, **Play SteamVR** first shows the placement check: the live picture with
the detected body drawn on it, what to fix, and **Skip**. It reads the device's gravity sensor and
asks to stand a device up when it lies flat face up or face down, or to stand it more upright when
the camera points more than 45 degrees up or down. Then it asks to step into view, to step back or
come closer (the shoulders should take 12 to 26 percent of the picture's width, about 0.75 to 1.6 m
from a 90 degree camera), to step back when an elbow or wrist is near the edge of the picture, and
to hold both hands in view. Once
everything has been fine for 1.2 s SteamVR starts on its own. With the back camera the screen faces
away from the player, so the advice is also spoken aloud.
`handtracking/HandCamera.kt` runs while SteamVR runs and either a Joy-Con is taken or no game
controller is connected at all. It picks the widest
camera on the chosen side (up to 100 degrees, zooming a logical camera out when it can), holds it at
its fastest fixed frame rate up to 30 per second so exposures stay short and moving hands do not
blur, takes 960x720 frames from CameraX, turns them upright by gravity, and runs MediaPipe's Pose
Landmarker (Lite) on the CPU in video mode, which follows the body from frame to frame and smooths it,
15 times a second (10 and then 6 when the device reports it is getting hot). The pose model's depth
cannot tell a hand at the chest from one reaching out (it read about 25 cm in front of the shoulders
for both), so each hand is measured on its own: `HandModel` runs MediaPipe's Hand Landmarker on a
square around the hand. To find a hand it looks for up to two hands in a square around the pose's
wrist and keeps the one whose wrist is nearest, taking turns between a square 4 shoulder widths across
centred on the wrist and one 2.5 shoulder widths across moved toward the fingers. The palm detector
misses many hands in a tight square: with the player about 0.65 m away the 2.5-wide square found 73
percent of the hands in view (a 1.4-wide one 49, the whole picture 68), and with the player lying close
to the camera, where hands look large, the wide square found 77 percent of the hands the tracker had
seen and the two in turn 82 (the 2.5-wide one alone 54). After that it follows the hand in a square 2.8
hands across, and finds it again in the same frame when it is lost. A hand whose wrist is nearer the other arm's wrist than its own is dropped.
The hand's 21 landmarks come in metres and in pixels, so a least-squares fit gives the hand's
distance from the size it appears (`BodyPose.handFix`); the middle of the palm is the point used.
The head is fitted the same way from the pose model's face landmarks. Each hand is given relative to
the eyes in a frame levelled by gravity, along with the face's heading from the nose and ears. When
the hand model misses a hand the pose still sees, the hand keeps its last distance for half a second
and is marked as estimated. The frame's exposure time, moved onto the monotonic clock, the hands, each hand-model hand's 21
landmarks relative to the middle of its palm (in metres, in the same levelled frame), the face heading
and whether bare hands are wanted go to a 568-byte seqlocked file, `handcam_shm.h`, at
`/run/droiddeck/droiddeck-handcam`.
No picture is kept or sent.
The driver turns the camera's frame to SteamVR's by comparing the face's heading with the headset's
heading at the same moment, averaged over about 3 s and restarted when they disagree for half a
second (after a recenter). Each hand then runs a Kalman filter (`HandKalman` in `hand_motion.h`) with
position and velocity on each axis. The Joy-Con's plain velocity integral moves it forward between
camera frames; its reports are timed 45 ms earlier than they arrive, which lines their movement up
with the camera's. The Joy-Con is trusted less while it moves hard, since a small misalignment then
turns into a large error. The filter's speed fades with a 0.3 s time constant (0.1 s once the camera
has not seen the hand for 0.2 s, since a small tilt error then pushes the hand steadily), and while the Joy-Con
has been still for 0.1 s (turning under 0.3 rad/s and accelerating under 0.6 m/s²) it is told the hand
is not moving, so a hand the camera loses settles where it was instead of sliding away, and a resting
hand does not shake (on a recording, 3.6 to 4.3 cm of shake fell to 1.0 to 1.5 cm). A camera sighting
is applied at the moment the picture was taken, 60 to 140 ms in the past, and the Joy-Con movement
since then is replayed on top, so the hand is where it is now, not where it was. A hand-model sighting
counts as about 3 cm of camera noise, an estimated one as 6 cm.
One sighting far from the filter (the model swapping left and right) is ignored unless three in a row
agree. When the camera has not seen a hand for 0.75 s, the arm model takes over from where the hand
was, and changes between the two blend over a quarter of a second.
#### Bare hands
With camera tracking on and no game controller or Joy-Con connected (checked again whenever an input
device comes or goes), the app sets a flag in the camera file and the driver gives SteamVR two hands
from the camera alone, the way a Quest's hand tracking does; the pad hands switch off. Each hand is
still an Index controller to SteamVR, so games' Index bindings and the dashboard work, but its render
model becomes a white glove with a light grey band at the wrist, like the plain hands a Quest draws
(`{droiddeck}droiddeck_hand_left` and `_right`, built at build time by `tools/vr/make_hand_models.cpp`
from the same skeleton). The glove is a smooth surface: tapered capsules along each finger bone, a
domed palm and the band are blended into one distance field and meshed with surface nets (a 2.6 mm
grid, up to about 10,000 vertices a part). SteamVR draws render models almost unlit, so the shading
is baked in: ambient occlusion sampled from the distance field, and a soft light on the back of the
hand, pick a column of a 64x64 texture whose rows run from the glove's white to the band's grey. It
has two parts with two shapes each: the palm with the middle, ring and little fingers (open, or
curled into a fist while `/input/grip/touch` is on, at half closed), and the thumb with the index
finger (open, or pinching while `/input/trigger/click` is on). The thumb part carries a copy of the
palm 0.3 mm inside the other part's, so the two blend without a seam. SteamVR only routes a part to
its input when the part also names a legacy button (`controller_button`, as the Index model's buttons
do; vrserver then logs `inputRouting=1` for it), and a hand whose laser points at the dashboard sends
its trigger to the dashboard, so that hand clicks without drawing the pinch. Its pointer and grip poses are the Index
controller's, so the laser leaves along the fingers. Games that draw hands from the
skeleton get the camera's finger curls. Joy-Cons connected later take over; their hands go back to the
Index model.
| Gesture | SteamVR input |
| --- | --- |
| Thumb and index finger together | Trigger: it starts pulling 6 cm apart, clicks under 3.5 cm and lets go over 4.5 cm |
| Middle, ring and little fingers closed | Grip, clicking when fully closed |
| Thumb to middle finger | B |
| Thumb to ring finger | A |
| Right palm toward the face, then pinch | System (the SteamVR dashboard) |
| Left palm toward the face, then pinch | B (most games' menu) |
A gesture has to hold for 50 ms to press and be gone for 100 ms to release, and a palm has to face the
headset for 0.3 s before its pinch becomes the menu. A and B only count with the hand open, take the
fingertips within 2.5 cm (released over 3.5 cm), and while the palm faces the headset the trigger stays
released. The distances were checked on 504 photos from the public HaGRID gesture set (50 each of
eleven gestures) through the same hand model: MediaPipe puts touching thumb and index tips a median
3.4 cm apart, so a 2.5 cm pinch caught only 27 percent of the "ok" signs; at 3.5 cm it catches 51
percent while open hands, pointing, "stop", "four", "three" and thumbs-up misfire in 4 percent or
fewer. A fist pinches in a quarter of them, which games read as grabbing with the trigger held. The
grip read closed for 92 percent of fists and 96 percent of pointing hands and for none of the open
hands.
`CameraHand` in `hand_pose.h` does the work. Each camera frame's landmarks are turned by the camera's
yaw. The finger curls come from each finger's joint angles, looked up in a table of the skeleton's own
angles. The skeleton's palm at those curls (wrist and four knuckles) is fitted to the camera's with
Horn's closed-form quaternion method, and the root is placed so the skeleton's palm lands on the palm
position. Only sightings with hand-model landmarks count; the pose-only estimates are left out. The
position goes through a 1€ filter (Casiez, Roussel and Vogel, 2012): a low-pass at 1 Hz while the
hand is still that opens up the further and faster the hand gets ahead of it. On a recording of bare hands it cut
the wobble of a still hand from the 9 to 11 mm the Joy-Con Kalman filter left to 2.5 to 3 mm, and the
largest jump between frames from 10 to 17 cm to about 1.3 cm. The turn goes through the same kind of
filter (1 Hz when still, 0.2 Hz more per radian per second), and the curls follow within 80 ms. A fit
more than 2 cm off is skipped, and a fit that turns the hand more than 45 degrees at once is held back
until the next one agrees within 25 degrees (the hand model now and then flips a hand around; the
largest turn between frames fell from 14 to 7.5 degrees). When the camera has not seen a hand's landmarks for half a second,
the hand reports itself out of range and lets go of every input; it reappears wherever it is seen
next. There is no stick or trackpad, so moving around needs a game's own hand tracking or pointing
to teleport.
On MediaPipe's own example pictures (a raised index finger, a thumbs-up) the right-hand skeleton fits
the palm within 7 mm, the curls read as the pose looks, and the palm direction points at the camera
when the palm faces it.
Depth from one camera is approximate: the model expects one person, up to about 4 m away, with the
head in view.
Joy-Con orientation and buttons were tested on a REDMAGIC tablet, and the movement code was tuned on
recordings from its Joy-Cons. Camera tracking was recorded on the same tablet with the front camera:
the camera holding 30 frames per second and video mode took the hands' frame-to-frame jitter from
about 5 cm to 1 to 2 cm; the hand model and the filter were then tuned on that recording. For a
diagnosis, an empty file named `handcam-record` in the app's files folder makes the next sessions save
up to 6 minutes of small camera pictures with every landmark and timing to the app's cache
(`handcam-rec/`), and the driver writes its camera, Joy-Con and filter values to
`/run/droiddeck/droiddeck-handtrace.csv` while they run. `tools/vr/build.sh` runs `test_joycon` (arm
model, aim pose, hand skeleton, movement, the filter's latency, noise and outlier handling, yaw,
both file layouts, a lost hand settling, the palm fit, curls, gestures, bare camera hands, the turn
filter and the hand render model). `JoyConTest`,
`JoyConOrientationTest`, `JoyConMotionTest`, `JoyConShmTest`, `JoyConPadTest`, `RumbleComponentTest`,
`BodyPoseTest`, `TrackingCamerasTest`, `PlacementAdviceTest`, `HandCameraShmTest`, `HandTrackingTest`
and `HandCameraPromptTest` cover the app side.
### Device-loss recovery
During a SteamVR session, DroidDeck reads new `vrcompositor.txt` output every two seconds and detects
`VK_ERROR_DEVICE_LOST` or `vkerror=-4`. Existing errors at session start, ordinary acquire timeouts,
and unrelated failures do not trigger recovery. Reads are bounded to the newest 128 KiB and handle
log replacement, truncation, and partial lines.
A detected fault shows an eight-second cancellable countdown while the session is foreground.
Touches outside the prompt do not dismiss it; the user can explicitly choose Keep open.
Recovery stops the guest, gives teardown and diagnostic collection up to 15 seconds, then uses a
private `:vr_recovery` activity to kill only DroidDeck's main process and reopen SteamVR. That process
does not initialize the glasses SDK or guest runtime. It recreates the native graphics context; an
Activity recreation or SteamVR-only restart does not. Running games close and unsaved progress cannot
be restored. A persisted ten-minute cooldown disables another automatic attempt, while still
offering a manual restart. Session events record detection and recovery requests. This mitigates
the freeze; it does not fix the underlying Vulkan device loss.
Validated on the phone with a clearly marked `SIMULATED_RECOVERY_TEST: VK_ERROR_DEVICE_LOST`
log entry in session 58. Detection and the eight-second countdown led to a new main-process PID
and session 59 automatically reached READY and requested SteamVR. The
cooldown timestamp survived the process restart. This was a recovery-flow test, not a new GPU
failure. Subsequent user feedback and `vrserver.txt` showed that SteamVR had blocked `driver_droiddeck`
after a previous crash: the server ran, but reported `HmdNotFound` and never produced VR output.
Recovery now clears only `driver_droiddeck.blocked_by_safe_mode`, atomically after stopping the old
process and before launching the new session. It preserves global safe-mode preferences and other
drivers' blocks. A running server or resumed sensor stream alone is not proof of successful recovery.
The follow-up marked test in session 63 exercised the manual retry during the cooldown. Recovery
logged the driver unblock, restarted into session 64, and SteamVR recognized the DroidDeck HMD.
Fresh compositor output and a 3840x1080 `DroidDeck Cardboard VR` presenter appeared, with subsequent
display intervals at 56–59 fps. The user confirmed the GT Max VR view and tracking work after this
recovery. The 19 SteamVR unit tests and APK runtime-input verification passed.
The glasses/SteamVR suite includes stale/rotated/split log handling, countdown,
cancellation, foreground-only behavior, and cooldown checks.
Stereo also requires a physical side-by-side display mode. On the tested Astra 2
firmware the Pro XR command succeeds but DisplayPort falls back to 640×480;
direct-connection stereo remains unresolved. DroidDeck remembers such a fallback for that glasses
model and stops asking for 3D on its own; **Retry** in the glasses settings tries again. See the
[Astra/VITURE investigation](development/astra-viture-stereo.md) for measured
results, app recovery behavior, and the unverified powered-adapter design.
### Not done yet
- **Controllers**: the driver adds two Vive-profile hands driven by the session's game pad. It reads
the absolute-state snapshot the app already publishes in fake input ring 0
(`FAKE_EVDEV_MEMFD_PATHS`), so the app needs no new plumbing. They are a gaze pointer: low in front
of each hand, pointing where the head looks. Mapping, right hand: right stick = trackpad, A/R3 =
trackpad click, RT = trigger, RB = grip, Start = menu, guide = system. Left hand: left stick, X/L3,
LT, LB, Select. Both hands activate in SteamVR and their laser shows on the dashboard; guide, Start and
A presses show up in the ring the driver reads.
(`FAKE_EVDEV_MEMFD_PATHS`), so the app needs no new plumbing. They rest low in front of each side and
point where the head looks. Each stick moves its hand sideways (40 cm), up (50 cm) and down (30 cm)
and turns it as if from an elbow 45 cm behind, so pointers and aim follow it too; the hand eases
back when the stick is let go. The d-pad's up and down move both hands in and out; while a hand's
trigger or grip is held they move only that hand (a slingshot or bow pulled back), and it eases back
on release. Clicking the left stick hands the sticks to the game as trackpads (walking, turning,
teleport) and back. Mapping, right hand: A/R3 = trackpad click, RT = trigger, RB = grip, Start = menu, guide =
system. Left hand: X, LT, LB, Select. Both hands activate in SteamVR and their laser shows on the
dashboard; guide, Start and A presses show up in the ring the driver reads. They are drawn as Index
controllers and switch off while another driver's controller is connected. A Joy-Con hand replaces
the pad hand on its side, and bare camera hands replace both while no controller is connected
(above).
- **Layers**: only the first layer of each frame is drawn. SteamVR's compositor composites the
dashboard into it, so this has not mattered yet.
- **Timing**: no reprojection, and the presenter blits whatever was submitted last, a guard delay
after it arrived. The chain is SteamVR → presenter → DroidDeck compositor → lens pass.
- **Timing**: no reprojection. The presenter blits the frame submitted last once `vrcompositor`'s GPU
work for it is done: the layer fences that process's submits and counts issued and finished ones in
`present-sync` beside the `active` marker, and the presenter sleeps on the count (a futex). Without
the file it falls back to a guard delay after the frame arrived (`DROIDDECK_VR_PRESENT_GUARD_MS`,
4 ms). It hands its own picture to Wayland only once its blit is done, because KGSL does not order
the DroidDeck compositor's copy after it. The chain is SteamVR → presenter → DroidDeck compositor →
lens pass.
- **Cross-process GPU sync** is a poll away from exact (see the semaphore note above); binary
semaphores are not bridged.
- **Apps and games**: Windows VR games run through Proton ARM64 (FEX for the x86-64 game, DXVK, and
+130
View File
@@ -0,0 +1,130 @@
# Astra 2 and VITURE stereo
## Tested connection
2026-10-14: REDMAGIC Astra 2, model `NP06J`, Android 16,
`RedMagicOS11.5.16_NP06J_GB`, Snapdragon `SM8850P`; VITURE Pro XR
(`35ca:101d`), firmware `07.0.03.013_20250422`. The tablet reports a locked
bootloader and green verified boot. Tests used the ordinary ADB shell, without root.
2D negotiates **1920×1080 at 120 Hz**. The glasses accept stereo command
`0x0008 [32]` with reply `00 32`, but Android then exposes **only 640×480 at
60 Hz**. An accepted USB command is not proof of a working stereo signal.
In this state the glasses reject a 2D command (`01 31` or `01 34`) and their
mode query returns `01 00`. A physical cable reconnect restored 1920×1080/120
with this update; Android then requested USB permission again and control resumed.
On the fresh attempt, `0x030D [03]` arrived 3.1 seconds after the accepted stereo
command. The vendor SDK maps that report to 2D/120 (`0x34`); the subsequent mode
query was rejected. The report does not encode a fallback reason or establish a
fixed timeout. The earlier command acknowledgement cannot prove stereo retention.
## What was checked
| Route | Result on this firmware |
| --- | --- |
| Pro full SBS command `0x32` | Accepted by MCU; physical output falls to 640×480 |
| Android preferred mode 3840×1080/60 | Preference saved; physical supported modes remain 640×480 only; preference cleared after test |
| USB source/host → source/device | Request issued; actual port stayed source/host |
| USB data disable/enable | Data status changed and was restored; physical display remained 640×480 |
| `IUsbManager.resetUsbPort` through ADB | HAL callback reported success (`0`); physical display mode did not change |
| External-display power off/reset | Did not recover the signal; glasses still rejected 2D |
| Physical cable reconnect | Restored 1920×1080/120 and USB controls after the permission prompt |
| OEM mirror/3D controls, source review | Change virtual-display routing, not physical stereo timings |
| OEM resolution selection, source review | Chooses cached resolution candidates and prefers stale 16:9 mode |
| Pro startup mode / half SBS, SDK review | No supported Pro startup-mode setting or half-SBS input |
Public driver decompilations from the related REDMAGIC 11 Pro (`NX809J`, SM8850)
[retain an active mode override](https://github.com/Coding-BR/android_kernel_nubia_sm8850_qwjujube/blob/efee6f411184886b0fbdaf63fc9db36b3ed96036/decompiled/msm_drm/dp_display_get_modes.c#L37-L44)
across a glasses hotplug. Their [USB-PD disconnect path](https://github.com/Coding-BR/android_kernel_nubia_sm8850_qwjujube/blob/efee6f411184886b0fbdaf63fc9db36b3ed96036/decompiled/msm_drm/dp_display_usbpd_disconnect_cb.c#L127-L147)
clears that override; their simulated hotplug path does not. This is consistent
with the Astra's measured behavior, but does not prove its exact kernel
implementation. That driver also [validates saved user modes against EDID](https://github.com/Coding-BR/android_kernel_nubia_sm8850_qwjujube/blob/efee6f411184886b0fbdaf63fc9db36b3ed96036/decompiled/msm_drm/nubia_edid_modes.c#L226-L250),
so active overrides and saved preferences must not be treated as the same
mechanism. The independent [MagicDesk investigation](https://github.com/mekhontsev/magicdesk/blob/main/docs/xr-resolution-fix.md)
documents a related failure on its separately identified REDMAGIC firmware.
The [VITURE SDK matrix](https://www.viture.com/en-SG/developer/glasses-sdk/glasses)
specifies full SBS at 3840×1080/60 for Pro. Persistent startup mode is restricted
to Luma/Luma Pro. Among the Luma families supported here, 90 Hz stereo is an
Ultra capability. The connected Pro firmware matches both the N6PL entry in the
[public updater catalog](https://static.viture.com/dfu-util/js/vers.js) and the newest
N6P entry in the [public release-note service](https://cloud.viture.dev/api/v1/system/releasenote)
checked on 2026-10-14. This does not rule out unpublished, device-specific updates.
## Powered dock results
A VITURE Pro Mobile Dock (`35ca:3011`) was connected between the Astra and Pro XR.
Its official read-only P9 version query returned `2.01.03.0.03` with a valid
checksum. The Astra negotiated 1920×1080/120, but enumerated only the dock's
USB interfaces, not the glasses' `35ca:101d` control/IMU interfaces. A one-second
DroidDeck IMU sample returned zero packets.
DroidDeck treats the glasses as a display behind the dock: no USB permission
prompt, video at 1080p/120 on the glasses, no Play SteamVR, refresh, 3D or tracking
settings. The dock alone, without glasses, does not count as glasses.
VITURE's updater calls this dock P9 (app `35ca:3011`, bootloader `35ca:3010`). Its
HID messages cover dock versions, battery, inputs and LEDs; none sets a display
mode or forwards glasses commands or IMU data. `2.01.03.0.03` is public release
`1.03.0.03_20250709`; the latest, `1.03.0.06_20260409`, adds Beast support and
updater fixes only. The updater also reads a Lontium LT8668 in the dock, a
DisplayPort receiver with its own EDID handling, so the tablet most likely sees the
dock as its DisplayPort sink rather than the glasses.
[VITURE's Pro Dock specifications](https://www.viture.com/product/viture-pro-mobile-dock)
confirm 3840×1080/60 video support and exclude phone features requiring
communication with the glasses. The vendor SDK also treats the dock as a separate
accessory, not an IMU device. This dock may test the video path, but it does not
provide DroidDeck's current head-tracking path. Stereo negotiation and mode
retention during an upstream-only reconnect still require a physical test.
## No-root hardware design to test
A powered pass-through connection may let the tablet see the stereo EDID on a
fresh USB-PD connection while the glasses retain their stereo mode:
1. Power the adapter and glasses independently of the tablet connection.
2. Enable stereo on the glasses.
3. Disconnect only the tablet's upstream USB-C connection promptly after the
stereo acknowledgement, keeping the glasses powered. Compare with a delayed
disconnect to test whether the observed mode report affects retention.
4. Reconnect the tablet and check its physical supported modes before starting a game.
This requires an adapter that preserves glasses power and mode during the
upstream disconnect, passes 3840×1080/60 video, and forwards USB HID for controls
and head tracking. [VITURE's Adapter Ultra documentation](https://www.viture.com/academy/adapters/usb-c-xr-charging-adapter-ultra)
explicitly excludes wired glasses data on Android, so it does not satisfy
DroidDeck's current USB control/tracking path. Its power and video specifications
also do not promise mode retention across upstream disconnect. This design
remains **unverified**, not a purchasing recommendation. First verifying stereo
retention through the adapter on a compatible host would provide a useful control.
An intermediary presenting the stereo EDID before first host
connection is another possible design; it must pass the actual stereo timing
and preserve HID access, not merely advertise a wider desktop.
VITURE advertises full Android functionality for its separate
[USB-C to Glasses and Charging Adapter](https://www.viture.com/en-MY/product/usb-c-to-glasses-and-charging-adapter).
That makes it a candidate for the USB-data experiment, not a confirmed fix.
First check USB enumeration, brightness controls and live IMU data through the
adapter; then test power/mode retention and the stereo timing.
Success requires Android to expose and select 3840×1080/60, different left/right
eye images to reach the lenses, live head tracking, and repeatable return to 2D.
A wide screenshot or `wm size` override alone does not meet those conditions.
## App safeguards
DroidDeck waits up to 20 seconds for physical stereo confirmation. When the
attempt ends at a low-resolution fallback, DroidDeck remembers it for that glasses
model on this device, so Play SteamVR stops requesting 3D after a restart; **Retry** in the
glasses settings clears it. A display that stays missing, such as an unanswered
cast prompt, fails only that attempt. Automatic retries do not loop.
USB mode reports are tracked separately from the physical display. When a session
enabled 3D, stopping it requests a return to 2D, including during negotiation;
this firmware can still require a cable reconnect. Output timing follows
the active glasses display rather than the tablet's requested refresh rate.
Keep hardware experiments separate from game loads. End the session, force-stop
DroidDeck, and reopen its home screen after each game test. Read current HAL
temperatures rather than cached thermal-service samples.
+26 -6
View File
@@ -44,12 +44,16 @@ OpenVR to SteamVR's ARM64 `vrclient.so`, so no x86 SteamVR is involved.
- `helloxr` blocked in a wait-idle in `vrclient.so`;
- DXVK's `dxvk-queue` thread blocked in Proton games.
The layer now gives a submit's wait on an imported shared value 3 ms, then drops it. It is kept
when the value is already reached, or when this process has queued the signal itself. Two details
mattered:
The layer now gives a submit's wait on an imported shared value 3 ms, then drops it, at once when
the shared counter has not moved for 100 ms. It is kept when the value is already reached, when
this process has queued the signal itself, or while a Quest session's frame socket exists (checked
at most once a second). Three details mattered:
- the waits are judged before the submit's own signals count, because an acquire waits on one
value and signals the next on the same semaphore;
- SteamVR's client interop device is Vulkan 1.0, so only the `KHR` entry points resolve there.
- SteamVR's client interop device is Vulkan 1.0, so only the `KHR` entry points resolve there;
- a Proton game waits on two values a frame that are never signalled (5,500 dropped, none reached
within 200 ms afterwards). With the grace on each, Angry Birds VR's submit thread lost 6 ms a
frame and the game ran at 60 fps; without it, 120.
4. **UBWC layouts must agree.** An imported image has to be created with the same
`VkImageFormatListCreateInfo` (sRGB + UNORM) as its creator, or Turnip lays out the compression
differently and the reader sees garbage. The presenter's eye-texture import does this.
@@ -83,6 +87,21 @@ OpenVR to SteamVR's ARM64 `vrclient.so`, so no x86 SteamVR is involved.
- **Memory.** Steam, SteamVR and one VR game fit in the Thor's 12 GB. A large game such as The Lab, or
two games at once, push the device into critical pressure, and the low-memory killer takes
DroidDeck itself (`ended-without-teardown.txt` in the session logs, `lowmemorykiller` in logcat).
- **Frames shown out of order.** Video from the glasses jumped back a few frames in bursts while the
head turned. Two causes, each found by stamping a frame counter into the presenter's output:
- the presenter copied SteamVR's eye texture a fixed 4 ms after `Present`, with no fence. Under
GPU load `vrcompositor` had not drawn it yet, so the copy got that texture's previous frame. The
layer now fences `vrcompositor`'s submits and the presenter waits for the frame's count;
- DroidDeck's compositor copies a Wayland client's dma-buf without waiting for its implicit fence,
and KGSL does not order the copy after the client's GPU work. The presenter's blit sat behind the
game's frame, so the compositor showed the swapchain image's older picture. The presenter now
waits for its blit before it presents.
- **Flat games under SteamVR.** With SteamVR running, Steam lists a flat game after its own window in
gamescope's base layer, so Big Picture keeps the focus and the game never shows, theatre setting or
not. SteamVR is therefore started only by Play SteamVR, never with the glasses alone.
- **A new projection needs an event.** `SetDisplayProjectionRaw` changed what `vrserver` reports, but
`vrcompositor` kept the frustum it started with, so the glasses' field of view did nothing until
SteamVR restarted. The driver now follows it with `VREvent_LensDistortionChanged`.
- **Head-tracking axes.** With the display at `ROTATION_90`, screen x is minus device y and screen y is
device x. Getting this wrong made a turn at the hips tilt the view. Recentring now keeps the world
vertical and resets the heading only.
@@ -123,8 +142,9 @@ OpenVR to SteamVR's ARM64 `vrclient.so`, so no x86 SteamVR is involved.
- **SteamVR Home** needs `IVROverlayView_002` in Proton's `vrclient`, or an ARM64 build of Home.
- **The Lab and other large games** need memory headroom. Candidates: stop Steam's own web helpers
while a VR game runs, or lower SteamVR's footprint.
- **Wait drops are a heuristic.** A 3 ms grace keeps the common case in sync. A submit thread in the
layer, deferring submits until their waits are reachable, would be exact.
- **Wait drops are a heuristic.** A 3 ms grace keeps the common case in sync, and an idle counter
skips it. A submit thread in the layer, deferring submits until their waits are reachable, would be
exact.
- **Layers:** only the first layer of each frame is presented. No reprojection.
- **Controllers** are a gaze pointer driven by the pad. Pad presses did not close the SteamVR menu in
testing. Untested: whether that came from gamescope focus being on Steam, or from the system button
+179
View File
@@ -0,0 +1,179 @@
# RayNeo Air / GT XR integration
Built on the current `feat/viture-xr` PR #732 at bdf876d47cc9bb6fa810d014370da5bbb3c28039.
The supplied historical hashes a127e66, 7f9dd75, e8e3e6b and f0b3297 were not
resolvable in the fetched branch; no native projection or synchronization files are changed.
## Discovery and transport
`Glasses.kt` owns USB permission, attachment/detachment and presentation-display
selection. There is no manifest USB VID filter: discovery uses `UsbManager.deviceList`.
VITURE discovery is retained. `RayNeoModel` accepts the scaffold's confirmed
`1bbb:af50` and verncat's confirmed GT identity `3941:af50`; other products under `1bbb` or bridge vendor `22d9` must identify
as RayNeo/TCL Air or GT in their USB product name. This covers named Air 2, 2s,
3, 4 Pro and GT devices without claiming arbitrary TCL phones or bridge chips.
Additional unnamed VID/PID pairs require captures before being allowlisted.
Other products under `3941` are rejected. Without a meaningful USB product name,
`3941:af50` is labeled "RayNeo GT series"; a supplied GT MAX name is preserved.
GT Max was observed on the Samsung SM-F976U with this USB identity on 2026-10-14;
USB permission and the command handshake succeeded.
EDID/product display names containing RayNeo, Ray Neo, or TCL Air/GT use the existing
external-screen path. Android's supported modes, not a synthetic refresh value,
determine whether 120 Hz can be selected. Stereo modes may have a lower maximum rate.
GT Max's observed display identity is `SmartGlasses`, EDID manufacturer `TCL`,
product `980` (1920x1080, 60/120 Hz in 2D). This exact metadata combination is
recognized even though neither display name contains RayNeo. Other generic
SmartGlasses/TCL products are not accepted by this rule.
Game output uses the same `GlassesScreen` presentation as VITURE, with the phone
retaining the session controls; no screen-capture permission is needed. Discovery
checks both Android's display name and its product name. On Android 12 and newer,
a missing product-info object is treated like an unnamed panel: a recognized
glasses USB device can identify a single presentation display. Unrelated named
monitors and multiple unnamed displays are not automatically selected by that
fallback. `Game on glasses` remains enabled by default.
The presentation holder is selected before `show()`, and the phone SurfaceView
is hidden only after the compositor attaches to the glasses holder. Late phone
surface callbacks cannot reset the external output.
`RayNeoLink` claims a paired IN/OUT interface and translates the controller's
internal commands to RayNeo packets. For `3941:af50`, selection prefers interface
number 5 (not array index 5), as tested in verncat's GT contribution. Only endpoints
that can carry 64-byte packets qualify. Firmware with a different interface number
can use a unique qualifying IN/OUT pair; ambiguous alternatives are rejected.
It requests device info (0x66/0), enables IMU
(0x66/1) and waits for acknowledgments, warms up for two seconds, and stops IMU
(0x66/2) when no pose consumer remains or the link closes. SBS uses commands 6/7.
Unsupported VITURE brightness, volume and electrochromic commands are never sent;
the VITURE hardware-control UI is hidden for RayNeo.
GT spatial-button notification 0x08 and volume/display ACKs remain non-device-info
responses and cannot satisfy unrelated startup commands. The spatial button is
left to the glasses' firmware; no undocumented spatial-mode command is sent.
The parser/filter are adapted from the user's scaffold at
581dbf712ed601ece4cf5e4a7c1f52e780299c88. Sensor packets are framed with 0x99/0x65,
with little-endian acceleration at byte 4, gyro (degrees/sec) at 16 and a uint32
100us device tick at 40. Fragmented and coalesced reports are assembled before decoding.
Board 0x3a (Air 4 Pro) receives the scaffold's -20-degree X IMU mounting correction.
GT Max (`3941:af50`, board `0x41`) uses the mapping measured on 2026-10-14:
gyro and acceleration `(-y, z, -x)`, then +35 degrees around X.
At the user's level pose the raw acceleration was approximately
`(5.70, 0.00, 7.95)` m/s². A directed left-turn-and-hold capture produced positive
X/Z gyro (e.g. `(20.5, 2.0, 28.2)` deg/s), and upward looks produced negative Y
gyro. The 35-degree mounting estimate comes from that level capture,
not manufacturer calibration; frame fit and other GT variants remain unverified.
Gravity initializes orientation before the first published pose. Subsequent
body-to-world fusion uses `measuredUp × predictedUp`, correcting tilt toward gravity
instead of amplifying the error. These fusion corrections also apply to Air;
the GT Max sensor remapping does not apply to Air or VITURE.
The non-Max GT shares USB `3941:af50` but reports board `0x40`, confirmed by
switching between both physical pairs on the same phone. Its sensor axes use
the ordinary XYZ basis with a measured -25-degree X mounting correction, rather
than the Max permutation. Its confirmed upside-down resting acceleration was
approximately `(0.020, -8.819, -4.106)` m/s²; the worn level capture was near
`(0.09, 9.26, 3.11)`. Left turns produced positive Y/Z gyro. The mounting estimate
uses the resting surface; per-device calibration refines its tilt and gyro bias.
Both the pose filter and calibration collector select the same board profile.
Non-Max calibration keys have a `:gt-standard-v1` suffix so they cannot replace
existing Max profiles when USB identity fields coincide. Calibration loading
waits for the device-info response; detached-device callbacks cannot change the
replacement device's calibration key. Existing Max keys remain compatible.
After installing this correction, the non-Max completed the upside-down
calibration on the phone with `saved=true`, phase `SAVED`, progress 100.
All 186 glasses/shared-pose/SteamVR-launch/UI regression checks passed and the
installed APK's packaged runtime inputs verified. After calibration and the
recenter check, the wearer confirmed on 2026-10-14 that the non-Max GT view
looks and feels good.
## Existing pose and SteamVR pipeline
The scaffold fuses gyro/accel into wxyz. The Android adapter converts its Y-up
coordinate basis and component order into VITURE's Z-up xyzw convention before
calling the same `Glasses.PoseSink` used by VITURE. `HeadTracker` and `HeadPose`
retain their existing recenter/seated-reference behavior. The path continues through
`WaylandCompositor.nativeSetCardboardPose`, the compositor's `headpose_shm.h`
shared-memory record and `tools/vr/src/driver_droiddeck.cpp`'s pose-file reader.
The OpenVR projection, presenter, Vulkan wait logic and vblank counters are untouched.
An explicit Play SteamVR request polls the guest runtime independently of display
attachment and USB-control readiness. Both RayNeo and VITURE call the same
`droiddeck-steamvr start` helper. Stopping cancels the pending launch request;
automatic hardware 3D switching still respects the shared Auto 3D setting.
## Optional stationary calibration
Glasses → Tracking → Tracking calibration guides the user to rest the connected
RayNeo upside down on a level surface. It allows three seconds to settle, then
requires five continuous seconds of stationary samples (at least 200 reports).
Invalid gravity, the wrong orientation, motion/variance, or gaps longer than 250 ms
restart the window. A 30-second deadline fails without replacing a saved profile;
USB stream loss also terminates the operation. Cancellation and link replacement
invalidate queued callbacks by operation revision and connection generation.
The profile contains a raw gyro bias and a small mounting tilt correction, applied
to both sensor vectors before fusion. It does not estimate heading, full accelerometer
scale/bias, or translation. Profiles persist by vendor/product/serial; when a serial
is unavailable the product and model name share a fallback profile. Reset deletes
only the current profile and restores the model mapping. VITURE's fused SDK poses
do not expose the raw inputs this measurement needs, so this control is RayNeo-only.
While measuring, live pose publication pauses. On completion the user wears the
glasses, looks ahead and taps Done to recenter the active session. Dismissing the
dialog or leaving the tracking panel cancels an in-progress measurement. Agent
diagnostics expose the calibration state through `glasses`; operations are
`calibrate`, `cancel-calibration`, and `reset-calibration`.
The calibration build passed 157 targeted sensor, lifecycle, pose, launch and
Compose UI tests. Installing this feature and validating a real upside-down capture
on the phone remain pending a debugging connection.
## Regression and hardware validation
### SteamVR library launch routing (2026-10-14)
DroidDeck's SteamVR library entry (appid 250820), including its game shortcut,
now sets the same `EXTRA_STEAMVR` request as Play SteamVR instead of sending a
normal Steam game URL. Existing sessions resume with that request as well.
Other games retain their normal launch path and arguments.
Inside Steam's library, the existing SharedJSContext bridge wraps
`SteamClient.Apps.RunGame` for exactly 250820 and dispatches it to
`droiddeck-steamvr launch`. This calls the same install/start helper used by the
button, including OpenVR registration, the ARM64 runtime and Vulkan layer setup.
It does not change Steam's saved launch options. The library bridge is installed
for both desktop and Big Picture. It relies on the live Steam UI API and needs
verification against the actual phone's Steam version after installation.
The helper serializes installation/startup and avoids restarting an active
DroidDeck SteamVR session. Library launch diagnostics are in
`${XDG_RUNTIME_DIR:-/tmp}/droiddeck-steamvr/library-launch.log`; normal runtime
logs remain in `vrstartup.log` and Steam's logs directory. It does not intercept
arbitrary external `steam://` URLs or change VR game launch arguments.
Validation: seven bridge/dispatch tests passed under Node/Python, five Android
SteamVR launch tests passed, shell syntax passed and the debug APK built with
runtime input verification. The broader Linux compatibility suite cannot run
unmodified on Windows because it requires `fcntl`; no Linux runtime was available
for the helper's lock/process integration tests. Installation and live library
Play verification are pending while the phone charges.
Run `./gradlew -PskipRust=true :app:testDebugUnitTest --tests 'com.droiddeck.launcher.glasses.*'`.
Protocol tests cover malformed/fragmented packets, unsigned timestamps, model gating,
quaternion normalization, yaw basis and tick rollover. USB integration tests cover
permissions, GT interface preference/fallback, interleaved GT notifications and
ACKs during startup, 2D/3D writes, and stale pose callbacks. Hardware validation is still required per model:
USB enumeration, acknowledgment/stream startup, axes and recenter, hot unplug/replug,
SBS negotiation, Android's actual 120Hz mode, and SteamVR pose/frame pacing.
GT Max was verified on SM-F976U with USB `3941:af50` and the TCL/980 display:
the compositor attached to its separate 1920x1080 display, the Play SteamVR
request started native `vrserver`/`vrcompositor` through the shared helper, and
the presenter logged roughly 60 frames/s while the IMU packet count increased.
The test retained the user's disabled Auto 3D setting. After installing the corrected
GT sensor mapping, the user confirmed an upright starting view and correct movement
in all directions. SteamVR and the glasses IMU remained running. Stereo negotiation,
long-term drift, and alternate bridge firmware variants still need their own
hardware validation. The targeted glasses, Cardboard pose, and SteamVR launch
suite passed 134 tests after the tracking correction. Tracking regression coverage
checks initial gravity alignment, tilt convergence, the recorded GT Max level pose,
and yaw/pitch/roll through the shared VITURE basis conversion and recenter path.
Attribution and the scaffold's Apache-2.0 license are in `docs/third-party/rayneo/`.
+92
View File
@@ -0,0 +1,92 @@
# VITURE Android SDK integration
The optional adapter is built against the user-supplied VITURE XR Glasses SDK
2.4.0. Set `droiddeck.vitureSdk=C:/path/to/VITURE_XR_Glasses_SDK_for_Android`
in the ignored `local.properties`, or pass `-PvitureSdkDir=/path/to/sdk`.
The directory must contain `include/` and `android/arm64-v8a/`.
Gradle compiles `droiddeck_viture`, packages `libglasses`, `libcarina_vio`, and
`libcloud_protocol`, and includes the SDK's LICENSE and NOTICE under
`assets/licenses/viture`. Vendor headers and binaries stay outside the repository.
A build without the optional SDK still supports the existing legacy VITURE and
RayNeo transports, but does not advertise control for SDK-dependent glasses.
## Supported app functions
| Device | Transport and tracking | App controls |
| --- | --- | --- |
| Pro 2 XR | SDK Gen2 pose callbacks, observed OpenGL axes converted to NWU; negotiated pose frequency | 1080p 2D through 120 Hz, SBS 60 Hz, brightness 0–8, volume 0–8 |
| Luma Ultra | SDK Carina USB transport; OpenGL poses converted to NWU | 1200p 2D through 120 Hz, SBS 60/90 Hz, brightness, volume, binary dimming |
| Beast | SDK Gen2; native/bypass display commands selected by capability and current mode | 1200p output, SBS, brightness, volume 0–15, dimming toggle |
Pro 2 identification uses the SDK's PID validation and market name, not a guessed
USB ID. Pro 2 has no electrochromic film control. Its display profile uses the
[official 50° FOV and 1080p/SBS limits](https://www.viture.com/academy/product/viture-pro-2-xr-glasses).
Device firmware can reject individual modes; Android's physical display size
must confirm SBS before the app considers the switch successful.
All three feed the existing `Glasses.PoseSink`, head recentering, compositor and
SteamVR pipeline. Ultra explicitly selects 3DoF before SDK initialization because
the current pipeline consumes orientation. Positional 6DoF and camera passthrough
are outside this integration. The SDK's optional statistics reporter is not enabled.
The SDK owns USB interface selection and I/O. `UsbDeviceConnection` remains open
until stop/shutdown/destroy finish. A generation token rejects callbacks from an
old connection. Device brightness, volume and dimming events update the app.
Beast native and standard display codes have separate meanings; they are mapped
explicitly. Host tracking suspends native DOF to prevent applying rotation twice
and restores the previous native DOF on stop. Older firmware rejecting a bypass
mode can fall back to the native table, with rollback on failure.
`Game on glasses` uses Android's existing Presentation output. USB control alone
does not create a video display: the phone, cable and adapter must expose a usable
external display. Discovery checks both display name and product metadata, with
a single unnamed-display fallback when recognized glasses USB is present.
Screen width and distance apply to **Virtual screen** rendering. In **Automatic**,
ordinary 2D games stay flat, ordinary games with a confirmed SBS display use a
virtual screen, and a running SteamVR session uses the direct stereo view.
The direct view uses SteamVR field of view instead of virtual-screen dimensions
while SteamVR is running. A plain side-by-side game fills each eye and does not
use the SteamVR field-of-view or recenter controls.
The settings UI and session renderer share this mode selection through
`GlassesRendering`; home-screen changes configure sessions rather than resizing
Android's mirrored launcher. Regular refresh rate applies to 2D output; SBS uses
the model's separate 3D refresh rate.
Software picture controls remain available while a display is connected even if
USB control is lost; hardware controls and head tracking still require USB.
Presentation refresh preferences are revalidated on display changes even when
the requested Hz is unchanged, and keep both dimensions of the active mode.
## Validation
Run `:app:externalNativeBuildDebug` and
`:app:testDebugUnitTest --tests 'com.droiddeck.launcher.glasses.*'` with the SDK
configured. Compile `app/src/test/cpp/viture_display_modes_test.cpp` with the NDK
C++17 compiler and the SDK include directory to check native/standard mappings
against the vendor constants. The Kotlin tests cover model capabilities, axis
conversion, invalid poses, rejected tracking starts and stale callbacks.
Physical acceptance checks remain: connect each model, grant USB permission,
verify the Play SteamVR control, verify game output moves to the glasses,
test head rotation/recenter and SBS, then unplug/reconnect. Building and unit
testing do not establish hardware compatibility for every firmware revision.
### Pro 2 pose-axis correction, 2026-10-14
The connected Pro 2 delivered approximately 200 normalized poses/sec. The wearer
reported yaw moving the view vertically, pitch rolling it, and roll turning it
horizontally. Directed captures showed a left turn primarily increasing quaternion
Y (approximately 0.004 to 0.253), while repeated upward looks varied quaternion X
(approximately -0.187 to +0.082) with Y/Z remaining near zero. This is the OpenGL
right/up/back basis, despite the SDK 2.4.0 generic Gen2 callback documentation
describing NWU.
The adapter therefore selects the existing OpenGL-to-shared-glasses conversion
for the SDK-identified Pro 2 family as well as Carina. Other Gen2 models retain
their previous mapping. Tests exercise model selection and yaw/pitch/roll through
the complete shared `HeadPose` conversion and recenter path. This fixes a model
coordinate mismatch; it does not claim to run a vendor sensor-calibration command
or save a RayNeo-style calibration for VITURE. All 188 glasses/shared-pose/
SteamVR-launch/UI regression checks passed, packaged runtime inputs verified,
and the corrected build was installed on the phone. Visual verification is pending.
+242
View File
@@ -0,0 +1,242 @@
# XREAL 1S / One Pro feasibility — 2026-10-14
The user owns XREAL 1S and also wants One Pro support. Supporting these in DroidDeck
is feasible based on existing open drivers, but the supplied Monado Air driver is
not their transport. The initial investigation below preceded implementation.
An experimental native 1S driver is now enabled; see the hardware validation
section at the end for what has actually been verified.
## Supplied Monado source
Inspected `C:/Users/conno/Downloads/monado-main/monado-main/src/xrt/drivers/xreal_air/`
and `src/xrt/targets/common/target_builder_xreal_air.c`.
| Model | USB vendor:product | Sensor/control interface | Sensor report |
| --- | --- | --- | --- |
| Air | 3318:0424 | 3 / 4 | 64 bytes |
| Air 2 | 3318:0428 | 3 / 4 | 64 bytes |
| Air 2 Pro | 3318:0432 | 3 / 4 | 64 bytes |
| Air 2 Ultra | 3318:0426 | 2 / 0 | 512 bytes |
This driver implements HID IMU input, segmented factory-calibration JSON reads,
gravity/gyro fusion, brightness 0–7 and 2D/3D mode commands. It does not register
1S or One Pro. Copying those Air HID commands to the new products is unjustified.
Its source carries Tobias Frisch's BSL-1.0 notice.
## Applicable One-family references
* [XRLinuxDriver](https://github.com/wheaney/XRLinuxDriver), inspected commit
`36e2139dd482f5984112d0c3ebafcc07a78f99c0`. `src/devices/xreal.c` lists vendor
`3318`, One Pro products `0435/0436`, and 1S products `043d/043e`. These use the
non-HID transport. Its README explicitly lists both models and requires current
firmware with glasses stabilization/anchor disabled when using external tracking.
* [xrealOneDeviceKit](https://github.com/wheaney/xrealOneDeviceKit), inspected commit
`f5833f611265f418b1ea549da20dc4764d86a4ec`. Its IMU adapter consumes the One TCP
driver, interprets gyro as radians/sec and acceleration as m/s², then feeds fusion.
Its factory-calibration JSON hook returns unsupported. The maintained Linux
integration disables its SBS-control capability when no MCU connection is open;
a static model table alone is not proof of working display switching.
* [xreal_one_driver](https://github.com/rohitsangwan01/xreal_one_driver), MIT,
inspected commit `3e912315ec16e94e9a47688770d649cfef293624`. Opens TCP
`169.254.2.1:52998` with a two-second timeout, assembles 84-byte IMU records,
reads a timestamp at byte 14, gyro floats at 34 and acceleration floats at 46.
This is a transport/parser reference, not a drop-in Android glasses controller.
The source check confirms a practical path for both requested models. It does not
establish that this Samsung phone exposes the glasses' USB Ethernet interface to
ordinary Android apps, or establish the physical tracking axes on this hardware.
## DroidDeck integration path
1. Attach the 1S and inspect its USB descriptors, presentation display identity,
Ethernet network/link properties and whether the IMU endpoint is reachable.
Obtain the same evidence for One Pro before claiming hardware validation.
2. Add exact model discovery and external-display selection. Preserve each panel's
Android-advertised dimensions and modes; do not assume the Air's resolution.
3. Implement a bounded One-family stream parser and cancellable socket transport.
On Android, bind the socket to the relevant Ethernet `Network` when available,
leaving Steam's Internet route alone. If Android does not expose that link,
a USB network transport is additional work; no root requirement is assumed.
4. Establish gyro units, timestamp deltas and axis mapping using stationary,
directed yaw, pitch and roll captures. Route the validated fused pose through
the same glasses/HeadTracker/SteamVR pipeline as VITURE and RayNeo. Avoid layering
DroidDeck tracking on top of the glasses' own anchor/stabilization.
5. Gate brightness and automatic stereo switching separately on a verified control
protocol. IMU streaming alone does not justify showing those controls as working.
6. Test malformed/fragmented/coalesced records, missing network, timeout/reconnect,
USB detach, screen handoff, SteamVR launch and each physical movement direction.
At this initial investigation stage, no external SDK was installed, firmware was
modified, or XREAL commands were sent.
## Further source investigation while the phone charges
Inspected [xr-tools](https://github.com/0xcaff/xr-tools), commit
`65c11105434a998f09ac4a5f8e4de8736bb4d36c`, particularly
`packages/xreal_one_driver/src/proto/net/`, `src/proto/usb/mod.rs`, and the IMU
example. This describes considerably more of the One protocol than the simple
TCP IMU reader above:
* Reports use TCP `169.254.2.1:52998`; controls use `169.254.2.1:52999`.
Both have a two-byte message identifier followed by a four-byte **big-endian**
body length. Control messages additionally contain a big-endian transaction ID
and protobuf payload. A port must bound lengths, use unique transaction IDs,
enforce deadlines, and close both sockets on detach.
* Sensor messages `28 36` have a **128-byte body**, hence 134 bytes including the
header. The older reader's 84-byte extraction is not the complete frame format.
Body offsets: device ID 0, device timestamp 8, report type 24, gyro 28,
acceleration 40, magnetometer 52, temperature 64 and IMU ID 68. Numeric sensor
fields are little-endian; timestamp is documented as nanoseconds, gyro rad/s,
acceleration m/s². Type 11 is IMU; type 4 is magnetometer. Do not interpret every
report as gyro data or use arrival time as the device's integration interval.
* Control `27 1f` reads factory JSON: IMU bias, temperature-dependent gyro bias,
and display-to-IMU transforms. Its example subtracts the factory biases, fuses
gyro/acceleration and applies the display rotation. This is preferable to
guessing a fixed mounting angle, but the example's frame convention still
needs conversion and directed-motion verification in DroidDeck.
* `27 1c` sets brightness 0–9; `27 27` sets dimming; `28 22` selects regular/SBS
input; `27 5e/5f` reads/sets display configuration; `28 a6/a7` reads/sets EIS.
Documented display configurations are 1920×1080 at 60/90/120 Hz and 3840×1080
at 60 Hz. These are evidence for One/One Pro, not confirmed 1S modes. Preserve
the Android-advertised modes and verify controls separately on 1S firmware.
* `28 29` is labelled buttons-enabled/buttons-disabled scene mode. Do not assume
that command disables stabilization; the separate EIS control exists.
* This project's USB detection labels `3318:0436` One Pro and `3318:0438` One as
normal devices, and `0435/0437` as **recovery** devices. XRLinuxDriver accepting
both IDs does not justify opening recovery products as ordinary glasses or
sending firmware commands. xr-tools does not register 1S; its applicability
there is a protocol-family inference, not hardware validation.
No license file or Cargo license declaration was found in this inspected xr-tools
revision. No implementation was copied into DroidDeck. Use protocol observations
for an independently written adapter, or resolve source licensing before a port.
The MIT TCP driver and GPL XRLinuxDriver remain explicitly licensed references.
Also inspected XRLinuxDriver commit
[`05d0cfb`](https://github.com/wheaney/XRLinuxDriver/commit/05d0cfb86abaacbf073e1a285ad4eabf681ccb05).
It moves per-device pitch adjustment into the core pose path, after coordinate
conversion; it does not add an Android transport or new One control protocol.
Its pitch constants should not replace the GT mapping already verified by the user.
Next hardware check remains read-only: enumerate the 1S USB interfaces, display
and Ethernet link; attempt bounded reads from both TCP services, save the factory
configuration, then capture stationary/yaw/pitch/roll data. No XREAL support is
advertised in this build. Android Ethernet availability and 1S control compatibility
are still unverified.
## Official XREAL documentation and SDK inspection
Checked the user's [official documentation](https://docs.xreal.com/) on
2026-10-14. This establishes an additional integration candidate alongside the
direct TCP driver; it does not make that candidate a drop-in Android controller.
* The [device page](https://docs.xreal.com/XREALDevices/XREAL%20Glasses) explicitly
includes One, One Pro and 1S in the X1-based One family with rotational tracking.
* [SDK 3.1.0 release notes](https://docs.xreal.com/Release%20Note/XREAL%20SDK%203.1.0)
add positional tracking for the One series with XREAL Eye and updated firmware.
Beam Pro and Samsung S25 are its listed tested hosts. This does not establish
6DoF on a camera-less 1S or validation on the user's SM-F976U.
* [ControlGlasses](https://docs.xreal.com/Tools/ControlGlasses) is a required server
for official SDK apps on compatible Android phones. It supplies device services,
3D switching and dynamically loaded algorithm libraries. Beam Pro uses MyGlasses
instead. An SDK integration would have a companion-app/version dependency.
* The [quickstart](https://docs.xreal.com/Getting%20Started%20with%20XREAL%20SDK)
describes Unity XR Plugin integration, ARM64 and OpenGL ES3. The
[dual-display guide](https://docs.xreal.com/Tools/Dual%20Screen%20Display)
confirms separate phone/glasses views and continued glasses output while the
phone runs another app. This demonstrates the desired behavior in the SDK;
it does not itself supply a native Kotlin implementation.
* The [compatibility page](https://docs.xreal.com/XREALDevices/Compatibility)
currently flags unresolved Android 16 compatibility. The
[FAQ](https://docs.xreal.com/Frequently%20Asked%20Questions) also says DeX can
interfere with SDK display operation, and Android 16 USB permission may require
camera permission first when the device exposes an enabled UVC interface. Apply
that permission requirement only when relevant; ordinary tracking must not
start camera capture or enable UVC automatically.
Downloaded, but did not install or bundle, the official release archive linked
from the 3.1.0 release notes:
`https://public-resource.xreal.com/download/XREALSDK_Release_3.1.0.20251125/com.xreal.xr.tar.gz`.
SHA-256: `fd7d0fce103712e7acc85bfcbb8b127007e1d84f64596efb6c11580bea058d90`.
Size: 248,169,074 bytes.
Package inspection found Android AARs including `nr_api` and `nr_loader`, ARM64
`libXREALXRPlugin.so` / `libXREALNativeSessionManager.so`, and Java
`com.xreal.sdk.display.GlassesDisplay` plus display/surface listeners. The C# layer
calls native exports for tracking type, resolution, refresh rate, component poses
and session lifecycle; the loader also integrates Unity subsystems. Presence of
these libraries does not establish a supported standalone JNI API or permission
to redistribute a stripped subset. No C headers were present in the archive file
listing inspected. No SDK source or binaries were added to the app.
Decision: retain both candidates. Before choosing the official native-library
route, establish non-Unity initialization, head-pose access, ControlGlasses
compatibility, display-surface ownership and distribution terms. Before choosing
direct TCP, establish the Android network link and 1S protocol behavior. Compare
both against DroidDeck's existing compositor instead of replacing its rendering
architecture merely to fit the SDK's Unity sample.
## Native 1S implementation and hardware validation
The pre-implementation checkpoint is `4b045519`. The new driver uses independently
written Kotlin TCP framing, control transactions, sensor parsing and gyro/gravity
fusion. It does not bundle XREAL SDK binaries or copy the unlicensed xr-tools
source. Protocol observations came from the references above and
[xr-tools](https://github.com/0xcaff/xr-tools), inspected commit
`65c11105434a998f09ac4a5f8e4de8736bb4d36c`.
Verified on the connected SM-F976U (Android reports release 17):
* Normal 1S USB identity is `3318:043e`, product name `XREAL 1S`. Only that exact
product enables this driver; Air, One Pro and alternate/recovery IDs are excluded.
* Android exposes NCM/ECM Ethernet networks at `169.254.2.10/24` and
`169.254.1.10/24`. Individual sockets bound to the first network reach the
glasses at `169.254.2.1`, control port 52999 and report port 52998. The process
default network remains unchanged, preserving Steam's Internet connectivity.
* Requests require the high bit of the transaction ID; responses clear that bit.
Replies must match both command and transaction before values are published.
* GET_DISPLAY returned payload `22 02 10 1d`: mode **29**, with Android reporting
**1920 x 1200 at 60 Hz**. This differs from the older One's mode 2 (1080 lines).
The 1S default 60 Hz mapping preserves mode 29.
* A two-second capture delivered **2,000 valid IMU poses (1,000 Hz)**. Reports
use the 128-byte body, type 11, little-endian device nanoseconds and float
radians/sec / m/s² format. The framing handles partial and coalesced TCP reads.
The driver plugs into the shared glasses display and head-pose paths, including
SteamVR. The FOV calculation now uses the actual per-eye aspect ratio, including
the 1S's 16:10 display. Controls use acknowledged commands, bounded queues and
timeouts; connection failures clear tracking state and retry. Volume is hidden
because no volume protocol has been established. Missing Ethernet is reported
without requesting HID permission or claiming USB interfaces from Android.
Directed wearer captures on the same device established the 1S sensor basis:
level acceleration is approximately `(0, -9.65, -1.07)` m/s²; turning left gives
negative gyro Y; looking up gives positive gyro X; tilting toward the right
shoulder gives positive gyro Z with negative acceleration X. Both vectors are
mapped as `(x, -y, -z)` into the shared right/up/back basis before initial gravity
alignment and fusion. No RayNeo GT mounting angle is reused. Regression tests
exercise those measured signs through `HeadPose`, check an upright first pose
before recenter, and preserve the device's radians/sec and nanosecond units.
Stereo switching was verified at 3840 x 1080 / 60 Hz, returning to native
1920 x 1200. On 1S, SET_INPUT performs the EDID switch itself; immediately sending
SET_DISPLAY returns busy status 5001 (`22 03 08 89 27`). The driver now polls
GET_DISPLAY across the temporary empty reply (`22 00`) and only sends a second
mode command if the settled mode differs. Hardware retesting kept the connection
and sensor stream running through the switch. The busy status is never accepted
as a successful acknowledgement.
After installing the corrected build on 2026-10-14, the wearer confirmed that
the view and motion feel good in response to the upright-view, yaw, pitch and
head-tilt check. The SteamVR-requested session was running with a rendered first
frame, stereo output and active tracking. All 181 glasses, shared-pose, SteamVR
launch and glasses-UI regression checks passed; packaged runtime inputs verified.
The wearer also confirmed on 2026-10-14 that XREAL 1S brightness control works.
Higher refresh rates were not tested.
Still experimental: dimmer, 90/120 Hz compatibility modes and
extended gameplay stability need hardware validation. One successful view/motion
check does not establish long-session stability. Users must select Follow mode and disable the glasses' own
stabilization. Factory calibration and XREAL Eye/6DoF are not implemented.
One Pro is not enabled or claimed as tested.
+218
View File
@@ -0,0 +1,218 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
===========================================================================
For files under tasks/cc/text/language_detector/custom_ops/utils/utf/
===========================================================================
/*
* The authors of this software are Rob Pike and Ken Thompson.
* Copyright (c) 2002 by Lucent Technologies.
* Permission to use, copy, modify, and distribute this software for any
* purpose without fee is hereby granted, provided that this entire notice
* is included in all copies of any software which is or includes a copy
* or modification of this software and in all copies of the supporting
* documentation for such software.
* THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
* WARRANTY. IN PARTICULAR, NEITHER THE AUTHORS NOR LUCENT TECHNOLOGIES MAKE ANY
* REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
* OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
*/
+3
View File
@@ -0,0 +1,3 @@
The MIT License
Copyright © 2019 Inigo Quilez
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+101
View File
@@ -0,0 +1,101 @@
# Camera hand tracking attribution
## Included
[MediaPipe](https://github.com/google-ai-edge/mediapipe) Tasks Vision 0.10.21
(`com.google.mediapipe:tasks-vision`, tag `v0.10.21` at cad7f3ab99ebf175947e40c5252c642612aae927;
copyright Google LLC and the MediaPipe authors, Apache License 2.0, `LICENSE_MEDIAPIPE` here) finds
the player's body in each camera frame. It comes from Maven Central with its dependencies
(Guava, Flogger, protobuf-javalite and Google's `datatransport`), all Apache-2.0.
`app/src/main/assets/handtracking/pose_landmarker_lite.task` is MediaPipe's Pose Landmarker (Lite)
model, BlazePose GHUM 3D, unchanged from
`https://storage.googleapis.com/mediapipe-models/pose_landmarker/pose_landmarker_lite/float16/1/pose_landmarker_lite.task`
(SHA-256 `59929e1d1ee95287735ddd833b19cf4ac46d29bc7afddbbf6753c459690d574a`). Its
[model card](https://storage.googleapis.com/mediapipe-assets/Model%20Card%20BlazePose%20GHUM%203D.pdf)
licenses it under the Apache License 2.0 and lists its limits: one person, up to about 4 metres
from the camera, the head in view, and depth that is approximate rather than metric.
`app/src/main/assets/handtracking/hand_landmarker.task` is MediaPipe's Hand Landmarker (full) model
bundle, a palm detector and a hand landmark model, unchanged from
`https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/1/hand_landmarker.task`
(SHA-256 `fbc2a30080c3c557093b5ddfc334698132eb341044ccee322ccf8bcf3607cde1`). Its
[model card](https://storage.googleapis.com/mediapipe-assets/Model%20Card%20Hand%20Tracking%20(Lite_Full)%20with%20Fairness%20Oct%202021.pdf)
licenses it under the Apache License 2.0; it gives 21 landmarks per hand in the picture and in metres,
based on the GHUM hand model, and is meant for prominently shown hands.
[CameraX](https://developer.android.com/jetpack/androidx/releases/camera) 1.4.2
(`androidx.camera:camera-camera2`, `camera-lifecycle`; copyright The Android Open Source Project,
Apache License 2.0) delivers the frames.
`tools/vr/src/hand_mesh.h` ports Inigo Quilez's signed distance to a polygon (`sdPolygon`, from
[2D distance functions](https://iquilezles.org/articles/distfunctions2d/) and his Shadertoy
"Polygon - exact", `wdBXRW`; copyright 2019 Inigo Quilez, MIT License, `LICENSE_SDPOLYGON` here) for
the glove's palm outline.
MediaPipe's task runner reports usage statistics through Google's `datatransport` library. The app
manifest removes that library's `CctBackendFactory` entry, so those reports have nowhere to go and
are dropped on the device. Camera frames are never stored or sent anywhere.
## References
No code from these projects is included. They were read to design and check the camera tracking
and the Joy-Con movement that it corrects:
- [JoyConVr](https://github.com/F8LEFT/JoyConVr) by F8LEFT and contributors (MIT), `android-camera`
at 76466c28829396651be3c68143f6297ed68923e4: an Android app that runs MediaPipe's pose landmarker
for Joy-Con VR hands, levels the camera with gravity and slows inference down as needed.
- Google's `GvrArmModel.cs` in the [Google VR SDK for Unity](https://github.com/googlevr/gvr-unity-sdk)
v1.30.0 (Apache-2.0): its optional accelerometer mode moves the elbow by a filtered, integrated
velocity and keeps the offset within a range, the idea behind the short Joy-Con movements here.
- MediaPipe's [pose landmarker guide](https://developers.google.com/edge/mediapipe/solutions/vision/pose_landmarker),
[hand landmarker guide](https://developers.google.com/edge/mediapipe/solutions/vision/hand_landmarker),
`pose_landmarker_graph.cc` and `pose_landmarks_detector_graph.cc` (Apache-2.0): image and world
landmarks, and the tracking and landmark smoothing that video mode applies to a single pose, which
the app uses. MediaPipe Holistic's idea of finding the hands from the pose's wrists informed the hand
crops.
- R. E. Kalman, "A New Approach to Linear Filtering and Prediction Problems", Journal of Basic
Engineering 82(1), 1960, and the usual treatment of late measurements by replaying the stored
inputs after them: the per-hand filter that joins Joy-Con movement and camera sightings.
- Android's [Camera2 reference](https://developer.android.com/reference/android/hardware/camera2/CameraCharacteristics)
(`SENSOR_ORIENTATION`, `LENS_FACING`, `LENS_INTRINSIC_CALIBRATION`, `CONTROL_ZOOM_RATIO_RANGE`,
`SENSOR_INFO_TIMESTAMP_SOURCE`): choosing the camera, its focal length and turning frames upright.
- [hid-nintendo](https://github.com/torvalds/linux/blob/master/drivers/hid/hid-nintendo.c)
(GPL-2.0+): the Joy-Con IMU report, three samples every 10 ms, and its timestamps.
- E. Foxlin, "Pedestrian Tracking with Shoe-Mounted Inertial Sensors", IEEE Computer Graphics and
Applications 25(6), 2005: zero-velocity updates while the sensor is still.
- I. Frosio, F. Pedersini, N. A. Borghese, "Autocalibration of MEMS Accelerometers", IEEE
Transactions on Instrumentation and Measurement 58(6), 2009: learning an accelerometer's offset
and scale from resting positions.
- [ALVR](https://github.com/alvr-org/ALVR) (MIT), `alvr/server_core/src/hand_gestures.rs` at
ebec107b7e5f81677fb9c631d239daf2110bf573: turning tracked hands into controller input (thumb pinches
to each finger, a pinch range from touching to pulling, grip from the other fingers, a held palm
for the menu). The distances, mapping and timing here are DroidDeck's own.
- Meta Quest's hand tracking: the palm-toward-the-face pinch that opens the system menu, and the
plain white hands it draws, which the gesture and the glove model follow.
- B. K. P. Horn, "Closed-form solution of absolute orientation using unit quaternions", Journal of
the Optical Society of America A 4(4), 1987: fitting the skeleton's palm to the camera's.
- G. Casiez, N. Roussel, D. Vogel, "1€ Filter: A Simple Speed-based Low-pass Filter for Noisy Input in
Interactive Systems", CHI 2012: the bare hands' position and turn filters.
- Valve's [OpenVR wiki](https://github.com/ValveSoftware/openvr/wiki) pages "Render Model Reference"
and "Driver Render Models": the render model JSON, its components, `component_path` and visibility.
The glove's tip, base, handgrip and grip poses are the numbers in SteamVR's Valve Index controller
model (`valve_controller_knu_1_0_left` and `_right`), so the pointer leaves the hand as it leaves an
Index controller, and its button parts showed which fields SteamVR needs to route a part to an input.
- S. F. F. Gibson, "Constrained Elastic Surface Nets", MICCAI 1998, and Mikola Lysenko's
[Smooth Voxel Terrain (Part 2)](https://0fps.net/2012/07/12/smooth-voxel-terrain-part-2/): meshing
the glove's distance field with surface nets.
- [HaGRID](https://github.com/hukenovs/hagrid) (A. Kapitanov et al., "HaGRID - HAnd Gesture Recognition
Image Dataset", WACV 2024; CC BY-SA 4.0), through the 384p sample
[cj-mills/hagrid-sample-30k-384p](https://huggingface.co/datasets/cj-mills/hagrid-sample-30k-384p):
550 of its photos were used, on the development machine only, to check the pinch and grip distances.
No picture is included.
- Inigo Quilez's articles on [smooth minimum](https://iquilezles.org/articles/smin/) and
[3D distance functions](https://iquilezles.org/articles/distfunctions/) (the polynomial smooth
minimum and the ellipsoid bound) and his talk "Rendering Worlds with Two Triangles" (NVScene 2008;
ambient occlusion from a distance field): blending the glove's capsules, palm and wrist band, and
baking its shading.
Nintendo Switch and Joy-Con are trademarks of Nintendo. This project is not affiliated with Nintendo,
Google, Meta or Valve.
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+23
View File
@@ -0,0 +1,23 @@
Boost Software License - Version 1.0 - August 17th, 2003
Permission is hereby granted, free of charge, to any person or organization
obtaining a copy of the software and accompanying documentation covered by
this license (the "Software") to use, reproduce, display, distribute, execute,
and transmit the Software, and to prepare derivative works of the Software,
and to permit third-parties to whom the Software is furnished to do so, all
subject to the following:
The copyright notices in the Software and this entire statement, including
the above license grant, this restriction and the following disclaimer, must
be included in all copies of the Software, in whole or in part, and all derivative
works of the Software, unless such copies or derivative works are solely in
the form of machine-executable object code generated by a source language
processor.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES
OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
+55
View File
@@ -0,0 +1,55 @@
# Joy-Con VR controller attribution
## Adapted code
`tools/vr/src/arm_model.h` ports the arm model of Google's `GvrArmModel.cs` from the
[Google VR SDK for Unity](https://github.com/googlevr/gvr-unity-sdk)
(`Assets/GoogleVR/Scripts/Controller/ArmModel/GvrArmModel.cs` at
f999ed727a1d238c246ba4a504b77d55b59c9e9a; copyright 2016 Google Inc., Apache License 2.0, LICENSE_GVR
here). It is rewritten in C++ in OpenVR's coordinate frame. The rest positions, extension
angles, elbow bend, extension weight and the torso following the gaze are Google's. The neck
offset is left out, as `GvrArmModel` leaves it out by default.
`tools/vr/src/hand_skeleton.h` adapts `hand_simulation.cpp` from Valve's OpenVR
`handskeletonsimulation` driver sample
([ValveSoftware/openvr](https://github.com/ValveSoftware/openvr), `samples/drivers/drivers/handskeletonsimulation`
at 0924064316de3effbcd1acf1e309182a2deb1c05; copyright Valve Corporation, BSD-3-Clause,
`tools/vr/src/OPENVR_LICENSE`). Valve's sample is inspired by Moshi Turner's hand simulation in
[Monado](https://gitlab.freedesktop.org/monado/monado) (`src/xrt/auxiliary/util/u_hand_simulation.c`).
`tools/vr/src/index_pose.h` uses the Valve Index tip rotation and grip offset listed in Monado's
`src/xrt/auxiliary/vive/vive_poses.c` (at 8b259763fdd23c46592fd4cdd30b4eea997d4b70; copyright
Collabora, Ltd., author Daniel Willmott, Boost Software License 1.0, LICENSE_MONADO here).
## References
No code from these projects is included. They were read to learn how Joy-Cons, Android and
SteamVR behave, and to check this implementation:
- [hid-nintendo](https://github.com/torvalds/linux/blob/master/drivers/hid/hid-nintendo.c), the Linux
Joy-Con driver by Daniel J. Ogorchock and contributors (GPL-2.0+): button codes, stick axes, IMU
axes and units, and the rumble channels Android exposes.
- [Nintendo_Switch_Reverse_Engineering](https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering)
by dekuNukem: the Joy-Con's buttons, sensors and rumble.
- [SDL](https://github.com/libsdl-org/SDL) (zlib): how Switch controller sensors map to a game
controller's axes.
- [Android Open Source Project](https://github.com/aosp-mirror/platform_frameworks_base) (Apache-2.0):
`data/keyboards/Generic.kl`, which Android applies to Joy-Cons, and the `InputDevice` sensor and
vibrator APIs.
- [ALVR](https://github.com/alvr-org/ALVR) (MIT): presenting controllers to SteamVR as Index
controllers and handling their haptic events.
- [OpenComposite](https://gitlab.com/znixian/OpenOVR) (GPL-3.0): cross-check of the Index input
profile and skeleton.
- [PSMoveSteamVRBridge](https://github.com/HipsterSloth/PSMoveSteamVRBridge) (Apache-2.0): driving
SteamVR hands from orientation-only controllers.
- [JoyConVr](https://github.com/F8LEFT/JoyConVr) by F8LEFT (MIT): a Joy-Con button layout for SteamVR
and recentering by holding a button.
- [Daydream-Controller-SteamVR](https://github.com/krnelpan1c/Daydream-Controller-SteamVR) by
krnelpan1c: snapping a 3DoF controller's heading to the view by holding Home.
- [joyconvr](https://github.com/yoyobuae/joyconvr) by yoyobuae: Joy-Con sensor axes in SteamVR.
- [Moonlight for Android](https://github.com/moonlight-stream/moonlight-android) (GPL-3.0) and
[Dolphin](https://github.com/dolphin-emu/dolphin) (GPL-2.0+): reading a game controller's motion
sensors through Android's `InputDevice` API.
Nintendo Switch and Joy-Con are trademarks of Nintendo. Valve Index and SteamVR are trademarks of
Valve Corporation. This project is not affiliated with either.
+201
View File
@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
+21
View File
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2025 verncat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
+13
View File
@@ -0,0 +1,13 @@
Monado Reference Attribution
============================
This project's RayNeo implementation was developed by referencing behavior and protocol details from the Monado project:
- Project: https://gitlab.freedesktop.org/monado/monado
- Relevant area: src/xrt/drivers/rayneo/
Notes:
- The app code in this repository was written for this project.
- Protocol understanding (packet IDs/layout, command flow, and initialization sequencing) was informed by the Monado RayNeo driver implementation.
- Monado is distributed under the Boost Software License 1.0 (BSL-1.0). See the upstream repository for full licensing and notices.
+21
View File
@@ -0,0 +1,21 @@
# RayNeo protocol and orientation filter attribution
RayNeoProtocol.kt and RayNeoOrientationFilter.kt are adapted from
https://github.com/informalTechCode/RayNeo-Air-Series-3DoF-Scaffold
at 581dbf712ed601ece4cf5e4a7c1f52e780299c88 (Apache License 2.0; LICENSE here).
The scaffold references Monado for protocol details; its notice is preserved here.
DroidDeck adaptations add frame validation, unsigned device ticks, endpoint filtering,
and conversion into the existing VITURE pose coordinate convention. The transport,
USB discovery and DroidDeck integration are implemented for this project.
GT USB identification and interface selection reference
https://github.com/verncat/RayNeo-Air-3S-Pro-OpenVR
at dfd2e8abab7052d88a1047266d89260347d0dd67, especially merged PR #3:
https://github.com/verncat/RayNeo-Air-3S-Pro-OpenVR/pull/3
(MIT; copyright 2025 verncat; full notice in LICENSE_VERNcat).
That contribution reports GT hardware tests for 3941:af50 on interface 5,
IMU streaming, spatial-button notification 0x08, and display/volume ACK handling.
DroidDeck keeps its Android transport and existing command-specific ACK parser;
it prefers interface 5 for this identity and falls back only to a unique pair
of protocol-sized endpoints. GT Max is not separately verified by this source.