Commit Graph
63 Commits
Author SHA1 Message Date
edubox d62e8f42ea feat(ngs2): implement the sampler and submixer peak meter 2026-10-28 09:02:36 +01:00
Felipebmaitan 0c3f104067 chore(ngs2): merge current main for audio routing 2026-10-26 09:03:02 -03:00
Dean 346a1be323 Merge pull request #10127 from Felipebmaitan/feat/ngs2-pcm-playback
feat(ngs2): play additional PCM sampler formats
2026-10-26 12:10:04 +13:00
Dean 59bf9480f7 Merge pull request #10432 from JAB-dev/fix/ngs2-pan-ps5
fix(libSceNgs2): return the PS5 pan codes and accept NaN pan inputs
2026-10-26 06:14:03 +13:00
Felipebmaitan 08587dfa7e feat(ngs2): play additional PCM sampler formats 2026-10-25 13:40:18 -03:00
Adrià 1ca0c5d86c Merge pull request #9926 from JAB-dev/fix/ngs2-play-without-setup
fix(libSceNgs2): return INVALID_VOICE_ACCESS for PLAY on a voice that was never set up
2026-10-25 10:22:17 +01:00
Felipebmaitan 93b887e514 feat(ngs2): route custom submixer buffers through Gain 2026-10-25 01:34:10 -03:00
boykopovar f38d29fd08 refactor(sdk): add canonical headers for remaining libraries 2026-10-24 23:17:42 +03:00
Kapy2003 a25aa36641 feat(libSceNgs2): support custom mastering rack 0x4003
Accept SCE_NGS2_RACK_ID_CUSTOM_MASTERING (0x4003) using the 0x508-byte
custom rack option layout without modules. Channels above NGS2_MAX_CHANNELS
(8) and non-zero module counts throw runtime_error as unsupported. Support
mastering voice control parameters 0x40030000 (setup), 0x40030004 (gain),
and 0x40030005 (output), write active mastering voices to render buffers,
and return voice state flags in sceNgs2VoiceGetState.

References #8039.
2026-10-24 09:58:09 +05:30
JAB-devandClaude Sonnet 5.5 8da1a2dc0b fix(libSceNgs2): return the PS5 pan codes and accept NaN pan inputs
sceNgs2PanGetVolumeMatrix now returns the PS5 error codes in the PS5 check order instead of throwing, and lets NaN angles and distances through as the PS5 module does. sceNgs2PanInit gives the 7-speaker degree defaults for 0 speakers without angles, stores NaN speaker angles and leaves unused slots untouched. Inputs on which the PS5 library never returns still throw.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-24 00:51:07 +02:00
Dean 1fc30716fa Merge pull request #10024 from ags-arnab/feat/ngs2-matrix-module-info
feat(libSceNgs2): implement sceNgs2VoiceGetMatrixInfo and sceNgs2CustomRackGetModuleInfo
2026-10-24 01:43:41 +13:00
JAB-devandClaude Sonnet 5.5 45b061fa6c Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into fix/ngs2-play-without-setup
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 13:59:13 +02:00
Federico Marras 012b87293b Merge remote-tracking branch 'upstream/main' into feat/ngs2-render-buffer-codes
# Conflicts:
#	docs/dev/debt/libSceNgs2.native.md
2026-10-23 11:07:02 +02:00
Dean 3d9c01daed Merge pull request #9337 from Th3EvilGod/codex/ngs2-userfx-module-id
fix(ngs2): correct UserFx ids and preserve Delay compatibility
2026-10-23 20:24:20 +13:00
JAB-dev 2cf37664d2 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into fix/ngs2-play-without-setup
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>

