Skip to content

audio: count frames the host stream skips in the real-clock tone tests - #795

Merged
techomancer merged 4 commits into
techomancer:mainfrom
steigr:feature/iris-hal2-windows-audio-test-e8b723
Nov 20, 2026
Merged

techomancer merged 4 commits into
techomancer:mainfrom
steigr:feature/iris-hal2-windows-audio-test-e8b723

Conversation

@steigr

@steigr steigr commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Fixes the Windows failure in https://github.com/techomancer/iris/actions/runs/44681210910/job/136104933706:

dev::hal2::host_tests::a_tone_in_guest_memory_reaches_the_host_on_the_real_clock
24691 of 38424 frames reached the file

The guest clock ran on time (38424 frames in 0.8 s), but about 286 ms of them never reached the WAV. When the file backend's thread is held up on a busy runner, the queue passes max_latency and the stream skips ahead to its target (overruns), or the ring is full and write refuses frames (dropped). That is the intended behaviour. The test only allowed 200 ms for what was still queued at the stop.

The test now reads the stream's stats before stopping and adds overruns + dropped to the frames heard, then applies the same 200 ms allowance. The frequency and level checks on what was heard are unchanged.

The O2's (mace_audio) and the Octane's (rad1) real-clock tone tests make the same check and get the same accounting; RAD1's skipped frames are converted from the card's 44.1 kHz to the file's 48 kHz. Upstream's 83c8ddd loosened the upper bound of the MACE and RAD1 checks; this PR keeps that and fixes the lower one.

Tested: cargo test --release --lib hal2::host_tests (3/3) cargo test --release --lib mace_audio (11/11) and cargo test --release --lib rad1:: (70/70) pass on macOS. The first commit passed this PR's CI, Windows included.

🤖 Generated with Claude Code

steigr and others added 2 commits November 20, 2026 10:35
On a loaded Windows runner the file backend's thread can stall long
enough for the queue to pass its ceiling; the stream then skips ahead
(overruns) or the ring refuses frames (dropped). Those frames reached
the host and were let go on purpose, so the check that every moved
frame reached the file now adds them back before allowing for what is
still queued at the stop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…test

The O2 test makes the same check as HAL2's: every pair played before
the mute must reach the file, give or take what was still queued. A
file thread stalled on a busy host makes the stream skip ahead or
refuse pairs on purpose, so those are now added back too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@steigr steigr changed the title hal2: count frames the host stream skips in the real-clock tone test audio: count frames the host stream skips in the real-clock tone tests Nov 20, 2026
steigr and others added 2 commits November 20, 2026 11:38
…indows-audio-test-e8b723

# Conflicts:
#	src/dev/mace_audio.rs
The Octane test makes the same lower-bound check as HAL2's and the O2's.
Frames the host stream skips or refuses after a stalled file thread are
added back, converted from the card's 44.1 kHz to the file's 48 kHz.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@techomancer
techomancer merged commit 3fdc2c0 into techomancer:main Nov 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants