feat(libSceGameLiveStreaming): answer offline setting and feedback calls locally #9524

Merged
AlxcBTW merged 3 commits from upstream-pr/9524 into main 2026-10-29 09:40:28 +00:00
AlxcBTW commented 2026-10-22 00:13:58 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by AlxcBTW on 2026-10-22T00:13:58Z.


What

Sixteen libSceGameLiveStreaming exports are still NotImplemented_nid_no_patch stubs, so every call from a title that imports them throws. The debt file already notes that PS4 titles import the library and do not load without it. This replaces the stubs with typed implementations that answer locally, the way the host already treats the service: it never broadcasts.

Under the existing g_mutex / g_initialized lifecycle each call returns 0x80A00004 (not initialized) first, then 0x80A00002 for an invalid argument, otherwise 0. Invalid means, from BunnyFl's firmware 13.42 check on this PR: a null pointer (also a null array with count 0 for SetSpoilerTag, a null messages with capacity 0 for GetSocialFeedbackMessages), a feedback type outside 1-3, a string longer than 240 (SetMetadata), 720 (preset description), 45 (invitation session id) or 360 (PostSocialMessage) characters, more than 16 spoiler tags or 5 preset commands, and a non-zero reserved tail (31 bytes at offset 193 of the 224-byte spoiler tag, 197 of the 228-byte preset command, 9 of the camera setting). Nothing is stored; queries report zero messages. The service's return after validation is not measured.

