tooling: align audio packet levels with input timestamps #1756
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1763"
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 R0Y00 on 2026-11-24T18:13:14Z.
Refs #1145
Change
Add a standalone Python tool that aligns process-loopback packet statistics with controller action timestamps on a shared QueryPerformanceCounter clock. Each event reports packet coverage, time-weighted RMS, peak and discontinuities. Uncovered intervals produce null levels so a capture gap cannot pass as silence. The tool only reads statistics and input-event files and has no external dependencies.
Verification
Verified commit
f6ea28fbon Windows with Python 3.12, based on312f5613.python -B tests/startup_audio_timeline_check.pypassed. The generated CSV and JSONL cover an audible window, a fully covered silent window, a timestamp-error gap, and an uncovered window.git diff --cached --checkpassed before committing.Usage and the packet schema are documented in
docs/startup-audio-timeline.md. All test inputs are generated in the fixture.This contribution was AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-24T18:34:01Z.
Review: COMMENTED
Reviewed at
f6ea28fb645a91845b3dbcf4434c24b9f686a4bf.No P1 or P2 defects found in local verification.
tools/startup_audio_timeline.pyvalidates finite inputs, non-negative flags, positive frame counts, and normalized[0, rms <= peak <= 1]bounds, excludes packets with WASAPI timestamp-error flag0x4, and advancescursoracross sorted packets so overlapping intervals are not double-counted.Verification executed:
git diff --check origin/main...HEAD-> pass/root/.local/share/x2w-rev-venv/bin/python -B tests/docs_links_check.py-> pass (18 Markdown files, 367 links)/root/.local/share/x2w-rev-venv/bin/python -B tests/bidi_controls_check.py-> pass (1304 tracked files)/root/.local/share/x2w-rev-venv/bin/python -B tests/startup_audio_timeline_check.py-> pass (1 test)python3 /root/.local/state/xbox2windows/pipeline/x2w_pipe.py win2025 1763 --py-checks tests/startup_audio_timeline_check.py-> pass on Windows Server 2025 (Build 26100, MSVC 14.44.35207 + D3D12 WARP),tests/startup_audio_timeline_check.pyok (0.27s)flags & 4toflags & 8intools/startup_audio_timeline.py;tests/startup_audio_timeline_check.pyfailed as expected (AssertionError: 1.0 != 0.5), then restored withgit checkout -- ..AI-assisted; commands listed were executed locally.