Skip to content

Tests: the XAudio2 voice tests wait 30 s for playback and skip a slow audio device (#1487) - #1600

Open
upipibi wants to merge 1 commit into
xcl-dev:mainfrom
upipibi:tests/xaudio2-start-wait
Open

upipibi wants to merge 1 commit into
xcl-dev:mainfrom
upipibi:tests/xaudio2-start-wait

Conversation

@upipibi

@upipibi upipibi commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Refs #1487: the XAudio2 part.

hle::xaudio2::tests::opus_source_voice_decodes_and_manages_lifetime and xma2_source_voice_decodes_and_manages_lifetime play their buffers on the real audio device and give them 3 s to start and end. Two ways that fails without anything being wrong in XCL:

Test-only: everything is inside xaudio2.rs's #[cfg(test)] mod tests.

What is in it

  • PLAYBACK_WAIT: the two tests wait up to 30 s for their buffers instead of 3 s. An idle PC still finishes in well under a second, so only a slow run waits longer.
  • slow_audio_device: when creating the mastering voice took more than 10 s, the test destroys it, releases the engine and is skipped with a SKIPPED <test>: the default audio device took N s to open line (runner::skip_test), instead of failing. That measures the device, not XCL's shims.
  • slow_audio_devices_are_skipped_not_failed: unit test of the threshold and the message.

Tested
NVIDIA GeForce RTX 3070, driver 616.56; Windows 11 Pro 26100; Rust 1.100.0 MSVC; debug; main 9e3831e.

Regression run

From eizispark's run (#1600 (comment)), thanks (AMD RX 9070 XT; the diff is test-only, so it shows only that nothing else changed):

main:

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14728 MB

PR:

xcl-smoke v1
commit: 5b59db2db544e491f8c8b7fc3fd621cf28968e80
gpu: AMD Radeon RX 9070 XT
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14728 MB

Not tested

  • Under load on a PC with a fast audio device, where only the 30 s wait matters. eizispark's RX 9070 XT run shows the other half: there the two voice tests ran and passed (777 passed, 0 failed) instead of being skipped.
  • Wine. Tests: the XMA2 voice test accepts no context before Start under Wine #1557 changes the XMA2 test next to the wait loop, so whichever lands second needs a small rebase.

AI use

  • Claude Code (Claude Opus 5.5) measured the device times, wrote the change and ran the tests.

🤖 Generated with Claude Code

… audio device

opus_ / xma2_source_voice_decodes_and_manages_lifetime gave their
buffers 3 s to start and end on the real audio device. On a busy PC (a
parallel test run, a build) that was not always enough (xcl-dev#1487). On a PC
whose default output is slow to open (a sleeping Bluetooth or virtual
device) it never was: the mastering voice took 56 s to create there, and
the first buffers as long again to play.

They now wait up to 30 s (an idle PC still finishes in well under a
second), and skip with a SKIPPED line, instead of failing, when the
mastering voice took more than 10 s to create: that measures the audio
device, not XCL's XAudio2 shims.

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

Copy link
Copy Markdown

Hardware test report — commit 5b59db2

Checked 5b59db2db544e491f8c8b7fc3fd621cf28968e80 (based on main 9e3831e1f570d3646e53ab753b19ec07eb8f1485): pass.

Tested

  • Hardware: Windows 11 x64, AMD Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (RDNA4, native wave32 + wave64, driver 32.0.32015.16001), 32 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profile
  • cargo test --workspace --no-fail-fast -- --test-threads=4: 777 passed, 0 failed, 41 ignored (1 skipped: heap_window_out_of_memory_falls_back_to_the_switch_form: no heap windows), including hle::xaudio2::tests::slow_audio_devices_are_skipped_not_failed, hle::xaudio2::tests::opus_source_voice_decodes_and_manages_lifetime, and hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime

Regression run
main (9e3831e):

xcl-smoke v1
commit: 9e3831e1f570d3646e53ab753b19ec07eb8f1485
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1677 (PresentX 1677)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14728 MB

PR (5b59db2):

xcl-smoke v1
commit: 5b59db2db544e491f8c8b7fc3fd621cf28968e80
gpu: AMD Radeon RX 9070 XT
title: GTA6.Xbox.v1.0.2.1
seconds: 60
exit: 0x0
frames shown: 1678 (PresentX 1678)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14728 MB

Not tested

  • a host whose default audio endpoint takes >10 s to open CreateMasteringVoice, Wine/vkd3d-proton, NVIDIA/Intel GPUs, XCL_SAMPLE_*

AI use

  • Antigravity (Google DeepMind, Gemini 4 Carbon) — ran the workspace test suite and 60 s retail smoke run on this commit and formatted the report.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~22 ignored. (Intermittent 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

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.

3 participants