Left out on purpose: Enable... (#9319), GetProgramInfo (#9031), the old GetCurrentStatus, the Screen* group, ServiceProviderPermission, RegisterCallback, and the standby-screen calls.

Tested

  • Linux (Ubuntu 24.04, lavapipe), fork CI at 26f72b63e5 (the PR head 24d6b39768 plus the CI scaffolding commit; run 39689382586, ctest -R guest_game_live_streaming): 1 of 1 passed (guest_game_live_streaming, 0.01 s). Not run on Windows.
  • GuestGameLiveStreaming.cpp calls the exports directly. Before sceGameLiveStreamingInitialize(0x4000) and again after Terminate, every one of the 16 returns 0x80A00004, also with null pointers (lifecycle is checked before arguments). While initialized, null pointer arguments return 0x80A00002 and valid arguments return 0, including extreme values (SetMaxBitrate with 0 and 0xffffffff, a count of 0x1000, empty strings). The Count query overwrites a sentinel with 0, GetSocialFeedbackMessages overwrites its sentinel with 0 and leaves a buffer pre-filled with 0xAA unchanged for several message types, Clear* calls are repeated, and zero-count calls with a null array return 0 (this is the case stated as unmeasured).
  • No console and no title were used; behaviour on a PS5 is not measured.
  • python3 tools/check_conventions.py --base origin/main passes. Based on a6dcea9279.
  • tools/pr_overlap.py --branch lists #9031 and #9319 (same three files; #9031 is listed under "same exports" for sceGameLiveStreamingGetProgramInfo, which this PR does not change, the insertion sits directly above it) and could not compare the three shared files because both conflict with main. Neither implements one of the sixteen functions. #9126 (a test asserting that PermitLiveStreaming and SetMaxBitrate still throw) is closed, so nothing contradicts this change; a re-opened version would have to be rebased onto it. #9031 and #9319 touch the same three files and will need a rebase for whichever lands second.

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 under Silent stubs in their library's technical debt file
  • 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 (none open; #9126 is closed)
  • Fixes: none
  • Unblocks: none (no named title, no Game bring-up discussion)
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4960093100 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9524). Originally posted by [AlxcBTW](https://github.com/AlxcBTW) on 2026-10-22T00:13:58Z. --- ### What Sixteen `libSceGameLiveStreaming` exports are still `NotImplemented_nid_no_patch` stubs, so every call from a title that imports them throws. The debt file already notes that PS4 titles import the library and do not load without it. This replaces the stubs with typed implementations that answer locally, the way the host already treats the service: it never broadcasts. Under the existing `g_mutex` / `g_initialized` lifecycle each call returns `0x80A00004` (not initialized) first, then `0x80A00002` for an invalid argument, otherwise 0. Invalid means, from BunnyFl's firmware 13.42 check on this PR: a null pointer (also a null array with count 0 for `SetSpoilerTag`, a null `messages` with capacity 0 for `GetSocialFeedbackMessages`), a feedback type outside 1-3, a string longer than 240 (`SetMetadata`), 720 (preset description), 45 (invitation session id) or 360 (`PostSocialMessage`) characters, more than 16 spoiler tags or 5 preset commands, and a non-zero reserved tail (31 bytes at offset 193 of the 224-byte spoiler tag, 197 of the 228-byte preset command, 9 of the camera setting). Nothing is stored; queries report zero messages. The service's return after validation is not measured. Left out on purpose: `Enable...` (#9319), `GetProgramInfo` (#9031), the old `GetCurrentStatus`, the `Screen*` group, `ServiceProviderPermission`, `RegisterCallback`, and the standby-screen calls. ### Tested - Linux (Ubuntu 24.04, lavapipe), fork CI at 26f72b63e5 (the PR head 24d6b39768 plus the CI scaffolding commit; run 39689382586, `ctest -R guest_game_live_streaming`): 1 of 1 passed (`guest_game_live_streaming`, 0.01 s). Not run on Windows. - `GuestGameLiveStreaming.cpp` calls the exports directly. Before `sceGameLiveStreamingInitialize(0x4000)` and again after `Terminate`, every one of the 16 returns `0x80A00004`, also with null pointers (lifecycle is checked before arguments). While initialized, null pointer arguments return `0x80A00002` and valid arguments return 0, including extreme values (`SetMaxBitrate` with 0 and 0xffffffff, a count of 0x1000, empty strings). The `Count` query overwrites a sentinel with 0, `GetSocialFeedbackMessages` overwrites its sentinel with 0 and leaves a buffer pre-filled with 0xAA unchanged for several message types, `Clear*` calls are repeated, and zero-count calls with a null array return 0 (this is the case stated as unmeasured). - No console and no title were used; behaviour on a PS5 is not measured. - `python3 tools/check_conventions.py --base origin/main` passes. Based on a6dcea9279. - `tools/pr_overlap.py --branch` lists #9031 and #9319 (same three files; #9031 is listed under "same exports" for `sceGameLiveStreamingGetProgramInfo`, which this PR does not change, the insertion sits directly above it) and could not compare the three shared files because both conflict with `main`. Neither implements one of the sixteen functions. #9126 (a test asserting that `PermitLiveStreaming` and `SetMaxBitrate` still throw) is closed, so nothing contradicts this change; a re-opened version would have to be rebased onto it. #9031 and #9319 touch the same three files and will need a rebase for whichever lands second. ### 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 under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [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 (none open; #9126 is closed) - [x] Fixes: none - [x] Unblocks: none (no named title, no Game bring-up discussion) - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-10-22 00:29:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T00:29:27Z.

Review: CHANGES_REQUESTED


The 16 functions have consistent lifecycle-first checks, typed declarations, focused state/output tests, and corresponding debt notes. The author-reported Linux test passes; current eligibility, intake, labels and report checks pass, while conventions is still in progress in the latest snapshot. Hosted product and relinker jobs are skipped. I did not run a local build or tests.

Please resolve the repository-required overlap ordering before merge. The live overlap scan reports the shared GetProgramInfo area with #9031 and cannot compare the shared Export.cpp, test, and debt files for #9031/#9319 because those PRs conflict with current main. Direct three-way merges confirm conflicts in all three shared files with both PRs. Your description says whichever lands second will rebase, but the checklist says Depends on: none; please coordinate the order, record the agreed prerequisite(s), and rebase/resolve the shared changes.

The PR body also includes a Claude session URL. AI-assisted: yes already provides the required disclosure; please remove the session link since it is unnecessary to review the change and may expose more information than the repository needs.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5607861902 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9524#pullrequestreview-5607861902). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T00:29:27Z. **Review:** CHANGES_REQUESTED --- The 16 functions have consistent lifecycle-first checks, typed declarations, focused state/output tests, and corresponding debt notes. The author-reported Linux test passes; current eligibility, intake, labels and report checks pass, while conventions is still in progress in the latest snapshot. Hosted product and relinker jobs are skipped. I did not run a local build or tests. Please resolve the repository-required overlap ordering before merge. The live overlap scan reports the shared `GetProgramInfo` area with #9031 and cannot compare the shared `Export.cpp`, test, and debt files for #9031/#9319 because those PRs conflict with current `main`. Direct three-way merges confirm conflicts in all three shared files with both PRs. Your description says whichever lands second will rebase, but the checklist says `Depends on: none`; please coordinate the order, record the agreed prerequisite(s), and rebase/resolve the shared changes. The PR body also includes a Claude session URL. `AI-assisted: yes` already provides the required disclosure; please remove the session link since it is unnecessary to review the change and may expose more information than the repository needs.
fogydes commented 2026-10-22 08:41:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fogydes on 2026-10-22T08:41:24Z.


Reviewed; this is consistent with the module's established pattern. The 12 converted calls follow the module's existing error vocabulary (ErrorNotInitialized / ErrorInvalidArgument, which are the codes the sibling sceGameLiveStreamingInitialize/GetSocialFeedbackMessagesCount already use — nothing invented), the lifecycle→null argument ordering matches the one pre-existing converted sibling, and the null-argument cases are recorded as unmeasured in the debt entry rather than presented as console behavior — the right shape given the signatures come from Orbital's db_types.json and the zero-answers trail fpPS4's Pascal module, both disclosed in the body.

Notes:

  1. There's no GetSocialFeedbackMessages-by-array call visible in the diff — the acquired/count pairs are covered, but if the console has a "read messages by index" counterpart the stub for it still throws; fine to leave for a follow-up given the count checks stub at zero.
  2. The offline answers are self-consistent by construction (nothing is stored, so a post-enable status query still reports 0 and GetCurrentStatus2 stays at its inactive stub) — that's the honest minimal model while the host broadcasts nothing. If a title later polls one of these expecting nonzero after enabling social feedback, that becomes the first real data point for this file's debt.
  3. The zero-count/null-array cases (SetSpoilerTag(0, nullptr) etc., which some hosts reject) are handled as success with no new constant — consistent with the "no valid-code" approach in the debt text; just flagging that this is an Orbital-inferred choice, which the debt file already says.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336554374 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9524#issuecomment-6336554374). Originally posted by [fogydes](https://github.com/fogydes) on 2026-10-22T08:41:24Z. --- Reviewed; this is consistent with the module's established pattern. The 12 converted calls follow the module's existing error vocabulary (`ErrorNotInitialized` / `ErrorInvalidArgument`, which are the codes the sibling `sceGameLiveStreamingInitialize`/`GetSocialFeedbackMessagesCount` already use — nothing invented), the lifecycle→null argument ordering matches the one pre-existing converted sibling, and the null-argument cases are recorded as unmeasured in the debt entry rather than presented as console behavior — the right shape given the signatures come from Orbital's `db_types.json` and the zero-answers trail fpPS4's Pascal module, both disclosed in the body. Notes: 1. There's no `GetSocialFeedbackMessages`-by-array call visible in the diff — the acquired/count pairs are covered, but if the console has a "read messages by index" counterpart the stub for it still throws; fine to leave for a follow-up given the count checks stub at zero. 2. The offline answers are self-consistent by construction (nothing is stored, so a post-enable status query still reports 0 and `GetCurrentStatus2` stays at its inactive stub) — that's the honest minimal model while the host broadcasts nothing. If a title later polls one of these expecting nonzero after enabling social feedback, that becomes the first real data point for this file's debt. 3. The zero-count/null-array cases (`SetSpoilerTag(0, nullptr)` etc., which some hosts reject) are handled as success with no new constant — consistent with the "no valid-code" approach in the debt text; just flagging that this is an Orbital-inferred choice, which the debt file already says.
BunnyFl commented 2026-10-22 08:47:51 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-10-22T08:47:51Z.


Checked these 16 against firmware 13.42's libSceGameLiveStreaming.sprx, running each function under an emulator with the service call stubbed. The not-initialised and null checks you have match. The firmware also rejects these with 0x80A00002 before it calls the service:

  • ClearSocialFeedbackMessages, GetSocialFeedbackMessagesCount, GetSocialFeedbackMessages: a type other than 1–3.
  • SetMetadata, SetPresetSocialFeedbackCommandsDescription, SetInvitationSessionId, PostSocialMessage: a string longer than 240, 720, 45 and 360 characters.
  • SetSpoilerTag: a count of 17 or more, or a null array even when the count is 0. Each tag is 224 bytes, not 96, and its 31 bytes at offset 193 must be zero.
  • SetPresetSocialFeedbackCommands: a count above 5. Each command is 228 bytes, and its 31 bytes at offset 197 must be zero.
  • SetCameraFrameSetting: any non-zero byte in the 31 bytes at offset 9.
  • GetSocialFeedbackMessages: a null messages even when the capacity is 0.

I didn't check what the service returns after these checks.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6336671575 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9524#issuecomment-6336671575). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-10-22T08:47:51Z. --- Checked these 16 against firmware 13.42's `libSceGameLiveStreaming.sprx`, running each function under an emulator with the service call stubbed. The not-initialised and null checks you have match. The firmware also rejects these with `0x80A00002` before it calls the service: - `ClearSocialFeedbackMessages`, `GetSocialFeedbackMessagesCount`, `GetSocialFeedbackMessages`: a type other than 1–3. - `SetMetadata`, `SetPresetSocialFeedbackCommandsDescription`, `SetInvitationSessionId`, `PostSocialMessage`: a string longer than 240, 720, 45 and 360 characters. - `SetSpoilerTag`: a count of 17 or more, or a null array even when the count is 0. Each tag is 224 bytes, not 96, and its 31 bytes at offset 193 must be zero. - `SetPresetSocialFeedbackCommands`: a count above 5. Each command is 228 bytes, and its 31 bytes at offset 197 must be zero. - `SetCameraFrameSetting`: any non-zero byte in the 31 bytes at offset 9. - `GetSocialFeedbackMessages`: a null `messages` even when the capacity is 0. I didn't check what the service returns after these checks. AI-assisted: yes (Claude Code)
MarcZX10 commented 2026-10-22 11:40:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T11:40:48Z.

Review: CHANGES_REQUESTED


I rechecked head 24d6b39768: it merges cleanly with current main, diff-check/conventions pass, and the author reports the focused Linux test passing. The branch is 2 ahead / 119 behind current main (base a6dcea927), so refresh and rerun before merge.

A new firmware 13.42 check on this PR’s 16 entry points reports validation that this implementation currently omits (BunnyFl’s comment, https://github.com/boykopovar/AnyPS5/pull/9524#issuecomment-6336671575). The current code accepts arbitrary feedback types, string lengths, array counts and reserved bytes, uses 96-byte spoiler tags, and permits null arrays/messages for zero capacity. The firmware check reports 0x80A00002 for out-of-range message types, strings over 240/720/45/360 bytes, spoiler counts ≥17 or null arrays (including count 0), nonzero tag reserved bytes, preset counts >5/nonzero preset reserved bytes, nonzero camera reserved bytes, and null message arrays even at capacity 0. Please verify these cases against the available firmware evidence, implement the supported checks/layouts, and add boundary/regression tests; update the debt entry and report exact firmware/build evidence. The service return values remain untested, so retaining the local offline response after validation is still a separate explicit limit.

The repository overlap blocker is also still live. #9031 and #9319 remain open, while this PR says Depends on: none; pairwise merge checks currently conflict in GuestGameLiveStreaming.cpp with both, and also in the debt file with #9031. Please agree on the order with both authors and declare the needed dependency/dependencies, then preserve all tests and debt entries through the rebase. The earlier request to remove the unnecessary session link is resolved; the PR still discloses AI assistance. I did not run a local build in this pass.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5613572604 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9524#pullrequestreview-5613572604). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-22T11:40:48Z. **Review:** CHANGES_REQUESTED --- I rechecked head `24d6b39768`: it merges cleanly with current `main`, diff-check/conventions pass, and the author reports the focused Linux test passing. The branch is 2 ahead / 119 behind current `main` (base `a6dcea927`), so refresh and rerun before merge. A new firmware 13.42 check on this PR’s 16 entry points reports validation that this implementation currently omits (BunnyFl’s comment, https://github.com/boykopovar/AnyPS5/pull/9524#issuecomment-6336671575). The current code accepts arbitrary feedback types, string lengths, array counts and reserved bytes, uses 96-byte spoiler tags, and permits null arrays/messages for zero capacity. The firmware check reports `0x80A00002` for out-of-range message types, strings over 240/720/45/360 bytes, spoiler counts ≥17 or null arrays (including count 0), nonzero tag reserved bytes, preset counts >5/nonzero preset reserved bytes, nonzero camera reserved bytes, and null message arrays even at capacity 0. Please verify these cases against the available firmware evidence, implement the supported checks/layouts, and add boundary/regression tests; update the debt entry and report exact firmware/build evidence. The service return values remain untested, so retaining the local offline response after validation is still a separate explicit limit. The repository overlap blocker is also still live. #9031 and #9319 remain open, while this PR says `Depends on: none`; pairwise merge checks currently conflict in `GuestGameLiveStreaming.cpp` with both, and also in the debt file with #9031. Please agree on the order with both authors and declare the needed dependency/dependencies, then preserve all tests and debt entries through the rebase. The earlier request to remove the unnecessary session link is resolved; the PR still discloses AI assistance. I did not run a local build in this pass.
adriadam10 commented 2026-10-25 15:22:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-25T15:22:09Z.

Review: CHANGES_REQUESTED


Thanks for the PR. Two things block it:

  • main now has #9031 and #9319 merged, and this branch conflicts in core/libs/prx/libSceGameLiveStreaming/Export.cpp, core/libs/tests/GuestGameLiveStreaming.cpp and docs/dev/debt/libSceGameLiveStreaming.md. Please rebase and keep both sides of each hunk (the ordering question with them is moot now).
  • BunnyFl's firmware 13.42 check (comment) contradicts what the PR hardcodes, and MarcZX10's two reviews asking for it are still unanswered on this head:
    • GameLiveStreamingSpoilerTag is declared as 96 bytes (text[65] + reserved[31], with a static_assert); the firmware uses 224-byte tags with the 31 reserved bytes at offset 193 required to be zero. The preset command is 228 bytes (reserved at 197) and the camera setting has 31 reserved bytes at offset 9.
    • 0x80A00002 is also returned for a feedback type outside 1–3 (ClearSocialFeedbackMessages, GetSocialFeedbackMessagesCount, GetSocialFeedbackMessages), strings longer than 240/720/45/360 (SetMetadata, SetPresetSocialFeedbackCommandsDescription, SetInvitationSessionId, PostSocialMessage), a spoiler count ≥ 17 or a preset count > 5, and a null array for SetSpoilerTag / null messages for GetSocialFeedbackMessages even when the count/capacity is 0.
    • The tests currently assert the opposite for some of these (e.g. SetSpoilerTag(0x1000, &tag) and zero-count null arrays return 0), and the PR states "no range, length, count or type errors are invented".

Please implement the checks and layouts that evidence supports, add boundary tests for each (type 0/1/3/4, string at limit and limit+1, counts 16/17 and 5/6, a non-zero reserved byte, null array with count 0), and update the debt entry to say what is still unmeasured (the service's return after validation). If you disagree with any of BunnyFl's values, say which and why.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5643843837 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9524#pullrequestreview-5643843837). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-25T15:22:09Z. **Review:** CHANGES_REQUESTED --- Thanks for the PR. Two things block it: - `main` now has #9031 and #9319 merged, and this branch conflicts in `core/libs/prx/libSceGameLiveStreaming/Export.cpp`, `core/libs/tests/GuestGameLiveStreaming.cpp` and `docs/dev/debt/libSceGameLiveStreaming.md`. Please rebase and keep both sides of each hunk (the ordering question with them is moot now). - BunnyFl's firmware 13.42 check ([comment](https://github.com/boykopovar/AnyPS5/pull/9524#issuecomment-6336671575)) contradicts what the PR hardcodes, and MarcZX10's two reviews asking for it are still unanswered on this head: - `GameLiveStreamingSpoilerTag` is declared as 96 bytes (`text[65]` + `reserved[31]`, with a `static_assert`); the firmware uses 224-byte tags with the 31 reserved bytes at offset 193 required to be zero. The preset command is 228 bytes (reserved at 197) and the camera setting has 31 reserved bytes at offset 9. - `0x80A00002` is also returned for a feedback type outside 1–3 (`ClearSocialFeedbackMessages`, `GetSocialFeedbackMessagesCount`, `GetSocialFeedbackMessages`), strings longer than 240/720/45/360 (`SetMetadata`, `SetPresetSocialFeedbackCommandsDescription`, `SetInvitationSessionId`, `PostSocialMessage`), a spoiler count ≥ 17 or a preset count > 5, and a null array for `SetSpoilerTag` / null `messages` for `GetSocialFeedbackMessages` even when the count/capacity is 0. - The tests currently assert the opposite for some of these (e.g. `SetSpoilerTag(0x1000, &tag)` and zero-count null arrays return 0), and the PR states "no range, length, count or type errors are invented". Please implement the checks and layouts that evidence supports, add boundary tests for each (type 0/1/3/4, string at limit and limit+1, counts 16/17 and 5/6, a non-zero reserved byte, null array with count 0), and update the debt entry to say what is still unmeasured (the service's return after validation). If you disagree with any of BunnyFl's values, say which and why.
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!9524
No description provided.