feat(libSceAudioIn): open ports through the Ex calls and accept the two setters #8914

Merged
hypermoist merged 2 commits from upstream-pr/8914 into main 2026-10-22 21:57:09 +00:00
hypermoist commented 2026-10-21 05:50:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hypermoist on 2026-10-21T05:50:51Z.


What

Four libSceAudioIn exports that d4387fbaf7 added as throwing stubs now behave as in the decrypted PS5 12.00 libSceAudioIn.sprx:

Export (NID, address) Console behaviour Here
sceAudioInOpenEx (+DY07NwJb0s, 0x810) Calls the open routine that sceAudioInOpen also uses (0x4C0). It passes its 4th argument as the routine's 4th, which sceAudioInOpen sets to 0, and the remaining len, freq, param unchanged. That argument is used in only one place: the routine passes it to sceMbusAddHandleByUserId when registering the handle. sceAudioInOpen(user, type, index, len, freq, param); the extra argument is ignored, since there is no Mbus registration here.
sceAudioInHqOpenEx (CTh72m+IYbU, 0x8D0) The same, with the routine's high-quality flag set. Unlike sceAudioInHqOpen (0x880), it skips the freq == 48000, len == 128 and param == 2 checks, so only the routine's own checks apply. The same as sceAudioInOpenEx. Forwarding to upstream's sceAudioInHqOpen would add those checks, so a 256-sample 16 kHz port opens here as it does on the console.
sceAudioInSetCompressorPreGain (vyh-T6sMqnw, 0x2D40) xor eax, eax; ret returns 0
sceAudioInSetNoiseGateThreshold (6jUfpgzO2J0, 0x2EB0) xor eax, eax; ret returns 0

The two Ex signatures are read from how the module moves their arguments, so their unknown signature debt lines are removed. The two setters read no argument on the console, so their parameter lists stay unknown; their debt lines now say they return 0, as the console does.

The bodies are written from this observed behaviour; nothing from the module is copied. I do not know of a title that imports these four; this replaces throws with the console's answers.

Not included: sceAudioInDeviceOpenEx and the Device*Open family, which use a separate device-open routine upstream does not implement.

Tested

Linux (CachyOS, GCC, Release): full build. All 546 guest_*, kernel and Ampr tests pass. guest_audio_in (both its capture and no_device modes) now checks:

  • the type, size and rate errors through sceAudioInOpenEx and sceAudioInHqOpenEx;
  • that both open and close a port;
  • that sceAudioInHqOpenEx accepts 256 samples at 16 kHz, which sceAudioInHqOpen rejects;
  • that the two setters return 0.

Forwarding sceAudioInHqOpenEx to sceAudioInHqOpen instead makes both modes fail.

