feat(libSceAudioPropagation): render silence for propagated sources #489

Merged
oneandonlydean merged 2 commits from upstream-pr/489 into main 2026-10-04 22:44:06 +00:00
oneandonlydean commented 2026-10-04 07:11:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T07:11:06Z.


Title: feat(libSceAudioPropagation): render silence for propagated sources

What

The SourceRender follow-up to #482 that @ThisIsAkill asked for (comment). The branch is stacked on #482's head (ac66e708), so until #482 merges GitHub shows its commit here too; this PR is the last commit only.

#482 leaves sceAudioPropagationSourceRender throwing. In PPSA21564 the audio engine calls it from each propagated source's voice callback, once per audio grain, so a level with a propagated source stops at the first one that plays.

Signature, from the only call site in PPSA21564 (0xf5283e) and PPSA21567 (0xf6efde, see the correction on #481): (Handle system, const RenderInfo* infos, u32 count), with count 1 at both. RenderInfo is {0x010107d6, 0x30}: source handle at +0x10, output buffer at +0x18, buffer size in bytes at +0x20 (grains * 64), and a u32 at +0x28 that both titles set to 2.

Behaviour, in #482's model (no acoustic propagation, invalid input throws std::invalid_argument):

  • Every RenderInfo is checked before anything is written: its descriptor, that its source is a live source of system (requireObject, as the other source calls do), and a non-null output with a non-zero size.
  • Each output buffer is then zeroed for its size and the call returns 0. Without propagation a source contributes nothing, so its propagated output is silence. No dry signal is rendered. PPSA21564 clears the buffer itself before the call, so the result in the title is the same.
  • Throws for what is not modelled:
    • count 0 or a null array: both titles always pass 1 and no other value has been observed, so there is no evidence for what 0 should do.
    • a format word other than 2 (std::runtime_error): its meaning is unknown, and zeroes are only known to be silence for the format the titles use (PPSA21564 adds the buffer to a float bus afterwards).
  • TechnicalDebt: the silent-stub entry now says SourceRender writes silence, and the unknowns entry records the +0x28 word and the count.

Changes: RenderInfo and RenderFormat in AudioPropagation.hpp, the 3-argument declaration, the implementation in Export.cpp, the test, TechnicalDebt.

Tested

  • Linux (CachyOS, GCC 16.2): full build with BUILD_TESTING=ON; ctest passes (146/146 on #482 + this branch).
  • guest_audio_propagation (#482's test) gets SourceRender cases: one and two RenderInfos (each output zeroed for its own size and not past it), and the throwing cases (count 0, null array, unknown system, wrong descriptor id or size, a room instead of a source, another system's source, a destroyed source, null or empty output, format 1). The rejected calls leave every output untouched.
  • Fails without the change: with #482's throwing body (only the 3-argument signature, so the test compiles), the test ends with sceAudioPropagationSourceRender not implemented.
  • PPSA21564: the same SourceRender behaviour (descriptor and ownership checks, zero fill) has been in my integration branch since 2026-09-28, and the title runs into its levels with it. This branch itself was not run in the title.
  • Fork CI (Linux and Windows) passes.

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 in TechnicalDebt
  • 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: #482
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4732595468 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/489). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-04T07:11:06Z. --- Title: feat(libSceAudioPropagation): render silence for propagated sources ### What The SourceRender follow-up to #482 that @ThisIsAkill asked for ([comment](https://github.com/boykopovar/AnyPS5/pull/482#issuecomment-5977218521)). The branch is stacked on #482's head (ac66e708), so until #482 merges GitHub shows its commit here too; this PR is the last commit only. #482 leaves `sceAudioPropagationSourceRender` throwing. In PPSA21564 the audio engine calls it from each propagated source's voice callback, once per audio grain, so a level with a propagated source stops at the first one that plays. Signature, from the only call site in PPSA21564 (0xf5283e) and PPSA21567 (0xf6efde, see the correction on #481): `(Handle system, const RenderInfo* infos, u32 count)`, with `count` 1 at both. `RenderInfo` is `{0x010107d6, 0x30}`: source handle at +0x10, output buffer at +0x18, buffer size in bytes at +0x20 (`grains * 64`), and a u32 at +0x28 that both titles set to 2. Behaviour, in #482's model (no acoustic propagation, invalid input throws `std::invalid_argument`): - Every `RenderInfo` is checked before anything is written: its descriptor, that its source is a live source of `system` (`requireObject`, as the other source calls do), and a non-null output with a non-zero size. - Each output buffer is then zeroed for its size and the call returns 0. Without propagation a source contributes nothing, so its propagated output is silence. No dry signal is rendered. PPSA21564 clears the buffer itself before the call, so the result in the title is the same. - Throws for what is not modelled: - `count` 0 or a null array: both titles always pass 1 and no other value has been observed, so there is no evidence for what 0 should do. - a format word other than 2 (`std::runtime_error`): its meaning is unknown, and zeroes are only known to be silence for the format the titles use (PPSA21564 adds the buffer to a float bus afterwards). - TechnicalDebt: the silent-stub entry now says SourceRender writes silence, and the unknowns entry records the +0x28 word and the count. Changes: `RenderInfo` and `RenderFormat` in `AudioPropagation.hpp`, the 3-argument declaration, the implementation in `Export.cpp`, the test, TechnicalDebt. ### Tested - Linux (CachyOS, GCC 16.2): full build with `BUILD_TESTING=ON`; `ctest` passes (146/146 on #482 + this branch). - `guest_audio_propagation` (#482's test) gets SourceRender cases: one and two `RenderInfo`s (each output zeroed for its own size and not past it), and the throwing cases (count 0, null array, unknown system, wrong descriptor id or size, a room instead of a source, another system's source, a destroyed source, null or empty output, format 1). The rejected calls leave every output untouched. - Fails without the change: with #482's throwing body (only the 3-argument signature, so the test compiles), the test ends with `sceAudioPropagationSourceRender not implemented`. - PPSA21564: the same SourceRender behaviour (descriptor and ownership checks, zero fill) has been in my integration branch since 2026-09-28, and the title runs into its levels with it. This branch itself was not run in the title. - Fork CI (Linux and Windows) passes. ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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: #482 - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-04 07:11:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T07:11:29Z.


Progress report (8a64778 → be3f06b)

📈 System libraries: 78.04% (+0.69%, +22 implemented functions)

✅ 22 implemented
Library Name
libSceAudioPropagation sceAudioPropagationPortalCreate
libSceAudioPropagation sceAudioPropagationPortalDestroy
libSceAudioPropagation sceAudioPropagationPortalSetAttributes
libSceAudioPropagation sceAudioPropagationRoomCreate
libSceAudioPropagation sceAudioPropagationRoomDestroy
libSceAudioPropagation sceAudioPropagationSourceCalculateAudioPaths
libSceAudioPropagation sceAudioPropagationSourceCreate
libSceAudioPropagation sceAudioPropagationSourceDestroy
libSceAudioPropagation sceAudioPropagationSourceGetAudioPath
libSceAudioPropagation sceAudioPropagationSourceGetAudioPathCount
libSceAudioPropagation sceAudioPropagationSourceGetRays
libSceAudioPropagation sceAudioPropagationSourceRender
libSceAudioPropagation sceAudioPropagationSourceSetAttributes
libSceAudioPropagation sceAudioPropagationSourceSetAudioPaths
libSceAudioPropagation sceAudioPropagationSystemCreate
libSceAudioPropagation sceAudioPropagationSystemDestroy
libSceAudioPropagation sceAudioPropagationSystemGetRays
libSceAudioPropagation sceAudioPropagationSystemQueryMemory
libSceAudioPropagation sceAudioPropagationSystemRegisterMaterial
libSceAudioPropagation sceAudioPropagationSystemSetAttributes
libSceAudioPropagation sceAudioPropagationSystemSetRays
libSceAudioPropagation sceAudioPropagationSystemUnregisterMaterial
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5977595623 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/489#issuecomment-5977595623). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-04T07:11:29Z. --- <!-- progress-report --> ### Progress report (8a64778 → be3f06b) 📈 **System libraries**: 78.04% (+0.69%, +22 implemented functions) <details> <summary>✅ 22 implemented</summary> | Library | Name | | - | - | | libSceAudioPropagation | `sceAudioPropagationPortalCreate` | | libSceAudioPropagation | `sceAudioPropagationPortalDestroy` | | libSceAudioPropagation | `sceAudioPropagationPortalSetAttributes` | | libSceAudioPropagation | `sceAudioPropagationRoomCreate` | | libSceAudioPropagation | `sceAudioPropagationRoomDestroy` | | libSceAudioPropagation | `sceAudioPropagationSourceCalculateAudioPaths` | | libSceAudioPropagation | `sceAudioPropagationSourceCreate` | | libSceAudioPropagation | `sceAudioPropagationSourceDestroy` | | libSceAudioPropagation | `sceAudioPropagationSourceGetAudioPath` | | libSceAudioPropagation | `sceAudioPropagationSourceGetAudioPathCount` | | libSceAudioPropagation | `sceAudioPropagationSourceGetRays` | | libSceAudioPropagation | `sceAudioPropagationSourceRender` | | libSceAudioPropagation | `sceAudioPropagationSourceSetAttributes` | | libSceAudioPropagation | `sceAudioPropagationSourceSetAudioPaths` | | libSceAudioPropagation | `sceAudioPropagationSystemCreate` | | libSceAudioPropagation | `sceAudioPropagationSystemDestroy` | | libSceAudioPropagation | `sceAudioPropagationSystemGetRays` | | libSceAudioPropagation | `sceAudioPropagationSystemQueryMemory` | | libSceAudioPropagation | `sceAudioPropagationSystemRegisterMaterial` | | libSceAudioPropagation | `sceAudioPropagationSystemSetAttributes` | | libSceAudioPropagation | `sceAudioPropagationSystemSetRays` | | libSceAudioPropagation | `sceAudioPropagationSystemUnregisterMaterial` | </details>
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!489
No description provided.