libSceAudioPropagation: call signatures and struct layouts recovered from PPSA21567 #481

Closed
opened 2026-10-03 21:02:19 +00:00 by ThisIsAkill · 2 comments
ThisIsAkill commented 2026-10-03 21:02:19 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-03T21:02:19Z.


libSceAudioPropagation is unimplemented: all 22 exports throw, and TechnicalDebt says their signatures are assumed. PPSA21567 (Astro Bot) calls sceAudioPropagationSystemQueryMemory during audio init and stops there. Below are the call shapes recovered so nobody has to redo them, and where several of the assumed signatures differ.

How

  • From the title's side only, local and not published: the relinker registry gives each import's PLT stub, a byte scan finds the direct calls (27 sites, all in one wrapper), and the argument setup and the use of results were read at each site.
  • Cross-checked as facts (no code copied) against KytyPS5 (GPL-2.0) and sharpemu (GPL-2.0-or-later), which agree on the SystemMemory layout. Both only stub the API.
  • Not used: repositories that appear to contain decompiled system libraries.
  • The title tags every struct with a {u32 id; size_t size} descriptor at +0, which gives the struct sizes below.

Calls (handles are 8 bytes)

Function Recovered call Assumed in Export.cpp
SystemQueryMemory (const Options*, SystemMemory*) same
SystemCreate (const Options*, const SystemMemory*, Handle* out) same
SystemDestroy (Handle system), result not checked same
SystemSetAttributes (Handle system, const Attribute*, u32 count) same
SystemRegisterMaterial (Handle system, const Material*, Handle* out) same
SystemUnregisterMaterial (Handle material) (Handle system, u32 material_id)
SystemGetRays (Handle system, Ray* rays, u32* count), result not checked; the title recounts valid rays itself same
SystemSetRays (Handle system, const Ray*, u32 count) same
RoomCreate (Handle system, Handle* out) same
RoomDestroy (Handle system, Handle room) (Handle room)
PortalCreate (Handle system, const PortalParams*, Handle* out) same
PortalDestroy (Handle system, Handle portal) (Handle portal)
PortalSetAttributes (Handle portal, const Attribute*, u32 count) (Handle, const void*)
SourceCreate (Handle system, Handle* out) (Handle, const void* params, Handle* out)
SourceDestroy (Handle system, Handle source) (Handle source)
SourceSetAttributes (Handle source, const Attribute*, u32 count) (Handle, const void*)
SourceGetAudioPathCount (Handle source, u32* count) same
SourceGetAudioPath (Handle source, u32 index, Handle* out), called for index < count (Handle, u32, void*)
SourceGetRays (Handle source, Ray* rays, u32* count) same
SourceCalculateAudioPaths (Handle source, const Ray*, u32 rayCount, u32, PathData* paths /* 0xe0 each */, u32 pathCount) (Handle, const void*)
SourceSetAudioPaths (Handle source, const PathEntry*, u32 count) (Handle, const void*, u32)
SourceRender (Handle system, const RenderInfo*) (Handle source, const void*, void*)

Structs (descriptor id / size as the title writes them)

  • SystemMemory 0x010107d4 / 0x30: cpuMem +0x10, cpuSize +0x18, gpuMem +0x20, gpuSize +0x28. The title zeroes it and sets the descriptor before QueryMemory. It then reads only cpuSize, allocates that many bytes (16-aligned), zeroes them, stores the pointer at +0x10 and passes the struct to SystemCreate. The GPU fields are never touched.
  • Options: 0x38 bytes copied from a template in the title; one u32 is set at +0x20. Layout otherwise unknown.
  • Attribute: 0x20 bytes, {u32 id; void* value @+0x08; size_t valueSize @+0x10; u32 @+0x18 (0)}. Ids seen: system 0x20000 (8-byte value); source 7, 5 and others (8- and 16-byte values); portal: 4 attributes.
  • Material 0x010107d1 / 0x40. Ray 0x010107d7 / 0x58 (64 per system call, prepared by the title). PortalParams 0x010107d8 / 0x60 (four 16-byte rows at +0x10, then two room handles at +0x50/+0x58). RenderInfo 0x010107d6 / 0x30 (source handle +0x10, buffer +0x18, size +0x20, u32 +0x28). PathEntry 0x010107d9 / 0x28 (path handle +0x10, path data pointer +0x18, float +0x20 = 1.0).

Error handling

