Repository navigation
fix(steamvr): let a streamed headset's poses through SteamVR unpredicted - #11
Merged
Merged
Conversation
The SteamVR driver's FRAME_END never set sample_id, and metalvrd's ALVR driver drops a frame that names no tracking sample, so a Quest streaming SteamVR over ALVR connected and tracked but received no video: every session ended with "headset disconnected (0 frames sent, N dropped)". SteamVR does not say which pose it rendered a frame with, only the pose itself (SubmitLayer's mHmdPose). Keep the head orientations of the last 64 tracking samples and send the one nearest the first projection layer's pose, as ALVR's own SteamVR driver does (PoseHistory::GetBestPoseMatch). Newest samples win ties, so a still head names the newest sample rather than an older one that float noise happens to put closer. The headset then reprojects each frame from the pose it was drawn with.
13 tasks done
multision
force-pushed
the
fix/steamvr-head-prediction
branch
from
November 19, 2026 18:45
47384bf to
bb5ad75
Compare
ALVR's client sends every head pose already predicted for the moment the frame drawn from it is shown, and Present names the tracking sample whose orientation is nearest SteamVR's render pose (mHmdPose) so the headset reprojects from it. The driver handed SteamVR the head's velocities as well, so SteamVR predicted the pose a second time, to its own display time, and rendered with a pose the headset never sent. The sample Present names is then off by the turn rate times SteamVR's prediction, the headset reprojects from the wrong reference, and the picture swims while the head turns: most when a game misses frames. For the headsets that stream through ALVR (Quest family, Steam Frame) the head pose goes to SteamVR without velocities, so its prediction leaves the pose as it is and Present finds the very sample. Controllers keep their velocities, which games read for throws. Headsets metalvrd drives itself (Rift, Lighthouse, PSVR2) are unchanged: their samples are for now, and SteamVR predicts them.
multision
force-pushed
the
fix/steamvr-head-prediction
branch
from
November 19, 2026 18:45
bb5ad75 to
b924191
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SteamVR games streamed to a Quest over ALVR (Blade & Sorcery, Skyrim VR) swim and judder during head turns, most when the game runs below the headset's rate. OpenXR games on the same headset don't.
ALVR's client sends every head pose already predicted for the moment the frame drawn from it is shown. The SteamVR driver passed that pose to SteamVR together with the head's velocities, so SteamVR predicted it a second time, to its own display time, and rendered with a pose the headset never sent.
Presentthen names the sample nearest SteamVR'smHmdPose(#8), which is off by the turn rate times SteamVR's prediction, and the headset reprojects from the wrong reference.For the headsets that stream through ALVR (Quest family, Steam Frame), the head pose now goes to SteamVR without velocities. SteamVR's prediction then leaves it as it is, and
Presentfinds the very sample. Controllers keep their velocities, which games read for throws. Headsetsmetalvrddrives itself (Rift, Lighthouse, PSVR2) are unchanged: their samples are for now, and SteamVR's prediction is wanted.This carries #8's commit, rebased onto
main. #8 conflicts withmainsince #9 addedsetViewsat the same place, and this change needs #8's sample matching. The conflict is resolved here by keeping both. Merging this PR covers #8, which can then be closed; or merge #8 first and I'll rebase this onto it.Testing
build/native,build/win64): not run, no CMake or Ninja on this Mac.driver_metalvr.dllbuilt withx86_64-w64-mingw32-g++16.2 from the CMake target's sources, include paths and flags: 0 warnings.scripts/test-native.shandscripts/test-failures.sh: not run; they do not reach the SteamVR driver.scripts/test-wine.sh: not run.scripts/test-openvr.sh: not run (SteamVR driver, not the OpenComposite path).Checklist
patches/, not edits inexternal/