fix(libSceAudioOut): open a port for any index in sceAudioOutOpen #16542

Merged
xXPBSXx merged 2 commits from upstream-pr/16542 into main 2026-11-07 13:19:00 +00:00
xXPBSXx commented 2026-11-07 02:24:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by xXPBSXx on 2026-11-07T02:24:49Z.


What

sceAudioOutOpen throws when its third argument, the index, is not 0. A PS5 opens the port for any index that was tried: a homebrew payload process on firmware 11.60 opened a main port (type 0) for index 1, 2, 3, 7, 8, 255 and -1, and a type 1 port for index 1, and closing each returned 0. The index no longer causes a throw; what the console does with it besides opening is not measured. A title process was not measured either, and no known title opens an index other than 0: every direct call in the titles checked for the debt entry passes the constant 0, except one that is not shown to be a constant. The debt entry now records the measurement.

Each open still gets its own port, as with index 0; the index is not stored anywhere.

Tested

Measured on a PS5 with firmware 11.60 (kernel_get_fw_version 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr), on 2026-11-06 at 17:49 UTC and 18:20 UTC (index 1 and 2, two runs, identical) and at 20:35 UTC (the other values). A title process may differ.

sceAudioOutOpen(0xff, type, index, len, 48000, param) PS5, payload process, firmware 11.60 main this change
type 0, index 1 or 2, len 1024, param 1 opens, close returns 0 throws opens
type 0, index 3, 7, 8, 255 or -1, len 1024, param 1 opens, close returns 0 throws opens
type 1, index 1, len 256, param 5 opens, close returns 0 throws opens

The new test audio_out_buffer_size_any_index opens and closes ports with index 1, 2, 255 and -1. On Ubuntu 24.04 under WSL2 with GCC 13.3.0 and an AddressSanitizer build, on main c643163045 and on this change on the same main, it fails on main (sceAudioOutOpen: index != 0 not supported) and passes with this change; the other seven audio_out_buffer_size_* tests pass on both. All 65 audio_out* tests pass with this change. tools/check_conventions.py --base upstream/main passes. The probe sources and their raw output are in the first comment.

Overlap: the 12 open pull requests that change one of the four files were checked on 2026-11-07 between 00:35 UTC and 00:55 UTC against main ad8e79fd81, together with all 497 open pull requests updated since 21:20 UTC on 2026-11-06 (none of those outside the 12 changes these files). Four of the 12 already conflict with main without this change, and none conflicts because of this change. At 01:55 UTC all 12 were still open, main had moved to 5dbc24eaea without a commit that changes these files, this change still merges into it without a conflict, and of the 203 pull requests updated since 00:30 UTC only #12315 (one of the 12) changes them. #12863 adds a mode to the same foreach list in CMakeLists.txt, so the new test is registered on its own line instead.

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 (audio change)
  • AI-assisted: yes

AI-assisted (Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5197579836 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/16542). Originally posted by [xXPBSXx](https://github.com/xXPBSXx) on 2026-11-07T02:24:49Z. --- ### What `sceAudioOutOpen` throws when its third argument, the index, is not 0. A PS5 opens the port for any index that was tried: a homebrew payload process on firmware 11.60 opened a main port (type 0) for index 1, 2, 3, 7, 8, 255 and -1, and a type 1 port for index 1, and closing each returned 0. The index no longer causes a throw; what the console does with it besides opening is not measured. A title process was not measured either, and no known title opens an index other than 0: every direct call in the titles checked for the debt entry passes the constant 0, except one that is not shown to be a constant. The debt entry now records the measurement. Each open still gets its own port, as with index 0; the index is not stored anywhere. ### Tested Measured on a PS5 with firmware 11.60 (`kernel_get_fw_version` 0x11600005), from a homebrew payload process (ps5-payload-sdk v0.45, elfldr), on 2026-11-06 at 17:49 UTC and 18:20 UTC (index 1 and 2, two runs, identical) and at 20:35 UTC (the other values). A title process may differ. | `sceAudioOutOpen(0xff, type, index, len, 48000, param)` | PS5, payload process, firmware 11.60 | `main` | this change | |---|---|---|---| | type 0, index 1 or 2, len 1024, param 1 | opens, close returns 0 | throws | opens | | type 0, index 3, 7, 8, 255 or -1, len 1024, param 1 | opens, close returns 0 | throws | opens | | type 1, index 1, len 256, param 5 | opens, close returns 0 | throws | opens | The new test `audio_out_buffer_size_any_index` opens and closes ports with index 1, 2, 255 and -1. On Ubuntu 24.04 under WSL2 with GCC 13.3.0 and an AddressSanitizer build, on `main` `c643163045` and on this change on the same `main`, it fails on `main` (`sceAudioOutOpen: index != 0 not supported`) and passes with this change; the other seven `audio_out_buffer_size_*` tests pass on both. All 65 `audio_out*` tests pass with this change. `tools/check_conventions.py --base upstream/main` passes. The probe sources and their raw output are in the first comment. Overlap: the 12 open pull requests that change one of the four files were checked on 2026-11-07 between 00:35 UTC and 00:55 UTC against `main` `ad8e79fd81`, together with all 497 open pull requests updated since 21:20 UTC on 2026-11-06 (none of those outside the 12 changes these files). Four of the 12 already conflict with `main` without this change, and none conflicts because of this change. At 01:55 UTC all 12 were still open, `main` had moved to `5dbc24eaea` without a commit that changes these files, this change still merges into it without a conflict, and of the 203 pull requests updated since 00:30 UTC only #12315 (one of the 12) changes them. #12863 adds a mode to the same `foreach` list in `CMakeLists.txt`, so the new test is registered on its own line instead. ### 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 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 <!-- #PR, or none --> - [x] Fixes: none <!-- issue it closes as Fixes #N, or none --> - [x] Unblocks: none <!-- title ID and Game bring-up discussion, e.g. PPSA01325 #3232, or none --> - [x] GPUs tested: n/a (audio change) <!-- for AGC, shader recompiler or VideoOut changes: vendor, model, driver and OS of each GPU the GPU tests ran on; otherwise n/a --> - [x] AI-assisted: yes <!-- yes / no --> AI-assisted (Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
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!16542
No description provided.