feat(libSceSystemService): answer queries for streaming, VR, shell and device features AnyPS5 does not have #9586
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/9586"
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 EagleBearerYS on 2026-10-22T03:26:47Z.
What
This answers 25 libSceSystemService queries about features AnyPS5 doesn't have, instead of throwing. Each answer comes from what the tree already reports.
sceLncUtilBlockAppSuspend/UnblockAppSuspend, andsceLncUtil/sceSystemServiceEnable/DisableSuspendNotification. AnyPS5 never suspends the title (GetStatusnever reports background execution, andReceiveEventhas no event), so these succeed and change nothing. An unblock with no block left returnsSCE_KERNEL_ERROR_EBUSYand changes nothing, before it reads the reason, as BunnyFl measured against firmware 13.42's library. A null reason still throwsNotImplemented_nid_no_patch: in a block the library reads it only for a log line whose path isn't measured, and in an unblock while a block is held it faults. The blocks are counted only to find the unblock with none left.sceShellCoreUtilGetRemotePlayStatus(withsceSystemServiceGetRemoteplayStatus),GetSharePlayStatus,GetGameLiveStreamingStatusand bothIsGameLiveStreamingOnAirreport no session. That matches what libSceRemoteplay (DISCONNECT), libSceSharePlay (no host or visitor) and libSceGameLiveStreaming (isOnAirfalse) already report.IsShellUiFgAndGameBgCpuMode(both),IsImposeScreenOverlaid,IsScreenSaverOn(both) andIsShellUIShutdownInProgressare false.GetSocialScreenStatusreports no social screen.IsEyeToEyeDistanceAdjusted(both) reports 0 for the logged-in user, since libSceHmd detects no headset. For another user ID it throwsNotImplemented_nid_no_patch, assceMoveOpendoes: AnyPS5's user service reports only that user (sceUserServiceGetLoginUserIdList), and what the console answers for other IDs is not measured.IsBdDriveReady,IsUsbMassStorageMountedandIsExternalStorageAppMoveInProgressare false, andsceLncUtilIsPs2Emuwrites false. libSceDiscId, the app-move declarations andAddLocalProcessForPs2Emuall throw. libSceUsbStorage lists host volumes only whenAPS5_USB_STORAGE_PASSTHROUGHis set (#11046, #11051), andIsUsbMassStorageMountedstays false even then: a known gap with no sourced answer, recorded in the debt file.Twins and null outputs:
sceSystemServicetwin forwards to itssceShellCoreUtil/sceLncUtiltarget.sceShellCoreUtilGetRemotePlayStatus,GetSharePlayStatusandGetGameLiveStreamingStatusreturn 0x80e30003 and write nothing.sceSystemServiceGetRemoteplayStatushas no null check of its own: it forwards, so it returns the same 0x80e30003.sceSystemServiceIsEyeToEyeDistanceAdjustedreturnsSYSTEM_SERVICE_ERROR_PARAMETERbefore forwarding.sceLncUtilIsPs2Emureturns 0x80940005.sceShellCoreUtilGetSocialScreenStatuswrites through the pointer and faults, andsceShellCoreUtilIsEyeToEyeDistanceAdjustedhands it to a service whose answer isn't measured, so those two still throwNotImplemented_nid_no_patchfor one.The ShellCore setters that would change these answers still throw. The debt file records the fixed answers and the throwing cases.
2bc794c94f, after oneandonlydean's review, drops the test assertions that pinned the unmeasured cases to throw. The code still throws for them, as the debt file says.Since then:
2e5b93fd5fmergesmain4bc9e779aaand takes jotitadev's fix for #10706's one-declaration rule: the test drops its 25 localextern "C"declarations and includes the library's header (Co-authored-by: jotitadev).2fd4c7024fcorrects the debt entry forIsUsbMassStorageMountedunder libSceUsbStorage passthrough.2831b2367duses #10801'sSHELL_CORE_UTIL_ERROR_INVALID_ARGUMENTandLNC_UTIL_ERROR_INVALID_ARGUMENTfor the null outputs, in place of this PR's duplicates with the same values.20078240fbincludes the umbrella headerprx/libSceSystemService/libSceSystemService.hpp, as oneandonlydean and MarcZX10 asked.Related: #9089 (merged;
sceSystemServiceIsBgmPlaying/sceShellCoreUtilIsBgmPlaying) and #8354 (the running title's app ID) answer neighbouring libSceSystemService queries. They touch none of these 25 functions.Overlap: checked with
git merge-treeon239de166ebagainst every open PR touching these files. The ones that merge cleanly withmainmerge cleanly with this PR too. Three conflict withmainthemselves, and I compared each with this PR and withmainalone:add_library_test. This PR adds one conflict there, inlibSceSystemService/CMakeLists.txt, where its fourguest_system_service_status_*registrations sit next tomain's. Neither waits: whichever merges second registers them in its form, and this PR takes that rebase if it's second.Tested
guest_system_service_status_*tests fail 2 of 2 runs on both runners withmain's stubs, whileguest_system_servicepasses there; with this PR all five pass ×5 on both. The libkernel suites pass on both. libc's passes on Windows; on Linux it failsprecise_wait, a timing test that fails in that run withmain's code too.f51064dbee(run): with the previous head's code, thesuspendandshelltests fail on both runners, as they now expectNotImplemented_nid_no_patch. With the commit the fourguest_system_service_status_*tests pass 10 runs in a row on both, and the libc and libkernel suites pass on both (115 and 197 on Linux, 142 and 207 on Windows).mainatd6eafa54d0(239de166eb; run):PendingExports.cppconflicted where #9089's merged stub deletions sit next to this PR's, and the merge keeps both, so each of the 25 functions is defined once, inExport.cpp. The PR's own diff is unchanged. Withmain's stubs the fourguest_system_service_status_*tests fail on both runners; with the merge they andguest_system_servicepass 10 runs in a row on both. The libkernel suites pass on both (197 on Linux, 207 on Windows), and libc's passes on Windows (143). On Linux libc fails onlyprecise_wait, which fails in that run withmain's code too.guest_system_service_status_{suspend,sessions,shell,devices}hold 32 cases. Each commit's cases fail against its parent's code, and the PR passes 10 repeats.SYSTEM_SERVICE_ERROR_PARAMETERfor them.7f26a225dd,main8b3e39832amerged in (clean; the PR's own diff is unchanged), on GitHub's runners (run):guest_system_service_status_suspend,_sessions,_shelland_devicespass 10 of 10 on Linux and Windows, and fail withmain's implementation on both. libkernel's suite passes on both and libc's on Windows. On Linux libc's one failure,precise_wait, failed withmain's implementation too.d64a74d8e9, BunnyFl's measured cases (comment): the null outputs above and the unblock with no block left answer as measured instead of throwing. Red, the commit's tests on 7f26a225dd's code (run): on both runners thesuspend,sessionsanddevicestests fail on exactly the seven changed cases, whileshellandguest_system_servicepass. Green (run): all five pass 10 runs in a row on Linux and on Windows, none skipped, and the libc and libkernel suites pass on both, run withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.check_conventions.pypasses, with no comment lines added.2bc794c94f, after oneandonlydean's review (run):GuestSystemServiceStatus.cppno longer asserts that the unmeasured cases throw:sceLncUtilBlockAppSuspend(nullptr),sceLncUtilUnblockAppSuspend(nullptr)while a block is held, the null outputs ofsceShellCoreUtilGetSocialScreenStatusandsceShellCoreUtilIsEyeToEyeDistanceAdjusted, and the other user IDs inReportsNotAdjusted. The answered cases and the measured null-output error codes stay.guest_system_serviceand the fourguest_system_service_status_*tests pass 10 runs in a row. Linux: 5 run, 5 pass, 0 skip, 0 fail. Windows: 5 run, 5 pass, 0 skip, 0 fail. Suites: libc and libkernel pass on Linux (116 and 198) and on Windows (143 and 207). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.20078240fb: the merge ofmain4bc9e779aaand the three follow-ups (run 41119590247).public_headerswith exactly 25 errors, the test's duplicate declarations, and nothing else. Everypublic_headers_compile_*batch passes.public_headersand its compile batches pass (65 of 65), and the 12guest_system_service*tests pass 10 of 10.public_headers, everypublic_headers_compile_*batch and theguest_system_service*tests.APS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.main06f47c0e81.public_headerswith its 64 compile batches passes 65 of 65 in 3 of 3 runs, with the audit at 0 errors.guest_system_service*tests pass 3 of 3.GuestSystemServiceStatus.cppas at2bc794c94fbrings back exactly the 25 duplicate-declaration errors.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-22T03:44:26Z.
Review: CHANGES_REQUESTED
The query implementations mostly preserve the repo's existing
NotImplemented_nid_no_patchbehavior when a shell-side value cannot be answered. The reported baseline comparisons are useful, and the new status tests cover repeated suspend notifications, inactive-session results, twins, null outputs, and device cases.I found two places where the new answers go beyond the available evidence:
sceLncUtilBlockAppSuspendandsceLncUtilUnblockAppSuspendreject an unbalanced unblock and maintain a process-global count, but the PR reports no console measurement for those error cases or says what the count affects. The null reason also raisesinvalid_argumentdespite no console evidence. These are invented failure semantics for a newly implemented export. Keep unsupported/unknown input paths throwing through the repository's standardNotImplemented_nid_no_patchmechanism, or provide evidence for the specific error behavior. The no-suspend environment supports the no-op success path, but not these guessed validation rules.sceShellCoreUtilIsEyeToEyeDistanceAdjustedthrows for every user exceptUSER_SERVICE_INITIAL_USER_ID. The absence of a headset supports0for the logged-in user's adjustment state, but does not establish that other IDs are invalid. Please return the same known hardware state for valid user IDs, or keep unknown ID behavior unimplemented with evidence for the accepted range; the current test encodes the unsupported assumption.The checklist is complete and the issue/PR links are not being misrepresented. Eligibility, conventions, intake, labels and report checks pass; product builds/tests are skipped. The Linux/Windows comparisons in the description are author-reported; I did not run tests locally.
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T04:23:25Z.
Thanks, @MarcZX10, agreed on both. In
f51064dbee:sceLncUtilBlockAppSuspendandsceLncUtilUnblockAppSuspendkeep only the no-op success. A null reason, and an unblock with no block left, now go throughNotImplemented_nid_no_patchinstead of throwinginvalid_argumentandlogic_error. The count stays only to find that unblock; it changes nothing else.sceShellCoreUtilIsEyeToEyeDistanceAdjusted, and thesceSystemServiceform that forwards to it, answer 0 forUSER_SERVICE_INITIAL_USER_ID, the one user AnyPS5's user service reports insceUserServiceGetLoginUserIdList. Any other ID now throwsNotImplemented_nid_no_patch, assceMoveOpendoes, instead of being treated as invalid.The tests expect those throws, and the debt entries say the console's answers to these cases aren't measured. On GitHub's runners (run) the four
guest_system_service_status_*tests pass 10 runs in a row on Linux and Windows; with the previous head's code,suspendandshellfail.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-22T10:18:12Z.
Review: DISMISSED
The two evidence issues from my earlier review are addressed in
f51064dbee: null/unbalanced suspend calls now useNotImplemented_nid_no_patch, and the eye-distance query returns the known value only for the one user ID this tree reports while leaving other IDs unimplemented. The focused tests include these cases. I found no remaining implementation issue in the code reviewed. The PR's merge with main atd6eafa54dwas followed by six more commits on currentupstream/main. Checks on exact head239de166eb74be850623aba3cb6432f0198bbf9b: -git diff --check upstream/main...HEAD: passed. -python tools/check_conventions.py --base upstream/main --head HEAD: passed. - Builtguest_system_service_status_testswith GCC 12.2 on Linux: passed. - Ranguest_system_service_status_{suspend,sessions,shell,devices}: all four aborted before reaching their tests in the project'sHostCpustatic initialization because this Xeon E5-1620 v2 lacks required PS5 instruction-set features, including AVX2. These local runs are blocked by the host CPU, not assertion failures. - Hosted eligibility, conventions, labels and report checks pass; Linux/Windows product jobs are skipped. The author's CI red/green and repeat-run results are useful, but are not local runs by me. The previously raised behavior-evidence concerns are resolved.I’ve noticed that holding this PR because of #5239 isn’t necessary. It’s fine for PRs to keep coming in; they’ll be handled in due course. Please disregard my earlier request to hold or defer it.
Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-22T14:02:55Z.
Thanks, @MarcZX10. The branch now has
mainat8b3e39832amerged in (7f26a225dd), with the PR's own diff unchanged. On GitHub's runners (run),guest_system_service_status_{suspend,sessions,shell,devices}pass 10 of 10 on Linux and Windows, and fail withmain's implementation on both. It's in Tested.Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T15:38:36Z.
Review: COMMENTED
Merging this head into current
mainbreakspublic_headers.Ubuntu 26.04, i7-8700, GCC 15.2, Release,
BUILD_TESTING=ON. Head2bc794c94fmerged (--no-commit) ontomained1e0ed08f; the merge is clean.The branch's base
8b3e39832apredates #10706, which requires each export to be declared once, in its library's public header.GuestSystemServiceStatus.cppdeclares 25 exports in its ownextern "C"lines thatprx/libSceSystemService/include/SystemService.hppalready declares, so the audit fails 25 times:Including the header instead of the 25 lines fixes it:
With that change, on the same merge:
public_headersand the 64public_headers_compile_*tests pass (65/65).guest_system_service*tests (including the fourguest_system_service_status_*) pass 3/3.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T19:50:19Z.
Review: CHANGES_REQUESTED
Re-checked — changes requested
The exact PR head merges cleanly onto current
main, but the merged-tree public-header audit fails on 25 duplicate declarations in the test source.What I ran
Reviewed head
2bc794c94ff4e7f4c50b410ae0ea22892c6df30cagainst PR base8b3e39832af85f404c6195418d11b3e1ebd1924d; merged it without committing onto currentmain29bd76030463fb20b404f6c6e57db94c35042612. Environment: Linux x86-64, Python 3.11.2, GCC 12.2.0. No build or compile was run.Results
main.SystemService.hppandGuestSystemServiceStatus.cpp.Unedited output from the merged-tree public-header audit
Findings
Blocking
GuestSystemServiceStatus.cppincludesSystemService.hppand then declares the same exported functions locally. Those declarations already exist in currentmain'score/libs/prx/libSceSystemService/include/SystemService.hpp, so this branch passes on its older base but fails after a clean merge withmain. Remove the 25 test-local declarations and include the public umbrella headerprx/libSceSystemService/libSceSystemService.hppso the test uses the library declarations.Non-blocking
None identified in this re-check.
Sources
mainmainNot verified
No C++ build, CTest run, or runtime behavior was tested. The public-header audit was run on the clean merge preview, not on a rebuilt binary.
To get this to a good state
Remove the duplicated local declarations, use the public library umbrella header, then rerun the header audit on the updated head. I’ll repeat this merged-tree audit and the same relevant checks after the update.
Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-30T23:17:23Z.
Review: COMMENTED
Re-checked
20078240fbon Linux: thepublic_headersbreak I reported is fixed.Ubuntu 26.04, i7-8700, GCC 15.2, Release,
BUILD_TESTING=ON. Head20078240fbmerged (--no-commit) ontomain06f47c0e81; clean merge, full build OK.public_headers+ the 64public_headers_compile_*tests: 65/65, 3/3 runs. The audit reports 0 errors.guest_system_service*tests (including the fourguest_system_service_status_*): 3/3 runs.GuestSystemServiceStatus.cppas it was at2bc794c94fbrings back exactly 25 duplicate-declaration errors, andpublic_headersfails.Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.