Commit Graph
8674 Commits
Author SHA1 Message Date
lbgos 59d3eddac1 Keep exact controller head queries outside the pose mutex 2026-10-13 06:51:36 +03:00
lbgos 5c23f4b9a2 Require advancing native vsync before ending display recovery 2026-10-13 05:31:02 +03:00
lbgos dce2075d43 Recover SteamVR display sessions after Rift S reattachment 2026-10-13 05:24:49 +03:00
lbgos 37ce53bbbc Reconfirm saved bounds after tracking loss and verify drift at one hertz 2026-10-13 04:45:39 +03:00
lbgos 90d695a566 Keep HID and camera handles out of SteamVR child processes 2026-10-13 04:41:42 +03:00
lbgos 10e56431ce Recognize the saved room from sparse samples and skip matching off-head
Hold world confirmations across invalid SLAM samples instead of
resetting on every miss; a candidate drops only when stale (>3 s) or
from an older SLAM session. The 3-vote bar, 4 cm / 3 deg agreement and
the chained 3 s window are unchanged, so transient wrong matches still
cannot accumulate votes.

Wait up to 250 ms for the exposure's SLAM sample and accept the same
250 ms gap the display pose path tolerates, so a loaded backend does
not make recognition samples unusable while published poses stay valid.

Skip feature matching while proximity reports off-head standby, and
verify at 0.2 Hz once the room is localized; match every queued pair
while searching or recording. Attempts and diagnostics freeze visibly
while skipping.

Count the first failing usability gate per unusable attempt
(paused/sample/gap/flags/generation/guard) in diagnostics, the
per-second world log, the pending-room warning and the status file, so
the next worn session shows which condition dominates.

Triangulate at most one landmark per second-view pixel, with separate
live and reference-image sets so temporal pairs keep their own domain.
Replay: same-room recognition still confirms in ~0.5 s with tighter
votes on fewer map points; sparse valid samples confirm where the old
window reset could not.
2026-10-13 04:23:11 +03:00
lbgos 3952df76d0 Return the Monado input update result for proximity 2026-10-13 02:37:46 +03:00
lbgos e54298ff75 Expose physical Rift S proximity to native runtime standby 2026-10-13 02:37:13 +03:00
lbgos 8bc9f0856b Publish Rift S transport loss through OpenVR connection poses 2026-10-13 02:32:16 +03:00
lbgos d68d598459 Keep the HMD alive while waiting for camera enumeration 2026-10-13 02:25:28 +03:00
lbgos e1ee4a8c2d Invalidate the retained tracker pose used by attached hand devices on loss 2026-10-13 02:22:59 +03:00
lbgos 66015ec751 Initialize online state in controller fixture constructors 2026-10-13 02:19:38 +03:00
lbgos ae84e8b785 Retry bounded EIO failures and model attached hardware in pose fixtures 2026-10-13 02:18:19 +03:00
lbgos 7ed84cfcdd Release SLAM buffers on USB loss and bound radio busy polling 2026-10-13 02:16:26 +03:00
lbgos fde10e6e9d d/v4l2: fix reconnect UAF, thread/mmap leaks on device loss
Refcount frameserver storage so destroy defers munmap/free/close
until outstanding ROI frames return; always join the stream thread
via a joinable flag instead of the running flag; wake blocked DQBUF
with poll timeout plus STREAMOFF; make running/used state atomic.
2026-10-13 02:15:42 +03:00
lbgos 505aa3352a Require radio recovery after ambiguous timeouts and register queue tests 2026-10-13 02:14:54 +03:00
lbgos 720d93e12e rift_s: bound radio queue with monotonic deadline and HID backoff
Add per-command monotonic deadline (1500 ms, beyond the device 1000 ms
timeout) so a missing response fails the head instead of wedging the
queue. Bound send and poll transport errors (8 each) with 5 ms doubling
to 100 ms backoff so a persistent STALL cannot spin HID ioctls.

Retries resend only the unsent head with identical bytes; once sent the
head is polled, never resent. The response carries no command echo
(seqnum/busy only), so a late reply after a timeout can be misattributed
to the next command; last seq is retained to ignore duplicates and
callers must validate payload status/length.

Fail callbacks once via a shared helper; clear stays safe after timeouts.
HID -1/errno semantics unchanged; valid busy polls every tick.

