Repository navigation
XAudio2: an XMA voice reports no bytes required, as the docs say - #1149
Conversation
XMA source voices play through a Windows PCM16 voice, and the callback wrapper passed that voice's OnVoiceProcessingPassStart BytesRequired (the PCM16 it needs) on to the title. Microsoft's documentation: "For xWMA and XMA data BytesRequired will always be zero". A title that streams just in time from this value would see its XMA voice as starving and submit more than it needs. The voice state now records whether the title submits XMA, and only then is 0 passed on. Opus voices, which the documentation does not cover, keep the count as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
Commands were AI-assisted. Codex (GPT-6, exact variant unavailable) wrote and ran the scratch test and drafted this report. |
|
Independent verification on current Machine: Windows 11, Ryzen 9 7900X; Rust stable MSVC, debug.
AI use: test runs by Devin (Cognition, SWE-2); no code changes. |
|
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
Not tested
AI use
|
Windows XAudio2 test report for PR #1149 at
|
|
merge-check claim |
|
merge-check |
|
merge-check claim |
|
merge-check |
|
merge-check |
|
@relativespace2K Please stop claiming PRs which have already been claimed!!! |
XMA 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=4on 41c4305: 742 passed, 0 failed, 41 ignored; no SKIPPED GPU testsplaced_title_textures_share_vram_and_preserve_pixels(the cubemap reuse flake of Tests: placed_title_textures_share_vram_and_preserve_pixels fails now and then at its cubemap reuse check (main 9ce2070) #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