startup: add a steady-versus-bursty playback-timing control #1361
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1368"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T09:26:41Z.
Playback-timing slice of #1145, as its own change. Refs #1145, #1250.
What it is
The same sink and the same endpoint as #1250, fed the same total audio two ways:
For each phase it records the first submission, block and frame counts, the endpoint clock, the largest gap between submissions, the drained interval (how long the queue sat empty while the producer withheld data) and the recovery time (producer resuming to consumption advancing).
The sink and endpoint are unmodified — this measures them, and it does not change any provider behaviour. #1250's fixture and NinosTech's decode oracle stay as the independent controls.
Measured here
Shared-mode endpoint, float32, 2 ch, 48 kHz, 24000-frame buffer:
The control can therefore see a producer-side stutter: bursty input produces a drained interval that steady input does not, and recovery is measured at 16 ms. It skips (77) where no shared-mode endpoint is available.
What it does not do yet
It does not instrument the title's audible path. That is the second half of the slice: record the same fields at the submission boundary the audible stream actually crosses. I would do that as a follow-up on this branch once the control is agreed, with the TSan-free instrumentation switch off by default.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T09:30:18Z.
Review: COMMENTED
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
8d062f33a7ℹ️ About Codex in GitHub
Your 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".
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T09:40:08Z.
Review: COMMENTED
Technical peer-review of commit
8d062f33a7d40d0ed7c8aa3bb0c7da5e1180a5cb:Verification
git diff --check origin/main...HEAD: clean.tests/docs_links_check.py: passed (16 Markdown files, 302 links).tests/bidi_controls_check.py: passed (1,147 files).--preset dev):startup_audio_pacingbuilt (4.48s);ctest -R '^startup_audio_pacing$'skipped (return code77, capability skip on headless node with no default render endpoint;0/1passed)./O2(--preset release):startup_audio_pacingbuilt (1.89s);ctest -R '^startup_audio_pacing$'skipped (return code77;0/1passed).Findings (
tests/startup_audio_pacing.cpp)AudioSinkacross phases:main()passes the sameAudioSinkinstance to bothrun_steadyandrun_bursty. BecauseAudioSink::r_is cumulative,burstyreports combined counts (120 + 48 = 168blocks,80,640frames) rather than the bursty phase alone. Constructing a freshAudioSinkper phase (or resetting state) would keep the two phase reports independent.run_steadysubmits120blocks (1,200 ms) andrun_burstysubmits8 * 6 = 48blocks (480 ms).CoInitializeExhas no matchingCoUninitialize()aftersinkis destroyed.Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T09:53:35Z.
Review: COMMENTED
Technical retest & peer-review at commit
10009a948787e6caeb22aca0328ab2a11878f654:Verification
git diff --check origin/main...HEAD: clean.tests/docs_links_check.py: passed (16 Markdown files, 302 links).tests/bidi_controls_check.py: passed (1,147 tracked files).--preset dev):startup_audio_pacingbuilt in4.07s;ctest -R '^startup_audio_pacing$'returned capability skip77(0/1 passed,0.02s) on the headless node with no default render endpoint./O2(--preset release):startup_audio_pacingbuilt in1.54s;ctest -R '^startup_audio_pacing$'returned capability skip77(0/1 passed,0.02s).Retest of Earlier Findings
run_steadyandrun_burstynow computedelta(before, after, ...)against asink.report()snapshot taken before each phase, isolatingblocks,frames,consumed,clock,drained_ms,rejected_full, andunsupportedper phase.120blocks (total_blocks = 120,20 * 6 = 120), matching the header comment, andrun()fails ifsteady.frames != bursty.frames.CoUninitialize(): Resolved —AudioSink sink;lives insiderun(), so it is destroyed beforemain()callsCoUninitialize().Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T09:26:53Z.
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
8d062f3ℹ️ About Codex in GitHub
Your 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.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T09:38:29Z.
Both findings fixed in
0972768a.Same total audio (first finding). Both phases now submit 120 blocks of 10 ms — steady paced one per 10 ms, bursty as 20 runs of 6 with a 150 ms withholding gap. The fixture also asserts that the frame totals match (
steady.frames != bursty.framesfails), so the control cannot silently drift back into varying amount as well as pacing.Per-phase counters (second finding). You are right that
report()is cumulative for the life of the sink. Every printed number is now a delta against a snapshot taken before the phase, so the bursty line excludes the steady phase, andfirst_blockis no longer reported as a phase figure (it is a sink-lifetime call index).Re-measured after both fixes, shared-mode endpoint, float32, 2 ch, 48 kHz, 24000-frame buffer:
The drained figure grew from 740.6 ms to 1872.2 ms now that it covers only the bursty phase rather than a mixed snapshot — which is the cumulative-counter bug you spotted showing up in the measurement itself.
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-24T09:47:52Z.
Thanks for the technical review — one useful correction and two notes on what you saw.
Your findings 1 and 2 were already fixed in
0972768a, which landed before your review was posted but after the commit you reviewed (8d062f33). That commit:AudioSink::report()is cumulative for the sink's lifetime.Re-measured after that fix, which also shows your point in the numbers:
The old mixed snapshot reported
drained_ms=740.6; with the phases separated it is1872.2, i.e. the cumulative counter was diluting the very measurement the control exists to make.Your finding 3 is fixed in
10009a94: the body moved intorun()so the sink is destroyed beforemain()callsCoUninitialize().On the skips:
77with no default render endpoint is the intended capability skip, so a headless Windows Server node reporting0/1 passedis the expected result there — the check needs a shared-mode endpoint to measure anything.Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T09:30:19Z.
Code review location:
tests/startup_audio_pacing.cpp; line 137The steady phase submits 120 10-ms blocks, while this call submits only 8 × 6 = 48. The phases therefore vary the amount of audio as well as its pacing, contrary to the stated same-total-audio control, so the comparison does not isolate pacing. Match the total frame counts, adjusting the burst count or gaps as needed.
AGENTS.md reference: AGENTS.md:L170-L170
Useful? React with 👍 / 👎.
Imported from R0Y00/Xbox2Windows. Originally posted by chatgpt-codex-connector[bot] on 2026-11-24T09:30:19Z.
Code review location:
tests/startup_audio_pacing.cpp; line 108run_burstyuses the samesinkasrun_steady, andAudioSink::report()returns cumulative counters. This snapshot therefore includes both phases: the printed bursty block and frame counts include the 120 steady blocks, andfirst_blockstill refers to the steady phase. The bursty report mislabels sink-lifetime consumption and clock data as phase-specific; report per-phase deltas or reset the report state.AGENTS.md reference: AGENTS.md:L170-L170
Useful? React with 👍 / 👎.