# Conflicts:
#	core/libs/prx/libSceNgs2.native/include/Ngs2Types.hpp
2026-10-23 08:29:14 +02:00
JAB-devandClaude Sonnet 5.5 9723f7af66 Merge branch 'main' of https://github.com/boykopovar/AnyPS5 into fix/ngs2-play-without-setup
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 07:58:53 +02:00
Arnab Ghosh 1f1ddc9e3a feat(libSceNgs2): implement sceNgs2VoiceGetMatrixInfo and sceNgs2CustomRackGetModuleInfo 2026-10-23 10:50:00 +06:00
Federico Marras ad5df50d6d Merge branch 'feat/ngs2-system-option-codes' into feat/ngs2-system-create-arguments
# Conflicts:
#	core/libs/prx/libSceNgs2.native/include/Ngs2Types.hpp
2026-10-23 05:25:39 +02:00
Federico Marras f51eafc9c4 fix(libSceNgs2.native): use main's option size and channel error constants 2026-10-23 05:25:18 +02:00
Federico Marras e03475e92f Merge remote-tracking branch 'upstream/main' into feat/ngs2-system-option-codes
# Conflicts:
#	core/libs/prx/libSceNgs2.native/src/System.cpp
2026-10-23 05:23:59 +02:00
Dean Galvin e51d8c57f0 Merge main into feat/ngs2-render-buffer-codes 2026-10-23 16:23:20 +13:00
Dean Galvin ae913751f0 Merge main into codex/ngs2-userfx-module-id 2026-10-23 15:53:12 +13:00
Dean a1d4803486 Merge pull request #9233 from EdouardSence/feat/ngs2-custom-gain
feat(libSceNgs2): process the custom Gain module
2026-10-23 15:32:08 +13:00
JAB-devandClaude Sonnet 5.5 32cff4e0b3 fix(libSceNgs2): return INVALID_VOICE_ACCESS for PLAY on a voice that was never set up, as the PS5 module does
The PS5 libSceNgs2.native module (firmware 3.20 and 4.03) fails a play event on a voice with no setup with 0x804A8351 on every rack I tried and leaves it idle, so the guard now covers every rack and returns that code.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 00:32:00 +02:00
JAB-devandClaude Sonnet 5.5 2eedb856d9 fix(libSceNgs2): return INVALID_NUM_CHANNELS for PLAY on a sampler voice that was never set up
A sampler voice with no setup used to enter the playing state and never finish, so a title that frees its sound slots by polling sceNgs2VoiceGetStateFlags ran out of slots. The PS4 firmware 11.00 library fails the event and keeps the voice idle.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-23 00:00:31 +02:00
Dean eb8dcfebaa Merge pull request #9837 from JAB-dev/fix/ngs2-pan-init-validation
fix(libSceNgs2): return the SDK pan error codes from sceNgs2PanInit
2026-10-23 10:43:59 +13:00
Th3EvilGod b553950efd fix(ngs2): correct UserFx ids and preserve the Delay compatibility path 2026-10-23 01:17:40 +04:00
Dean Galvin 3e00103497 Merge main into feat/ngs2-custom-gain 2026-10-23 09:17:07 +13:00
JAB-devandClaude Sonnet 5.5 b939663075 fix(libSceNgs2): return the SDK pan error codes from sceNgs2PanInit
An unsupported speaker count returns 0x804A8451, a unit angle other than 360 or 2*pi with angles returns 0x804A8450 and a null work returns 0x804A8010, leaving the work untouched, instead of throwing.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-22 18:01:40 +02:00
Federico Marras 738308a2be fix(libSceNgs2.native): return the module's errors for render buffer counts, types and null buffers 2026-10-21 20:19:46 +02:00
Federico Marras 62799443d5 fix(libSceNgs2.native): return the module's buffer and allocator errors from sceNgs2SystemCreate and sceNgs2SystemCreateWithAllocator 2026-10-21 20:15:07 +02:00
Federico Marras 310cb0c4b5 fix(libSceNgs2.native): validate the system option with the module's error codes 2026-10-21 20:06:25 +02:00
EdouardSenceandClaude Opus 5.5 8c9444b5ae feat(libSceNgs2): process the custom Gain module
A custom submixer rack now accepts the Gain module (0x15). Its voice
parameter 0x40001500 | module index sets one linear level per channel
(37 levels, default 0), and each grain multiplies the voice's samples
by a level that ramps linearly from the previous one to the new one,
following fma-rc's reading of the PS5 12.70 module (#8039). Gain on a
custom sampler rack, whose parameter index is offset, still throws, as
do levels outside -32 to 32.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 17:51:44 +02:00
KernelPanicNT 9f5640af66 fix(libSceNgs2): return the custom rack creation errors
sceNgs2RackCreate and sceNgs2RackCreateWithAllocator now return the firmware's errors for a custom rack whose buffer count is outside 1 to 4 or below the submixer's max_inputs, whose module buffer id is at or above the count, or whose submixer has more than 37 channels, and for the state sizes of the Gain, Reverb and PitchShift modules, the Reverb option size and word, and the PitchShift option word. Racks that pass these checks with one of these modules or Convolution, with more than one buffer, more than 8 channels or a submixer max_inputs other than 1 or 2 still throw, and so does sceNgs2RackQueryBufferSize for the rejected options.
2026-10-21 13:35:52 +00:00
JAB-devandClaude Sonnet 5.5 8420e13688 fix(libSceNgs2): return INVALID_GEOM_FLAG and the listener-address error from sceNgs2GeomCalcListener
A flags value above 1 returns 0x804A8463 and a null listener parameter returns 0x804A8461, both leaving the output untouched, instead of throwing.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-20 23:09:48 +02:00
011010 6d72ebe47c feat(libSceNgs2.native): keep a registry of report handlers
sceNgs2ReportRegisterHandler and sceNgs2ReportUnregisterHandler stop
being throwing stubs: they keep a registry of report handlers, so a
title that imports them can register and later drop its handler.

