feat(ngs2): play additional PCM sampler formats #10127
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10127"
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 Felipebmaitan on 2026-10-23T10:25:42Z.
What
NGS2 sampler voices rejected unsigned 8-bit, signed 24/32-bit and 32/64-bit floating PCM, while frame addressing and decoded-byte accounting assumed signed 16-bit samples. Add complete-block playback for those five formats through a shared reader used by libSceNgs2 and libSceNgs2.native, and use the actual sample width for validation, positions and counters. Existing resampling, repeats, block callbacks and signed-16 streaming remain in place.
The format mappings follow prosper's published waveform analysis; the parser's WAVE input representations follow the Microsoft PCM description. Integer PCM is normalized by its signed range and double PCM narrows to host float. Console rounding and unsupported behavior are recorded in the library debt entry. The new formats require complete blocks and zero configuration; floating samples outside -1..1, nonfinite values and nonzero magnitudes below the smallest normal float throw. Bit-based checks also reject these values when the caller enables DAZ/FTZ.
Parser expansion remains in #9148. The manual overlap review from 2026-10-23 records the exact heads and integration requirements inspected at that time. It is historical and does not establish compatibility with subsequent updates to those branches. This implementation has no build dependency on them.
Rebased onto main
c661d9fae2d630a48819218a8271ce19b39f006ain response to the review from Dean. Nonempty setups accept ATRAC9 and the six implemented PCM formats; the shared PCM-width validator throws for every other type. The empty-format setup handling from main remains before reset/validation, so an empty format preserves an existing setup and its queued playback. The PCM regressions now exercise that behavior for all six formats and 1/2/6/8 channels. The VoiceEvents test from main and both PCM test registrations are retained.Tested
Windows 11 Pro 10.0.26200, WinLibs MinGW-w64 GCC 15.2.0 r7, Ninja Release; NVIDIA GeForce RTX 5080, Windows driver 32.0.16.2101. No title or console was run, and no new dumps were used.
2026-10-25 rebase validation on
1cccff944105af1f9987a838609898ad3885f40f: Full Release buildcmake --build build --parallel 8succeeded.ctest --test-dir build -R "^ngs2_" --output-on-failurepassed 16/16, includingngs2_pcm,ngs2_core_pcmandngs2_voiceevents(4.79 s total).python tools/check_conventions.py --base origin/mainandgit diff --checkpass.Previous full build:
cmake --build build --parallel 8succeeded on head1d945338ebec8582daa8921f213cd23ea2d0d908, based on main5e9f4b896680f8ec848ba495c556d2ab8b3a99fa.Previous full suite on
1d945338ebec8582daa8921f213cd23ea2d0d908:ctest --test-dir build --output-on-failure --parallel 4: 2001 passed, 3 failed, 4 skipped out of 2008, in 274.52 s. The suite is not fully green.All 15 NGS2 tests passed on that previous head, including the same PCM regression linked separately against both NGS2 libraries. The retained regressions check literal sample bytes, multichannel interleaving, unaligned input, skips, repeats, cross-block resampling, pitch, callbacks, byte positions, short/overflowing buffers and integer/float narrowing.
2026-10-23 maintainer follow-up: removed throw expectations for unimplemented incomplete streaming, silence, configuration, floating inputs and waveform setup. Rebuilt
ngs2_pcm_testsandngs2_core_pcm_tests;ctest --test-dir build -R "^(ngs2_pcm|ngs2_core_pcm)$" --output-on-failurepasses 2/2. This follow-up changes tests only; the full suite was not repeated.The three full-suite failures are
agc_driver_sample_order,agc_driver_sample_order_grid_referenceandagc_driver_sample_order_recipe_depth_locations. They also fail serially on unchanged mainc188e01a4286bfc402519df2ceb56441479cc835, on this same machine/GPU, with identical assertion messages. That tested head reproduces those same three messages; no additional failures occurred. This patch changes no AGC, shader or VideoOut code.Baseline assertions: standard 2x sample locations and the grid-reference composite do not leave depth both at and below the clear value; recipe-depth-locations reports depth other than the clear value after the clear between a recorded draw and replay.
Skipped:
agc_host_import_sparse,agc_driver_sparse_dma_buf_import,agc_driver_stencil_ref_export,guest_video_out_wqhd_detection_no_vulkan.python tools/check_conventions.py --base origin/mainandgit diff --checkpass. The previoustools/pr_overlap.py --branch feat/ngs2-pcm-playback --repo boykopovar/AnyPS5 --jobs 6run reported no direct overlap among comparisons it completes and warns that the four conflicted branches cannot be compared. The linked manual review documents their actual conflicts and integration requirements.The tests establish host conversion and integration behavior. PS5 numerical equivalence remains unverified as recorded in the existing library debt file.
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-23T10:30:16Z.
Review: APPROVED
Reviewed the full diff, linked issue #10126 and the existing NGS2 format/render paths. The change keeps this scope to sampler input playback; render-buffer output remains on the existing supported formats. I checked the signed 24-bit sign extension, signed-width normalization, little-endian float decoding and range checks, and the updates to frame positions, byte accounting, skips, repeats, resampling and multichannel access. The new tests exercise both NGS2 libraries and cover those paths, malformed/incomplete input, unsupported formats and floating-point edge cases. The unsupported console-specific behavior is recorded in the library debt entry.
The PR's reported Windows run passes all 15 NGS2 tests; its full suite has three failures that the author reproduced with identical assertions on unchanged main, and four skips. The hosted intake, conventions and labels checks pass; hosted Linux/Windows builds are skipped by repository policy. I ran the conventions checker and
git diff --checkon the exact head; both pass. I also attempted a local focused build, but CMake configuration stops before building because the SDL2 submodule is absent and XRandR development support is unavailable in this environment. The PR is mergeable with current main, and the pairwise merge check is clean. I found no blocking correctness issue.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-23T11:13:33Z.
Review: APPROVED
Reviewed the exact head
1d945338ebec8582daa8921f213cd23ea2d0d908. The sample-width helper is used consistently for frame addressing, byte counts and waveform positions; signed 24-bit sign extension, signed normalization, float range checks and multichannel reads have targeted fixtures. New formats are limited to complete blocks, and the remaining numerical/console assumptions are recorded in debt. The PR documents the three unrelated AGC failures as reproduced on unchanged main, with no additional failures on its full Windows suite; all 15 NGS2 tests reportedly pass, including both library variants. Hosted conventions, intake, labels and report pass; product jobs were skipped by path policy. I reviewed the listed overlap conflicts and the explicit coordination notes; this PR does not claim the combined branches were tested. No blocking issue found.