Honor XMA loop-end subframes across linked packets #1999

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

@⁠lgr123 on GitHub · 2026-11-25 17:54 UTC · original
lgr123:lgr123/runtime-xma-loop-end → main · +289 −27 · 3 files · 1 commits · open

Claimed as RT-XMA-LOOP-END-SUBFRAME.

A generated two-packet mono loop wrote 12 decoded blocks for every end subframe. Selectable end subframes should produce 9, 10, 11 and 12 blocks. At subframe 0 the extra 384 samples extend a repeat by 8 ms at 48 kHz. A separate loop-end frame split across linked packets wrote 8 blocks instead of 10 with the pinned decoder.

Respect the frame bit offsets and 128-sample end boundary on repeating passes. Account for frame PCM returned by a following linked packet and rewind to the selected frame. Keep the normal end-of-loop pass and packet-based fallback. A decoder rejection while checking a continuation still resets the codec before the rewind.

Reviewer check

Build and run the Windows CMake target acphal_test with the pinned Rust XMA decoder. All input is generated by the test. It exercises subframes 0–3, multiple frames per packet, linked continuations including a split prefix, two input buffers, decoder rejection and PCM order.

Tested

  • Native Windows x64 MSVC, exact pinned Rust decoder. Same test against parent shim: 9 failures in 203 checks. Patched: 203 of 203 pass.
  • Native CPU fallback: 193 of 193 pass.
  • No game files. The tests check decoded PCM and timing, with no in-title listen test.
  • Source-only check and git diff --check passed on public main b9320a1.

GPUs tested: n/a.

AI-assisted: yes.

Checklist

  • Based on public main.
  • One topic.
  • No game data, keys or protection workarounds.
**@⁠lgr123** on GitHub · 2026-11-25 17:54 UTC · [original](https://github.com/ubiquitarianism/leonida/pull/1999) `lgr123:lgr123/runtime-xma-loop-end` → `main` · +289 −27 · 3 files · 1 commits · open Claimed as [RT-XMA-LOOP-END-SUBFRAME](https://git.gtahub.st/github/ubiquitarianism--leonida/issues/1608). A generated two-packet mono loop wrote 12 decoded blocks for every end subframe. Selectable end subframes should produce 9, 10, 11 and 12 blocks. At subframe 0 the extra 384 samples extend a repeat by 8 ms at 48 kHz. A separate loop-end frame split across linked packets wrote 8 blocks instead of 10 with the pinned decoder. Respect the frame bit offsets and 128-sample end boundary on repeating passes. Account for frame PCM returned by a following linked packet and rewind to the selected frame. Keep the normal end-of-loop pass and packet-based fallback. A decoder rejection while checking a continuation still resets the codec before the rewind. ### Reviewer check Build and run the Windows CMake target `acphal_test` with the pinned Rust XMA decoder. All input is generated by the test. It exercises subframes 0–3, multiple frames per packet, linked continuations including a split prefix, two input buffers, decoder rejection and PCM order. ### Tested - Native Windows x64 MSVC, exact pinned Rust decoder. Same test against parent shim: 9 failures in 203 checks. Patched: 203 of 203 pass. - Native CPU fallback: 193 of 193 pass. - No game files. The tests check decoded PCM and timing, with no in-title listen test. - Source-only check and `git diff --check` passed on public main `b9320a1`. GPUs tested: n/a. AI-assisted: yes. ### Checklist - [x] Based on public main. - [x] One topic. - [x] No game data, keys or protection workarounds.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 10:14:19 +00:00
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/1999/head:github-bot/gh-1999'
git switch 'github-bot/gh-1999'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1999'
git switch 'github-bot/gh-1999'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1999'
git switch 'github-bot/gh-1999'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1999'
git switch 'main'
git merge --squash 'github-bot/gh-1999'
git switch 'main'
git merge --ff-only 'github-bot/gh-1999'
git switch 'main'
git merge 'github-bot/gh-1999'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.