Audio: resume ended XMA voices when input is refilled #3555

Open
github-bot wants to merge 1 commit from github-bot/gh-3555 into main AGit
Owner

@⁠pablogonz12 on GitHub · 2026-11-27 17:25 UTC · original
pablogonz12:upstream/xma-resume-ended → main · +54 −2 · 1 files · 1 commits · open

Summary

An ended XMA voice returned before checking for newly published input. I let it resume when either input becomes valid, while leaving it ended when neither is valid. I credit codec-d/cool_fox for the restart fix.

The whole-block refill change is left to #2444.

Evidence

  • The new regression checks that a voice stays ended without input and decodes a frame after input is republished.
  • Nine audio tests passed under Wine on a system with RX 9070 XT / RADV.
  • Windows-target workspace clippy passed for all targets, both default and all features.
  • The full workspace run under Wine encountered pre-existing Wine-specific HLE test failures and a timeout; it did not complete. Windows CI will run the workspace tests.

Not tested on NVIDIA hardware.

Merge Danger

Door: two-way

Blast Radius: XMA audio

**@⁠pablogonz12** on GitHub · 2026-11-27 17:25 UTC · [original](https://github.com/Marvisak/VIctory/pull/3555) `pablogonz12:upstream/xma-resume-ended` → `main` · +54 −2 · 1 files · 1 commits · open ## Summary An ended XMA voice returned before checking for newly published input. I let it resume when either input becomes valid, while leaving it ended when neither is valid. I credit codec-d/cool_fox for the restart fix. The whole-block refill change is left to #2444. ## Evidence - The new regression checks that a voice stays ended without input and decodes a frame after input is republished. - Nine audio tests passed under Wine on a system with RX 9070 XT / RADV. - Windows-target workspace clippy passed for all targets, both default and all features. - The full workspace run under Wine encountered pre-existing Wine-specific HLE test failures and a timeout; it did not complete. Windows CI will run the workspace tests. Not tested on NVIDIA hardware. ## Merge Danger **Door:** two-way **Blast Radius:** XMA audio
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 17:38:14 +00:00
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 18:09 UTC · original

All nine native Windows audio tests passed on this PR's b7fb07b, and its Windows CI passed.

I also tested the two fixes together. A synthetic mono voice decodes two packets, drains to the end, and stays quiet while neither input is valid. The refill publishes an empty input 0 and two complete packets in input 1. The same enabled voice resumes and decodes six frames in both builds. b7fb07b writes 27 output blocks, including an extra silent block at the switch. Adding #2444 at 413cf34 produces all 26 expected blocks, including the overlap tail.

The tested branch preserves both PR heads and adds the integration regression. All 155 HLE tests, both strict Clippy configurations and the asset policy passed on Windows.

The results support taking both fixes. Next step is for the authors or maintainers to decide which PR carries the integration fixture. Please retain the original Git authors on cherry-pick or rebase. If folding my test into another commit, add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>. AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 18:09 UTC · [original](https://github.com/Marvisak/VIctory/pull/3555#issuecomment-7225192156) All nine native Windows audio tests passed on this PR's `b7fb07b`, and its [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46041706327) passed. I also tested the two fixes together. A synthetic mono voice decodes two packets, drains to the end, and stays quiet while neither input is valid. The refill publishes an empty input 0 and two complete packets in input 1. The same enabled voice resumes and decodes six frames in both builds. `b7fb07b` writes 27 output blocks, including an extra silent block at the switch. Adding #2444 at `413cf34` produces all 26 expected blocks, including the overlap tail. [The tested branch](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/c69a2261d8885dbb52a0a42e55051871e6aa37db) preserves both PR heads and adds the integration regression. All 155 HLE tests, both strict Clippy configurations and the asset policy passed on Windows. The results support taking both fixes. Next step is for the authors or maintainers to decide which PR carries the integration fixture. Please retain the original Git authors on cherry-pick or rebase. If folding my test into another commit, add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with Codex.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 18:11 UTC · original

Independent verification of b7fb07bc (base main 63bcca43; the PR is a single branch off that base). AI-assisted (Claude Sonnet 5.5); claim: #1633. This adds to the native Windows report above at the same head rather than repeating it.

  • Host: Windows 11 build 26200, native Windows. The audio code does not use the GPU, so WARP does not apply; no physical GPU used.
  • cargo test -p victory-hle --lib: main 63bcca43 = 152 passed, 0 failed. PR head = 153 passed, 0 failed. The new ended_voice_stays_ended_until_input_is_republished passes.
  • cargo clippy -p victory-hle --all-targets -- -D warnings: clean.

Review notes (no blockers found):

  • On refill the clear set_field(2, 26, 6, 0) covers six bits, so it also resets bit 31 that the end path sets (set_field(2, 31, 1, 1)), which keeps the two sides symmetrical. Decoder::flush ends with reset(), so the comment about the overlap being reset holds.
  • The offset field (field(2, 0, 26)) and the current-input bit are not reset on resume. If a title republishes the same input without resetting them, the voice would find the input used up and end again. Whether the console behaves like that is unproven; the test only covers a switch to the other input.
**@⁠oni-swr** on GitHub · 2026-11-27 18:11 UTC · [original](https://github.com/Marvisak/VIctory/pull/3555#issuecomment-7225224714) Independent verification of `b7fb07bc` (base `main` 63bcca43; the PR is a single branch off that base). AI-assisted (Claude Sonnet 5.5); claim: #1633. This adds to the native Windows report above at the same head rather than repeating it. - Host: Windows 11 build 26200, native Windows. The audio code does not use the GPU, so WARP does not apply; no physical GPU used. - `cargo test -p victory-hle --lib`: main 63bcca43 = 152 passed, 0 failed. PR head = 153 passed, 0 failed. The new `ended_voice_stays_ended_until_input_is_republished` passes. - `cargo clippy -p victory-hle --all-targets -- -D warnings`: clean. Review notes (no blockers found): - On refill the clear `set_field(2, 26, 6, 0)` covers six bits, so it also resets bit 31 that the end path sets (`set_field(2, 31, 1, 1)`), which keeps the two sides symmetrical. `Decoder::flush` ends with `reset()`, so the comment about the overlap being reset holds. - The offset field (`field(2, 0, 26)`) and the current-input bit are not reset on resume. If a title republishes the same input without resetting them, the voice would find the input used up and end again. Whether the console behaves like that is unproven; the test only covers a switch to the other input.
Author
Owner

@⁠cloph-dsp on GitHub · 2026-11-27 19:41 UTC · original

Independent CPU-only verification on Windows / Rust 1.100.0 / MSVC.

  • PR head: b7fb07bcae7fa979ec9920e06b94601b54773da3, merge base 63bcca43c6a00a758510398fa43096ce7e4f7df0.
  • Command: cargo test --locked -p victory-hle --lib -- modules::audio::tests::ended_voice_stays_ended_until_input_is_republished --exact --test-threads=1 --quiet
  • Result: test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 152 filtered out, exit 0.
  • Negative control: git grep -F -c ended_voice_stays_ended_until_input_is_republished 63bcca43 -- . → exit 1 / 0 hits (test genuinely new); present on PR head.
  • git diff --check 63bcca43 HEAD → exit 0.
  • Caveat: only the named synthetic audio test was replayed; full crate suite and real XMA playback were not exercised.
  • GPU/driver: N/A (CPU-only test). No game data, assets, extracted shaders or DRM involved.
  • AI-assisted: Hy4 flash.
**@⁠cloph-dsp** on GitHub · 2026-11-27 19:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/3555#issuecomment-7226769527) Independent CPU-only verification on Windows / Rust 1.100.0 / MSVC. - PR head: `b7fb07bcae7fa979ec9920e06b94601b54773da3`, merge base `63bcca43c6a00a758510398fa43096ce7e4f7df0`. - Command: `cargo test --locked -p victory-hle --lib -- modules::audio::tests::ended_voice_stays_ended_until_input_is_republished --exact --test-threads=1 --quiet` - Result: `test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 152 filtered out`, exit 0. - Negative control: `git grep -F -c ended_voice_stays_ended_until_input_is_republished 63bcca43 -- .` → exit 1 / 0 hits (test genuinely new); present on PR head. - `git diff --check 63bcca43 HEAD` → exit 0. - Caveat: only the named synthetic audio test was replayed; full crate suite and real XMA playback were not exercised. - GPU/driver: N/A (CPU-only test). No game data, assets, extracted shaders or DRM involved. - AI-assisted: Hy4 flash.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3555/head:github-bot/gh-3555'
git switch 'github-bot/gh-3555'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3555'
git switch 'github-bot/gh-3555'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3555'
git switch 'github-bot/gh-3555'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3555'
git switch 'main'
git merge --squash 'github-bot/gh-3555'
git switch 'main'
git merge --ff-only 'github-bot/gh-3555'
git switch 'main'
git merge 'github-bot/gh-3555'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3555
No description provided.