feat(libSceNpSessionSignaling): implement sceNpSessionSignalingGetConnectionStatus, GetConnectionStatistics, GetMemoryInfo #1582

Closed
Deses wants to merge 1 commit from upstream-pr/1582 into main
Deses commented 2026-10-08 13:30:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Deses on 2026-10-08T13:30:28Z.


What

Implements sceNpSessionSignalingGetConnectionStatus, sceNpSessionSignalingGetConnectionStatistics and sceNpSessionSignalingGetMemoryInfo for the library's offline model (contexts exist, no connection is ever created), with the signatures from the SDK reference. GetConnectionStatistics and GetMemoryInfo were declared without parameters and take one output pointer each; the ids of GetConnectionStatus are uint32_t (were int32_t).

  • GetConnectionStatus: NOT_INITIALIZED (0x80553301) before Initialize, INVALID_ARGUMENT for a null connStatus, CTX_NOT_FOUND (0x80553308) for a context that was never created or was destroyed, otherwise CONN_NOT_FOUND (0x8055330C). Nothing is written.
  • GetConnectionStatistics: the four counters (0x10 bytes) are 0.
  • GetMemoryInfo: totalMemSize is the poolSize passed to Initialize; current and peak usage are 0, as nothing is allocated from the pool; the reserved bytes are zeroed (0x28 bytes).
  • For these, Initialize reads SceNpSessionSignalingInitParam (0x28 bytes) and keeps poolSize; a null param returns INVALID_ARGUMENT and a second call ALREADY_INITIALIZED (0x80553302). Terminate returns NOT_INITIALIZED when the library is not initialized and drops the contexts. CreateContext2 and DestroyContext keep the set of live context ids; their results are unchanged.
  • TechnicalDebt: the two "unknown signature" entries are removed and NpSessionSignaling leaves the "assumed signatures" line (no export of the library is left without an implementation; tools/progress.py reports 15 of 15). New Unknown function info entries for the unknown-connection result and the pool usage GetMemoryInfo reports.

Sources (Sony SDK 12.000 NpSessionSignaling reference, mirrored in peterpuppy/bm under features/ps5):

Unconfirmed: the result for a connection id that does not exist. The reference lists CONN_NOT_FOUND but also describes status INACTIVE (0) as "a connection with the specified ID does not exist"; the error is returned here, as no connection id is ever handed out. The console's own pool usage after initialization is unknown. The library's existing UNAVAILABLE (0x80552D06) is not in the reference's error table; it is left as is.

Overlaps: #1128 (clang-format) reformats the old GetConnectionStatus and #1539 removes the same two TechnicalDebt entries; neither implements these calls.

Tested

Windows 11, GCC 15.2.0 (WinLibs), Release, in this branch's worktree rebased on current upstream/main (fe9beae0): full build, libs target and ctest -R np_ pass. guest_np_session_signaling checks the three calls and Terminate before Initialize (NOT_INITIALIZED), a null and a second Initialize, null outputs, the pool size of the first Initialize with zero usage, zero statistics, CTX_NOT_FOUND for an unknown and a destroyed context, CONN_NOT_FOUND with the outputs left untouched, and NOT_INITIALIZED after Terminate. check_conventions.py and check_test_registration.py clean. No title tested.

