feat(audioout2): report supported user attributes #4893

Merged
Lorkydey merged 1 commit from upstream-pr/4893 into main 2026-10-13 08:31:47 +00:00
Lorkydey commented 2026-10-13 02:17:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Lorkydey on 2026-10-13T02:17:49Z.


What

Implement sceAudioOut2UserGetSupportedAttributes for the attributes supported by AnyPS5's AudioOut2 backend.

NHL 27 (PPSA34063, bring-up #4275) was reported in merged #4544 to load its modules and start its threads, then stop at:

sceAudioOut2UserGetSupportedAttributes not implemented

That query is still a throwing stub on the base of this PR, 37dd4830846182bff60c73a07a74fab4fb8c1c60. This title evidence is from #4544; NHL 27 has not been rerun with this change.

The query takes a user handle and two uint32_t* outputs. It reports context mask 0 (no context attributes are applied) and port mask 3 (PCM data, bit 0; per-channel gain, bit 1). Those are the attributes AudioOut2PortSetAttributes currently applies. User creation and destruction now maintain a locked live-handle registry, so the query rejects unknown and destroyed handles. Null outputs also throw, before writing either output.

The signature and attribute IDs follow SharpProspero; KytyPS5 also implements these as two 32-bit capability masks. The returned masks describe AnyPS5's existing implementation, not capabilities measured on a PS5. Validation order and console error values are unknown, so unsupported calls throw. Port ownership and busy-user destruction remain outside this change. These limits are recorded in the library's technical debt.

The existing audio_out2_port_layouts test now checks live, invalid and destroyed user handles, independent users, a query from another thread, null outputs without partial writes, and guard words around both 32-bit outputs. Its existing SDL disk-output checks exercise the advertised PCM data and per-channel gain, including multichannel folds.

Overlap audit: no open PR changes either implementation file or the test file, and none implements this query. There is one documentation-only collision with #4860: both update different resolved functions in the same old grouped debt entry. Neither implementation depends on the other. Proposed merge order: #4860 first, then this PR, pending confirmation from its author. The checklist dependency records that order only. After #4860 lands, the rebase must keep both resolved functions removed from the grouped entry while retaining the new AudioOut2 limitations. Pairwise git merge-tree of 1970bcb2f and #4860's c29a5ad99 confirms that only this debt file conflicts; no combined runtime validation is claimed.

Tested

  • Windows 11, WinLibs MinGW-w64 GCC 15.2, Ninja, Release, BUILD_TESTING=ON: built libs, relinker, and all four selected test executables. audio_out2_port_layouts, audio_out2_port_buffers, audio_out2_latency, and patched_libraries each pass five consecutive runs.
  • Negative control on Windows: kept the new test and restored AudioOut2User.cpp and AudioOut2System.cpp from main. audio_out2_port_layouts fails at the unimplemented supported-attributes query. Restoring the PR sources and rebuilding makes all four tests pass five times again. Both restored source files are identical on the tested baseline and the rebased main.
  • Ubuntu 24.04, GCC 13, Ninja, Release: fork validation run on the exact PR head 1970bcb2f874beec94e47b3ac2738dcd83aac3b0 passes. Built libs, relinker, and the four test executables; all four tests pass five times. The same negative control fails at the missing query on main; after restoring the exact PR sources, all four tests pass five times again.
  • python tools/check_conventions.py --base origin/main, test registration, and git diff --check pass.
  • NHL 27, PS5 hardware behavior, and the full CTest suite were not tested here. Full upstream build jobs require a maintainer's manual dispatch; the Linux run linked above is on my fork.

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: #4860 (proposed merge order for the debt entry only; author confirmation pending)
  • Unblocks: PPSA34063 #4275 (reported stop; title not rerun here)
  • AI-assisted: yes (Codex)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4837419929 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4893). Originally posted by [Lorkydey](https://github.com/Lorkydey) on 2026-10-13T02:17:49Z. --- ### What Implement `sceAudioOut2UserGetSupportedAttributes` for the attributes supported by AnyPS5's AudioOut2 backend. NHL 27 (PPSA34063, bring-up #4275) was reported in merged #4544 to load its modules and start its threads, then stop at: ```text sceAudioOut2UserGetSupportedAttributes not implemented ``` That query is still a throwing stub on the base of this PR, `37dd4830846182bff60c73a07a74fab4fb8c1c60`. This title evidence is from #4544; NHL 27 has not been rerun with this change. The query takes a user handle and two `uint32_t*` outputs. It reports context mask `0` (no context attributes are applied) and port mask `3` (PCM data, bit 0; per-channel gain, bit 1). Those are the attributes `AudioOut2PortSetAttributes` currently applies. User creation and destruction now maintain a locked live-handle registry, so the query rejects unknown and destroyed handles. Null outputs also throw, before writing either output. The signature and attribute IDs follow [SharpProspero](https://github.com/SvenGDK/SharpProspero/blob/5dfdb4b0b166e83dc9ae275001afb695f12c7174/src/SharpProspero/Interop/Audio/AudioOut2.cs); [KytyPS5](https://github.com/KytyPS5/KytyPS5/blob/df5b9b92be7dfd463b47756b707d6d356a9f0550/src/libs/libAudio2.cpp) also implements these as two 32-bit capability masks. The returned masks describe AnyPS5's existing implementation, not capabilities measured on a PS5. Validation order and console error values are unknown, so unsupported calls throw. Port ownership and busy-user destruction remain outside this change. These limits are recorded in the library's technical debt. The existing `audio_out2_port_layouts` test now checks live, invalid and destroyed user handles, independent users, a query from another thread, null outputs without partial writes, and guard words around both 32-bit outputs. Its existing SDL disk-output checks exercise the advertised PCM data and per-channel gain, including multichannel folds. Overlap audit: no open PR changes either implementation file or the test file, and none implements this query. There is one documentation-only collision with #4860: both update different resolved functions in the same old grouped debt entry. Neither implementation depends on the other. Proposed merge order: #4860 first, then this PR, pending confirmation from its author. The checklist dependency records that order only. After #4860 lands, the rebase must keep both resolved functions removed from the grouped entry while retaining the new AudioOut2 limitations. Pairwise `git merge-tree` of `1970bcb2f` and #4860's `c29a5ad99` confirms that only this debt file conflicts; no combined runtime validation is claimed. ### Tested - Windows 11, WinLibs MinGW-w64 GCC 15.2, Ninja, Release, `BUILD_TESTING=ON`: built `libs`, `relinker`, and all four selected test executables. `audio_out2_port_layouts`, `audio_out2_port_buffers`, `audio_out2_latency`, and `patched_libraries` each pass five consecutive runs. - Negative control on Windows: kept the new test and restored `AudioOut2User.cpp` and `AudioOut2System.cpp` from `main`. `audio_out2_port_layouts` fails at the unimplemented supported-attributes query. Restoring the PR sources and rebuilding makes all four tests pass five times again. Both restored source files are identical on the tested baseline and the rebased `main`. - Ubuntu 24.04, GCC 13, Ninja, Release: [fork validation run](https://github.com/Lorkydey/AnyPS5/actions/runs/38335364046) on the exact PR head `1970bcb2f874beec94e47b3ac2738dcd83aac3b0` passes. Built `libs`, `relinker`, and the four test executables; all four tests pass five times. The same negative control fails at the missing query on `main`; after restoring the exact PR sources, all four tests pass five times again. - `python tools/check_conventions.py --base origin/main`, test registration, and `git diff --check` pass. - NHL 27, PS5 hardware behavior, and the full CTest suite were not tested here. Full upstream build jobs require a maintainer's manual dispatch; the Linux run linked above is on my fork. ### 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: #4860 (proposed merge order for the debt entry only; author confirmation pending) - [x] Unblocks: PPSA34063 #4275 (reported stop; title not rerun here) - [x] AI-assisted: yes (Codex)
github-actions[bot] commented 2026-10-13 02:18:10 +00:00 (Migrated from github.com)

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


Progress report (e96bfff → 87ee824)

📈 System libraries: 88.3% (+0.02%, +1 implemented functions)

✅ 1 implemented
Library Name
libSceAudioOut sceAudioOut2UserGetSupportedAttributes
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136764931 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4893#issuecomment-6136764931). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T02:18:10Z. --- <!-- progress-report --> ### Progress report (e96bfff → 87ee824) 📈 **System libraries**: 88.3% (+0.02%, +1 implemented functions) <details> <summary>✅ 1 implemented</summary> | Library | Name | | - | - | | libSceAudioOut | `sceAudioOut2UserGetSupportedAttributes` | </details>
Lorkydey commented 2026-10-13 03:18:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Lorkydey on 2026-10-13T03:18:10Z.


@jagrat04 The bot's overlap between #4893 and #4860 is limited to the grouped entry in docs/dev/debt/libSceAudioOut.md; the implementations and tests do not overlap. A pairwise merge check of 1970bcb2f and c29a5ad99 confirms this.

I propose #4860 first, then #4893, and have recorded that proposed merge order in my checklist. After yours lands, I will rebase mine, keeping both sceNpEntitlementAccessGetPftFlag and sceAudioOut2UserGetSupportedAttributes removed from the old unresolved list and retaining the new AudioOut2 limitations. Does that order work for you? This is a documentation merge-order dependency, with no runtime dependency or combined runtime validation claimed.

AI-assisted: yes (Codex).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6137427670 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4893#issuecomment-6137427670). Originally posted by [Lorkydey](https://github.com/Lorkydey) on 2026-10-13T03:18:10Z. --- @jagrat04 The bot's overlap between #4893 and #4860 is limited to the grouped entry in `docs/dev/debt/libSceAudioOut.md`; the implementations and tests do not overlap. A pairwise merge check of `1970bcb2f` and `c29a5ad99` confirms this. I propose #4860 first, then #4893, and have recorded that proposed merge order in my checklist. After yours lands, I will rebase mine, keeping both `sceNpEntitlementAccessGetPftFlag` and `sceAudioOut2UserGetSupportedAttributes` removed from the old unresolved list and retaining the new AudioOut2 limitations. Does that order work for you? This is a documentation merge-order dependency, with no runtime dependency or combined runtime validation claimed. AI-assisted: yes (Codex).
adriadam10 commented 2026-10-13 08:25:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T08:25:21Z.


Checked the build and audio_out2_port_layouts plus the other libSceAudioOut tests (green); the new test fails without the change. Masks match KytyPS5 minus ambisonics, which isn't implemented here. Rebased onto main to resolve the debt-file conflict with #4860 (kept sceNpEntitlementAccessGetPftFlag out of the remaining list); merging once CI is green.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6141462665 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4893#issuecomment-6141462665). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-13T08:25:21Z. --- Checked the build and `audio_out2_port_layouts` plus the other libSceAudioOut tests (green); the new test fails without the change. Masks match KytyPS5 minus ambisonics, which isn't implemented here. Rebased onto main to resolve the debt-file conflict with #4860 (kept `sceNpEntitlementAccessGetPftFlag` out of the remaining list); merging once CI is green.
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!4893
No description provided.