feat(libSceNgs2.native): mix a stereo mastering voice into a 6 or 8 channel render buffer #1032

Merged
gjonn merged 1 commit from upstream-pr/1032 into main 2026-10-07 04:56:42 +00:00
gjonn commented 2026-10-07 02:23:57 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by gjonn on 2026-10-07T02:23:57Z.


What

Mixes a 2-channel mastering voice into a 6- or 8-channel render buffer. The mixing stage threw NGS2: mixing 2 mastering channels into 8 is not implemented for any mastering voice whose channel count differed from its render buffer. A stereo voice now goes to the first two channels of a 6- or 8-channel buffer (front left and right) and the remaining channels stay silent; every other mismatch still throws. The console's actual conversion is unknown, so the assumption is recorded in TechnicalDebt.

PPSA21402 (Balatro) sets up a 2-channel mastering voice and renders into an 8-channel buffer. With sceNgs2ParseWaveformFile in place (#1020), the title stops about 5 s after start on main with NGS2: mixing 2 mastering channels into 8 is not implemented. With this change it gets past that point; its next stop is an unrelated GPU one (extended register semantics are not implemented), which this PR does not touch.

Tested

  • Windows 11, NVIDIA GeForce RTX 5090 Mobile (laptop GPU), MinGW-w64 GCC 15.2.0: ctest -R ngs2 passes (all 5 Ngs2 suites). The new TestStereoIntoSurround renders a stereo voice into a 6-channel and an 8-channel buffer (checks the front pair and silence in the other channels) and checks that a 2-into-4 mismatch still throws. Without the change it fails with mixing 2 mastering channels into 6 is not implemented.
  • PPSA21402 (same machine): ran the title built from main + #1020, with and without this change, and got the stops described above.
  • The full test suite was not run locally, and nothing was run on Linux. Not verified on PS5 hardware.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4767087154 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1032). Originally posted by [gjonn](https://github.com/gjonn) on 2026-10-07T02:23:57Z. --- ### What Mixes a 2-channel mastering voice into a 6- or 8-channel render buffer. The mixing stage threw `NGS2: mixing 2 mastering channels into 8 is not implemented` for any mastering voice whose channel count differed from its render buffer. A stereo voice now goes to the first two channels of a 6- or 8-channel buffer (front left and right) and the remaining channels stay silent; every other mismatch still throws. The console's actual conversion is unknown, so the assumption is recorded in TechnicalDebt. PPSA21402 (Balatro) sets up a 2-channel mastering voice and renders into an 8-channel buffer. With `sceNgs2ParseWaveformFile` in place (#1020), the title stops about 5 s after start on `main` with `NGS2: mixing 2 mastering channels into 8 is not implemented`. With this change it gets past that point; its next stop is an unrelated GPU one (`extended register semantics are not implemented`), which this PR does not touch. ### Tested - Windows 11, NVIDIA GeForce RTX 5090 Mobile (laptop GPU), MinGW-w64 GCC 15.2.0: `ctest -R ngs2` passes (all 5 Ngs2 suites). The new `TestStereoIntoSurround` renders a stereo voice into a 6-channel and an 8-channel buffer (checks the front pair and silence in the other channels) and checks that a 2-into-4 mismatch still throws. Without the change it fails with `mixing 2 mastering channels into 6 is not implemented`. - PPSA21402 (same machine): ran the title built from `main` + #1020, with and without this change, and got the stops described above. - The full test suite was not run locally, and nothing was run on Linux. Not verified on PS5 hardware. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
Sign in to join this conversation.
No reviewers
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!1032
No description provided.