XAudio2: an XMA voice reports no bytes required, as the docs say #1149
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!1149
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1149"
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?
@emirduran707 on GitHub · 2026-11-24 12:34 UTC · original
emirduran707:xma-bytes-required→main· +57 −1 · 1 files · 1 commits · openXMA source voices play through a Windows PCM16 voice. XCL's callback wrapper passed that voice's
OnVoiceProcessingPassStartBytesRequired(the PCM16 it needs) on to the title. Microsoft's documentation ofIXAudio2VoiceCallback::OnVoiceProcessingPassStartsays that for xWMA and XMA dataBytesRequiredis always zero. A title that streams just in time from this value sees its XMA voice as starving and submits more data than it needs.The voice state now records whether the title submits XMA, and only then passes 0 on. Opus voices, which the documentation does not cover, keep the count as before.
What is in it
crates/xcl/src/hle/xaudio2.rs:DecodedVoiceStateremembers whether the voice is XMA; the pass-start wrapper reports 0 for it. Testdecoded_voice_reports_no_bytes_required_to_the_title(XMA reports 0, an Opus voice still reports the PCM count).Tested
cargo test --workspace -- --test-threads=4on41c4305: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU testsplaced_title_textures_share_vram_and_preserve_pixels(the cubemap reuse flake of #718, two other tests then failed on its poisoned lock);cargo test -p xcl --lib hle::d3d12x::then passed 3 times in a row on this head, and the whole suite again (the counts above)Regression run
main:
this PR:
Not tested
BytesRequired: the smoke title does not show a difference in its run.AI use
🤖 Generated with Claude Code
@thehollowedone on GitHub · 2026-11-24 12:44 UTC · original
Independent native XAudio2 2.9 check on Windows 11 build 26300, Ryzen 7 9800X3D, Rust 1.99.1 MSVC, debug. I started an empty mono 48 kHz XMA2 voice through XCL and recorded the byte requests delivered to the title callback by the Windows engine.
47efa2eforwarded nonzero PCM demand on all 8 callbacks, with a maximum of 960 bytes.41c4305reported zero bytes on all 8 callbacks. The ten stock XAudio2 tests and the scratch test passed together, including the stock XMA2 and Opus voice tests.Commands were
cargo test --offline --locked -p xcl --lib scratch_xma_empty_voice_native_passes_report_zero_bytes -- --nocapture --test-threads=1on each revision and the same command filtered tohle::xaudio2::testson the PR. Retail audio was outside this check.AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch test and drafted this report.
@DavidM1911 on GitHub · 2026-11-24 12:50 UTC · original
Independent verification on current
main384f7f7(branch already contains it — clean).Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.
cargo test -p xcl --lib xaudio2: 10 passed, 0 failed — XMA2 and Opus source-voice lifetime tests pass with the no-bytes-required reporting.AI use: test runs by Devin (Cognition, SWE-2); no code changes.
@fromthemoonx on GitHub · 2026-11-24 13:06 UTC · original
NVIDIA run with the whole suite, since Not tested lists NVIDIA. The two runs above covered the XAudio2 tests and a native XMA2 voice.
Tested
stable-x86_64-pc-windows-msvc; DXC 1.9.2602.17; debug41c43053b10628515a0f528263b7fbf42e3190c7, which is on currentmain47efa2e(so also the merged result):cargo build --workspace, thencargo test --workspace --no-fail-fast -- --test-threads=4: 742 passed, 0 failed, 41 ignored, the same as yours.xaudio2::tests::decoded_voice_reports_no_bytes_required_to_the_titlepassed.((*vt).pass_start)(obj, bytes), the test fails atxaudio2.rs:1683withleft: 1920, right: 0. The PCM16 byte count reaches the title.hle::xaudio2tests, 10 runs: 10 of 10 passed (10 each, including the XMA2 and Opus voice lifetime tests)e2e, 3 runs: 3 of 3 passed (the test title's audio voices)gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardwareNot tested
AI use
@luckyteagirl on GitHub · 2026-11-25 04:33 UTC · original
Windows XAudio2 test report for PR #1149 at
41c43053b10628515a0f528263b7fbf42e3190c7Setup: Windows 11 build 26200, Ryzen 9 5980HX, Radeon RX 6800M (driver
30.0.13002.13003), Rust1.99.0MSVC. Clean checkout of this PR's exact head.Tested
cargo test --locked -p xcl --lib -j 2 decoded_voice_reports_no_bytes_required_to_the_title -- --test-threads=1 --show-output: 1 passed, 0 failed, 0 ignored. The synthetic callback test covers XMA's zeroBytesRequiredand the unchanged Opus count.cargo build --locked --workspace -j 2: passed.Not tested: Full workspace suite, a title that streams XMA based on
BytesRequired, paired retail-title smoke, or other audio devices. This is focused Windows verification, not a claim about GPU behavior or world loading. No game data was used.AI assistance: OpenAI Codex (GPT-6) ran the commands, extracted the test count from the log, and drafted this report.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.