At every checked site the title only tests eax != 0. No error code value can be confirmed from its checks.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5693504585 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/481). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-03T21:02:19Z. --- libSceAudioPropagation is unimplemented: all 22 exports throw, and TechnicalDebt says their signatures are assumed. PPSA21567 (Astro Bot) calls `sceAudioPropagationSystemQueryMemory` during audio init and stops there. Below are the call shapes recovered so nobody has to redo them, and where several of the assumed signatures differ. ### How - From the title's side only, local and not published: the relinker registry gives each import's PLT stub, a byte scan finds the direct calls (27 sites, all in one wrapper), and the argument setup and the use of results were read at each site. - Cross-checked as facts (no code copied) against KytyPS5 (GPL-2.0) and sharpemu (GPL-2.0-or-later), which agree on the `SystemMemory` layout. Both only stub the API. - Not used: repositories that appear to contain decompiled system libraries. - The title tags every struct with a `{u32 id; size_t size}` descriptor at +0, which gives the struct sizes below. ### Calls (handles are 8 bytes) | Function | Recovered call | Assumed in `Export.cpp` | |---|---|---| | SystemQueryMemory | `(const Options*, SystemMemory*)` | same | | SystemCreate | `(const Options*, const SystemMemory*, Handle* out)` | same | | SystemDestroy | `(Handle system)`, result not checked | same | | SystemSetAttributes | `(Handle system, const Attribute*, u32 count)` | same | | SystemRegisterMaterial | `(Handle system, const Material*, Handle* out)` | same | | SystemUnregisterMaterial | `(Handle material)` | `(Handle system, u32 material_id)` | | SystemGetRays | `(Handle system, Ray* rays, u32* count)`, result not checked; the title recounts valid rays itself | same | | SystemSetRays | `(Handle system, const Ray*, u32 count)` | same | | RoomCreate | `(Handle system, Handle* out)` | same | | RoomDestroy | `(Handle system, Handle room)` | `(Handle room)` | | PortalCreate | `(Handle system, const PortalParams*, Handle* out)` | same | | PortalDestroy | `(Handle system, Handle portal)` | `(Handle portal)` | | PortalSetAttributes | `(Handle portal, const Attribute*, u32 count)` | `(Handle, const void*)` | | SourceCreate | `(Handle system, Handle* out)` | `(Handle, const void* params, Handle* out)` | | SourceDestroy | `(Handle system, Handle source)` | `(Handle source)` | | SourceSetAttributes | `(Handle source, const Attribute*, u32 count)` | `(Handle, const void*)` | | SourceGetAudioPathCount | `(Handle source, u32* count)` | same | | SourceGetAudioPath | `(Handle source, u32 index, Handle* out)`, called for index < count | `(Handle, u32, void*)` | | SourceGetRays | `(Handle source, Ray* rays, u32* count)` | same | | SourceCalculateAudioPaths | `(Handle source, const Ray*, u32 rayCount, u32, PathData* paths /* 0xe0 each */, u32 pathCount)` | `(Handle, const void*)` | | SourceSetAudioPaths | `(Handle source, const PathEntry*, u32 count)` | `(Handle, const void*, u32)` | | SourceRender | `(Handle system, const RenderInfo*)` | `(Handle source, const void*, void*)` | ### Structs (descriptor id / size as the title writes them) - `SystemMemory` 0x010107d4 / 0x30: `cpuMem` +0x10, `cpuSize` +0x18, `gpuMem` +0x20, `gpuSize` +0x28. The title zeroes it and sets the descriptor before `QueryMemory`. It then reads only `cpuSize`, allocates that many bytes (16-aligned), zeroes them, stores the pointer at +0x10 and passes the struct to `SystemCreate`. The GPU fields are never touched. - `Options`: 0x38 bytes copied from a template in the title; one u32 is set at +0x20. Layout otherwise unknown. - `Attribute`: 0x20 bytes, `{u32 id; void* value @+0x08; size_t valueSize @+0x10; u32 @+0x18 (0)}`. Ids seen: system 0x20000 (8-byte value); source 7, 5 and others (8- and 16-byte values); portal: 4 attributes. - `Material` 0x010107d1 / 0x40. `Ray` 0x010107d7 / 0x58 (64 per system call, prepared by the title). `PortalParams` 0x010107d8 / 0x60 (four 16-byte rows at +0x10, then two room handles at +0x50/+0x58). `RenderInfo` 0x010107d6 / 0x30 (source handle +0x10, buffer +0x18, size +0x20, u32 +0x28). `PathEntry` 0x010107d9 / 0x28 (path handle +0x10, path data pointer +0x18, float +0x20 = 1.0). ### Error handling At every checked site the title only tests `eax != 0`. No error code value can be confirmed from its checks. AI-assisted: yes.
ThisIsAkill commented 2026-10-04 06:12:29 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-04T06:12:29Z.


Correction to the table above: SourceRender takes a third argument, u32 count, and PPSA21567 passes 1. It is (Handle system, const RenderInfo*, u32 count), not (Handle system, const RenderInfo*).

In PPSA21567, the only call site (0xf6efde) sets edx before the call, which I missed:

f6ef9e  lea  rsi,[rbp-0xd0]        ; RenderInfo {0x010107d6, 0x30}
f6efa5  mov  edx,0x1               ; count
f6efdb  mov  rdi,QWORD PTR [rbx]   ; system
f6efde  call sceAudioPropagationSourceRender

The RenderInfo fields: +0x10 from [rbx+0xb0], +0x18 the output buffer, +0x20 [rbx+0x23d0] << 6 bytes, +0x28 = 2. Thanks to @oneandonlydean, who found the third argument in PPSA21564 (see #482).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5977211583 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/481#issuecomment-5977211583). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-04T06:12:29Z. --- Correction to the table above: `SourceRender` takes a third argument, `u32 count`, and PPSA21567 passes 1. It is `(Handle system, const RenderInfo*, u32 count)`, not `(Handle system, const RenderInfo*)`. In PPSA21567, the only call site (0xf6efde) sets `edx` before the call, which I missed: ``` f6ef9e lea rsi,[rbp-0xd0] ; RenderInfo {0x010107d6, 0x30} f6efa5 mov edx,0x1 ; count f6efdb mov rdi,QWORD PTR [rbx] ; system f6efde call sceAudioPropagationSourceRender ``` The RenderInfo fields: +0x10 from `[rbx+0xb0]`, +0x18 the output buffer, +0x20 `[rbx+0x23d0] << 6` bytes, +0x28 = 2. Thanks to @oneandonlydean, who found the third argument in PPSA21564 (see #482).
ThisIsAkill commented 2026-10-05 00:47:48 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-05T00:47:48Z.


Resolved by #482 and #489.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:5986222290 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/481#issuecomment-5986222290). Originally posted by [ThisIsAkill](https://github.com/ThisIsAkill) on 2026-10-05T00:47:48Z. --- Resolved by #482 and #489.
Sign in to join this conversation.
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#481
No description provided.