tools/check_conventions.py is clean. No open PR touches these names or NIDs, and a three-way merge against every open PR touching these files (including #8889 on the debt file) adds no conflicts.

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 under Silent stubs in their library's technical debt file
  • 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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes (Claude Code), reviewed by the contributor

🤖 Generated with Claude Code

https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4947053816 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8914). Originally posted by [hypermoist](https://github.com/hypermoist) on 2026-10-21T05:50:51Z. --- ### What Four `libSceAudioIn` exports that d4387fbaf7 added as throwing stubs now behave as in the decrypted PS5 12.00 `libSceAudioIn.sprx`: | Export (NID, address) | Console behaviour | Here | |---|---|---| | `sceAudioInOpenEx` (`+DY07NwJb0s`, 0x810) | Calls the open routine that `sceAudioInOpen` also uses (0x4C0). It passes its 4th argument as the routine's 4th, which `sceAudioInOpen` sets to 0, and the remaining `len, freq, param` unchanged. That argument is used in only one place: the routine passes it to `sceMbusAddHandleByUserId` when registering the handle. | `sceAudioInOpen(user, type, index, len, freq, param)`; the extra argument is ignored, since there is no Mbus registration here. | | `sceAudioInHqOpenEx` (`CTh72m+IYbU`, 0x8D0) | The same, with the routine's high-quality flag set. Unlike `sceAudioInHqOpen` (0x880), it skips the `freq == 48000`, `len == 128` and `param == 2` checks, so only the routine's own checks apply. | The same as `sceAudioInOpenEx`. Forwarding to upstream's `sceAudioInHqOpen` would add those checks, so a 256-sample 16 kHz port opens here as it does on the console. | | `sceAudioInSetCompressorPreGain` (`vyh-T6sMqnw`, 0x2D40) | `xor eax, eax; ret` | returns 0 | | `sceAudioInSetNoiseGateThreshold` (`6jUfpgzO2J0`, 0x2EB0) | `xor eax, eax; ret` | returns 0 | The two `Ex` signatures are read from how the module moves their arguments, so their `unknown signature` debt lines are removed. The two setters read no argument on the console, so their parameter lists stay unknown; their debt lines now say they return 0, as the console does. The bodies are written from this observed behaviour; nothing from the module is copied. I do not know of a title that imports these four; this replaces throws with the console's answers. Not included: `sceAudioInDeviceOpenEx` and the `Device*Open` family, which use a separate device-open routine upstream does not implement. ### Tested Linux (CachyOS, GCC, Release): full build. All 546 `guest_*`, kernel and Ampr tests pass. `guest_audio_in` (both its `capture` and `no_device` modes) now checks: - the type, size and rate errors through `sceAudioInOpenEx` and `sceAudioInHqOpenEx`; - that both open and close a port; - that `sceAudioInHqOpenEx` accepts 256 samples at 16 kHz, which `sceAudioInHqOpen` rejects; - that the two setters return 0. Forwarding `sceAudioInHqOpenEx` to `sceAudioInHqOpen` instead makes both modes fail. `tools/check_conventions.py` is clean. No open PR touches these names or NIDs, and a three-way merge against every open PR touching these files (including #8889 on the debt file) adds no conflicts. ### 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](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes (Claude Code), reviewed by the contributor 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RbLgECLQ2bpDM7oe2urGZK
github-actions[bot] commented 2026-10-21 05:51:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-21T05:51:38Z.


Progress report (7ce3b1d → 50985e2)

📈 System libraries: 53.27% (+0.05%, +4 implemented functions)

✅ 4 implemented
Library Name
libSceAudioIn sceAudioInHqOpenEx
libSceAudioIn sceAudioInOpenEx
libSceAudioIn sceAudioInSetCompressorPreGain
libSceAudioIn sceAudioInSetNoiseGateThreshold
⚪ 2 behaviourally empty (constant return or throw)
Library Name
libSceAudioIn sceAudioInSetCompressorPreGain
libSceAudioIn sceAudioInSetNoiseGateThreshold
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6309102303 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8914#issuecomment-6309102303). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-21T05:51:38Z. --- <!-- progress-report --> ### Progress report (7ce3b1d → 50985e2) 📈 **System libraries**: 53.27% (+0.05%, +4 implemented functions) <details> <summary>✅ 4 implemented</summary> | Library | Name | | - | - | | libSceAudioIn | `sceAudioInHqOpenEx` | | libSceAudioIn | `sceAudioInOpenEx` | | libSceAudioIn | `sceAudioInSetCompressorPreGain` | | libSceAudioIn | `sceAudioInSetNoiseGateThreshold` | </details> <details> <summary>⚪ 2 behaviourally empty (constant return or throw)</summary> | Library | Name | | - | - | | libSceAudioIn | `sceAudioInSetCompressorPreGain` | | libSceAudioIn | `sceAudioInSetNoiseGateThreshold` | </details>
MarcZX10 commented 2026-10-21 05:55:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T05:55:24Z.

Review: APPROVED


The OpenEx signatures and forwarding behavior are tied to the stated PS5 12.00 disassembly evidence, and the HqOpenEx path correctly avoids the stricter 128/48 kHz checks in sceAudioInHqOpen. The regression covers that distinction, including 256 samples at 16 kHz, and exercises the setters. I reviewed the diff and the reported full Linux build / 546-test run; I did not independently run the audio test in this environment. No blocker found.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5595506379 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8914#pullrequestreview-5595506379). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T05:55:24Z. **Review:** APPROVED --- The `OpenEx` signatures and forwarding behavior are tied to the stated PS5 12.00 disassembly evidence, and the `HqOpenEx` path correctly avoids the stricter 128/48 kHz checks in `sceAudioInHqOpen`. The regression covers that distinction, including 256 samples at 16 kHz, and exercises the setters. I reviewed the diff and the reported full Linux build / 546-test run; I did not independently run the audio test in this environment. No blocker found.
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!8914
No description provided.