fix(libSceNgs2.native): accept a reverb voice with different input and output channel counts #10347
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10347"
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 hugodearaujo on 2026-10-23T18:33:03Z.
What
SCE_NGS2_REVERB_VOICE_PARAM_SETUPthrowsNGS2: reverb channel conversion is not implementedwhennum_input_channelsdiffers fromnum_output_channels. The Elder Scrolls V: Skyrim (PPSA03747) sets up its reverb voice with 2 inputs and 8 outputs 19 s into boot, so it stops there.This PR accepts the conversion:
Ngs2Voice::inputChannels; 0 means the output count, for every other voice). Ports into the voice mix in the input layout, through their matrix or the default channel map.e15f1644e3the reverb folds its input to mono with the PS4 library's fixed gains, and runs its comb selection and allpasses per output channel. The fold now uses the input count, and those stages run for each output channel.max_channels, as the output count already had to be.@JAB-dev, your reverb was checked against the PS4 library's output. If your setup can render a 2-in, 8-out voice, that would settle the dry path. #1384, a draft from before
e15f1644e3, also kept a separate input count, on its own reverb.Tested
main65ac1d3b50(with #8091, which I run for host imports; it doesn't touch NGS2) stops at 19 s withNGS2: reverb channel conversion is not implemented.main65ac1d3b50with this PR (and no #8091) sets the voice up with 2 inputs and 8 outputs. It reaches the main menu, and New Game reaches its loading screen. At 155 s it stops on a separate graphics refusal,guest cube texture descriptor holds fewer than 6 array slices (format 71, 512x512x5, ...).ngs2_renderandngs2_core_render, inNgs2Render.cpp:TestReverbConversion: a 2-in, 6-out voice and a 2-in, 8-out voice (the title's layout) give the same front left and right as a 2-in, 2-out voice on the same input, wet and dry. Their centre, surrounds and backs carry the reverb, and their LFE stays silent. With the wet level at 0, a 6-in, 2-out voice givesL + C * sqrt(2)/2 + Ls/2andR + C * sqrt(2)/2 + Rs/2.TestReverbSetup: 1 input and 2 outputs is accepted. Input or output counts of 3 or 7 are rejected with the invalid-argument error, as equal counts of 3, 4, 5 and 7 already were.main'sVoice.cpp, both executables abort withNGS2: reverb channel conversion is not implemented.ngs2_*tests pass. Linux (Arch, kernel 7.2.11), GCC 16.2.1, Release.tools/check_conventions.pypasses.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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T19:09:55Z.
Review: APPROVED
Reviewed the channel-layout path through
MixPort,RenderVoiceandNgs2ProcessReverb. The new input count is used for port mixing and the wet mono fold, while output channel state continues to drive the comb/allpass stages; the dry path is remapped before the output channels are processed. The tests cover unequal counts in both directions, input/output validation, wet output distribution and dry downmix, and the author reports the exact Skyrim setup reaching the menu/loading screen. The open #1384 draft is explicitly distinct: it contains the older experimental reverb and itself records that a rework must preserve main’s reference-checked DSP; this PR does preserve that DSP and adds the missing channel conversion. One useful follow-up would be a focused 2-in/8-out render assertion for the exact title layout. The unverified dry mapping is recorded in technical debt. Hosted eligibility, conventions, intake, labels and report checks pass; product jobs are skipped by path policy. I found no blocking issue in this scope.