feat(ngs2): report custom sampler voice state #5470
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5470"
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 p3n1cillin on 2026-10-13T20:38:05Z.
What
With #4417 merged, Dead Cells (PPSA15552) creates custom sampler voices (rack
0x4001) and polls them withsceNgs2VoiceGetState. That call threw for every custom sampler voice:The title passes a 48-byte buffer at two call sites, and both read only the 64-bit value at offset 16:
So offset 16 is a running counter that the title measures progress with. The custom sampler state now:
INVALID_OUT_SIZEfor any other size, as the sampler, submixer and reverb racks do.shadPS4's
OrbisNgs2CustomSamplerVoiceStateis about 80 bytes, so it doesn't match what this title passes. The size and that one field come only from the title, and the other field names and the console's values are unverified. This is recorded under Unknown function info indocs/dev/debt/libSceNgs2.native.md.Tested
Dead Cells on Windows 11 (MinGW GCC 15), on
maina0f5916a2with #4777. Dead Cells patches a sampler voice to a rack handle, which needs #4777 first. It also needs two local, unsubmitted stubs:mainreads (see my comment on #4417);sceNgs2GeomCalcListenerlistener, front(1,0,0)and up(0,0,1).Before this change, it stops on the error above about 80 s in. After it, it runs for the whole 120 s run with no library stop. With the same stack plus a local stand-in for this call, it reaches its title screen with audio.
Unit test:
ngs2_customnow creates a custom sampler voice, renders one grain and checks that:INVALID_OUT_SIZE;INUSE|PLAYINGwith 8 decoded samples, then 16 after a second render.With
main'sVoice.cppthe test aborts on the throw. All 10 NGS2 tests pass on Windows and on Linux (WSL Ubuntu, GCC).python tools/check_conventions.py --base origin/mainandtools/pr_overlap.pypass, with no overlap with open PRs.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-13T23:29:21Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)docs/dev/debt/libSceNgs2.native.mdL27Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T11:49:43Z.
Checked the new
Ngs2CustomSamplerVoiceState(48 bytes, decoded sample count at offset 16), theINVALID_OUT_SIZEpath for other sizes, and thengs2_customtest (fails to build without the change, passes with it); the 9 libSceNgs2.native ctest targets pass on Linux. The debt line records what only the title establishes. Merging.