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>
…e XCL does not decode Wine's XAudio2 counts the buffers of a source voice that has not started but names no current one, where Windows names the first queued buffer. The change before this one answers that for decoded (XMA / Opus) voices from their own record. A voice XCL does not decode has none: plain PCM, and the silence that stands in for XMA / Opus without a decoder (the test title's "Opus GetState: ctx=0x0, queued=1" under Wine without libopus). A PCM voice with two buffers queued reads (2 queued, context 0) under CrossOver 26.3. Under Wine only, the contexts submitted to such a voice are kept, oldest first and at most the 64 a voice can hold; the host's queued buffers are the last ones submitted, so a null current context with N queued is the N-th from the end. FlushSourceBuffers keeps what the host kept, and DestroyVoice drops the record. On Windows nothing is kept and nothing is asked: the host answers. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Regression run for this PR on Windows / NVIDIA, since it has no Tested
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 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. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Stacked 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 (comment)) 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+ XAudio2: GetState names the oldest queued buffer when the host gives none #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 XAudio2: GetState names the oldest queued buffer when the host gives none #890. XAudio2: GetState names the oldest queued buffer when the host gives none #890 (comment)main:cargo test -p xcl --lib, all passed, 0 failed. XAudio2: under Wine GetState names the oldest queued buffer of a voice XCL does not decode #1698 (comment)Regression 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