feat(libSceAjm.native): implement M4AAC decoder #4934

Closed
MarcZX10 wants to merge 1 commit from upstream-pr/4934 into main
MarcZX10 commented 2026-10-13 05:17:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-13T05:17:27Z.


What

Implements the AJM M4AAC decoder (codec 2) using the FFmpeg AAC decoder already linked by the project. Adds support for the observed ADTS initialization shape and raw access units, channel/sample format reporting, reset and gapless behavior, plus explicit errors for cases whose console behavior or layouts are not established.

The exact PPSA26344 control flow and remaining compatibility limits are recorded in docs/dev/debt/libSceAjm.native.md. The regression uses an offline five-frame stereo ADTS fixture and checks decoded samples, channel separation, delay, reset, gapless trimming, raw input, output capacity, partial input and invalid parameters.

Tested

  • Debian 12 / GCC 12.2 / Release / Ninja: guest_ajm_tests built successfully.
  • ctest --test-dir build-m4aac -R '^guest_ajm$' --output-on-failure: passed (1/1).
  • python3 tools/check_conventions.py --base upstream/main --head HEAD: passed.
  • python3 tools/check_test_registration.py build-m4aac: 760 executable(s), 0 built and unrun.
  • git diff --check upstream/main...HEAD: passed.
  • Windows-specific and full-suite runtime validation has not been run on this Linux checkout.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw and limitations are recorded in the library debt file
  • No investigation notes or images added to the repository
  • New third-party code is a submodule built from source
  • Generic behavior, not specific to one title
  • Depends on: none
  • Unblocks: PPSA26344 #4443
  • AI-assisted: yes, implementation ported from the ready branch and independently reviewed/validated in this session
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4838722370 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4934). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-13T05:17:27Z. --- ### What Implements the AJM M4AAC decoder (codec 2) using the FFmpeg AAC decoder already linked by the project. Adds support for the observed ADTS initialization shape and raw access units, channel/sample format reporting, reset and gapless behavior, plus explicit errors for cases whose console behavior or layouts are not established. The exact PPSA26344 control flow and remaining compatibility limits are recorded in `docs/dev/debt/libSceAjm.native.md`. The regression uses an offline five-frame stereo ADTS fixture and checks decoded samples, channel separation, delay, reset, gapless trimming, raw input, output capacity, partial input and invalid parameters. ### Tested - Debian 12 / GCC 12.2 / Release / Ninja: `guest_ajm_tests` built successfully. - `ctest --test-dir build-m4aac -R '^guest_ajm$' --output-on-failure`: passed (1/1). - `python3 tools/check_conventions.py --base upstream/main --head HEAD`: passed. - `python3 tools/check_test_registration.py build-m4aac`: 760 executable(s), 0 built and unrun. - `git diff --check upstream/main...HEAD`: passed. - Windows-specific and full-suite runtime validation has not been run on this Linux checkout. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except technical debt - [x] Unimplemented paths throw and limitations are recorded in the library debt file - [x] No investigation notes or images added to the repository - [x] New third-party code is a submodule built from source - [x] Generic behavior, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA26344 #4443 - [x] AI-assisted: yes, implementation ported from the ready branch and independently reviewed/validated in this session
github-actions[bot] commented 2026-10-13 05:17:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T05:17:53Z.


Progress report (7e181fc → a8ffd24)

📉 System libraries: 87.9% (-0.02%, -1 reverted functions)

⚠️ 1 went back to stubs
Library Name
libSceAjm.native sceAjmInstanceCreate
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6138803621 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4934#issuecomment-6138803621). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T05:17:53Z. --- <!-- progress-report --> ### Progress report (7e181fc → a8ffd24) 📉 **System libraries**: 87.9% (-0.02%, -1 reverted functions) <details> <summary>⚠️ 1 went back to stubs</summary> | Library | Name | | - | - | | libSceAjm.native | `sceAjmInstanceCreate` | </details>
xXPBSXx commented 2026-10-13 08:41:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-10-13T08:41:10Z.


Windows test: head a8ffd244d merged onto current main 42e5edadb (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, -j2: full build 0 errors; ctest with the filter guest_ajm: guest_ajm passed (1 test(s), 0 failed); python tools/check_conventions.py --base upstream/main passed. I did not run the new tests against main without the change.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6141722340 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4934#issuecomment-6141722340). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-10-13T08:41:10Z. --- Windows test: head `a8ffd244d` merged onto current `main` `42e5edadb` (clean merge, no conflicts). Windows 10, MinGW GCC (WinLibs), Ninja Release, `-j2`: full build 0 errors; ctest with the filter `guest_ajm`: guest_ajm passed (1 test(s), 0 failed); `python tools/check_conventions.py --base upstream/main` passed. I did not run the new tests against `main` without the change. AI-assisted (Claude Code).
CnRJay commented 2026-10-14 01:38:02 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-14T01:38:02Z.


Heads-up: #5307 (also yours) implements the same M4AAC decoder, carrying screamm's commit for #3410. Only one of the two can merge. Please say which one continues and close the other, carrying over the tests only one of them has.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6158944254 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4934#issuecomment-6158944254). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-14T01:38:02Z. --- Heads-up: #5307 (also yours) implements the same M4AAC decoder, carrying screamm's commit for #3410. Only one of the two can merge. Please say which one continues and close the other, carrying over the tests only one of them has.
oneandonlydean commented 2026-10-14 03:30:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T03:30:59Z.


Closing as the same change as #5307, which has the identical code and tests and keeps screamm's authorship from #3410.
If something here is missing from it, please reopen with that part.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6160250738 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4934#issuecomment-6160250738). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T03:30:59Z. --- Closing as the same change as #5307, which has the identical code and tests and keeps screamm's authorship from #3410. If something here is missing from it, please reopen with that part.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!4934
No description provided.