Register rejects a null handler with an invalid argument and returns
INVALID_OUT_ADDRESS for a null out handle, then stores the report
type, handler and user data under a freshly allocated opaque handle.
Unregister removes and frees the matching record and throws for a
handle that is not registered.

The signatures follow SharpProspero and shadPS4's ngs2_report.h, and
the 24-byte Ngs2ReportDataHeader passed to a handler is its
OrbisNgs2ReportDataHeader. No report is produced yet, so no registered
handler is ever invoked.
2026-10-19 10:29:06 -06:00
JJenkx b17406a33a fix(ngs2): return PS5 errors for invalid voice handles 2026-10-17 14:07:44 -04:00
JJenkx 5637c958c4 fix(ngs2): use PS5 system and rack handle errors 2026-10-16 16:02:31 -04:00
Adrià ea4cc112a0 Merge pull request #5916 from JosepBove/fix/ngs2-rack-voice-index-error
fix(ngs2): return the voice-index error from sceNgs2RackGetVoiceHandle
2026-10-16 21:54:28 +02:00
Dean a077a88df5 Merge pull request #5139 from Kikoarl/feat/ngs2-custom-module-user-fx
feat(ngs2): support custom submixer rack UserFx module 0x1d
2026-10-15 15:34:22 +13:00
JosepBove 5fe4780812 fix(ngs2): return the voice-index error from sceNgs2RackGetVoiceHandle
An index at or beyond the rack's voice count returned through
APS5_INVALID_ARG_EX, which throws and ends the process. Heretic + Hexen
(PPSA26525) creates a one-voice reverb rack, takes voice 0 and asks for
voice 1 at start-up, so it stopped at 1.5 s on
"sceNgs2RackGetVoiceHandle: invalid argument". Return 0x804A8305 and
leave the output handle untouched, after the existing null-output and
rack-handle checks. The value follows prosper's analysis of
libSceNgs2.native.sprx; shadPS4 lists 0x804A0302 for the PS4 library.
Neither is a PS5 measurement, recorded in the technical debt.

ngs2_voiceindex creates one-voice sampler, submixer, mastering and
reverb racks and a default sampler rack, and checks the error, the
untouched output, the null-output and invalid-rack codes and that the
last valid index still resolves afterwards. It aborts on main's library
with the throw above and passes with this change.
2026-10-14 17:29:25 +02:00
Kikoarl 40e2019756 feat(ngs2): support custom submixer rack UserFx module 0x1d
Accept SCE_NGS2_CUSTOM_MODULE_ID_USER_FX (0x1d) on custom submixer racks alongside UserFx2 (0x1f). When configuring a custom rack voice, support voice control parameter SCE_NGS2_CUSTOM_VOICE_PARAM_USER_FX (0x40001d00) to install custom submixer UserFx callbacks with user data. Run legacy UserFx callbacks during custom voice rendering and update sample presence flags accordingly.

