feat(libSceNgs2.native): reverb rack following the PS4 libSceNgs2 reverb #960
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/960"
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 JAB-dev on 2026-10-06T20:25:14Z.
What
sceNgs2RackCreatethrows for rack id0x2001(reverb). This adds the rack, with the reverb the console library renders.SceNgs2ReverbRackOption(rack option,max_channels,reverb_size). The defaults come from KytyPS5: 8 channels andreverb_size1.0x20010000setup takes input and output channel counts and flags. It accepts 1, 2, 6 or 8 channels; other counts are invalid arguments. Non-zero flags and differing input and output counts throw.0x20010001takesSceNgs2ReverbI3DL2Param(88 bytes). The layout of both params, and of the voice state, matches shadPS4'sngs2_reverb.h. Values are clamped to the library's ranges, as it does; NaN throws.sceNgs2VoiceGetStatereturns the common voice state.density.diffusion.hf_reference, then the wet and dry levels. The LFE channel passes dry.densityandreflection_patternare used.reverb_sizeis still not used. Only the default rack options are handled, and their 14400-sample buffer is used whateverreverb_sizesays.Reference
libSceNgs2.sprx, dumped and decrypted from a console. It was loaded on Windows with a small test loader and called directly; neither the loader nor the library is part of this PR. The reverb was read from its disassembly, and the test values are its output.libSceNgs2.sprx(the module titles import aslibSceNgs2): its code is still encrypted, so it hasn't been run yet. Its readable ELF headers match the PS4 library: the same.eh_frame_hdrsize (3,460 bytes, 431 functions) and code plus read-only data within 1% (321,328 bytes against 323,432).Tested
Windows 11, WinLibs GCC 15.2.0 r7, Release.
ngs2_renderTestReverbuses 8 cases with the PS4 library's output, to 2e-7 + 1e-5 of each value:Channel 3 is skipped: the PS4 mastering voice low-passes the LFE channel, and AnyPS5's doesn't yet.
TestReverbSetup: 3, 4, 5 and 7 channels are rejected; channel conversion, flags and NaN throw; the setup defaults render a non-zero level below 1e-8.On
mainthe tests fail, because rack 0x2001 throws. 25 mutations ofReverb.cppeach make them fail.Full ctest on this branch alone, merged with
main: 409/409.Seen in PPSA22520 (Animal Well): it creates the rack with default options, sets up a 2-in, 2-out voice, loads I3DL2 preset 9 ("cave" in the standard preset order) and patches it to its mastering voice. This version hasn't been played in game yet.
Linux not tested.
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 repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-06T21:20:43Z.
Thanks for the I3DL2 parameter work and the tests. I'm closing this one. The reverb isn't the console's algorithm:
INPUT_GAIN0.015,OUTPUT_GAIN3.0 and the early-tap gains);density,reflection_patternandreverb_sizeare accepted and then ignored;The project's rule is that a function either does what the console does or throws, so rack 0x2001 should keep throwing until there's a reference for its output.
If you find a reference, such as a trace or a disassembly of the console's reverb, please reopen.
Imported from boykopovar/AnyPS5. Originally posted by JAB-dev on 2026-10-09T15:49:29Z.
Opened again as #2336. It now follows the PS4 firmware 11.00 libSceNgs2 reverb, read from its code and checked against its output, so it has the reference this was closed for.
Pull request closed