libSceNgs2: rack id 0x4001 custom sampler is rejected (Dead Cells); fix branch ready #3759

Closed
opened 2026-10-11 16:30:51 +00:00 by screamm · 1 comment
screamm commented 2026-10-11 16:30:51 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-11T16:30:51Z.


libSceNgs2 rejects rack id 0x4001 (the custom sampler rack). Dead Cells (#3553) stops with NGS2: rack id 0x4001 is not implemented.

Fix branch ready: screamm:feat/ngs2-custom-sampler-rack (1f23f238, one commit on main a11c8f7f). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is. It has not been run with Dead Cells, so whether the title gets past this stop is untested; if it installs modules other than UserFx2 or calls sceNgs2VoiceGetState, it will stop on those next (see below).

  • Creating the rack (query, create, create with an allocator) with its 1304-byte option, which KytyPS5 src/libs/ngs2.cpp (16a7fe68) and shadPS4 ngs2_custom.h (3a9f5726) agree on; voice params 0x40010000 (setup), 0x40010001 (waveform blocks) and 0x40010005 (pitch) behave as the plain sampler's 0x1000xxxx params where KytyPS5 treats them as identical; rendering plays the voice like a sampler voice (PCM and ATRAC9) and then runs the rack's UserFx2 modules the way the existing 0x4002 custom submixer rack does.
  • Still throwing, with the reason named: looping waveform blocks, exit loop 0x40010004, the filter 0x4001000a, other 0x4001xxxx params and more than one buffer (KytyPS5 does not implement them either); module ids other than UserFx2 and creation without an option struct (kept as the 0x4002 rack does); patching a voice into a custom sampler voice (the option has no input count); sceNgs2VoiceGetState (KytyPS5 and shadPS4 disagree on the state layout). Unknown rack ids keep the existing throw. Recorded in TechnicalDebt.
  • Ngs2Custom.cpp covers rack creation and info, setup/blocks/pitch, three renders with exact output and the module process flags, voice end, every throw case, a wrong option size, zero voices, too many ports, a bad module buffer id and module cleanup on destroy.

Tested on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, BUILD_TESTING=ON, full build including libs: all eight ngs2_* tests 3/3; ctest -j8 -E "^agc_driver_|^video_out_flip" 532/536, the failures being the known windows_exceptions (#3411, fixed by #3415), guest_kernel_sys (#3510), guest_filesystem (#3518) and the agc_driver flake (#3171); tools/check_conventions.py --base main and git diff --check pass. Not run on Linux.

Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5802963430 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3759). Originally posted by [screamm](https://github.com/screamm) on 2026-10-11T16:30:51Z. --- libSceNgs2 rejects rack id 0x4001 (the custom sampler rack). Dead Cells (#3553) stops with `NGS2: rack id 0x4001 is not implemented`. **Fix branch ready:** [`screamm:feat/ngs2-custom-sampler-rack`](https://github.com/screamm/AnyPS5/tree/feat/ngs2-custom-sampler-rack) (`1f23f238`, one commit on `main` `a11c8f7f`). I cannot open it as a PR because of the intake check; anyone eligible is welcome to carry it, keeping the commit as is. It has not been run with Dead Cells, so whether the title gets past this stop is untested; if it installs modules other than UserFx2 or calls `sceNgs2VoiceGetState`, it will stop on those next (see below). - Creating the rack (query, create, create with an allocator) with its 1304-byte option, which KytyPS5 `src/libs/ngs2.cpp` (`16a7fe68`) and shadPS4 `ngs2_custom.h` (`3a9f5726`) agree on; voice params `0x40010000` (setup), `0x40010001` (waveform blocks) and `0x40010005` (pitch) behave as the plain sampler's `0x1000xxxx` params where KytyPS5 treats them as identical; rendering plays the voice like a sampler voice (PCM and ATRAC9) and then runs the rack's UserFx2 modules the way the existing 0x4002 custom submixer rack does. - Still throwing, with the reason named: looping waveform blocks, exit loop `0x40010004`, the filter `0x4001000a`, other `0x4001xxxx` params and more than one buffer (KytyPS5 does not implement them either); module ids other than UserFx2 and creation without an option struct (kept as the 0x4002 rack does); patching a voice into a custom sampler voice (the option has no input count); `sceNgs2VoiceGetState` (KytyPS5 and shadPS4 disagree on the state layout). Unknown rack ids keep the existing throw. Recorded in TechnicalDebt. - `Ngs2Custom.cpp` covers rack creation and info, setup/blocks/pitch, three renders with exact output and the module process flags, voice end, every throw case, a wrong option size, zero voices, too many ports, a bad module buffer id and module cleanup on destroy. **Tested** on Windows 11 Pro 26220, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja, Release, `BUILD_TESTING=ON`, full build including `libs`: all eight `ngs2_*` tests 3/3; `ctest -j8 -E "^agc_driver_|^video_out_flip"` 532/536, the failures being the known `windows_exceptions` (#3411, fixed by #3415), `guest_kernel_sys` (#3510), `guest_filesystem` (#3518) and the `agc_driver` flake (#3171); `tools/check_conventions.py --base main` and `git diff --check` pass. Not run on Linux. Written with Claude Code assistance (implementation by a subagent, reviewed and validated in this session).
oneandonlydean commented 2026-10-12 06:17:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-12T06:17:47Z.


Closing as a duplicate of #3553: same stop, NGS2: rack id 0x4001 is not implemented (PPSA15552). This branch is carried in #4254.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6118866351 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3759#issuecomment-6118866351). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-12T06:17:47Z. --- Closing as a duplicate of #3553: same stop, `NGS2: rack id 0x4001 is not implemented` (PPSA15552). This branch is carried in #4254.
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#3759
No description provided.