libSceNgs2.native: custom rack module id 0x20 (PitchShift) is not implemented (Trails in the Sky 2nd Chapter, PPSA35169) #4246

Closed
opened 2026-10-12 02:15:40 +00:00 by Dextroid17 · 6 comments
Dextroid17 commented 2026-10-12 02:15:40 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T02:15:40Z.


Trails in the Sky 2nd Chapter (PPSA35169) crashes well into gameplay setup on an unimplemented NGS2 custom module (id 0x20)

Repro. Relinked and launched PPSA35169 against a fresh upstream/main build (7a84b2226, plus the libkernel/libSceAmpr fixes from #4214). The title now gets much further than before — Vulkan device/swapchain created, save data touched, 16 game threads running — before aborting:

[libc] unhandled exception 'St13runtime_error' thrown from 0x7efda7074e30
terminate called after throwing an instance of 'std::runtime_error'
  what():  NGS2: custom module id 0x20 is not implemented

This throw is the intended, documented behavior of Ngs2CheckCustomRack (core/libs/prx/libSceNgs2.native/src/Custom.cpp:20, described in docs/dev/TechnicalDebt.md's "NGS2 custom submixer rack" entry): only module id 0x1f (UserFx2) is accepted today; every other module id intentionally throws. This report names the next module id a real title actually needs.

What the title is asking for (captured with temporary local instrumentation, not included in this diff): a custom rack with num_buffers=1, num_modules=1, max_ports=1, and its one module is {module_id=0x20, source_buffer_id=0, extra_buffer_id=0, dest_buffer_id=0, state_offset=0, state_size=0, option->size=8}.

A lead, not a confirmed answer. No public reference — shadPS4's ngs2_custom.h, KytyPS5, SharpProspero, or any existing AnyPS5 fork — names module id 0x20 anywhere (gh search code across all of them returns nothing but this project's own UserFx2-only check). shadPS4's header does define several other built-in custom-module option structs without assigning them numeric ids: Envelope, Reverb, Chorus, PeakMeter, Delay, PitchShift. Of those, only OrbisNgs2CustomPitchShiftModuleOption ({size; quality;}, two u32s) matches the measured 8-byte option size exactly — Envelope/Reverb/Chorus/PeakMeter are all 12 bytes, Delay is larger. The header also has no ...ModuleState struct for PitchShift (unlike Envelope/Compressor/PeakMeter/NoiseGate), consistent with this module reporting state_size=0. That makes "pitch shift" a reasonable hypothesis for what 0x20 is — but it is still a hypothesis: no implementation is proposed here, since guessing the actual DSP algorithm would risk exactly the "plausible but wrong" result docs/dev/CONVENTIONS.md warns against. AnyPS5 has not implemented any of these six built-in module types yet (only UserFx2, a passthrough callback, exists) — confirmed via a full grep for PitchShift/Envelope/etc. across libSceNgs2.native, so there is no existing partial implementation to extend either.

No existing claim found — gh search issues/gh search prs for "NGS2 custom module" and "0x20 ngs2" return nothing relevant.

This is flagged as a research item, not implemented here: it needs either a public reference that names module id 0x20, or real PS5 hardware/firmware measurement of what a module id 0x20 custom rack module actually does.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5807403468 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4246). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-12T02:15:40Z. --- **Trails in the Sky 2nd Chapter (PPSA35169) crashes well into gameplay setup on an unimplemented NGS2 custom module (id `0x20`)** **Repro.** Relinked and launched PPSA35169 against a fresh `upstream/main` build (`7a84b2226`, plus the `libkernel`/`libSceAmpr` fixes from #4214). The title now gets much further than before — Vulkan device/swapchain created, save data touched, 16 game threads running — before aborting: ``` [libc] unhandled exception 'St13runtime_error' thrown from 0x7efda7074e30 terminate called after throwing an instance of 'std::runtime_error' what(): NGS2: custom module id 0x20 is not implemented ``` This throw is the intended, documented behavior of `Ngs2CheckCustomRack` (`core/libs/prx/libSceNgs2.native/src/Custom.cpp:20`, described in `docs/dev/TechnicalDebt.md`'s "NGS2 custom submixer rack" entry): only module id `0x1f` (`UserFx2`) is accepted today; every other module id intentionally throws. This report names the next module id a real title actually needs. **What the title is asking for** (captured with temporary local instrumentation, not included in this diff): a custom rack with `num_buffers=1`, `num_modules=1`, `max_ports=1`, and its one module is `{module_id=0x20, source_buffer_id=0, extra_buffer_id=0, dest_buffer_id=0, state_offset=0, state_size=0, option->size=8}`. **A lead, not a confirmed answer.** No public reference — [shadPS4's `ngs2_custom.h`](https://github.com/shadps4-emu/shadPS4/blob/main/src/core/libraries/ngs2/ngs2_custom.h), KytyPS5, SharpProspero, or any existing AnyPS5 fork — names module id `0x20` anywhere (`gh search code` across all of them returns nothing but this project's own `UserFx2`-only check). shadPS4's header does define several other built-in custom-module option structs without assigning them numeric ids: `Envelope`, `Reverb`, `Chorus`, `PeakMeter`, `Delay`, `PitchShift`. Of those, only `OrbisNgs2CustomPitchShiftModuleOption` (`{size; quality;}`, two `u32`s) matches the measured 8-byte option size exactly — `Envelope`/`Reverb`/`Chorus`/`PeakMeter` are all 12 bytes, `Delay` is larger. The header also has no `...ModuleState` struct for `PitchShift` (unlike `Envelope`/`Compressor`/`PeakMeter`/`NoiseGate`), consistent with this module reporting `state_size=0`. That makes "pitch shift" a reasonable hypothesis for what `0x20` is — but it is still a hypothesis: no implementation is proposed here, since guessing the actual DSP algorithm would risk exactly the "plausible but wrong" result `docs/dev/CONVENTIONS.md` warns against. AnyPS5 has not implemented any of these six built-in module types yet (only `UserFx2`, a passthrough callback, exists) — confirmed via a full grep for `PitchShift`/`Envelope`/etc. across `libSceNgs2.native`, so there is no existing partial implementation to extend either. **No existing claim found** — `gh search issues`/`gh search prs` for "NGS2 custom module" and "0x20 ngs2" return nothing relevant. This is flagged as a research item, not implemented here: it needs either a public reference that names module id `0x20`, or real PS5 hardware/firmware measurement of what a module id `0x20` custom rack module actually does. Written with AI assistance.
Dextroid17 commented 2026-10-12 02:17:44 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T02:17:44Z.


Dug further into the trusted sources this project cites (references/trusted-sources.md) looking for a name for module id 0x20 — all dead ends, recording them so nobody re-walks this:

  • VitaSDK's ngs_internal.h (the original PS Vita sceNgs, which NGS2 descends from) only typedefs SceNgsModuleID as an opaque uint32; it never enumerates the actual built-in module id constants.
  • fpPS4 (red-prig/fpPS4) doesn't reimplement NGS2 at all — its own issue tracker says titles need the real console-dumped libSceNgs2.prx dropped into sce_module. No source to mine there.
  • SharpProspero has no NGS2 code whatsoever (checked directly).
  • gh search code across all of GitHub for the module id or its likely constant name returns nothing beyond this project's own fork.

Per references/local-firmware.md, pulling this from an actual PS5 firmware dump isn't an option either (encrypted, no public decryption path above the exploited version ceiling, and the project's own policy is to never build a contribution on PUP-extracted data regardless).