Fixes runtime abort in Void Terrarium (PPSA03061):
  terminate called after throwing an instance of 'std::runtime_error'
    what(): NGS2: custom module id 0x1d is not implemented
  FATAL: abort() (SIGABRT)

Closes #5055
2026-10-14 10:04:34 +02:00
p3nicillinandClaude Opus 5.5 87f2c7de83 feat(ngs2): report custom sampler voice state
Dead Cells (PPSA15552) calls sceNgs2VoiceGetState on custom sampler
voices with a 48-byte buffer and reads the 64-bit value at offset 16 as
a running counter. Fill it with the decoded sample count, keep the
common state flags, and return INVALID_OUT_SIZE for other sizes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-13 21:20:15 +01:00
Jnbla6 ef52b16920 feat(libSceNgs2.native): add custom voice filter support and related tests for 0x13 issue case 2026-10-14 08:39:32 +13:00
Jnbla6 855823e85e feat(libSceNgs2.native): implement custom sampler rack id 0x4001 (#4334) 2026-10-14 08:39:32 +13:00
cac398cb96 feat(libSceNgs2): implement the Geom reset functions
Implement sceNgs2GeomResetListenerParam and sceNgs2GeomResetSourceParam,
taken from #1021 and limited to the two reset functions. The Geom
structures get their real layouts. sceNgs2GeomCalcListener and
sceNgs2GeomApply stay unimplemented.

Co-Authored-By: Dextroid17 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 15:39:27 +04:00
Simon 233590462c fix(libSceNgs2): report EMPTY for a streaming sampler that played its queue
A playing sampler voice whose waveform still accepts blocks (CONTINUE)
reported only INUSE|PLAYING after it had played every queued block, so
a title that waits for EMPTY before it reuses the voice never did.
PPSA18391 (engine: Clickteam Fusion) reads state_flags & 0x22 != 2 from
sceNgs2VoiceGetState as the end of a sound; each of its sound effects
played once and never again.

The voice now also reports EMPTY (0x20) in that state and keeps
playing, so blocks added later still play. A waveform that was closed
without CONTINUE does not report it.
2026-10-12 00:26:12 +02:00
PhialsBasementandClaude Code 2d9b6aebb7 feat(libSceNgs2.native): render silent waveform blocks with flag 0x10
A waveform block that declares samples with no data threw as not
fitting them. PPSA04867 adds such a block with flags 0x11 (data_size 0,
num_samples 16385) and terminates the process on the throw, followed by
a fully specified block under the same flags, which takes the ordinary
path. Accept flag 0x10, named SILENCE here: a dataless block under it
renders num_samples frames of silence and finishes like a complete
block, reporting its bytes through decoded_data_size. A dataless block
without the flag keeps throwing. No public reference names the flag;
the assumption is recorded in TechnicalDebt.

Co-Authored-By: Claude Code <[email protected]>
2026-10-11 00:37:42 +02:00
Dean 903863c974 Merge pull request #959 from JAB-dev/feat/ngs2-pan
feat(libSceNgs2.native): implement sceNgs2PanInit and sceNgs2PanGetVolumeMatrix
2026-10-10 18:53:48 +13:00
JAB-devandClaude Opus 5.5 00e13ecfa7 feat(libSceNgs2.native): implement sceNgs2PanInit and sceNgs2PanGetVolumeMatrix
Pan follows the PS4 firmware 11.00 libSceNgs2.sprx: the speaker layout
from the init angles, then each param's angle and distance into a
volume matrix for the voice. Every param is checked before anything is
written, and angles too large to wrap throw. The pan functions are
exported from the existing Voice.cpp export block.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-09 23:26:24 +02:00