feat(libSceHmd2): report the uninitialized library from the device exports #3820

Closed
13hourstilliland wants to merge 1 commit from upstream-pr/3820 into main
13hourstilliland commented 2026-10-11 17:13:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by 13hourstilliland on 2026-10-11T17:13:23Z.


What

Picks up #3242 by @dantdmdarealguy (auto-closed by the intake pause), rebased onto current main with no changes.

sceHmd2Initialize still fails because there's no PS VR2 runtime, so the library stays uninitialized. Open, Close and SetVibration now return NOT_INITIALIZED (0x8A720002) instead of throwing. GetDeviceInformation and GetFieldOfViewWithoutHandle return PARAMETER_NULL (0x8A720008) for a null output and NOT_INITIALIZED otherwise. Signatures follow PS5VR, error values follow KytyPS5 in the observed 0x8A72 facility, and the Initialize placeholder moves to 0x8A720016. A new Hmd2.hpp holds the constants and struct layouts, with static_asserts. The reprojection exports get their signatures but still throw, because their headset-less console behaviour is unknown. Sources and open questions are in TechnicalDebt.

Tested

Linux x86-64, GCC 14, Release, BUILD_TESTING=ON. guest_hmd2 passes, and check_conventions and check_test_registration pass. Not tested with a title.

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:4820842413 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3820). Originally posted by [13hourstilliland](https://github.com/13hourstilliland) on 2026-10-11T17:13:23Z. --- ### What Picks up #3242 by @dantdmdarealguy (auto-closed by the intake pause), rebased onto current main with no changes. `sceHmd2Initialize` still fails because there's no PS VR2 runtime, so the library stays uninitialized. Open, Close and SetVibration now return `NOT_INITIALIZED` (0x8A720002) instead of throwing. GetDeviceInformation and GetFieldOfViewWithoutHandle return `PARAMETER_NULL` (0x8A720008) for a null output and `NOT_INITIALIZED` otherwise. Signatures follow PS5VR, error values follow KytyPS5 in the observed 0x8A72 facility, and the Initialize placeholder moves to 0x8A720016. A new Hmd2.hpp holds the constants and struct layouts, with static_asserts. The reprojection exports get their signatures but still throw, because their headset-less console behaviour is unknown. Sources and open questions are in TechnicalDebt. ### Tested Linux x86-64, GCC 14, Release, BUILD_TESTING=ON. guest_hmd2 passes, and check_conventions and check_test_registration pass. Not tested with a title. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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
github-actions[bot] commented 2026-10-11 17:13:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-11T17:13:45Z.


Progress report (436e310 → 563666b)

📈 System libraries: 86.6% (+0.15%, +5 implemented functions)

✅ 5 implemented
Library Name
libSceHmd2 sceHmd2Close
libSceHmd2 sceHmd2GetDeviceInformation
libSceHmd2 sceHmd2GetFieldOfViewWithoutHandle
libSceHmd2 sceHmd2Open
libSceHmd2 sceHmd2SetVibration
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111574159 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3820#issuecomment-6111574159). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-11T17:13:45Z. --- <!-- progress-report --> ### Progress report (436e310 → 563666b) 📈 **System libraries**: 86.6% (+0.15%, +5 implemented functions) <details> <summary>✅ 5 implemented</summary> | Library | Name | | - | - | | libSceHmd2 | `sceHmd2Close` | | libSceHmd2 | `sceHmd2GetDeviceInformation` | | libSceHmd2 | `sceHmd2GetFieldOfViewWithoutHandle` | | libSceHmd2 | `sceHmd2Open` | | libSceHmd2 | `sceHmd2SetVibration` | </details>
13hourstilliland commented 2026-10-11 19:38:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by 13hourstilliland on 2026-10-11T19:38:16Z.


Trial-merging this against #3537 gives two content conflicts, both resolvable by hand. In core/libs/prx/libSceHmd2/Export.cpp, this PR appends nine new stub exports while #3820 both rewrites the signatures of the neighboring existing exports (sceHmd2Open, sceHmd2Close, sceHmd2GetDeviceInformation, sceHmd2GetFieldOfViewWithoutHandle, sceHmd2SetVibration, and the reprojection entries get typed parameters and SizeAlign returns) and adds its own exports at the same tail — no export name is duplicated between the two PRs (verified by diffing the added function lists), so whoever rebases second keeps both sets and takes the rewritten signatures from whichever PR landed first. In docs/dev/TechnicalDebt.md, both PRs reword the same libSceHmd2/PPSA01317 bullets, so the rebased version needs to merge the two wordings rather than pick one. No same-exports overlap, so it is a positional merge, not a design one.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6112925611 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3820#issuecomment-6112925611). Originally posted by [13hourstilliland](https://github.com/13hourstilliland) on 2026-10-11T19:38:16Z. --- Trial-merging this against #3537 gives two content conflicts, both resolvable by hand. In `core/libs/prx/libSceHmd2/Export.cpp`, this PR appends nine new stub exports while #3820 both rewrites the signatures of the neighboring existing exports (`sceHmd2Open`, `sceHmd2Close`, `sceHmd2GetDeviceInformation`, `sceHmd2GetFieldOfViewWithoutHandle`, `sceHmd2SetVibration`, and the reprojection entries get typed parameters and `SizeAlign` returns) and adds its own exports at the same tail — no export name is duplicated between the two PRs (verified by diffing the added function lists), so whoever rebases second keeps both sets and takes the rewritten signatures from whichever PR landed first. In `docs/dev/TechnicalDebt.md`, both PRs reword the same libSceHmd2/PPSA01317 bullets, so the rebased version needs to merge the two wordings rather than pick one. No same-exports overlap, so it is a positional merge, not a design one.
oneandonlydean commented 2026-10-11 23:17:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-11T23:17:42Z.


Which title calls sceHmd2Open, sceHmd2Close, sceHmd2GetDeviceInformation, sceHmd2GetFieldOfViewWithoutHandle or sceHmd2SetVibration after sceHmd2Initialize has failed? PPSA01317 skips its VR set-up at that point, and the 0x8A72 values come from KytyPS5, not from a console. With the title ID and the log line where it stops on main this can go in; otherwise I'll close it until one does.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6115011919 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3820#issuecomment-6115011919). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-11T23:17:42Z. --- Which title calls `sceHmd2Open`, `sceHmd2Close`, `sceHmd2GetDeviceInformation`, `sceHmd2GetFieldOfViewWithoutHandle` or `sceHmd2SetVibration` after `sceHmd2Initialize` has failed? PPSA01317 skips its VR set-up at that point, and the `0x8A72` values come from KytyPS5, not from a console. With the title ID and the log line where it stops on main this can go in; otherwise I'll close it until one does.
13hourstilliland commented 2026-10-12 07:36:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by 13hourstilliland on 2026-10-12T07:36:18Z.


No title log line from me: PPSA01317 skips its VR set-up when sceHmd2Initialize fails, and I have no other title that reaches the Hmd2 device calls after a failed initialize — which is your point: on the only title anyone has checked, the console path never reaches these calls on main's behaviour.

The change still replaces main's throws on the libSceHmd2 device exports with PS5VR/KytyPS5-sourced code paths, but if no title reaches them, there is nothing observable to pin. Close until one does is fine.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6119847111 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3820#issuecomment-6119847111). Originally posted by [13hourstilliland](https://github.com/13hourstilliland) on 2026-10-12T07:36:18Z. --- No title log line from me: PPSA01317 skips its VR set-up when `sceHmd2Initialize` fails, and I have no other title that reaches the Hmd2 device calls after a failed initialize — which is your point: on the only title anyone has checked, the console path never reaches these calls on main's behaviour. The change still replaces main's throws on the libSceHmd2 device exports with PS5VR/KytyPS5-sourced code paths, but if no title reaches them, there is nothing observable to pin. Close until one does is fine.
adriadam10 commented 2026-10-12 20:32:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-12T20:32:37Z.


Closing as agreed in the thread: no title is known to call sceHmd2Open, sceHmd2Close, sceHmd2GetDeviceInformation, sceHmd2GetFieldOfViewWithoutHandle or sceHmd2SetVibration after sceHmd2Initialize fails (PPSA01317 skips its VR set-up there), and the 0x8A72 values come from KytyPS5, not from a console. The branch also conflicts with main now.

Feel free to reopen, rebased, with the title ID and the log line where it stops on main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6132123980 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/3820#issuecomment-6132123980). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-12T20:32:37Z. --- Closing as agreed in the thread: no title is known to call `sceHmd2Open`, `sceHmd2Close`, `sceHmd2GetDeviceInformation`, `sceHmd2GetFieldOfViewWithoutHandle` or `sceHmd2SetVibration` after `sceHmd2Initialize` fails (PPSA01317 skips its VR set-up there), and the `0x8A72` values come from KytyPS5, not from a console. The branch also conflicts with `main` now. Feel free to reopen, rebased, with the title ID and the log line where it stops on `main`.

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