This confirms the module-id-0x20 identity is a genuine public-source dead end, not something a more thorough search would turn up. The PitchShift hypothesis in the issue body (struct-size match) is the best lead available without console hardware access or someone publishing a reference that doesn't exist yet.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116570217 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4246#issuecomment-6116570217). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-12T02:17:44Z. --- Dug further into the trusted sources this project cites (`references/trusted-sources.md`) looking for a name for module id `0x20` — all dead ends, recording them so nobody re-walks this: - **VitaSDK's `ngs_internal.h`** (the original PS Vita `sceNgs`, which NGS2 descends from) only typedefs `SceNgsModuleID` as an opaque `uint32`; it never enumerates the actual built-in module id constants. - **fpPS4** (`red-prig/fpPS4`) doesn't reimplement NGS2 at all — its own issue tracker says titles need the real console-dumped `libSceNgs2.prx` dropped into `sce_module`. No source to mine there. - **SharpProspero** has no NGS2 code whatsoever (checked directly). - `gh search code` across all of GitHub for the module id or its likely constant name returns nothing beyond this project's own fork. Per `references/local-firmware.md`, pulling this from an actual PS5 firmware dump isn't an option either (encrypted, no public decryption path above the exploited version ceiling, and the project's own policy is to never build a contribution on PUP-extracted data regardless). This confirms the module-id-0x20 identity is a genuine public-source dead end, not something a more thorough search would turn up. The PitchShift hypothesis in the issue body (struct-size match) is the best lead available without console hardware access or someone publishing a reference that doesn't exist yet. Written with AI assistance.
Dextroid17 commented 2026-10-12 02:19:40 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T02:19:40Z.


