tooling: align audio packet levels with input timestamps #1763

Manually merged
github merged 1 commit from gh-pr/1763/head into gh-pr/1763/base 2026-11-26 23:31:46 +00:00
Owner

@⁠R0Y00 on GitHub · 2026-11-24 18:13 UTC · original
R0Y00:codex/align-audio-input-timeline → main · +218 −0 · 3 files · 1 commits · merged 2026-11-24 19:09 UTC

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 f6ea28fb on Windows with Python 3.12, based on 312f5613.

  • python -B tests/startup_audio_timeline_check.py passed. 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 --check passed 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.

**@⁠R0Y00** on GitHub · 2026-11-24 18:13 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1763) `R0Y00:codex/align-audio-input-timeline` → `main` · +218 −0 · 3 files · 1 commits · merged 2026-11-24 19:09 UTC 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 `f6ea28fb` on Windows with Python 3.12, based on `312f5613`. - `python -B tests/startup_audio_timeline_check.py` passed. 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 --check` passed 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 23:31:45 +00:00
github manually merged commit f6ea28fb64 into gh-pr/1763/base 2026-11-26 23:31:46 +00:00
Author
Owner

@⁠tedin7 on GitHub · 2026-11-24 18:34 UTC · original · reviewed

Reviewed at f6ea28fb645a91845b3dbcf4434c24b9f686a4bf.

No P1 or P2 defects found in local verification. tools/startup_audio_timeline.py validates finite inputs, non-negative flags, positive frame counts, and normalized [0, rms <= peak <= 1] bounds, excludes packets with WASAPI timestamp-error flag 0x4, and advances cursor across 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.py ok (0.27s)
  • Local mutation check: changed flags & 4 to flags & 8 in tools/startup_audio_timeline.py; tests/startup_audio_timeline_check.py failed as expected (AssertionError: 1.0 != 0.5), then restored with git checkout -- ..

AI-assisted; commands listed were executed locally.

**@⁠tedin7** on GitHub · 2026-11-24 18:34 UTC · [original](https://github.com/R0Y00/Xbox2Windows/pull/1763#pullrequestreview-6045123526) · **reviewed** Reviewed at `f6ea28fb645a91845b3dbcf4434c24b9f686a4bf`. No P1 or P2 defects found in local verification. `tools/startup_audio_timeline.py` validates finite inputs, non-negative flags, positive frame counts, and normalized `[0, rms <= peak <= 1]` bounds, excludes packets with WASAPI timestamp-error flag `0x4`, and advances `cursor` across 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.py` ok (`0.27s`) - Local mutation check: changed `flags & 4` to `flags & 8` in `tools/startup_audio_timeline.py`; `tests/startup_audio_timeline_check.py` failed as expected (`AssertionError: 1.0 != 0.5`), then restored with `git checkout -- .`. AI-assisted; commands listed were executed locally.
This discussion has been locked. Commenting is limited to contributors.
No description provided.