feat(libSceNgs2.native): implement system, racks, voices and PCM rendering #247
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/247"
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 adriadam10 on 2026-10-01T18:46:07Z.
What
First of three NGS2 pull requests. The implementation lives only in
libSceNgs2.native;libSceNgs2only exportedNotImplementedstubs of functions that.nativeimplements, so, as asked in #228 and #241, itsExport.cppis nowAPS5_DUMMY_FUNonly, likelibkernel_sys(no title found that importslibSceNgs2without.native).Implemented:
ResetOption,QueryBufferSize,Create,CreateWithAllocator,Destroy,GetInfo,SetGrainSamples,Render.0x1000, submixer0x2000, mastering0x3000):QueryBufferSize,Create,CreateWithAllocator,Destroy,GetVoiceHandle,Lock,Unlock.Control(matrix levels, port volume/matrix, patch, events, block callback, sampler setup/waveform blocks/exit loop/pitch, submixer and mastering setup, mastering output),RunCommands(event, matrix levels, port volume, port matrix),GetState(sampler, submixer),GetStateFlags.Not implemented, these throw: ATRAC9 and other waveform types, custom/reverb racks, filters, envelopes, port delay, unknown voice params and commands.
ParseWaveformData,CalcWaveformBlock,Pan*andGeom*stayNotImplemented(next pull requests).The NGS2 types move from
SceTypes.hpptolibSceNgs2.native/include/Ngs2Types.hppwith the PS5 layouts, checked withstatic_assert:nameis 64 bytes,SystemOptionhasjob_scheduler_optionsandmax_voice_channels(144 bytes),RackOption176,SystemInfo184,VoiceState8.sceNgs2VoiceRunCommandstakes(handle, commands, size_t count).References (behaviour, layouts and codes only, no code copied): KytyPS5
src/libs/ngs2.cpp(layouts, param ids, PS5 error codes0x804A8010/8011/8201/8202), SharpProsperoNgs2.cs(rack ids, waveform types). shadPS4's codes (0x804A0xxx) are the PS4 numbering and differ from KytyPS5's PS5 ones, so only the four PS5 codes known from KytyPS5 are returned; other invalid arguments throw.Tested
Linux (GCC, Release). New
ngs2_rendertest renders known PCM and compares exact samples: block end and callback, pitch 0.5 with a repeated block, submixer with a matrix to stereo float, allocator create/destroy, error codes and system info. Fullctest: 91/91 pass. NID patching of both.prxsucceeds. No title tested.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); no silent stubs.mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-01T18:46:29Z.
Progress report (
c00bc19→90295d3)📈 System libraries: 79.5% (+1.31%, +22 implemented, -25 removed functions)
✅ 22 implemented
AllocateOnBlockReleasesceNgs2RackCreatesceNgs2RackCreateWithAllocatorsceNgs2RackDestroysceNgs2RackGetVoiceHandlesceNgs2RackLocksceNgs2RackQueryBufferSizesceNgs2RackUnlocksceNgs2SystemCreatesceNgs2SystemCreateWithAllocatorsceNgs2SystemDestroysceNgs2SystemGetInfosceNgs2SystemQueryBufferSizesceNgs2SystemRendersceNgs2SystemResetOptionsceNgs2SystemSetGrainSamplessceNgs2VoiceControlsceNgs2VoiceGetStatesceNgs2VoiceGetStateFlagssceNgs2VoiceRunCommands🗑️ 25 removed
sceNgs2CalcWaveformBlocksceNgs2GeomApplysceNgs2GeomCalcListenersceNgs2GeomResetListenerParamsceNgs2GeomResetSourceParamsceNgs2PanGetVolumeMatrixsceNgs2PanInitsceNgs2ParseWaveformDatasceNgs2RackCreatesceNgs2RackCreateWithAllocatorsceNgs2RackDestroysceNgs2RackGetVoiceHandlesceNgs2RackLocksceNgs2RackQueryBufferSizesceNgs2RackUnlocksceNgs2SystemCreatesceNgs2SystemCreateWithAllocatorsceNgs2SystemDestroysceNgs2SystemGetInfosceNgs2SystemQueryBufferSizesceNgs2SystemRendersceNgs2SystemSetGrainSamplessceNgs2VoiceControlsceNgs2VoiceGetStatesceNgs2VoiceGetStateFlagsImported from boykopovar/AnyPS5. Originally posted by boykopovar on 2026-10-01T20:58:33Z.
As I understand it, libSceNgs2 is currently a complete copy of libSceNgs2.native? Unless this is caused by a game being found that imports libSceNgs2 but doesn't import libSceNgs2.native, there's no need to duplicate it; you can simply leave libSceNgs2 empty.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-02T04:22:09Z.
Right, no title needed it. Moved: the implementation now lives only in
libSceNgs2.native;libSceNgs2is back to its stubs (its only change is including the NGS2 types header from.native, since the types leftSceTypes.hpp). #248 is rebased the same way.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-02T07:25:19Z.
Following the review on #228/#241:
libSceNgs2/Export.cppis nowAPS5_DUMMY_FUNonly, likelibkernel_sys. All 25 of its stubs are exported bylibSceNgs2.native. Rebased onmain.