Repository navigation
Conversation
…none Under Wine (CrossOver 26.3), GetState on a decoded (XMA / Opus) source voice that has buffers queued but has not started returns BuffersQueued = 2 and pCurrentBufferContext = NULL. Windows names the first queued buffer there, and xma2_source_voice_decodes_and_manages_lifetime checks for it (left 0, right 0x3003). XCL submits its decoded buffers with a non-null token as the context, so a null current context with buffers queued means the host did not say. Each decoded buffer now carries its submission number, and GetState names the oldest one that has not ended. When the host returns a context, the mapping is unchanged, so Windows is not affected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Native Windows x64 verification on 76d2ff7: all 9 XAudio2 unit tests passed with system XAudio2 2.9 (cargo test -p xcl --lib hle::xaudio2:: -- --test-threads=1 --nocapture). Both source-voice lifetime tests ran to completion, including the Opus path using Windows Media Foundation’s MSOpusDecoder. Neither took the missing-device/decoder skip. I also exercised the fallback separately. In a local test build I verified that the native GetState result had two queued buffers and a non-null current context, then cleared only that context immediately after the host call. The fallback returned the first submitted context for both codecs: 0x1001 for Opus and 0x3003 for XMA2. Both tests passed their subsequent playback callback and lifetime assertions. This second run simulates the missing host context on Windows; Wine and retail playback were outside this check. OpenAI Codex (GPT-6.2 Astra) assisted with verification. |
|
Tested on Linux / RADV, and it also fixes the Opus variant of the same test. Tested
Not tested: the whole suite on the head, the AI use: T3 Code (Claude Opus 5.5) built both, ran the tests and wrote this comment. The runs are real, on the hardware above, and I checked the report before posting. |
There was a problem hiding this comment.
Tested on Linux with Proton's Wine, in addition to the CrossOver run in the description: same failure on main, fixed by this PR.
Tested (head 76d2ff7, and merged onto main 1ec4c98: no conflicts)
- AMD Radeon RX 6700 XT (RDNA2, gfx1031, RADV NAVI22, Mesa 26.3.1), Ryzen 7 5700X, Linux 7.3.5 (CachyOS)
- Wine: Proton Experimental 11.0-20261112 (its
files/bin/wine, kernel write watches), with its own vkd3d-proton (stock, not the #257 patch) and DXVK v3.1.1-209dxgi;VKD3D_CONFIG=ignore_shared_fence; DXC 1.9.2609 - Cross-built on Linux for
x86_64-pc-windows-msvc(clang-cl / lld-link 23.1.5, xwin SDK 10.0.26100), Rust 1.99.1, debug; the lib test binary run under Wine - On
main1ec4c98,hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetimefails here too, withleft: 0, right: 12291atxaudio2.rs:1599. That is Proton's Wine giving a nullpCurrentBufferContext, the same as CrossOver. hle::xaudio2:: --test-threads=1, 3 runs each: head76d2ff79 passed / 0 failed every time. Merged onto1ec4c98, also 9 / 0 every time.main: 8 passed / 1 failed.
Not tested
- Windows (where the host gives a context and the new path should not be taken), a retail title, audible output.
AI use
- Claude Code (Claude Opus 5.5) built the branches, ran the tests and wrote this report; I checked the results.
Update (merged onto main 930e8b4, vkd3d-proton v3.1 + #257 patch + #775's dxil-spirv, opus.dll from #257's build-opus.sh)
hle::xaudio2::9 passed / 0 failed in 3 runs, now includingopus_source_voice_decodes_and_manages_lifetime, which only reaches the check with an Opus decoder. The e2e test title's XAudio2 check passes as well.- One gap: without
opus.dll, which is a stock Wine/Proton setup since there is noMSOpusDecoder.dllthere, the e2e test title still fails withOpus GetState: ctx=0x0, queued=1. The Opus voice then takes the silence fallback insubmit_source_buffer. That voice is not inDECODED_VOICES, soget_statenever reaches the new fallback, and the host's null context passes through. This might be out of scope here, but it should be named somewhere, since #257 makes libopus optional.
|
Linux / AMD RDNA3 datapoint. Merged state: head Full suite, Not tested: retail titles (none here), Windows, RDNA4. Machine: RX 7900 XT (RADV NAVI31), Mesa 26.2.5, kernel 7.2 (Arch), Proton Experimental (wine-11.0), patched vkd3d-proton v3.1, Rust cross AI use: Hermes agent (local Qwen-class) ran the suite and drafted this; I checked it before posting. |
|
Test report from macOS (CrossOver/Wine), head Under CrossOver 26.3 (Wine 11.0), Tested
Not tested
AI use
|
|
Verified on a second host, on the Host: MacBook Pro M5 Pro (48 GB), macOS 27.2.1, CrossOver 26 with D3DMetal, Rosetta 2, Rust 1.100.0,
What the numbers are, since they read like a sample count and are not: the failing assert is Two things worth having on the record:
One methodological note, in case anyone else is about to run this pair: my first attempt at a "clean main" run looked like a pass, and it was a mistake of mine - Host: macOS 27.2.1 (Apple silicon, M5 Pro), CrossOver 26, D3DMetal; local inference unloaded and the bottle's wineserver stopped for each run. AI use: GPT-6 Luna built every tree, ran the tests and drafted this comment; the counts, line numbers and codes are from those runs. |
|
Test report on RDNA4 / Wine: Tested
Not tested
AI use
|
|
@pablogonz12 thanks, that is the run this PR was missing (the test title does not get that far on my Mac). The second gap is real and wider than the Opus voice: under Wine any voice XCL does not decode reads that way before it starts, a plain PCM voice too. It is in #1698, stacked on this one, so this commit and the runs against it stay as they are. If you have a moment, the test title's |
|
@pablogonz12 matches what I see on RDNA2 under Wine (my review above, the Update section). The one case you didn't run, with libopus: given an |
|
On the merged At your head Written with Claude (Anthropic) assistance; tested by me on the hardware listed. |
Empirical test report (76d2ff7)Verified the clean, detached PR #890 head Hardware / environment
Commands and results
Observed behavior The PR changes runtime code and adds or modifies no tests. The filter selected the existing XMA2 and Opus source-voice tests. Both created a system XAudio2 2.9 engine, then received Not tested The full GPU workspace suite and game smoke runs were omitted. The XMA2 and Opus AI use Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
|
@pablogonz12 thanks for the run. The Opus case you hit behind this one is the gap #1698 covers (it is stacked on this PR); a run of that on your setup would be very welcome. |
|
Ran the stacked head on Linux here.
Not tested: the full lib suite on this head, and any game run. Scope is the |
Under Wine (CrossOver 26.3),
GetStateon a decoded (XMA / Opus) source voice that has buffers queued but has not started returnsBuffersQueued = 2andpCurrentBufferContext = NULL; Windows names the first queued buffer.hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetimechecks for that and fails under Wine (left: 0, right: 12291=0x3003). Reported in #258 (comment).XCL submits its decoded buffers with a non-null token as the context, so a null current context with buffers queued means the host did not say. When that happens,
GetStatenow names the oldest of the voice's buffers that has not ended. When the host returns a context, the mapping is unchanged, so this does nothing on Windows.What is in it
crates/xcl/src/hle/xaudio2.rs:DecodedBuffergets a submission number (NEXT_BUFFER_SEQ);get_statefalls back to the oldest live buffer when the host's current context is null andBuffersQueued != 0. +16 / -2, one commit.Tested
x86_64-pc-windows-msvcwith clang-cl / lld-link 23.1.6 and an xwin SDK 10.0.26100, Rust 1.100.0, debug. The test binary was run under Wine;mainisbeaa245, the head is this PR's commit (the runs were made before a comment-only edit to the new comment).xcl-<hash>.exe hle::xaudio2:: --test-threads=1, 3 runs each:main8 passed, 1 failed (this test) every run; head 9 passed, 0 failed every run.hle::with--skip ::gpu_on the head (skipping the 3 tests below that crash this host onmaintoo): 278 passed, 3 failed, 2 ignored; this test passes. The 3 failures fail onmainas well.--skip ::gpu_ --test-threads=1, restarted past each crash),mainvs head: 571 / 5 / 20 and 572 / 5 / 20 (passed / failed / ignored); no other test changed outcome apart from two that are flaky on this host (cpu_writes::tests::writes_land_after_the_queuefailed once onmainand passed on reruns;vram::tests::d32s8_targets_take_their_own_size_of_video_memorycrashed in themainrun and not in the head's). In this whole-lib run the head still fails this test, later on: afterGetStateit gets no buffer callbacks within the test's 3 s (STARTED0). It passes alone and in thehle::run above; the whole-lib run took 636 s under Rosetta, so I read it as the audio thread being late, not confirmed.mainand head (as reported in macOS (Apple Silicon, CrossOver + D3DMetal): the newer retail game reaches its first-run menus at 30 fps #258):bind::tests::create_list_reset_and_clear_state_track_initial_pso_on_d3d12,title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels,vram::tests::d32s8_targets_take_their_own_size_of_video_memory.Tested by others (on head
76d2ff7)hle::xaudio2::tests pass, both lifetime tests run to completion (Opus through MSOpusDecoder). With the host's context cleared right after the call in a local build, the fallback returned the first submitted context for both codecs (0x1001 Opus, 0x3003 XMA2). XAudio2: GetState names the oldest queued buffer when the host gives none #890 (comment)main7 passed / 2 failed (the XMA2 test andopus_source_voice_decodes_and_manages_lifetime, the sameGetStatecheck), head 9 / 0, 3 runs each. XAudio2: GetState names the oldest queued buffer when the host gives none #890 (comment)main8 / 1, head 9 / 0, and head merged ontomain1ec4c98(no conflicts) 9 / 0, 3 runs each. XAudio2: GetState names the oldest queued buffer when the host gives none #890 (review)Regression run
scripts/smoke.ps1 -Seconds 60under PowerShell 7 on macOS, the retail title, release builds cross-built forx86_64-pc-windows-msvc, each from a clean tree of the commit, each on a fresh data root, one after the other. The script startsxcl.exethrough a small wrapper that runs it under Wine and rewrites only theLog:/Report:lines to macOS paths;XCL_DXC_THREADS=4for both runs. The blocks are as printed.maindoes not draw (OpenExistingHeapFromAddress … Not implemented, macOS (Apple Silicon, CrossOver + D3DMetal): the newer retail game reaches its first-run menus at 30 fps #258), so both runs sit at 0 frames for the 60 s and end cleanly; XCL's log has no XAudio2 line before that point, so the change is not reached. It is a check that nothing is worse (no crash, no device removal, the same frames), not a run of the change.gpu:is D3DMetal's adapter name, andpeak commitreads 0 MB under Wine, so the commit limit cannot be compared here. A Windows pair would say more.main:this PR:
Not tested
hle::xaudio2::tests ran on Windows, above); the GPU tests were not run for this PR.e2etest title's XAudio2 check (XMA2 GetState: ctx=0x0, queued=1under Wine, noted by @ClosetPie107).AI use