feat(ajm): decode Opus surround mapping family #3831
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3831"
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?
Imported from boykopovar/AnyPS5. Originally posted by eljackjoestar-cmd on 2026-10-11T17:19:42Z.
What
Lost Soul Aside (PPSA26358) submits the AJM Opus initialization tuple
4, 48000, 1. Main rejects the nonzero third word. Interpret it as the channel mapping family and provide FFmpeg with the conventional family-1 multistream layout through an OpusHead header. This enables actual surround packet decoding instead of dropping the restriction while leaving the decoder unable to open.The parameter name follows KytyPS5's initialize structure. Header fields follow RFC 7845 section 5.1; the implicit stream allocation follows libopus 1.5.2's surround layout. The header has zero gain and pre-skip; existing AJM gapless controls retain responsibility for skipping. PCM stays in FFmpeg's native speaker order. These console ABI assumptions are recorded in TechnicalDebt. Other mapping families and sample rates still throw; family 0 rejects more than two channels.
Open PR searches for Opus, mapping family and sceAjmBatchJobInitialize found no duplicate. #3626 concerns the separate libSceOpusCeltDec API.
Tested
Windows 11 x86-64, Ryzen 7 7800X3D, 32 GB RAM, RTX 5070, WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON.
libsandguest_ajm_teststargets.guest_ajmpasses in approximately 0.05 s, including the existing decoding, control and resampling tests.tools/check_conventions.py --base origin/mainandgit diff --checkpass.buffer descriptor uses an unsupported typeduring level loading. Audio output and gameplay are not claimed as verified. That run did not enable the correctly named AJM trace option, so further title tracing remains necessary.Rebased onto main
5aaf26bd3. The Opus change is9a0c59570. Windows main did not compile becauseHostPollwas defined only on Unix but called from unguarded branches; this branch includes #4021's121b16fb4fix with its original author, asac4954c6e, without resubmitting that fix. The updated local integration build passesguest_ajm,guest_sce_net, masked-select, graphics, and both focused layered-volume tests. Broader integration testing has failures and a hanging layered-volume submission test; the full suite is not claimed green. Local title testing additionally used #3391, #3739, #3633, #1077, #3763, #425 and #3523; those graphics changes are excluded from this PR. Linux and macOS were not run. Console PCM comparison and the implicit surround layout remain unverified.Checklist
main; no other open PR implements the same functionsImported from boykopovar/AnyPS5. Originally posted by tv7 on 2026-10-11T18:25:11Z.
@eljackjoestar-cmd Wolverine data point for this PR. Marvel's Wolverine (PPSA03671), Windows 11, RTX 3070, Release. Main
a11c8f7f7+ #757, #3588, #3633, #3846, #3867 and #3336, with and without this PR at its current head.sceAjmBatchJobInitialize (Opus sample rate other than 48000 or nonzero third parameter word) not implemented. The init parameters (12 bytes, logged locally) are00000001 0000bb80 00000000for one instance and00000004 0000bb80 00000001for another: 4 channels, 48000 Hz, mapping family 1.VGT_SHADER_STAGES_EN=0x482030).I did not check the decoded surround audio itself, only that initialization and decoding no longer stop the title.
AI-assisted: yes (Claude Code)