XAudio2: under Wine GetState names the oldest queued buffer of a voice XCL does not decode #1698
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!1698
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1698"
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?
@shortside on GitHub · 2026-11-24 19:23 UTC · original
shortside:xaudio2/getstate-undecoded-voices→main· +209 −5 · 1 files · 2 commits · openStacked on #890; only the top commit (
e2ee5c0) belongs here.#890 makes
GetStatename the oldest queued buffer of a decoded voice when the host names none. @pablogonz12's run of it (#890) showed the same gap one check further in the test title:Opus GetState: ctx=0x0, queued=1under Wine without libopus, where the voice plays silence and is not a decoded one. It is wider than that: under Wine any source voice XCL does not decode reads so before it starts, a plain PCM voice too (two buffers queued: 2 queued, context 0, on CrossOver 26.3).Under Wine only, XCL now keeps the contexts submitted to such a voice (at most the 64 a voice can hold) and answers a null current context with buffers queued from them. On Windows nothing is kept and nothing is asked: the host answers.
What is in it (
crates/xcl/src/hle/xaudio2.rs, +193 / -3 with the tests)QUEUED: voice → the contexts submitted, oldest first;note_submitted,oldest_queued(the host's queued buffers are the last ones submitted, so with N queued it is the N-th from the end),note_flushed(a flush keeps the playing buffer, the oldest of those queued).submit_source_buffer: on the path that is not decoded (PCM passed through, or silence), a submit the host took is noted.flush_source_buffers: asks the host its queue before and after.destroy_voice: drops the record. All three only withutil::under_wine().get_state: after the decoded voices' branch (unchanged in what it does; it now returns), a null context with buffers queued is answered fromQUEUED.queued_contexts_follow_submits_and_flushes(the record alone, any host) andget_state_names_the_oldest_buffer_of_a_voice_that_is_not_decoded(a PCM voice on the real engine: two queued and not started names the first; after they have played, a third names itself).Tested
x86_64-pc-windows-msvcwith clang-cl / lld-link 23.1.6 and an xwin SDK 10.0.26100, debug. The lib test binary run under Wine. Basemainc160d86+ #890's commit.hle::xaudio2:: --test-threads=1, 3 runs at the head: 11 passed, 0 failed every run.QUEUEDanswer inget_stateswitched off (a local edit, reverted), 2 runs: failed,left: (2, 0), right: (2, 20481)("two queued, not started"; 20481 is the context0x5001). With it on: passed. So the test fails without the change on this host.Tested by others
e2ee5c0merged withmain568e7db: thexaudio2tests, 11 passed, 0 failed, on the real engine (system XAudio2 2.9), includingget_state_names_the_oldest_buffer_of_a_voice_that_is_not_decoded. This is the Opus case he met behind #890. #890main:cargo test -p xcl --lib, all passed, 0 failed. #1698Regression run
main:this PR:
Not tested
Opus GetStatecheck itself:maindoes not get that far on this host (D3DMetal). The silent voice goes through the same branch ofsubmit_source_bufferas the PCM voice tested here; a Wine host without libopus that runs the title can confirm it.AI use
🤖 Generated with Claude Code
@papasmurph0 on GitHub · 2026-11-24 20:08 UTC · original
Regression run for this PR on Windows / NVIDIA, since it has no
xcl-smokepair yet.Tested
scripts/smoke.ps1 -Seconds 60on the retail title of #505 (game folder passed as a neutral junction, hencetitle: t1), each build from a clean worktree of the exact commit.main:this PR:
Both runs started from the same state (the title's settings already saved, so no first-run screens). The PR's run is within the limits: 93 % of
main's frames, 106 % of its peak commit, no crash, no device removal. A first run of this PR right after the title had saved its settings, paired with amainrun that still showed the first-run screens, is left out: the two did not start from the same state.Not tested: Wine; on native Windows the host's XAudio2 names its buffers, so the PR's branch is not reached and this is a regression check only.
AI use: Claude Code (Claude Opus 5.5) built the trees, made the runs on my PC and wrote this report; I asked for it to be posted.
@DavidM1911 on GitHub · 2026-11-24 22:09 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~23 ignored.Thanks!
@vakaobr on GitHub · 2026-11-25 16:15 UTC · original
Tested
e2ee5c0on a Mac: the test title's Opus check passes with it.Tested (MacBook Pro M5 Pro, macOS 27.2.1, CrossOver 26.3.0, D3DMetal 3.0, no libopus, Rust 1.100.0
x86_64-pc-windows-gnu, debug). Cherry-picked onto the Mac branch from #258 (vakaobr/xclmac/integration, which already has #890's commit throughmac7, plus #750 so the title gets that far), not ontomain.e2e::test_title_runs_and_game_folder_is_untouched: without it,XAudio2 … Opus GetState: ctx=0x0, queued=1failed in 2 of 2 runs. With it, the XAudio2 check passes in 2 of 2, and 48 of the title's checks pass. The test still fails onuser32 … not cloaked(Wine) andfiles: delete hides the file, which also failed in runs without it.hle::xaudio2lib tests, each in its own process: 11 of 11 pass,get_state_names_the_oldest_buffer_of_a_voice_that_is_not_decodedandqueued_contexts_follow_submits_and_flushesamong them. The other 9 passed before it too.Not tested: Windows,
main, a title with audio.AI use: Claude Code with Claude Opus 5.5 ran the tests and wrote 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.