feat(libSceAjm.native): implement sceAjmBatchJobGetInfo #909

Merged
adriadam10 merged 1 commit from upstream-pr/909 into main 2026-10-06 21:08:13 +00:00
adriadam10 commented 2026-10-06 16:02:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-06T16:02:22Z.


What

Implements sceAjmBatchJobGetInfo (libSceAjm.native). On main it was a stub that throws.

  • It queues a run job without buffers that has the SIDEBAND_FORMAT flag and a result + format sideband. The run path writes that sideband the same way sceAjmBatchJobGetGaplessDecode and sceAjmBatchJobGetCodecInfo already do. The behaviour (result followed by the instance's AjmSidebandFormat) follows KytyPS5 AjmBatchJobGetInfo. The format layout (channels, channel mask, sample rate, sample encoding, bitrate, reserved) is the same in shadPS4 AjmSidebandFormat.
  • The references disagree on two points. Both are recorded in TechnicalDebt under "Unknown function info":
    • ATRAC9 bitrate: KytyPS5 reports 0, which main already writes for SIDEBAND_FORMAT. shadPS4 derives it from the superframe size. This PR doesn't change it, and the test doesn't pin it.
    • Before the instance is initialized: the existing run path returns the not-initialized result (1) and writes no format, the same as GetCodecInfo. KytyPS5 returns result 0 and the uninitialized decoder's format.

Tested

Linux, guest_ajm_tests (new TestGetInfo, registered in ctest), with three cases:

  • ATRAC9 before Initialize: result 1, format untouched.
  • ATRAC9 after Initialize with the stereo 48 kHz config: 2 channels, mask 0x3, 48000 Hz, S16, reserved 0.
  • MP3 mono after decoding one frame of the existing fixture: 1 channel, mask 0x4, 48000 Hz, S16, bitrate 32000, which matches KytyPS5 and shadPS4 (both use the FFmpeg bit rate).

The test fails on main, where the stub throws. It also fails if any of these is mutated: the flag, the sideband size, or the result pointer. Full Release build (GCC) passes, and ctest -R 'guest_|ajm' passes 119/119.

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 (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4761395035 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/909). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-06T16:02:22Z. --- ### What Implements `sceAjmBatchJobGetInfo` (libSceAjm.native). On `main` it was a stub that throws. - It queues a run job without buffers that has the `SIDEBAND_FORMAT` flag and a result + format sideband. The run path writes that sideband the same way `sceAjmBatchJobGetGaplessDecode` and `sceAjmBatchJobGetCodecInfo` already do. The behaviour (result followed by the instance's `AjmSidebandFormat`) follows [KytyPS5](https://github.com/KytyPS5/KytyPS5) `AjmBatchJobGetInfo`. The format layout (channels, channel mask, sample rate, sample encoding, bitrate, reserved) is the same in shadPS4 `AjmSidebandFormat`. - The references disagree on two points. Both are recorded in TechnicalDebt under "Unknown function info": - **ATRAC9 bitrate:** KytyPS5 reports 0, which `main` already writes for `SIDEBAND_FORMAT`. shadPS4 derives it from the superframe size. This PR doesn't change it, and the test doesn't pin it. - **Before the instance is initialized:** the existing run path returns the not-initialized result (1) and writes no format, the same as `GetCodecInfo`. KytyPS5 returns result 0 and the uninitialized decoder's format. ### Tested Linux, `guest_ajm_tests` (new `TestGetInfo`, registered in ctest), with three cases: - ATRAC9 before `Initialize`: result 1, format untouched. - ATRAC9 after `Initialize` with the stereo 48 kHz config: 2 channels, mask 0x3, 48000 Hz, S16, reserved 0. - MP3 mono after decoding one frame of the existing fixture: 1 channel, mask 0x4, 48000 Hz, S16, bitrate 32000, which matches KytyPS5 and shadPS4 (both use the FFmpeg bit rate). The test fails on `main`, where the stub throws. It also fails if any of these is mutated: the flag, the sideband size, or the result pointer. Full Release build (GCC) passes, and `ctest -R 'guest_|ajm'` passes 119/119. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-06 16:02:52 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-06T16:02:52Z.


Progress report (5895ea7 → 05de11a)

📈 System libraries: 87.03% (+0.03%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceAjm.native sceAjmBatchJobGetInfo
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6020276857 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/909#issuecomment-6020276857). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-06T16:02:52Z. --- <!-- progress-report --> ### Progress report (5895ea7 → 05de11a) 📈 **System libraries**: 87.03% (+0.03%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceAjm.native | `sceAjmBatchJobGetInfo` | </details>
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!909
No description provided.