Asking directly: does anyone recognize NGS2 custom module id 0x20?

To recap the concrete, falsifiable question — everything needed to answer it is in the issue body and the comment above:

  • The title (Trails in the Sky 2nd Chapter, PPSA35169) creates a custom NGS2 rack with one module: module_id=0x20, an 8-byte option struct, state_size=0.
  • shadPS4's ngs2_custom.h names several built-in module option structs (Envelope, Reverb, Chorus, PeakMeter, Delay, PitchShift) but never assigns them numeric ids — only UserFx2 (0x1f) has a known id, from KytyPS5.
  • Struct-size matching points at PitchShift (8 bytes, no module-state struct) as the best guess, but that's unconfirmed.

If you've worked with PS4/PS5 NGS2 internals, reverse-engineered a libSceNgs2.sprx, or have access to any SDK documentation that names the built-in custom module ids, a pointer here would directly unblock this title (and likely others using the same built-in effects). Thanks for any lead, even a partial one.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6116586801 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4246#issuecomment-6116586801). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-12T02:19:40Z. --- **Asking directly: does anyone recognize NGS2 custom module id `0x20`?** To recap the concrete, falsifiable question — everything needed to answer it is in the issue body and the comment above: - The title (Trails in the Sky 2nd Chapter, PPSA35169) creates a custom NGS2 rack with one module: `module_id=0x20`, an 8-byte option struct, `state_size=0`. - shadPS4's `ngs2_custom.h` names several built-in module option structs (Envelope, Reverb, Chorus, PeakMeter, Delay, PitchShift) but never assigns them numeric ids — only `UserFx2` (`0x1f`) has a known id, from KytyPS5. - Struct-size matching points at PitchShift (8 bytes, no module-state struct) as the best guess, but that's unconfirmed. If you've worked with PS4/PS5 NGS2 internals, reverse-engineered a `libSceNgs2.sprx`, or have access to any SDK documentation that names the built-in custom module ids, a pointer here would directly unblock this title (and likely others using the same built-in effects). Thanks for any lead, even a partial one. Written with AI assistance.
Dextroid17 commented 2026-10-12 03:58:05 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-12T03:58:05Z.


Reopened — this was closed by accident while the question is still open, so the ask is live again.

The question, restated in one place: the title (Trails in the Sky 2nd Chapter, PPSA35169) creates a custom NGS2 rack with one module — module_id=0x20, an 8-byte option struct, state_size=0. shadPS4's ngs2_custom.h names the built-in option structs (Envelope, Reverb, Chorus, PeakMeter, Delay, PitchShift) but assigns them no numeric ids; only UserFx2 (0x1f) has a known id, from KytyPS5. Struct-size matching points at PitchShift, but that is unconfirmed.

If you have worked with PS4/PS5 NGS2 internals, or know of published documentation that names the built-in custom module ids, a pointer here would help move this title forward. A partial lead helps too.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6117475830 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4246#issuecomment-6117475830). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-12T03:58:05Z. --- Reopened — this was closed by accident while the question is still open, so the ask is live again. The question, restated in one place: the title (Trails in the Sky 2nd Chapter, PPSA35169) creates a custom NGS2 rack with one module — `module_id=0x20`, an 8-byte option struct, `state_size=0`. shadPS4's `ngs2_custom.h` names the built-in option structs (Envelope, Reverb, Chorus, PeakMeter, Delay, PitchShift) but assigns them no numeric ids; only `UserFx2` (`0x1f`) has a known id, from KytyPS5. Struct-size matching points at PitchShift, but that is unconfirmed. If you have worked with PS4/PS5 NGS2 internals, or know of published documentation that names the built-in custom module ids, a pointer here would help move this title forward. A partial lead helps too. Written with AI assistance.
MarcZX10 commented 2026-10-21 21:52:00 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T21:52:00Z.


