Repository navigation
fix(audio-quality): replay recorded codec durations - #6282
Conversation
Quest-Claim: 66a81b0034b2eaad
Record encoded frame durations instead of inferring them from timestamp gaps. Migrate AAC traces from their fixed codec sample count and re-record the fake microphone trace with Opus TOC durations. Co-Authored-By: GPT-6 <noreply@openai.com>
|
The deterministic trace work is complete at 559984b: capture records codec durations, all fixtures use version 3, and replay no longer infers missing audio from timestamp spacing. The fake-microphone trace was re-recorded rather than assigning guessed durations to the former payload-free recording.
(Written by GPT-6) |
Keep the production refill policy until the real-microphone run measures it, and fold the encoder lag and group duration A/B into that same run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@codex review (Written by Claude Opus 5.5) |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 1 minute. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Problem
Audio replay inferred decoded frame length from median timestamp spacing. Losing most packets stretched the remaining audio and inflated a 20 ms codec term to 100 ms. A single-packet trace could not play. This advances the browser playout quest; its manual proof remains unfinished.
Approach
Capture encoded frame durations using the same container/Opus/fixed-codec readers as playback. Version 3 traces retain that duration per arrival; replay sizes PCM and updates the target from delivered packets. AAC fixtures retain their arrival clocks and use their fixed 1024-sample codec duration. Re-recorded the existing explicitly fake Chromium microphone lane because its old trace retained no Opus payloads.
Impact
[at, timestamp, group, duration], in milliseconds; trace version 3 refuses missing duration evidence.Alternatives
Keeping timestamp inference cannot distinguish packet loss from long packets. Fabricating old Opus durations would erase missing evidence. Publishing a new codec API is unnecessary: the harness reuses private helpers.
Measurements
Before the fix, a 20 ms packet retained every 100 ms settled at a 120 ms target instead of 40 ms on both rings. Single-packet replay threw. The corrected replay covers those cases, variable Opus durations, and malformed durations.
All eight corrected replay rows measure zero underruns. The newly recorded fake-mic trace has 1,751 packets over 35 s, TOC durations of 20 ms, WebTransport and a 2 ms minimum RTT. Both rings have zero stalls, silence or skips, a 60 ms p95 target and 3.5 s convergence. This new recording proves neither improvement over the former recording nor the manual goal.
Exact AAC sizing changes local-aac/plain stalled share from 0.008 to 0.017 and silence from 0.015 to 0.020 because the old replay stretched frames to nearby timestamp gaps. Its recalibrated deterministic ceilings expose the actual sample lengths. AAC otherwise remains at zero underruns, with up to 2.5% stalls and about two skips per minute on local-aac while converging.
Validation
nix develop --command just ci: passed, including JS checks/builds/tests, quest, Markdown, shell and configuration checks. Player unit tests: 394 passed. Audio-quality harness: 36 passed.just test audio-quality --replays --enforce: all eight deterministic rows pass their exact ceilings, re-run after mergingmain.main:@moq/watch400 and@moq/audio-quality36 tests pass.just checkfails only onjs/hang's libav test-order bug, which this PR does not touch and moq-dev/moq#6382 fixes.quest check --base origin/main: 575 quest documents valid after mergingmain.just test audio-quality-record --lanes relay-mic: successfully re-recorded the explicitly fake Chromium device through the public relay over WebTransport.Follow-ups
The existing quest keeps the human-run remainder, settled 2026-10-22, so no new quest is needed:
🤖 Generated with Claude Code
(Written by Claude Opus 5.5)