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]>
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/.
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]>
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]>
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.
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]>
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]>
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]>
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]>
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]>
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.
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]>
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]>
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]>
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]>
#11315 implemented sceNgs2JobSchedulerResetOption with an
Ngs2JobSchedulerOption* parameter in src/System.cpp and tests it in
Ngs2HandleErrors.cpp. The pending-export list still named it as a
no-parameter stub, so the test stopped compiling once merged with main.
The list drops it, and the debt entry counts the 14 exports that are
still pending. The other listed exports are still stubs on main.
On a PS4 firmware 10.71 console, libSceNgs2.sprx answers
sceNgs2VoiceGetState with 0x804A0054 for a state size below 4 before it
resolves the voice and 0x804A0300 for an invalid voice, and
sceNgs2VoiceGetStateFlags writes 0 and returns 0x804A0300 for an invalid
voice. The libSceNgs2 target now does the same; libSceNgs2.native keeps
the PS5 module values.
Co-Authored-By: Claude Opus 5.5 <[email protected]>