Research update from the PS5 12.70 NGS2 module analysis on #8039: custom module 0x20 is PitchShift. The firmware entry specifies an 8-byte option whose second word must be 0, plus 8 bytes of module state. This issue's captured rack reports option->size=8 but state_size=0, so the state-size discrepancy still needs resolving before treating that capture as a valid PitchShift configuration. The module identity is now known, but its processing behavior is not established, so this does not support a passthrough/no-op implementation.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6327357252 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4246#issuecomment-6327357252). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T21:52:00Z. --- Research update from [the PS5 12.70 NGS2 module analysis on #8039](https://github.com/boykopovar/AnyPS5/issues/8039#issuecomment-6294323150): custom module `0x20` is PitchShift. The firmware entry specifies an 8-byte option whose second word must be 0, plus 8 bytes of module state. This issue's captured rack reports `option->size=8` but `state_size=0`, so the state-size discrepancy still needs resolving before treating that capture as a valid PitchShift configuration. The module identity is now known, but its processing behavior is not established, so this does not support a passthrough/no-op implementation.
MarcZX10 commented 2026-10-21 23:11:23 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-21T23:11:23Z.


Correction to my earlier note: the PS5 12.70 rack-create observation in #8039 says it rejects a module state size only when it is non-zero and differs from the module’s own size. Therefore state_size=0 is accepted as the default and does not make this title’s captured PitchShift rack invalid. The module is identified as PitchShift and its option contract is partly known, but its DSP behavior is not established, so a processing implementation still needs evidence.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6328619839 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4246#issuecomment-6328619839). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-21T23:11:23Z. --- Correction to my earlier note: the PS5 12.70 rack-create observation in #8039 says it rejects a module state size only when it is non-zero and differs from the module’s own size. Therefore `state_size=0` is accepted as the default and does not make this title’s captured PitchShift rack invalid. The module is identified as PitchShift and its option contract is partly known, but its DSP behavior is not established, so a processing implementation still needs evidence.
Dextroid17 commented 2026-10-21 23:56:57 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by Dextroid17 on 2026-10-21T23:56:57Z.


Thanks @MarcZX10, and thanks to @fma-rc for the PS5 12.70 module-table analysis on #8039 (https://github.com/boykopovar/AnyPS5/issues/8039#issuecomment-6294323150) that answers the question this issue asked.

Where this leaves the report:

  • Module id 0x20 is PitchShift per that analysis (id map stated as identical in 4.00, 7.01, 9.00, 10.01 and 12.70). The struct-shape hypothesis in the opening report (8-byte option, no state struct) pointed the same way.
  • The capture here (option->size=8, state_size=0) does not contradict the firmware contract: 8-byte option, state size 0 accepted as default (your correction). The option's second word, which must be 0, was not captured, so the rack is consistent with PitchShift rather than fully confirmed.
  • Since this was filed, Ngs2CheckCustomRack has grown: main now accepts 0x13 Filter, 0x1d UserFx and 0x1f UserFx2 (so the "only 0x1f" sentence in the opening report is outdated). None of those is PitchShift, and there is no PitchShift code to extend.

Still open: the module's DSP behaviour. I am not proposing a passthrough or a guessed algorithm. This issue stays as the tracking item for 0x20; retitling it to name PitchShift so it is findable.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6329240357 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/4246#issuecomment-6329240357). Originally posted by [Dextroid17](https://github.com/Dextroid17) on 2026-10-21T23:56:57Z. --- Thanks @MarcZX10, and thanks to @fma-rc for the PS5 12.70 module-table analysis on #8039 (https://github.com/boykopovar/AnyPS5/issues/8039#issuecomment-6294323150) that answers the question this issue asked. **Where this leaves the report:** - Module id `0x20` is **PitchShift** per that analysis (id map stated as identical in 4.00, 7.01, 9.00, 10.01 and 12.70). The struct-shape hypothesis in the opening report (8-byte option, no state struct) pointed the same way. - The capture here (`option->size=8`, `state_size=0`) does not contradict the firmware contract: 8-byte option, state size 0 accepted as default (your correction). The option's second word, which must be 0, was not captured, so the rack is consistent with PitchShift rather than fully confirmed. - Since this was filed, `Ngs2CheckCustomRack` has grown: `main` now accepts `0x13` Filter, `0x1d` UserFx and `0x1f` UserFx2 (so the "only `0x1f`" sentence in the opening report is outdated). None of those is PitchShift, and there is no PitchShift code to extend. **Still open:** the module's DSP behaviour. I am not proposing a passthrough or a guessed algorithm. This issue stays as the tracking item for `0x20`; retitling it to name PitchShift so it is findable. Written with AI assistance.
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#4246
No description provided.