feat(libSceAudio3d): mix the bed and deliver audio through AudioOut #5259

Closed
011010 wants to merge 15 commits from upstream-pr/5259 into main
011010 commented 2026-10-13 15:53:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by 011010 on 2026-10-13T15:53:10Z.


What

Implement the non-positional (bed) audio path of libSceAudio3d and give it a real output:

  • A pure, header-only mixer (Mixer.hpp): linear-balance pan (unity at centre), 5.1/7.1 downmix to stereo, S16/float input.
  • sceAudio3dBedWrite and sceAudio3dBedWrite2: validate and copy the bed PCM.
  • sceAudio3dPortAdvance mixes the bed into a frame; sceAudio3dPortPush lazily opens an AudioOut type-126 port and delivers the frames (libSceAudioOut, new PRIVATE link).
  • The explicit sceAudio3dAudioOut{Open,Close,Output,Outputs} exports queue into associated ports that Push/Flush drain, with queue_depth backpressure.
  • sceAudio3dObjectSetAttribute, sceAudio3dPortGetParameters, sceAudio3dStrError, sceAudio3dPortGetAttributesSupported.
  • The remaining libSceAudio3d exports are NotImplemented stubs.
  • Technical debt records the unknown PS5 object-attribute ABI.

Tested

Linux (Ubuntu 24.04 x86-64). Full build; guest_audio3d_parameters, guest_audio3d_port and guest_audio3d_mixer pass, plus audio_out. Verified by hand that the new exports carry the expected auto-NIDs. The wider suite has failures only in this sandbox (userfaultfd denied, produced-binary execution), in unrelated areas. Not tested against a title: no catalogued title drives libSceAudio3d yet, so object PCM/GAIN/POSITION are validated but produce no audio (ABI unknown).

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 listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository
  • New third-party code is a submodule built from source (none added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4845872321 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5259). Originally posted by [011010](https://github.com/011010) on 2026-10-13T15:53:10Z. --- ### What Implement the non-positional (bed) audio path of libSceAudio3d and give it a real output: - A pure, header-only mixer (`Mixer.hpp`): linear-balance pan (unity at centre), 5.1/7.1 downmix to stereo, S16/float input. - `sceAudio3dBedWrite` and `sceAudio3dBedWrite2`: validate and copy the bed PCM. - `sceAudio3dPortAdvance` mixes the bed into a frame; `sceAudio3dPortPush` lazily opens an AudioOut type-126 port and delivers the frames (`libSceAudioOut`, new PRIVATE link). - The explicit `sceAudio3dAudioOut{Open,Close,Output,Outputs}` exports queue into associated ports that Push/Flush drain, with queue_depth backpressure. - `sceAudio3dObjectSetAttribute`, `sceAudio3dPortGetParameters`, `sceAudio3dStrError`, `sceAudio3dPortGetAttributesSupported`. - The remaining libSceAudio3d exports are `NotImplemented` stubs. - Technical debt records the unknown PS5 object-attribute ABI. ### Tested Linux (Ubuntu 24.04 x86-64). Full build; `guest_audio3d_parameters`, `guest_audio3d_port` and `guest_audio3d_mixer` pass, plus `audio_out`. Verified by hand that the new exports carry the expected auto-NIDs. The wider suite has failures only in this sandbox (userfaultfd denied, produced-binary execution), in unrelated areas. Not tested against a title: no catalogued title drives libSceAudio3d yet, so object PCM/GAIN/POSITION are validated but produce no audio (ABI unknown). ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs listed in TechnicalDebt - [x] No notes, investigation `.md` files or images added to the repository - [x] New third-party code is a submodule built from source (none added) - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-13 15:53:59 +00:00 (Migrated from github.com)

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


Progress report (9d0a41d → fcc19aa)

📉 System libraries: 87.8% (-0.35%, +10 implemented, +16 declared functions)

✅ 10 implemented
Library Name
libSceAudio3d sceAudio3dAudioOutClose
libSceAudio3d sceAudio3dAudioOutOpen
libSceAudio3d sceAudio3dAudioOutOutput
libSceAudio3d sceAudio3dAudioOutOutputs
libSceAudio3d sceAudio3dBedWrite
libSceAudio3d sceAudio3dBedWrite2
libSceAudio3d sceAudio3dObjectSetAttribute
libSceAudio3d sceAudio3dPortGetAttributesSupported
libSceAudio3d sceAudio3dPortGetParameters
libSceAudio3d sceAudio3dStrError
🆕 16 declared as stubs
Library Name
libSceAudio3d sceAudio3dCreateSpeakerArray
libSceAudio3d sceAudio3dDeleteSpeakerArray
libSceAudio3d sceAudio3dGetSpeakerArrayMemorySize
libSceAudio3d sceAudio3dGetSpeakerArrayMixCoefficients
libSceAudio3d sceAudio3dGetSpeakerArrayMixCoefficients2
libSceAudio3d sceAudio3dPortCreate
libSceAudio3d sceAudio3dPortDestroy
libSceAudio3d sceAudio3dPortFreeState
libSceAudio3d sceAudio3dPortGetBufferLevel
libSceAudio3d sceAudio3dPortGetState
libSceAudio3d sceAudio3dPortGetStatus
libSceAudio3d sceAudio3dPortOpenEx
libSceAudio3d sceAudio3dPortQueryDebug
libSceAudio3d sceAudio3dReportRegisterHandler
libSceAudio3d sceAudio3dReportUnregisterHandler
libSceAudio3d sceAudio3dSetGpuRenderer
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6149572724 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5259#issuecomment-6149572724). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-13T15:53:59Z. --- <!-- progress-report --> ### Progress report (9d0a41d → fcc19aa) 📉 **System libraries**: 87.8% (-0.35%, +10 implemented, +16 declared functions) <details> <summary>✅ 10 implemented</summary> | Library | Name | | - | - | | libSceAudio3d | `sceAudio3dAudioOutClose` | | libSceAudio3d | `sceAudio3dAudioOutOpen` | | libSceAudio3d | `sceAudio3dAudioOutOutput` | | libSceAudio3d | `sceAudio3dAudioOutOutputs` | | libSceAudio3d | `sceAudio3dBedWrite` | | libSceAudio3d | `sceAudio3dBedWrite2` | | libSceAudio3d | `sceAudio3dObjectSetAttribute` | | libSceAudio3d | `sceAudio3dPortGetAttributesSupported` | | libSceAudio3d | `sceAudio3dPortGetParameters` | | libSceAudio3d | `sceAudio3dStrError` | </details> <details> <summary>🆕 16 declared as stubs</summary> | Library | Name | | - | - | | libSceAudio3d | `sceAudio3dCreateSpeakerArray` | | libSceAudio3d | `sceAudio3dDeleteSpeakerArray` | | libSceAudio3d | `sceAudio3dGetSpeakerArrayMemorySize` | | libSceAudio3d | `sceAudio3dGetSpeakerArrayMixCoefficients` | | libSceAudio3d | `sceAudio3dGetSpeakerArrayMixCoefficients2` | | libSceAudio3d | `sceAudio3dPortCreate` | | libSceAudio3d | `sceAudio3dPortDestroy` | | libSceAudio3d | `sceAudio3dPortFreeState` | | libSceAudio3d | `sceAudio3dPortGetBufferLevel` | | libSceAudio3d | `sceAudio3dPortGetState` | | libSceAudio3d | `sceAudio3dPortGetStatus` | | libSceAudio3d | `sceAudio3dPortOpenEx` | | libSceAudio3d | `sceAudio3dPortQueryDebug` | | libSceAudio3d | `sceAudio3dReportRegisterHandler` | | libSceAudio3d | `sceAudio3dReportUnregisterHandler` | | libSceAudio3d | `sceAudio3dSetGpuRenderer` | </details>
oneandonlydean commented 2026-10-14 02:30:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-14T02:30:43Z.


Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6159561855 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/5259#issuecomment-6159561855). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-14T02:30:43Z. --- Closing: no title is known to reach this. With the queue at 700+ open PRs, please hold off on new PRs that don't name a title needing the change until it's down. If a title stops on this on current main, reopen with the title ID and the log line.

Pull request closed

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!5259
No description provided.