xaudio2: pin multi-stream XMA2 decode (packet base, header skip, interleave) #580
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
hle
input
INTEL
lighting
linux-proton
memory
MULDER
needs-info
needs-logs
needs-rebase
NVIDIA
performance
post-merge
pr-diagnostics
pr-docs
pre-merge
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
relevance
high
relevance
low
relevance
medium
relevance
very-high
rendering
report
roadmap-proposal
saves
series-s
shaders
startup
status
blocked-by-rework
status
needs-test-report
status
needs-triage
status
ready-for-review
status
stale
status
superseded
status
wip
tools
ui
upstream
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
TrustNo1/Darner!580
Loading…
Reference in a new issue
No description provided.
Delete branch "qnjk/Darner:xaudio2-multistream-test"
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?
Contributor role (optional)
What it changes
The problem on main: nothing. This is a tests-only change (no production line is edited).
What it pins:
decode(crates/darner-hle/src/modules/xaudio2.rs:302) was reached by exactly one test,xma2_voices_play_through_the_host, which builds one two-channel stream and submits a packet of zeros.xma::read_framerefuses that packet outright (if bits <= LENGTH_BITS as usize || bits == 0x7fff { return None; },darner-formats/src/xma.rs:132), sodecodereturned an empty vector and the existing test only exercised the silence fallback. Nothing calleddecodewith a stream index above 0 or with a frame that actually decodes, so three things that can only go wrong silently were unpinned: the per-stream packet bases * xma::PACKET_BYTES * 8, the 32-bit packet-header skip added tofirst_frame_biton the same line, and the shortest-stream minimum plus stream-order interleave. A mistake in any of them plays noise where PCM belongs, and the only symptom is a once-only warning.This change adds a test that decodes a real two-stream packet pair and pins all three, plus the silence contract the caller relies on.
How it was tested
13fe482(one commit onc8258f9).cargo test --locked -p darner-hle --lib -- xaudio2— 5 passed, 0 failed, with the new test among them; the crate's full suite is green too.modules::xaudio2::tests::multi_stream_packets_decode_and_interleave_in_stream_order: stream 0's packet (three frames) first and stream 1's (two frames) second, decoded with two mono decoders seeded with opposite overlap values so the streams are told apart by what they carry into their first frame. It pins: the per-stream base (a wrong base changes the length to 3072 instead of 2048); the 32-bit header skip (without it the length is 0 instead of 2048); the interleave (stream 0's sample is the even one,first == -second, only in the first frame — a reversed interleave gives-1000, 1000); the shortest-stream minimum (two 512-sample frames even though stream 0's packet holds three); and that a buffer in which no frame begins decodes to empty.cargo clippy --locked -p darner-hle --all-targets -- -D warningspasses.git checkout --.cargo clippy --workspace --all-targets --locked -- -D warnings: passes.cargo clippy --workspace --all-targets --all-features --locked -- -D warnings: passes.cargo test --workspace --locked: not run to completion here; the pre-existingdarner-gputest deadlock (#224) anddarner-shaderwaterfall fixture failure (#227) make the whole-workspace run non-green on this machine.darner-hle's suite is green.streams(...)refusal paths are not exercised.Checklist
main.docs/asset-policy.md. (cargo xtask policy: 576 files ok.)Checked for overlap
crates/darner-hle/src/modules/xaudio2.rs(checked against the file list of all 189 open pull requests), and no open or closed issue mentions XMA2 multi-stream decode.[pr-tests][audio] xaudio2: pin multi-stream XMA2 decode (packet base, header skip, interleave)to xaudio2: pin multi-stream XMA2 decode (packet base, header skip, interleave)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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.