Repository navigation
fix(recording): start the gated Instant screen track at the arm point - #2658
Merged
Merged
Conversation
Gated Instant audio starts at the gate's arm time, but the screen track started at its first admitted frame, 17 to 25 ms later on a MacBook Pro, so the screen played early by that delay. Instant merges its tracks by timestamp, so its gate now stamps the first admitted frame at the arm point; later frames keep their capture times. Studio, which aligns its tracks with recorded start times, is unchanged.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
richiemcilroy
marked this pull request as ready for review
October 17, 2026 01:36
Member
Author
|
@greptileai review |
…s first capture time Stamping the first admitted frame with the arm instant fed the video drift tracker a capture time earlier than the frame's real one. The tracker read the difference as hand-off lag, judged the next frame to be ahead of the wall clock and pulled it back by the same amount: frames captured 20, 53 and 86 ms after the arm point were muxed at 0, 33 and 86 ms. Capture times now pass through clock remapping and drift tracking unchanged. The gate reports the first frame's lead over the arm point; the first frame stays at the track start and every later frame is muxed that much later, so the same frames land at 0, 53 and 86 ms. The recorded first timestamp, the encoder-pair start and the static tail use the arm point as the origin. Both the live and the stop-time drain paths share the rule, and a pipeline test covers it.
Member
Author
|
@greptileai review |
… the gate arms before the pipeline epoch
Member
Author
|
@greptileai review |
This branch was successfully deployed
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.
Gated Instant recordings start their audio at the start gate's arm time (#2650), but the screen track started at its first admitted frame, 17 to 25 ms later. Instant merges its tracks by timestamp, so the screen played early by that delay.
Fix
The gated Instant video track now starts where its audio starts: the arm point, or the pipeline epoch if the gate armed before it (
audio_epoch, the Linux composite-camera path can create its epoch late). The first admitted frame is shown from that origin, and every later frame is muxed at its capture time relative to it.RecordingStartGate::video_origin_lead(crates/recording/src/output_pipeline/start_gate.rs) gives the first frame's lead over that origin.primed_instant_video_armed_before_the_epoch_starts_at_the_epochcovers a gate armed before the epoch. Only the Instant pipeline turns it on (set_video_origin_at_armininstant_recording.rs), behind a gate.primed_instant_video_starts_at_the_arm_pointchecks 0, 53 and 86 ms and fails with the shift disabled.Measured
recording/instant/gated(the app's start), real capture on a MacBook Pro, 5 recordings each:recording/instant/gatedsync entry stays until more runner runs show it no longer fires.

Confidence Score: 5/5
The PR appears safe to merge; no actionable new issues were found.Summary
Gated Instant recordings now start video at the same origin as audio.
No new actionable issues were found. The earlier test-coverage thread has an explanatory reply and regression coverage. Tests were inspected but not run.
Reviews (3) · Last reviewed commit: "fix(recording): start gated Instant vide..." · Reviewed by Greptile