libSceAc3Enc: Encode, EncodeAsync, Flush, WaitEncode and IsEncoding need readings from the firmware module #28574

Open
opened 2026-12-01 20:44:00 +00:00 by cmsierrave-coder · 0 comments
cmsierrave-coder commented 2026-12-01 20:44:00 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by cmsierrave-coder on 2026-12-01T20:44:00Z.


What happens

With PR #28563 (feat(libSceAc3Enc): initialize AC-3 encoders through AJM), sceAc3EncCreateEncoder creates a live AJMI codec 7 encoder handle and sceAc3EncDeleteEncoder destroys it. The remaining live-handle paths still throw or assume no async encode can start because only their handle check is known:

  • sceAc3EncEncode
  • sceAc3EncEncodeAsync
  • sceAc3EncFlush
  • sceAc3EncWaitEncode
  • sceAc3EncIsEncoding

What's known

  • In #21863 (comment 6940149738), firmware 13.42's system/priv/lib/libSceAc3Enc.sprx (SHA-256 caa3e58b86fbd1fbf0b9cac022c4a18650129182fe7dce7dc5088aa5a6382a38) was read for sceAc3EncCreateEncoder and the handle check/destroy in sceAc3EncDeleteEncoder; the remaining encoder exports were listed as unread.
  • docs/dev/debt/libSceAc3Enc.md notes that 0xc024 holds the active encoder handle (-1 when absent) and 0xc02c holds the async slot (-1 when idle).
  • No open issue or pull request currently covers the live-handle encode, async encode, flush, wait, or status paths.

What would settle it

@BunnyFl, if your 13.42 dump has it, from firmware 13.42's system/priv/lib/libSceAc3Enc.sprx, for sceAc3EncEncode, sceAc3EncEncodeAsync, sceAc3EncFlush, sceAc3EncWaitEncode, and sceAc3EncIsEncoding:

  1. The full argument lists and any input/output struct layouts.
  2. The validation checks, in order, with their error codes (null pointers, sizes, busy/already-encoding, not-encoding, etc.).
  3. The AJMI batch job calls (RunBufferRa / ControlBufferRa / StartBuffer / Wait), job flags, input/output buffer sizes, sideband output layout, and AJMI/job-status error mapping.
  4. How the async slot at 0xc02c (and any saved output/status state) is set, polled, and cleared across EncodeAsync, IsEncoding, WaitEncode, Flush, and DeleteEncoder.
  5. If visible from libSceAc3Enc.sprx, the expected PCM sample format, frame size, and channel layout for setup mode 0 vs 1 (AJM flags 0x31 / 0x131, setup record mode 0 / 2).

What was checked

main at 18913472847, PR #28563 (b510cc3e994), issue #21863, and open issues/PRs for libSceAc3Enc.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6730257845 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/28574). Originally posted by [cmsierrave-coder](https://github.com/cmsierrave-coder) on 2026-12-01T20:44:00Z. --- ### What happens With PR #28563 (`feat(libSceAc3Enc): initialize AC-3 encoders through AJM`), `sceAc3EncCreateEncoder` creates a live AJMI codec 7 encoder handle and `sceAc3EncDeleteEncoder` destroys it. The remaining live-handle paths still throw or assume no async encode can start because only their handle check is known: - `sceAc3EncEncode` - `sceAc3EncEncodeAsync` - `sceAc3EncFlush` - `sceAc3EncWaitEncode` - `sceAc3EncIsEncoding` ### What's known - In #21863 (comment 6940149738), firmware 13.42's `system/priv/lib/libSceAc3Enc.sprx` (SHA-256 `caa3e58b86fbd1fbf0b9cac022c4a18650129182fe7dce7dc5088aa5a6382a38`) was read for `sceAc3EncCreateEncoder` and the handle check/destroy in `sceAc3EncDeleteEncoder`; the remaining encoder exports were listed as unread. - `docs/dev/debt/libSceAc3Enc.md` notes that `0xc024` holds the active encoder handle (`-1` when absent) and `0xc02c` holds the async slot (`-1` when idle). - No open issue or pull request currently covers the live-handle encode, async encode, flush, wait, or status paths. ### What would settle it @BunnyFl, if your 13.42 dump has it, from firmware 13.42's `system/priv/lib/libSceAc3Enc.sprx`, for `sceAc3EncEncode`, `sceAc3EncEncodeAsync`, `sceAc3EncFlush`, `sceAc3EncWaitEncode`, and `sceAc3EncIsEncoding`: 1. The full argument lists and any input/output struct layouts. 2. The validation checks, in order, with their error codes (null pointers, sizes, busy/already-encoding, not-encoding, etc.). 3. The AJMI batch job calls (`RunBufferRa` / `ControlBufferRa` / `StartBuffer` / `Wait`), job flags, input/output buffer sizes, sideband output layout, and AJMI/job-status error mapping. 4. How the async slot at `0xc02c` (and any saved output/status state) is set, polled, and cleared across `EncodeAsync`, `IsEncoding`, `WaitEncode`, `Flush`, and `DeleteEncoder`. 5. If visible from `libSceAc3Enc.sprx`, the expected PCM sample format, frame size, and channel layout for setup `mode` 0 vs 1 (AJM flags `0x31` / `0x131`, setup record mode `0` / `2`). ### What was checked `main` at `18913472847`, PR #28563 (`b510cc3e994`), issue #21863, and open issues/PRs for `libSceAc3Enc`. AI-assisted: yes
Sign in to join this conversation.
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#28574
No description provided.