mirror of
https://github.com/ubiquitarianism/leonida.git
synced 2026-11-26 22:45:53 +01:00
[PR #404] [MERGED] acphal: ACP message queue and background XMA ring decoding with the Rust XMA2 decoder (RT-ACPHAL-XMA2) #457
Labels
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
starred/leonida#457
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
📋 Pull Request Information
Original PR: https://github.com/ubiquitarianism/leonida/pull/404
Author: @Andretuta
Created: 11/24/2026
Status: ✅ Merged
Merged: 11/24/2026
Merged by: @ubiquitarianism
Base:
main← Head:feat/acphal-xma2-decoder📝 Commits (10+)
4750df6acphal: add portable XMA2 decoder, ACP message queue, and SHAPE XMA worker259772eMerge remote-tracking branch 'ubiq/main' into feat/acphal-xma2-decoder12536c2acphal: stop the XMA worker it was meant to stopcfcedb5acphal: decode XMA contexts with runtime/xma_decoder when cargo is availablea99a3fbacphal: preserve XMA packet chains and context lifetimea0327eeruntime: target the MSVC ABI for the Rust XMA2 decodere02ec36acphal: synchronize XMA context words and bound the output ring0fe9c0bacphal: recover SHAPE allocation and preserve XMA stream state4e9407aacphal: isolate voice failures and keep input transitions ordered713eec5acphal: stabilize APU mappings and reuse XMA PCM storage📊 Changes
10 files changed (+1518 additions, -120 deletions)
View changed files
📝
.github/workflows/runtime.yml(+1 -0)📝
runtime/CMakeLists.txt(+44 -0)📝
runtime/shims/acphal.cpp(+769 -104)📝
runtime/test/acphal_test.cpp(+620 -8)📝
runtime/xma_decoder/README.md(+9 -2)📝
runtime/xma_decoder/leonida_xma2_decoder.h(+4 -0)📝
runtime/xma_decoder/src/lib.rs(+46 -5)📝
runtime/xma_decoder/tests/ffi_contract.rs(+22 -0)📝
scripts/build_runtime.ps1(+1 -1)📝
third_party/xma/NOTICE.md(+2 -0)📄 Description
Claimed in the coordination issue as:
RT-ACPHAL-XMA2(https://github.com/ubiquitarianism/leonida/issues/14#issuecomment-7121796272)Depends on: #357
What and why
acphal.dllstub with an ACP command and message queue and a worker that fills SHAPE XMA PCM rings. The worker follows packet skips and refill order, updates shared fields atomically, and bounds each pass to the ring. Repeated enables preserve queued PCM for the same format and reset it when the format changes.runtime/xma_decoderat configure time through Cargo. The shim outputs silence based on each packet's frame count when Cargo is missing, the build fails, or the directcl.exefallback is used. Windows runtime CI explicitly requires the decoder.std::jthreadstop token. A worker memory failure reports an error for the affected voice. SHAPE allocation publishes a complete table or returnsE_OUTOFMEMORY. Release detaches the worker, then frees the process-wide arrays without writing through the opaque HAL handle.Tested
gta6rtandacphal_testin Debug and Release with Rust. A separate CMake configuration builtacphal_testwith the silence fallback in both build types. CTest passed in all four configurations, with 170 checks per normal run with Rust, 166 with silence, and 14 for the separate non-cached-only case in each configuration.4e9407a40.x86_64-pc-windows-msvcandx86_64-pc-windows-gnullvm, including a first-frame test for the hardware constructor. Locked release builds succeeded on both targets.GPUs tested: n/a
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a — audio decoder & runtime shim only)🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.