feat(libSceAudioPropagation): implement the no-acoustic-propagation path with recovered signatures #482
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/482"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-03T21:29:15Z.
What
Implements
libSceAudioPropagationas an explicit no-acoustic-propagation path, using the call shapes recovered from PPSA21567 (Astro Bot) in #481. Every export either has defined behaviour or throws.Signature corrections to the assumed declarations:
(Handle object)(Handle system, Handle object)(Handle, const void*)(Handle, const Attribute*, u32 count)(Handle, const void* params, Handle* out)(Handle system, Handle* out)(Handle system, u32 id)(Handle material)(Handle, u32, void*)(Handle source, u32 index, Handle* out)(out type assumed)(Handle, const void*)(Handle source, const Ray*, u32 rayCount, u32, void* paths, u32 pathCount)(Handle source, const void*, void*)(Handle system, const RenderInfo*)The other 15 match the existing declarations. Struct descriptor ids and sizes (
{u32 id; size_t size}at +0, written by the title) are checked on entry:SystemMemory0x010107d4/0x30,Material0x010107d1/0x40,PortalParams0x010107d8/0x60.Attributeis 0x20 bytes.Model:
SystemQueryMemoryreports 16 bytes of CPU memory and no GPU memory.SystemCreatekeeps a header in that title-owned memory, and the system handle is its address. The title frees the memory only afterSystemDestroy.GetRaysreports 0) and sources report 0 audio paths. Non-empty ray results, path calculation and audio paths throw, andSourceGetAudioPathreports any index as out of range. A direct path is not reported, because the 0xe0-byte path record layout is unknown.SourceRenderstays unimplemented.eax != 0), so invalid input throwsstd::invalid_argument.SystemDestroy, so the order is not proven for every object.Documented in TechnicalDebt (a silent-stub entry like libSceHmd's, plus the unknowns). Signatures come from the title's own calls, cross-checked as facts against KytyPS5 and sharpemu (no code taken). Repositories that appear to contain decompiled system libraries were not used.
Tested
ctest146/146 onmain+ this branch, including the newguest_audio_propagationtest (lifecycle, descriptor and attribute validation, handle kinds, orphaned destroys, throwing paths).mainwith #285, #290 and local changes (not cleanmain): the title previously stopped atsceAudioPropagationSystemQueryMemory not implemented. With this PR, its AudioPropagation calls pass without a throw and it runs on to an unrelated libSceFont export. Audio output was not checked (the runs were on a virtual display).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repositoryRefs #481 (recovered signatures and how they were obtained).
🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-04T05:15:45Z.
Thanks for writing these up. I recovered the same API from PPSA21564 (the other region of the title you used, PPSA21567) for my integration branch, reading the argument setup at each call site. I also find 27 call sites for the 22 imports, and my call shapes match yours for 20 of the 22. The two where #481 and my branch disagreed are below. Addresses are PPSA21564 eboot vaddrs (text at vaddr 0, file offset +0x4000).
SystemUnregisterMaterial:
(Handle material), as in #481. My branch had(Handle system, Handle material), which is wrong; I have a fix ready for it. Both call sites set only rdi:mov rdi,[r14+0x18]then call. rsi is not written in the loop.mov rdi,r12wherer12 = [node+0x18], the handle RegisterMaterial wrote through its rdx out pointer (0xf45e44, stored at 0xf45e7e). rsi at the call is a hash bucket pointer. The system handle[rbx]is passed to RegisterMaterial in the same function (0xf45e58) but not to Unregister.SourceRender:
(Handle system, const RenderInfo*, u32 count). There is a third argument, and the title passes 1. Only call site, 0xf5283e:The RenderInfo layout matches yours. A few details: +0x18 is the source's output buffer, +0x20 is
m_numOfGrains * 64bytes, and +0x28 is 2. Afterwards the title addsgrains * 16floats from that buffer into a bus (0xf52910). So I read it as 16 floats per sample frame, but I have not worked out what format 2 means. The result is only tested!= 0, and a failure just logssceAudioPropagationSourceRender failed.#482 leaves SourceRender throwing, and in PPSA21564 that is reached as soon as a propagated source plays. Reading the code, the call sits in the audio engine's per-voice callback (a std::function that asserts
numSamples == m_numOfGrains), so it runs every audio grain for each propagated source with input. I did not measure the frequency at runtime. Just before each render, the title passes that source's mono input through SourceSetAttributes (attribute 4).My branch implements SourceRender with no propagation: for each of the
countRenderInfos it checks the descriptor (0x010107d6 / 0x30) and that the source belongs to the system, zero-fills the output buffer for the given size, and returns 0. The title already clears that buffer before the call, so in practice the propagation output is silence and the title carries on. It does not render a dry signal. I can send that as a follow-up to #482 if useful, rather than a competing PR.Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-04T05:33:27Z.
Progress report (
ccd60ce→ac66e70)📈 System libraries: 77.94% (+0.66%, +21 implemented functions)
✅ 21 implemented
sceAudioPropagationPortalCreatesceAudioPropagationPortalDestroysceAudioPropagationPortalSetAttributessceAudioPropagationRoomCreatesceAudioPropagationRoomDestroysceAudioPropagationSourceCalculateAudioPathssceAudioPropagationSourceCreatesceAudioPropagationSourceDestroysceAudioPropagationSourceGetAudioPathsceAudioPropagationSourceGetAudioPathCountsceAudioPropagationSourceGetRayssceAudioPropagationSourceSetAttributessceAudioPropagationSourceSetAudioPathssceAudioPropagationSystemCreatesceAudioPropagationSystemDestroysceAudioPropagationSystemGetRayssceAudioPropagationSystemQueryMemorysceAudioPropagationSystemRegisterMaterialsceAudioPropagationSystemSetAttributessceAudioPropagationSystemSetRayssceAudioPropagationSystemUnregisterMaterialImported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-04T06:12:30Z.
Thanks for cross-checking this against PPSA21564.
Both points match PPSA21567.
SystemUnregisterMaterialtakes only the material handle.SourceRenderdoes have the third argument: the only call site setsmov edx,0x1at 0xf6efa5 before the call at 0xf6efde, and I had missed it. The RenderInfo fields there match yours: +0x18 output buffer, +0x20grains * 64bytes, +0x28 = 2. I've posted the correction on #481.On SourceRender in this PR and your follow-up offer, I'll come back to you shortly.
Imported from boykopovar/AnyPS5. Originally posted by ThisIsAkill on 2026-10-04T06:13:33Z.
Yes please, a follow-up on top of #482 for SourceRender would be great. Thanks again for catching the third argument. Your no-propagation version fits this PR's model (silence, with the descriptor and ownership checked), and it has been tested on PPSA21564, so it's better than leaving the export throwing.