Audio: refill XMA rings from a decoded reserve on the title's thread #1880
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1880
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1880"
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?
@beamdotdev on GitHub · 2026-11-25 00:00 UTC · original
beamdotdev:audio/xma-reserve→main· +99 −24 · 1 files · 1 commits · openAudio was choppy: XMA rings ran dry under load.
Why
What
ADVANCE_XMA_READcopies from that reserve into the freed blocks at once, on the title's thread; the decoding thread then tops the reserve up.THREAD_PRIORITY_TIME_CRITICAL. It works only while a ring has room or a reserve is short, so it cannot hog a core.imdct_half's pre/post rotations are computed once per transform size instead of per channel and subframe (bit-identical output).Testing
cargo test -p victory-hle audioandcargo test -p victory-formats xmapass; clippy is clean on both crates.xma_contexts_decode_into_their_output_ringsnow also covers the refill from the reserve on read-advance and resuming after input runs out.VICTORY_AUDIO_CAPTURE(diagnostics build) can record before/after.🤖 Generated with Claude Code
@Marvisak on GitHub · 2026-11-25 01:37 UTC · original · edited 2026-11-25 02:28 UTC
Automated triage for the maintainers.
The reserve-and-refill part (
fillcalled fromADVANCE_XMA_READ, plus the decoding thread topping up two frames ahead) is a reasonable way to keep XMA rings from running dry. However, the PR also changes what the emulated XMA context does, and gives no evidence for it. Indecodeincrates/victory-hle/src/modules/audio.rs, a voice whose input ran out now resumes when new input arrives, from a cold decoder, with context dword 2 zeroed (context.set(2, 0)). Enabling only clears the error bits (set_field(2, 26, 6, 0)inXma::enable), so the comment "as enabling does" does not match the code, and the read offset is reset too. A partial block now waits for more input instead of being padded. Whether the hardware resumes a context that ran out, and from where, is the kind of runtime behaviour that needs a reference: the title's own handling of that state, or public documentation. The description also says the change has not been heard in a title. To move forward: give evidence for the resume semantics (or split them out, so the reserve and the thread priority can be judged alone), and attach a before/afterVICTORY_AUDIO_CAPTUREcomparison or a listening report from the title.Generated by Claude Code
@beamdotdev on GitHub · 2026-11-25 02:05 UTC · original
Rebased onto main (
8fb0b28). The IMDCT rotation cache is dropped from this PR: main's own (#172) covers it. One test from main that builds a Voice now uses the renamed field. victory-hle tests: 142 pass; the one failure, dstorage::a_page_list_filled_after_its_request_starts, fails on main too.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.