Add fake-HID/fake-time tests for success pipelining, busy timeout
advance, send/poll/short backoff bounds, clear-once safety, stale seq,
and null HID expiry.
2026-10-13 02:13:48 +03:00
lbgos 40b6ed4944 Test USB interruption classification and tracker epoch loss 2026-10-13 02:13:48 +03:00
lbgos b9c1913aba Avoid callback lock inversion and pause feature traffic during read retries 2026-10-13 02:11:53 +03:00
lbgos 9416ad0f4e Reconnect Rift S transport without replacing registered devices 2026-10-13 02:11:36 +03:00
lbgos 620a51d8e8 rift_s: add tracker device-lost path with world worker join/restart
USB thread calls rift_s_tracker_device_lost before camera frameserver stop.
Retains tracker, passthrough pointer, and SLAM/constellation xfctx; marks
ready_for_data=false, pauses via existing restart path with forced pending
restart, resets hw clock/IMU/frame epochs and fusion history for counter
reset, bumps slam_generation and invalidates world candidate so stale worker
results cannot publish, preserves saved map/anchor, joins world worker.
tracker_start restarts worker after reconnect. Controller/SLAM/IMU paths
already drop while !ready; no xfctx teardown here.
2026-10-13 02:09:56 +03:00
lbgos 41924a4e48 Inline CPU-dispatched Hamming distance into the native LSH loop 2026-10-13 01:53:27 +03:00
lbgos 32d1033475 Halve LSH lookup memory and align public key-loader rows 2026-10-13 01:48:21 +03:00
lbgos e88a35d5c1 Pack LSH candidates and reject empty buckets with a bitset 2026-10-13 01:44:42 +03:00
lbgos 8d6203d303 Use direct LSH bucket lookup with identical candidate ordering 2026-10-13 01:42:09 +03:00
lbgos 5216ef0281 rift_s: shorten room query cache contract comments 2026-10-13 01:34:53 +03:00
lbgos 454085391e rift_s: use native Hamming LSH for uncached room queries 2026-10-13 01:34:05 +03:00
lbgos 284e6c6998 rift_s_world: memoize exact knnMatch 4-neighbor results per bank
Cache bounded FIFO (8192/bank) exact 32-byte ORB query -> ordered
k-neighbor lists incl empties against unchanged index. Batched misses
preserve row order, queryIdx/trainIdx, tie order; same matcher params,
gates untouched. Clear on index rebuild and map replace/clear/reload.

Tests cover cached vs uncached equality for repeats, reorder, changed
bytes, ties, mixed hit/miss batches, empty/short lists, per-bank
isolation, invalidation (stale without clear, exact after), FIFO bound,
BF small and LSH map >2000.
2026-10-13 01:33:11 +03:00
lbgos 799148371b rift_s: retain unsigned source geometry in baked resampling 2026-10-13 01:32:13 +03:00
lbgos af5928adbb rift_s: precompute passthrough resampling indices and weights
Bake the fixed per-pixel resampling (integer base pixel plus dx/dy and
1-dx/1-dy weights) at camera-create time instead of re-deriving it from
the float UV map on every conversion. The per-frame path keeps the live
source bounds check (integer form, exactly equivalent for validated
payloads) and per-capture stride, and preserves the original float
expression ordering so converted bytes match bit-for-bit.

Skipped in-place output reuse: get_frame hands out references that
outlive the provider, so a fresh conversion buffer per timestamp stays
required for torn-frame safety.

Adds a focused comparison test: verbatim original scalar path vs the new
path over the full 320x320x2 map on a fisheye/rolled calibration with
per-eye distortion, at tight and padded source strides, frames held
immutable.
2026-10-13 01:31:41 +03:00
lbgos e3fcd5df1c rift_s: specialize unchanged room LSH search with native Hamming popcount 2026-10-13 01:31:41 +03:00
lbgos 9a9255d686 rift_s: keep passthrough logging independent of target builder 2026-10-13 01:25:36 +03:00
lbgos cabb5eb4c4 perf-logs: bound roomsetup/passthrough/event diagnostic logging
- roomsetup guard: monado-coordinates dump (and its public queries)
  behind MONADO_ROOMSETUP_COORDS_DEBUG; state changes/errors unchanged
- rift_s passthrough: 5s stereo INFO demoted to RIFT_S_LOG-gated debug,
  skipping the pixel scan when disabled; rejection warnings untouched
- steamvr_drv: repeated Unhandled Event log behind MONADO_STEAMVR_EVENT_DEBUG
2026-10-13 01:25:17 +03:00
lbgos 7371dd5300 rift_s: test haptic replacement, coalescing, expiry and retry scheduling 2026-10-13 00:58:49 +03:00
lbgos 7fec0eda71 rift_s: stop latched haptics on exit and track applied radio identity 2026-10-13 00:57:19 +03:00
lbgos 6a3d8c4f72 rift_s: use wide nanosecond arithmetic for haptics and exposure retry 2026-10-13 00:48:57 +03:00
lbgos 14c9c49175 rift_s: dispatch native raw controller haptics on the radio worker 2026-10-13 00:45:39 +03:00
lbgos d4f5f9ec47 steamvr_drv: identify each drain independently of reused handles 2026-10-13 00:39:10 +03:00
lbgos 047a0e9b93 steamvr_drv: release dispatch lock across transfer-queue drain with drain ownership
recover_rings ran vkQueueWaitIdle while holding the global layer mutex,
stalling every other thread in any intercepted Vulkan call for the whole
GPU drain. Collect candidates under the lock, wait unlocked, then revalidate
before resetting the cursor.

