Skip to content

Honor XMA loop-end subframes across linked packets - #1999

Open
lgr123 wants to merge 1 commit into
ProjectLeonida:mainfrom
lgr123:lgr123/runtime-xma-loop-end
Open

lgr123 wants to merge 1 commit into
ProjectLeonida:mainfrom
lgr123:lgr123/runtime-xma-loop-end

Conversation

@lgr123

@lgr123 lgr123 commented Nov 25, 2026

Copy link
Copy Markdown

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant