Commit Graph
238 Commits
Author SHA1 Message Date
Dean d11668dcc6 Merge pull request #15694 from JJenkx/fix/ngs2-ps5-filter-sizes
fix(libSceNgs2): accept the PS5 SDK filter params in libSceNgs2
2026-11-05 08:21:12 +13:00
Dean Galvin acb208b6c2 Merge branch 'main' into feat/ngs2-hevag 2026-11-04 21:00:49 +13:00
JJenkxandClaude Opus 5.5 a5e8b9b8c0 docs(debt): note the PS5 filter param sizes in libSceNgs2
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-04 01:36:39 -05:00
Dean e943f4f216 Merge pull request #12673 from 2Swagger/feat/ngs2-userfx-buffers
feat(ngs2): copy custom UserFx source to dest across multiple buffers
2026-11-04 11:25:58 +13:00
Dean 34700461ad Merge pull request #15240 from simnJS/docs/ngs2-mastering-params-gap
docs(libSceNgs2.native): record the mastering LFE, limiter and peak meter gaps
2026-11-04 08:11:50 +13:00
Dean Galvin 6f1301f1e0 Merge main 1e658521a0 into #12673 (c17c71e4d1)
Clean merge (two merge bases, so GitHub reports a conflict). No hand resolution.
2026-11-04 05:44:50 +13:00
Yunus Shaikh 48f0002490 Merge main into feat/unbuilt-exports-guard 2026-11-02 17:03:14 -08:00
simnJS f8f6255256 docs(libSceNgs2.native): record the mastering LFE, limiter and peak meter gaps
Params 0x30000002, 0x30000003 and 0x30000006 keep throwing: no library reading or run shows what they do. PPSA02195 sends all three, so the entry records its arguments, what shadPS4 and the published module runs establish, and what stays unknown.
2026-11-02 22:57:21 +01:00
Federico Marras d63077a6eb Merge main into feat/ngs2-parse-pcm-loops 2026-11-02 18:25:38 +01:00
Dean 0702b30fa0 Merge pull request #10599 from kyon-eth/fix/ngs2-custom-reverb
feat(ngs2): implement the custom Reverb module
2026-11-02 23:23:12 +13:00
Dean Galvin 1e4443ce43 Merge commit 'a644edf30c501a612d06f17d05ef1b7051350cef' into HEAD
# Conflicts:
#	core/libs/prx/libSceNgs2.native/src/Voice.cpp
2026-11-01 23:27:03 +13:00
JAB-dev e402f0086f Merge remote-tracking branch 'origin/main' into fix/ngs2-ps4-port-volume-range-ps5
# Conflicts:
#	core/libs/prx/libSceNgs2.native/tests/Ngs2JobBuffer.cpp
2026-11-01 08:00:02 +02:00
Adrià ebb95e8489 Merge pull request #13857 from JAB-dev/fix/ngs2-waveform-add-codes-main-ps5
fix(libSceNgs2): follow PS5 for waveform add flags and APPEND blocks
2026-11-01 06:40:00 +01:00
JAB-dev e4b9fb91b8 Merge remote-tracking branch 'origin/main' into fix/ngs2-ps4-port-volume-range-ps5
# Conflicts:
#	core/libs/prx/libSceNgs2.native/src/Voice.cpp
#	docs/dev/debt/libSceNgs2.native.md
2026-11-01 07:03:46 +02:00
Adrià 3ab5a11d66 Merge pull request #13851 from JAB-dev/fix/ngs2-rack-waveform-block-limit-ps5
fix(libSceNgs2): reject sampler racks outside 1 to 32 waveform blocks
2026-11-01 06:00:17 +01:00
JAB-devandClaude Sonnet 5.5 8155820bb7 docs(libSceNgs2): say the waveform add results come from the PS5 and PS4 modules run on a PC
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-01 05:45:03 +01:00
JAB-devandClaude Sonnet 5.5 164246490e fix(libSceNgs2): follow PS5 for waveform add flags and APPEND blocks
Waveform adds now follow the PS5 module in cases main threw or answered with
the wrong code: flag bits 0x8, 0x20 and 0x40 and up are ignored in the values
PS5 ran, an add of no blocks with APPEND or RESET|APPEND returns 0 (or the
closed code on a closed waveform), one APPEND block on a mono PCM voice with
nothing queued is queued as a block of no frames (unsigned 8-bit, 16, 24 and
32-bit integer, 32 and 64-bit float), and any add to a never-set-up voice whose
waveform an add of no blocks closed returns the closed code.

The PS4 library shares the sources and returns its own code for a closed
waveform and a full queue, 0x804A0151, as PS4 11.00 does.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-11-01 05:45:02 +01:00
Dean 1526c6aeae Merge pull request #13902 from edubox/feat/ngs2-custom-sampler-gain
feat(ngs2): allow the custom Gain module on custom sampler racks
2026-11-01 15:53:56 +13:00
Adrià 1ffd2b81f5 Merge pull request #13787 from JAB-dev/fix/ngs2-sampler-filter-types-ps5
fix(libSceNgs2): read the PS5 sampler and custom filter params and run filter types 1 to 11
2026-11-01 01:37:59 +01:00
nekomancer01andClaude Opus 5.5 63fe6bb067 test(ngs2): check the VAG 2^32 boundary in memory instead of sparse files
The 2^32-sample boundary tests extended a file to 2.4 GiB with
std::filesystem::resize_file. On MinGW that goes through _chsize_s,
which writes the zeros, so ngs2_vag took 206 s on Windows and hit the
120 s CI timeout. With the second frame's flag bit 1 clear the parser
reads only the header and that frame, so the in-memory entry point
covers the boundary with a large declared buffer size and no file.

0x924924a0 wraps to fewer samples than one frame and trips the
short-waveform throw even without the 2^32 guard, so 0x924924c0, which
wraps to 80 samples, now checks that the guard itself throws.

The debt entry is shortened under the 1000-character limit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 10:19:41 +11:00
nekomancer01andClaude Opus 5.5 12f670e798 fix(ngs2): reject VAG data sizes past the end of the buffer
A VAGp header can declare more data than the buffer holds. With bit 1
of the second frame's flags clear, nothing compared the two, so the
parser built blocks that made Ngs2DecodeVag read past the input.

ParseVag now runs every size check before it writes the output, so a
declared size larger than the payload returns
SCE_NGS2_ERROR_INVALID_WAVEFORM_DATA and leaves the structure cleared,
for both sceNgs2ParseWaveformData and sceNgs2ParseWaveformFile. The
2^32-sample boundary tests move to sparse files, since a small buffer
can no longer declare that much data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 10:19:41 +11:00
nekomancer01andClaude Opus 5.5 3c308259a0 fix(ngs2): throw for VAG waveforms of more than 2^32 samples
Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 10:19:41 +11:00
nekomancer01andClaude Opus 5.5 c56191baa8 feat(ngs2): parse and decode VAG and HE-VAG waveforms
Parse VAGp headers in sceNgs2ParseWaveformData and sceNgs2ParseWaveformFile
as prosper's reading of the PS5 module describes, including the loop split
from frame flags, and decode submitted type 0x1c blocks with vgmstream's
HE-VAG decoder from the existing submodule.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-11-01 10:19:41 +11:00
Yunus Shaikh f90a7e9b30 Merge main into feat/unbuilt-exports-guard
The conflict in core/libs/prx/libSceAgcDriver/CMakeLists.txt from #12862's split is resolved with tools/agc_test_split.py resolve, which moves this PR's test registrations into tests/cmake/.
2026-10-31 20:28:15 +00:00
JAB-dev e556054fdc Merge remote-tracking branch 'origin/main' into fix/ngs2-ps4-port-volume-range-ps5
# Conflicts:
#	core/libs/prx/libSceNgs2.native/tests/Ngs2Render.cpp
2026-10-31 21:57:03 +02:00
JAB-devandClaude Sonnet 5.5 7ef0533d08 fix(libSceNgs2): follow the PS4 module for filter sizes, types and the fc clamp
The PS4 11.00 module accepts only header sizes 0x30 (sampler) and 0x28 (custom) and returns 0x804A030A for the rest, runs types 1 to 10 and treats 11 and above as off, takes locations 0 to 17, and raises fc to 0.001 x rate.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 15:11:04 +02:00
JAB-devandClaude Sonnet 5.5 d44c0739b9 fix(libSceNgs2): clamp the PS4 port volume to [-4, 4]
The PS4 11.00 module stores a port volume clamped to [-4, 4] with NaN and -0 kept; the PS4 library used the PS5 range [0, 32].

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 15:00:13 +02:00
Eduardo Ruiz 06a481b208 feat(ngs2): allow the custom Gain module on custom sampler racks
The bundled 12.70 module accepts Gain (0x15) on rack 0x4001, where the
voice parameter index is one higher than the module index (fma-rc's
reading). Creation now passes the rack check, a parameter at index 0 or
beyond the module count returns INVALID_PARAM_ID, and the existing
processing path ramps the module as on a custom submixer.

The test covers creation, the ramped gain over two grains, and the
parameter index bounds. Initialization and lifecycle remain unverified:
processing after a setup or stop still throws.
2026-10-31 13:09:47 +01:00
JAB-devandClaude Sonnet 5.5 2ae97dfe26 docs(libSceNgs2): say the rack block limit was measured on the PS5 module run on a PC
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 12:25:20 +02:00
JAB-devandClaude Sonnet 5.5 9c009622b5 fix(libSceNgs2): reject sampler racks outside 1 to 32 waveform blocks
A sampler rack or a custom sampler rack whose max_waveform_blocks is 0 or above
32 now returns 0x804A8053 from sceNgs2RackQueryBufferSize, sceNgs2RackCreate
and sceNgs2RackCreateWithAllocator, checked before the peak meter and buffer
count checks as the PS5 module does. Main checked only a custom sampler rack
with 0 and accepted any count for a sampler rack, taking 0 as 1.

The PS4 build keeps main's behaviour: no limit for sampler racks, and 0x804A8053
for a custom sampler rack with 0. PS4 11.00 takes 1 to 16 on sampler racks and
returns 0x804A0106, but the PS4 library reads the PS5 rack option layout, so it
cannot apply that.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 11:08:00 +02:00
JAB-devandClaude Sonnet 5.5 97a16f9a09 fix(libSceNgs2): read the PS4 sampler filter param in shadPS4's layout
Under APS5_NGS2_PS4_LIBRARY the sampler filter param 0x1000000a is parsed as
shadPS4's OrbisNgs2SamplerVoiceFilterParam (index 0x8, location 0xC, type
0x10, 32-bit channel mask 0x14, fc, q and level from 0x18, size 0x30), the
way the custom param 0x40001300 already is, and goes through the new filter
code. main read KytyPS5's layout (type 0x10, 64-bit mask 0x18); neither is
measured on PS4 11.00. Types 0 and 1 at location 1 are accepted, anything
else throws as on main. Raw-byte tests in ngs2_core_render cover the layout.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 09:50:43 +02:00
JAB-devandClaude Sonnet 5.5 f8ce8aade3 fix(libSceNgs2): keep the PS4 sampler filter layout and name the measurement source
Under APS5_NGS2_PS4_LIBRARY the sampler filter param 0x1000000a is parsed in
the layout main used (type at 0x10, 64-bit mask at 0x18, fc at 0x20) instead
of the PS5 layout, as the custom param 0x40001300 already is, and goes
through the new filter code. Raw-byte tests in ngs2_core_render cover it.

