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

Open
pablogonz12 wants to merge 1 commit from upstream-pr/3555 into main
pablogonz12 commented 2026-11-27 17:25:16 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by pablogonz12 on 2026-11-27T17:25:16Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:issue:5530625119 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3555). Originally posted by [pablogonz12](https://github.com/pablogonz12) on 2026-11-27T17:25:16Z. --- ## 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
andrewpozdnakov7-jpg commented 2026-11-27 18:09:43 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-27T18:09:43Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7225192156 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3555#issuecomment-7225192156). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-27T18:09:43Z. --- 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.
oni-swr commented 2026-11-27 18:11:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-27T18:11:29Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7225224714 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3555#issuecomment-7225224714). Originally posted by [oni-swr](https://github.com/oni-swr) on 2026-11-27T18:11:29Z. --- 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.
cloph-dsp commented 2026-11-27 19:41:06 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-27T19:41:06Z.


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.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7226769527 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3555#issuecomment-7226769527). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-27T19:41:06Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3555:upstream-pr/3555'
git switch 'upstream-pr/3555'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/3555'
git switch 'upstream-pr/3555'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3555'
git switch 'upstream-pr/3555'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3555'
git switch 'main'
git merge --squash 'upstream-pr/3555'
git switch 'main'
git merge --ff-only 'upstream-pr/3555'
git switch 'main'
git merge 'upstream-pr/3555'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

Reference
Marvisak/VIctory!3555
No description provided.