libSceAjm.native: no M4AAC decoder (Ghost of Yotei initialises AAC); implementation ready #3410
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?
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T09:48:18Z.
libSceAjm.native (Ajm.cpp) has no M4AAC decoder:
sceAjmBatchJobControlINITIALIZE for codec id 2 reachesNotImplemented_nid_no_patch. Ghost of Yotei (PPSA26344 v1.008) initialises an AAC instance with flags0x200000006000(RESET, INITIALIZE, gapless decode), 8 bytes of gapless parameters plus 8 bytes of M4AAC parameters, and an 8-byte result (#884).Fix branch ready:
screamm:feat/ajm-m4aac(a395684b, one commit onmain0490ca18). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is.ajm_aac.h/ajm_aac.cpp,ajm.h,ajm_instance.cpp(443f0224), fdk-aactpdec_lib.cppandaacdecoder_lib.cpp(3e09594c) for raw transport and the bitrate formula. Codec id 2, channels from flag bits 3 to 6,ENABLE_SBR_DECODE/ENABLE_NONDELAY_OUTPUT/surround order from bits 32 to 35, other codec flags throw. INITIALIZE reads config type (1 ADTS, 2 raw) and sampling frequency index; bad values return the invalid-parameter result (4) as the ATRAC9 and Opus paths do. RUN decodes ADTS frames by header length, or one raw access unit per job, through the FFmpeg AAC decoder already linked, into S16/S32/float with the existing gapless, resampler, stream and multiple-frames handling; the first two frames after INITIALIZE/RESET produce no output unless non-delay is set, as in shadPS4; decoder errors returnCODEC_ERROR | FATAL; the format reports fdk-aac's bitrate. Unsettled cases throw: ADTS not starting with a header, profiles other than AAC LC, more than one raw data block per frame, channel configurations other than 1, 2 and 6, more channels than the instance, HE-AAC withoutENABLE_SBR_DECODE, raw input with multiple frames, a frame longer than the reserved room. TechnicalDebt records the shadPS4-only delay model and the unknown console result for decoder errors.guest_ajmgains an 896-byte five-frame stereo ADTS fixture (two chirps encoded offline with FFmpeg 6.1.1; the linked FFmpeg has no AAC encoder) decoded through the exact PPSA26344 control shape: the two silent delay frames, sample counts, format (2 channels, mask 0x3, 48000 Hz, bitrate 78750), codec info, correlation above 0.9 with each input chirp and below 0.07 with the other channel (channel order), RESET, gapless trimming, multiple-frames float output, raw access units matching ADTS, not-enough-room, partial input, the result-4 validation cases and the throws.Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release,
BUILD_TESTING=ON, full build includinglibs:guest_ajm3/3;ctest -j8 -E "^agc_driver_|^video_out_flip"524/525, the one failure beingwindows_exceptions, which fails identically onmain0490ca18without this change (reported separately); withmain'sAjm.cppthe extended test fails;tools/check_conventions.py --base mainandgit diff --checkpass. Not run on Linux.Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-11T10:27:50Z.
Independent verification on Linux (the gap noted in the report), with the negative control the report used: CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON.a395684bonto currentmain: one conflict indocs/dev/TechnicalDebt.md, resolved by keeping both this entry and main's newer entries; no code conflicts.tools/check_conventions.pyandgit diff --checkpass.guest_ajmpasses, stable across repeated runs. Negative control: with this branch's extended test butmain'sAjm.cpp, the test aborts atsceAjmBatchJobControl (INITIALIZE for a codec other than MP3, ATRAC9 and Opus) not implemented— the M4AAC paths the test covers are exactly the ones this branch implements, and it passes only with the branch's decoder.ctest -j8 -E "^agc_driver_|^video_out_flip"): 522/522 passed, including thewindows_exceptionstest that failed on the report's Windows machine.The rebased branch is available at
blawesom:verify/3410for anyone carrying — the commit is otherwise unchanged.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T16:50:50Z.
Carried the M4AAC implementation into PR #5307: https://github.com/boykopovar/AnyPS5/pull/5307. Linux
guest_ajmpasses (1/1), and conventions pass. The PS4-derived behavior assumptions and Windows-only testing from the issue are documented in the PR.