The two filter debt entries name the module and firmware versions measured,
say the runs were on a PC with host math imports and not on a console, point
to the result records, and keep the PS4 differences gap-first. The title is
left out of the debt text; only the title ID stays.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 09:45:38 +02:00
JAB-devandClaude Sonnet 5.5 52be0d5b23 fix(libSceNgs2): read the PS5 sampler and custom filter params and run filter types 1 to 11
The sampler filter param (0x1000000a) and the custom filter param
(0x40001300) read their fields in a layout PS5 titles do not use, so a
low-pass was read as off. Both now use the SDK layout and filter types 1 to
11 as the PS5 module does: float coefficients, outputs in blocks of four
frames from the first frame of each render, clamps, level, masks, locations,
the error order, a zero history when the voice starts again, a history that
decays over zero input while a voice is paused, a restart from the first
block when a filtered voice is played again, and no tail past the render in
which a block voice ends. The PS4 library keeps main's 40-byte custom param.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 08:23:38 +02:00
JAB-devandClaude Sonnet 5.5 107954e355 fix(libSceNgs2): use the PS5 default map for 3, 4, 5 and 7 channels
PS5 firmware 3.20 and 4.03 have their own default port map rows for every source and destination pair with 3, 4, 5 or 7 channels on either side, and a mastering voice of those counts maps its channels into a render buffer of the same count through them. Ours threw for a port into such a voice, used the PS4 fold-down from one, and copied the channels of a 3, 5 or 7 channel mastering voice unchanged. A mastering voice into a buffer of another count still throws when either count is 3, 4, 5 or 7. The PS4 library, the reverb conversion and Pan keep the PS4 rows. The routing tests that rendered 3, 5 and 7 channel mastering voices now expect those rows, and the render tests expect the sampler startup delay.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-31 02:48:40 +02:00
JAB-dev 0ad239feea Merge origin/main into fix/ngs2-default-port-map-ps5
# Conflicts:
#	docs/dev/debt/libSceNgs2.native.md
2026-10-30 23:54:48 +02:00
Adrià e1b563a8fc Merge pull request #13488 from JAB-dev/fix/ngs2-i16-render-conversion-ps5
fix(libSceNgs2): convert PCM_I16L render output as the PS5 module does
2026-10-30 22:42:02 +01:00
Yunus Shaikh a61e7d7b04 Merge main into feat/unbuilt-exports-guard
docs/dev/debt/libSceAgcDriver.md: the pending-exports entry counts 28 named callable exports, not 35. Main's #13471 moved seven of them from Export.cpp to Unimplemented.cpp, where they return fixed error codes, leaving 28 NotImplemented_nid_no_patch calls in Export.cpp.
2026-10-30 21:37:03 +00:00
Swag 8306788ab3 Merge remote-tracking branch 'upstream/main' into feat/ngs2-userfx-buffers 2026-10-30 16:59:16 -04:00
Swag c379455814 Merge #10599 head bc07113988 into feat/ngs2-userfx-buffers 2026-10-30 16:58:53 -04:00
Yunus Shaikh 1c9c0a26fd Merge main into feat/unbuilt-exports-guard 2026-10-30 20:11:14 +00:00
JAB-devandClaude Sonnet 5.5 f35ab1ccf2 docs(libSceNgs2): record how the PCM_I16L render conversion was measured and what was not
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 19:24:51 +02:00
JAB-devandClaude Sonnet 5.5 e9c8069804 fix(libSceNgs2): use the PS5 default channel map for ports and mastering output
PS5 firmware 3.20 and 4.03 fold 6 and 8 channel sources into stereo and mono with different surround and back gains than the PS4 rows, and fold a mastering voice into a render buffer of another channel count through the same default map. Ours used the PS4 rows and threw on a channel count mismatch other than stereo into 6 or 8. The PS4 library, the reverb conversion and Pan matrices keep the PS4 rows.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 19:20:35 +02:00
JAB-devandClaude Sonnet 5.5 a9c4e82299 docs(libSceNgs2): say the port volume measurements ran on the PS5 module on a PC
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 18:55:55 +02:00
JAB-devandClaude Sonnet 5.5 8c1291efdb docs(libSceNgs2): put the mastering gain gaps first and drop the stale nonfinite integer render sentence
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 18:51:59 +02:00
JAB-devandClaude Sonnet 5.5 8ae66c36b3 fix(libSceNgs2): convert PCM_I16L render output as the PS5 module does
PS5 firmware 3.20 and 4.03 write trunc(clamp(x * 32767.0f, -32767, 32767)) into a PCM_I16L render buffer, with the product in float, NaN written as 0 and -32768 never written; ours rounded x * 32768 to nearest, wrote -32768 for -1 and threw on a nonfinite sample. Combined with the sampler's exact x / 32768 input, an I16 source now comes back one step toward zero, so the existing render, stream and gain tests expect that, and a new sweep checks the measured values on 1, 2, 6 and 8 channels.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 18:37:47 +02:00
JAB-devandClaude Sonnet 5 26833d555f docs(libSceNgs2): list every unmeasured port volume case in the debt entry
Co-Authored-By: Claude Sonnet 5 <[email protected]>
2026-10-30 18:36:52 +02:00
JAB-devandClaude Sonnet 5.5 eb81f61955 docs(libSceNgs2): scope the port volume debt entry to what was measured
The clamp was measured on a sampler voice's ports only, so the entry now says that a port past the count on another rack's voice and sceNgs2VoiceGetPortInfo still throw, and it no longer repeats the port gain ramp, which a separate change implements.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 18:21:43 +02:00
JAB-devandClaude Sonnet 5.5 0dc600e7fa fix(libSceNgs2): clamp the port volume to [0, 32] as the PS5 module does
PS5 firmware 3.20 and 4.03 clamp the port volume of VoiceControl param 0x2 and RunCommands command 6 to [0, 32], keeping NaN and -0, and return 0 for every value. Command 6 reads the low 32 bits of its value as a float whatever the value type and ignores numValues and flags, and a batch of port volumes naming a port past an 8-port rack returns 0x804A8357 without applying any of them. Ours stored the value raw, threw on a value type other than float and threw on the bad port after applying the earlier commands; other command ids and the unmeasured bad-port cases keep their old behaviour.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
2026-10-30 18:21:43 +02:00
Adrià f0a7231d62 Merge pull request #13099 from Queuse/codex/ngs2-grain-validation-20261029
fix(ngs2): validate grain size in 64-sample units
2026-10-30 11:58:53 +01:00
Adrià a1782bdc02 Merge pull request #12995 from hugodearaujo/fix/ngs2-buffer-setup-controls
fix(ngs2): buffer voice setups, waveform blocks and patches sent during processing
2026-10-30 10:55:38 +01:00