CI: the upstream runs for this head are waiting for approval (#1631). The same Build workflow ran on the fork for head 0c6ce38b: https://github.com/Deses/AnyPS5/actions/runs/37804528715, Windows green; Linux stopped at check_test_registration.py because the base fe9beae0 still carried the guest_formatting_tests exception that #1603 removed. The head merged into current main (4b005b22, merge 191b8e99): https://github.com/Deses/AnyPS5/actions/runs/37805201526, Linux and Windows (full build, libs, ctest) and the relinker jobs (Linux, Windows, macOS) green.

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:4787554416 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1582). Originally posted by [Deses](https://github.com/Deses) on 2026-10-08T13:30:28Z. --- ### What Implements `sceNpSessionSignalingGetConnectionStatus`, `sceNpSessionSignalingGetConnectionStatistics` and `sceNpSessionSignalingGetMemoryInfo` for the library's offline model (contexts exist, no connection is ever created), with the signatures from the SDK reference. `GetConnectionStatistics` and `GetMemoryInfo` were declared without parameters and take one output pointer each; the ids of `GetConnectionStatus` are `uint32_t` (were `int32_t`). - `GetConnectionStatus`: `NOT_INITIALIZED` (0x80553301) before `Initialize`, `INVALID_ARGUMENT` for a null `connStatus`, `CTX_NOT_FOUND` (0x80553308) for a context that was never created or was destroyed, otherwise `CONN_NOT_FOUND` (0x8055330C). Nothing is written. - `GetConnectionStatistics`: the four counters (0x10 bytes) are 0. - `GetMemoryInfo`: `totalMemSize` is the `poolSize` passed to `Initialize`; current and peak usage are 0, as nothing is allocated from the pool; the reserved bytes are zeroed (0x28 bytes). - For these, `Initialize` reads `SceNpSessionSignalingInitParam` (0x28 bytes) and keeps `poolSize`; a null param returns `INVALID_ARGUMENT` and a second call `ALREADY_INITIALIZED` (0x80553302). `Terminate` returns `NOT_INITIALIZED` when the library is not initialized and drops the contexts. `CreateContext2` and `DestroyContext` keep the set of live context ids; their results are unchanged. - TechnicalDebt: the two "unknown signature" entries are removed and NpSessionSignaling leaves the "assumed signatures" line (no export of the library is left without an implementation; `tools/progress.py` reports 15 of 15). New Unknown function info entries for the unknown-connection result and the pool usage `GetMemoryInfo` reports. Sources (Sony SDK 12.000 NpSessionSignaling reference, mirrored in peterpuppy/bm under `features/ps5`): - [`GetConnectionStatus`, `SceNpSessionSignalingConnectionStatus` and its errors](https://github.com/peterpuppy/bm/blob/3f9d1ba6b896a53080460c903f5c15af8affb80d/features/ps5/document/output/psn_12/PlayStationNetwork/Peer_to_Peer_Communication/NpSessionSignaling-Reference/sce-np-session-signaling-get-connection-status.md?plain=1#L132-L203) - [`GetConnectionStatistics`, `GetMemoryInfo` and their structures](https://github.com/peterpuppy/bm/blob/3f9d1ba6b896a53080460c903f5c15af8affb80d/features/ps5/document/output/psn_12/PlayStationNetwork/Peer_to_Peer_Communication/NpSessionSignaling-Reference/sce-np-session-signaling-get-connection-statistics.md?plain=1#L7-L150) - [`SceNpSessionSignalingInitParam`, `Initialize` and `Terminate` errors](https://github.com/peterpuppy/bm/blob/3f9d1ba6b896a53080460c903f5c15af8affb80d/features/ps5/document/output/psn_12/PlayStationNetwork/Peer_to_Peer_Communication/NpSessionSignaling-Reference/sce-np-session-signaling-initialize.md?plain=1#L7-L150) - [Context and connection ids are `uint32_t`](https://github.com/peterpuppy/bm/blob/3f9d1ba6b896a53080460c903f5c15af8affb80d/features/ps5/document/output/psn_12/PlayStationNetwork/Peer_to_Peer_Communication/NpSessionSignaling-Reference/sce-np-session-signaling-context-id.md?plain=1#L15-L72) - The pages do not name the console; the three exports are in the PS5 3.20 firmware stubs ([DNNDHH/PS5-3.20_Libs `libSceNpSessionSignaling.c`](https://github.com/DNNDHH/PS5-3.20_Libs/blob/b2a77c09cd71c01f34c790cfbe98c751a13262ad/libSceNpSessionSignaling.c#L93-L142)). - NIDs (`tools/nid_names.py`, also in aerolib): GetConnectionStatus `n1fn2KFeLDA`, GetConnectionStatistics `+Q++Q49a9z8`, GetMemoryInfo `lbXTXRG5nyM`. The PS4 `sceNpSignaling*` counterparts were not used. Unconfirmed: the result for a connection id that does not exist. The reference lists `CONN_NOT_FOUND` but also describes status `INACTIVE` (0) as "a connection with the specified ID does not exist"; the error is returned here, as no connection id is ever handed out. The console's own pool usage after initialization is unknown. The library's existing `UNAVAILABLE` (0x80552D06) is not in the reference's error table; it is left as is. Overlaps: #1128 (clang-format) reformats the old `GetConnectionStatus` and #1539 removes the same two TechnicalDebt entries; neither implements these calls. ### Tested Windows 11, GCC 15.2.0 (WinLibs), Release, in this branch's worktree rebased on current upstream/main (fe9beae0): full build, `libs` target and `ctest -R np_` pass. `guest_np_session_signaling` checks the three calls and `Terminate` before `Initialize` (`NOT_INITIALIZED`), a null and a second `Initialize`, null outputs, the pool size of the first `Initialize` with zero usage, zero statistics, `CTX_NOT_FOUND` for an unknown and a destroyed context, `CONN_NOT_FOUND` with the outputs left untouched, and `NOT_INITIALIZED` after `Terminate`. `check_conventions.py` and `check_test_registration.py` clean. No title tested. CI: the upstream runs for this head are waiting for approval (#1631). The same Build workflow ran on the fork for head `0c6ce38b`: https://github.com/Deses/AnyPS5/actions/runs/37804528715, Windows green; Linux stopped at `check_test_registration.py` because the base `fe9beae0` still carried the `guest_formatting_tests` exception that #1603 removed. The head merged into current `main` (`4b005b22`, merge `191b8e99`): https://github.com/Deses/AnyPS5/actions/runs/37805201526, Linux and Windows (full build, `libs`, ctest) and the relinker jobs (Linux, Windows, macOS) green. ### Checklist - [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
oneandonlydean commented 2026-10-09 08:53:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-09T08:53:05Z.


Closing: no title is shown reaching these calls on main, and library functions go in when one does. The same goes for #1537, #1564 and #1583. Please reopen any of them with the title ID and the log line where it stops.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6077681304 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/1582#issuecomment-6077681304). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-09T08:53:05Z. --- Closing: no title is shown reaching these calls on main, and library functions go in when one does. The same goes for #1537, #1564 and #1583. Please reopen any of them with the title ID and the log line where it stops.

Pull request closed

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!1582
No description provided.