The wait window allows destroy/recreate reusing the same buffer handle, a
concurrent recovery, or a disable (unmap, author change) to land mid-drain.
Each drain carries its ring's slot, buffer/memory identity, cursor, and reset
count plus a per-ring draining flag: a replacement (draining==false, own
slot/identity) is left alone instead of being reset or disabled, a concurrent
drain skips instead of double-resetting, and a ring disabled during the wait
is never reset. A failed wait stays a failure even if the cursor reads zero.
2026-10-13 00:38:42 +03:00
lbgos 292d847c88 steamvr_drv: run roomsetup failure repair only once per guard
failed stayed set after a handled repair, so every later immediate
RoomSetupFinished re-restored the stale pre-failure snapshot over the new
calibration and posted a duplicate persistent notification each time.
2026-10-13 00:38:42 +03:00
lbgos 0146ca92b6 steamvr_drv: reuse the live roomsetup guard on repeated Activate
A second start overwrote pid/ack, orphaning the first guard (own VR
connection, overlay, mailbox registration) and leaking its pipe fd.
Return early while the child is alive; reset ack state on respawn.
2026-10-13 00:38:42 +03:00
lbgos c049c3b69a steamvr_drv: drop ring recovery state when its buffer is destroyed
Keeping a disabled entry let a later buffer reusing the same handle inherit
dead state and skip re-detection at map time. Erase it; identify_ring
re-validates from scratch on the next map.
2026-10-13 00:38:42 +03:00
lbgos 7c76f5b827 steamvr_drv: intercept vkBindImageMemory2 for roomsetup SDF images
Buffers already handled Bind2 but images did not, so SDF images bound via
vkBindImageMemory2 never recorded memory/layout and missed the linear R8
initialization on map. Mirror the vkBindImageMemory bookkeeping.
2026-10-13 00:38:42 +03:00
lbgos bcc353520c rift_s: exercise failed radio transfers and malformed reports 2026-10-13 00:34:49 +03:00
lbgos e86a145ee6 rift_s: cover corrupt rig landmarks and invalid observation storage 2026-10-13 00:33:01 +03:00
lbgos f877999222 rift_s_world: validate solve inputs in the non-gravity path too
The gravity solver rejects null observation arrays and oversized
counts up front; the per-camera PnP path dereferenced obs[eye]
unchecked once counts reached MIN_POINTS. Same fail-closed check.
2026-10-13 00:32:27 +03:00
lbgos 45f6e99334 rift_s_world: skip unusable points instead of failing rig relocalization
One mismatched edge pixel or non-finite landmark aborted the whole
multi-camera gravity solve, delaying room recognition by a cycle.
Skip the point; the support/coverage gates still decide.
2026-10-13 00:32:27 +03:00
lbgos af2333572c Key driver version cache on vrserver PID and cache failures
cached_version only returned a hit when the cached value was Some, so
failures recomputed every snapshot poll despite the minute-cache claim.
It also served the previous runtime's driver hash for up to 60 s after a
restart. Replace the generic helper with a PID-keyed cache mirroring
steam_version: same-PID results (including None) are cached for 60 s and
any PID change forces recompute. Pass the PID into the uncached probe to
avoid a second pgrep per poll.
2026-10-13 00:31:49 +03:00
lbgos 3f123b0027 Prefer python3 for the SteamVR restart launcher
Bare python is absent on several distributions, so a present launcher
failed after SteamVR had already been terminated. Try python3 first
and fall back to python only when the interpreter binary is missing,
never re-running a script that already failed.

(cherry picked from commit 1dc1a1d7929d802221730c7547ff6d1f3baf4fb5)
2026-10-13 00:31:49 +03:00
lbgos f046863394 Re-establish registration watches after Steam moves
inotify drops watches on moved or deleted directories and wait()
drains the fd without parsing, so the remembered path set kept dead
entries forever. Re-add watches every pass so watch mode recovers
after a Steam reinstall instead of stalling until service restart.

(cherry picked from commit 9cd08b0d7a4cb095f6bae516f42d141e1d2b0d64)
2026-10-13 00:31:49 +03:00