Tests under Wine: the decoded XMA2 voice loses the title's context at the first GetState (null of 0x3003), so the audio checks cannot be exercised on the Linux lane #2471
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Imported from ivall/xcl. Originally posted by pablogonz12 on 2026-11-25T19:57:04Z.
On Linux under Wine, the decoded (XMA2) source-voice test gets a null context from
GetStateat its first call, before any buffer ends, so the XMA2 context checks fail on that lane — onmainand on #2410 alike. This is not #2386's ended-buffer race (that one needsOnBufferEndto have run first) and it is not diagnosed here, just reported with a reproduction.Setup
RADV GFX1201), AMD Radeon RX 9070 XT 16 GB, Ryzen 9 9900X.WINEDEBUG=-all,WINEDLLOVERRIDES="d3d12,d3d12core,dxgi,d3d11,d3d10core=n,b",VKD3D_CONFIG=ignore_shared_fence, DXC 1.9.2609.5.main2898511, release,x86_64-pc-windows-msvcstatic (RUSTFLAGS="-C target-feature=+crt-static").Reproduction
12291is0x3003= the test'sCTX_VALID. The line just above (assert_eq!({ st.buffers_queued }, 2)) passes, so two submits were recorded; only the context is missing.left: 0meansGetStateansweredpCurrentBufferContext = null, the value the vtable-form test asserts against right afterSubmitSourceBuffer, with no buffer ended in between.The same symptom in the e2e test title (
e2eintegration test,test_title_runs_and_game_folder_is_untouched): 48[PASS]lines, and among the two[FAIL]lines(the other
[FAIL]is the window-cloak check, which Wine cannot satisfy). With #2410 applied the value staysctx=0x0, so the Wine lane cannot be used to validate that fix, although the PR's own unit testget_state_context_survives_buffer_enddoes pass here.What would settle it
TestState/GetStatereturns0x3003there at the same point, this is a Wine-only difference in when the decoded buffer completes (no audio device in the prefix would also explain it — nothing here asserts a device exists).WINEDEBUG=+xaudio2(or an XCL log line atSubmit) showing whether the buffer is already ended/flushed before the firstGetState.Not tested
AI use
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T00:25:14Z.
Windows check for #2481: the focused XMA2 source-voice test reaches its pre-playback
GetStatecontext assertion and passes here.Setup: Windows 11 Home build 26200; Ryzen 9 5980HX. The GPU was not used by this test. I ran an existing Windows debug test binary built from clean XCL head
57853e017054d715cd46cd3c07cb70e58eddddc8(PR #2514). Itscrates/xcl/src/hle/xaudio2.rsis identical to currentmain08db8020d323bf478964fcc586152cce54959cfc. Binary SHA-256:35BAB9D76DEE45A9CDE50DE2B7B68CB6D629589E8F1144FB720896D6B8192072.Command:
work-pr2444\target\debug\deps\xcl-6ada34314a84214a.exe hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime --exact --test-threads=1 --show-output(from the local XCL-test directory; no rebuild).Result: 1 passed, 0 failed, 0 ignored, 1326 filtered out; 0.82 s. There was no
SKIPPEDor no-audio-device message. The assertion thatcurrent_buffer_context == 0x3003before playback passed. This answers the Windows comparison requested in the issue; the Wine cause remains open.Limit: The run logged
XMA buffer decoded 0 samples – substituting silence, so this confirms the context/lifetime assertions, not nonzero decoded PCM. I did not run the e2e test or a title.AI use: Codex (GPT-6) located and verified the prebuilt binary, ran the focused test, checked source parity, and wrote this report; a Codex Luna subagent performed the initial test run.
Imported from ivall/xcl. Originally posted by SlopTart on 2026-11-26T06:30:10Z.
Root cause, confirmed on two more Wine setups: the bundled FAudio reports
pCurrentBufferContext = NULLfor a stopped voice that has queued buffers. FAudio behavior older than 26.05, not XMA2-specific and not xcl-caused.Tested
x86_64-pc-windows-gnurun under Wine. Red atb49be183andcaed44ec.b49be183too, so not PR-induced.Instrumentation: one log line added to xcl's
get_statewrapper (crates/xcl/src/hle/xaudio2.rs, immediately after the original vtable call). The underlying XAudio2 answer at the test's firstGetState, beforeStart:Two buffers queued, context null, no samples played. Matches your passing
buffers_queued == 2exactly. xcl decodes XMA2 in its own submit wrapper and forwards plain PCM16 to the underlying voice, so queue/context semantics here are vanilla PCM, not the XMA2 path.Mechanism (Wine's
xaudio2_7/8/9DLLs are thin wrappers over FAudio since the 2019 rewrite):src/FAudio.c, tag 25.12):SubmitSourceBuffersetsvoice->src.newBuffer = 1when the queue was empty (:2775), andGetStatereports the context onlyif (!voice->src.newBuffer)(:2931).newBufferis cleared only when the audio graph thread begins playing the buffer (FAudio_internal.c:380) or byFlushSourceBuffers(:2826). A voice with buffers submitted but neverStarted therefore reportsBuffersQueued = nwithpCurrentBufferContext = NULL, exactly the observed signature.GetStaterequiresqueued_buffers[0].sent_OnStartBuffer(src/FAudio.c:2985), so still null untilOnBufferStarthas fired.GetStatereturnsqueued_buffers[0].buffer.pContextwhenever the queue is nonempty, matching MSDN and the native Windows pass luckyteagirl reported above.The Wine stacks in all three reports (Proton wine-11.0, GE-Proton11-14, Debian wine-10.0) vendor a FAudio predating that fix; behaviorally confirmed by the raw instrumented return on both of our machines.
Not tested: a Wine build with FAudio 26.05+, which should make this red go green without touching xcl. We did not rebuild Wine to verify.
Options for xcl (upstream's call): the test matches Windows, so leaving it as Wine-side staleness is a valid resolution. If the check should be meaningful on Wine anyway, xcl already mediates these submits, so its
get_statewrapper can backfill a nullpCurrentBufferContextfrom its own live-buffer tracking for the first submitted buffer; or gate that single assertion oncrate::util::under_wine()as existing Wine-leniency asserts do.AI use: Hermes agent (local Qwen-class) ran both machines and drafted this; I checked it before posting.
Imported from ivall/xcl. Originally posted by Anon64 on 2026-11-27T05:04:21Z.
Data point from a different Wine build: on WineHQ's own
winehq-stable11.0 (not Proton/GE) these tests crash the test process instead of failing the assertion, which takes the rest of the lib tests down with them on this lane.Setup: Ubuntu 24.04 in Docker,
wine-11.0from dl.winehq.org, Xvfb, no GPU,WINEDEBUG=-all,winedbgdisabled.main8b957bec6f82495aec940944c6bf47faa02db590,x86_64-pc-windows-gnudebug (Rust 1.100.0, mingw-w64 GCC 13), run through Wine as the cargo runner.Each test alone (
cargo test -p xcl --lib --target x86_64-pc-windows-gnu <name>):hle::xaudio2::tests::xma2_source_voice_decodes_and_manages_lifetime:Unhandled page fault on read access to 00000000000000DC at address 00006FFFF9454BA0hle::xaudio2::tests::clamped_and_silenced_buffers_accepted_by_windows_xaudio2: the same fault, same address. This one has no XMA2, which fits @SlopTart's "not XMA2-specific".hle::xaudio2::tests::engine_from_the_system_dll: passes.With Ubuntu's own
wine-9.0the first two hang the run inwinedbg(or hang outright with it disabled), so neither Wine build here reaches the context assertion. I have not checked which FAudio this WineHQ build ships.For anyone running the whole suite on this lane:
--skip clamped_and_silenced_buffers_accepted_by_windows_xaudio2 --skip xma2_source_voice_decodes_and_manages_lifetimelets the rest finish (1,426 passed here; the other failures are #1411's WARP set, #810 / #2415, and two setup ones).AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this comment.