fix(libSceHmd2): report the PS VR2 runtime as unavailable again #7760

Merged
MontyMcK merged 1 commit from upstream-pr/7760 into main 2026-10-19 07:47:30 +00:00
MontyMcK commented 2026-10-19 06:29:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MontyMcK on 2026-10-19T06:29:24Z.


What

fixes a regression from my #7323. that PR made sceHmd2Initialize succeed and sceHmd2Open return a handle, like a real PS5 with no headset plugged in. GT7 (PPSA01317) then thinks it can set up PS VR2, moves on to sceHmd2ReprojectionQueryBufferSizeAlign, which isn't implemented, and aborts a few seconds after launch. @frankea reported it in #6350 (comment).

AnyPS5 doesn't support PS VR2 or PC VR headsets, so this puts sceHmd2Initialize back to what it returned before #7323: libSceHmd's UNSUPPORTED_FEATURE (0x81110016, the existing Hmd::UnsupportedFeature) for any param. GT7 only checks that result for non-zero and skips its VR set-up, same as before. sceHmd2Open then returns NotInitialized (0x8a720002) from the check it already had. no new values: both codes were already in the code base.

the code past the init check (open handle, device info, field of view, vibration) stays as it is. it just can't be reached until there's a real VR backend. sceHmd2ReprojectionQueryBufferSizeAlign, sceHmd2ReprojectionQueryDisplayBufferSizeAlign and sceHmd2ReprojectionQuerySeeThroughBufferSizeAlign are not implemented here and still throw.

test: guest_hmd2 drops the test of the initialized path, since init can't succeed anymore. it now checks that init returns 0x81110016 with and without a param, and that sceHmd2Open, sceHmd2GetDeviceInformation and sceHmd2Terminate return NotInitialized after it. the test aborts against main's Export.cpp and passes on this branch.

debt: the Silent stubs entry in docs/dev/debt/libSceHmd2.md now says init fails, and that this is restored from the behaviour before #7323, not measured on hardware: the firmware with the no-headset state i measured initializes and opens. it also says the three size queries stay unimplemented pending console measurements. the other entries stay, since they still describe the code past the init check.

heads up: #7658 and #7690 implement the reprojection size queries. with init failing, GT7 won't reach them, which is the point for now. both also edit the same debt line, so whichever merges second gets a one-line conflict there.

@frankea could you check that GT7 gets past the sceHmd2ReprojectionQueryBufferSizeAlign abort on this branch? it should get as far as your local 0x81110016 bypass did.

Tested

Fedora 44, GCC 16.2.1, Release, RX 9070 XT (RADV).

  • full ctest: 1543/1547 pass. the 4 that fail here (application_heap_lazy, agc_driver_image_table_vouched_lookups, agc_driver_bda_device, agc_driver_tessellation) don't load libSceHmd2 and none of their sources change in this PR
  • GT7 01.710, relinked from main, with a local copy of libSceHmd2 that prints each call. with main's libSceHmd2 it calls Initialize, GetDeviceInformation, GetFieldOfViewWithoutHandle and then ReprojectionQueryBufferSizeAlign, and aborts about 6 s in. with this branch's it calls sceHmd2Initialize and no other Hmd2 export, and doesn't abort there. a few seconds later it hits the null deref at +0x48 that #6350 is about, so i can't take it further on Linux/RADV, hence the ask above
  • 01.710 also links libMozaSDK.prx, which AnyPS5 doesn't have. i used an empty stand-in library to get it to load. it exports nothing and isn't part of this PR

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
  • Fixes: none
  • Unblocks: PPSA01317 #4697, PPSA05666 #6214
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4916836879 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7760). Originally posted by [MontyMcK](https://github.com/MontyMcK) on 2026-10-19T06:29:24Z. --- ### What fixes a regression from my #7323. that PR made `sceHmd2Initialize` succeed and `sceHmd2Open` return a handle, like a real PS5 with no headset plugged in. GT7 (PPSA01317) then thinks it can set up PS VR2, moves on to `sceHmd2ReprojectionQueryBufferSizeAlign`, which isn't implemented, and aborts a few seconds after launch. @frankea reported it in #6350 ([comment](https://github.com/boykopovar/AnyPS5/issues/6350#issuecomment-6256153570)). AnyPS5 doesn't support PS VR2 or PC VR headsets, so this puts `sceHmd2Initialize` back to what it returned before #7323: libSceHmd's `UNSUPPORTED_FEATURE` (`0x81110016`, the existing `Hmd::UnsupportedFeature`) for any param. GT7 only checks that result for non-zero and skips its VR set-up, same as before. `sceHmd2Open` then returns `NotInitialized` (`0x8a720002`) from the check it already had. no new values: both codes were already in the code base. the code past the init check (open handle, device info, field of view, vibration) stays as it is. it just can't be reached until there's a real VR backend. `sceHmd2ReprojectionQueryBufferSizeAlign`, `sceHmd2ReprojectionQueryDisplayBufferSizeAlign` and `sceHmd2ReprojectionQuerySeeThroughBufferSizeAlign` are not implemented here and still throw. test: `guest_hmd2` drops the test of the initialized path, since init can't succeed anymore. it now checks that init returns `0x81110016` with and without a param, and that `sceHmd2Open`, `sceHmd2GetDeviceInformation` and `sceHmd2Terminate` return `NotInitialized` after it. the test aborts against main's `Export.cpp` and passes on this branch. debt: the Silent stubs entry in `docs/dev/debt/libSceHmd2.md` now says init fails, and that this is restored from the behaviour before #7323, not measured on hardware: the firmware with the no-headset state i measured initializes and opens. it also says the three size queries stay unimplemented pending console measurements. the other entries stay, since they still describe the code past the init check. heads up: #7658 and #7690 implement the reprojection size queries. with init failing, GT7 won't reach them, which is the point for now. both also edit the same debt line, so whichever merges second gets a one-line conflict there. @frankea could you check that GT7 gets past the `sceHmd2ReprojectionQueryBufferSizeAlign` abort on this branch? it should get as far as your local `0x81110016` bypass did. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Fedora 44, GCC 16.2.1, Release, RX 9070 XT (RADV). - full `ctest`: 1543/1547 pass. the 4 that fail here (`application_heap_lazy`, `agc_driver_image_table_vouched_lookups`, `agc_driver_bda_device`, `agc_driver_tessellation`) don't load libSceHmd2 and none of their sources change in this PR - GT7 01.710, relinked from main, with a local copy of libSceHmd2 that prints each call. with main's libSceHmd2 it calls `Initialize`, `GetDeviceInformation`, `GetFieldOfViewWithoutHandle` and then `ReprojectionQueryBufferSizeAlign`, and aborts about 6 s in. with this branch's it calls `sceHmd2Initialize` and no other Hmd2 export, and doesn't abort there. a few seconds later it hits the null deref at +0x48 that #6350 is about, so i can't take it further on Linux/RADV, hence the ask above - 01.710 also links `libMozaSDK.prx`, which AnyPS5 doesn't have. i used an empty stand-in library to get it to load. it exports nothing and isn't part of this PR ### 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 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 - [x] Fixes: none - [x] Unblocks: PPSA01317 #4697, PPSA05666 #6214 - [x] GPUs tested: n/a - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-19 06:36:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T06:36:40Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6844 core/libs/tests/GuestHmd2.cpp L10-11, L136
PR 7463 docs/dev/debt/libSceHmd2.md L5
PR 7658 core/libs/tests/GuestHmd2.cpp L136
docs/dev/debt/libSceHmd2.md L5
PR 7690 docs/dev/debt/libSceHmd2.md L5

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 6044 core/libs/tests/GuestHmd2.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6261254920 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7760#issuecomment-6261254920). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T06:36:40Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6844](https://www.github.com/boykopovar/AnyPS5/pull/6844) | `core/libs/tests/GuestHmd2.cpp` [L10-11](https://github.com/boykopovar/AnyPS5/blob/feb74b65c26e4c27f667a908439aec0d2350d2bd/core/libs/tests/GuestHmd2.cpp#L10-L11), [L136](https://github.com/boykopovar/AnyPS5/blob/feb74b65c26e4c27f667a908439aec0d2350d2bd/core/libs/tests/GuestHmd2.cpp#L136) | | | | [PR 7463](https://www.github.com/boykopovar/AnyPS5/pull/7463) | `docs/dev/debt/libSceHmd2.md` [L5](https://github.com/boykopovar/AnyPS5/blob/feb74b65c26e4c27f667a908439aec0d2350d2bd/docs/dev/debt/libSceHmd2.md#L5) | | | | [PR 7658](https://www.github.com/boykopovar/AnyPS5/pull/7658) | `core/libs/tests/GuestHmd2.cpp` [L136](https://github.com/boykopovar/AnyPS5/blob/feb74b65c26e4c27f667a908439aec0d2350d2bd/core/libs/tests/GuestHmd2.cpp#L136)<br>`docs/dev/debt/libSceHmd2.md` [L5](https://github.com/boykopovar/AnyPS5/blob/feb74b65c26e4c27f667a908439aec0d2350d2bd/docs/dev/debt/libSceHmd2.md#L5) | | | | [PR 7690](https://www.github.com/boykopovar/AnyPS5/pull/7690) | `docs/dev/debt/libSceHmd2.md` [L5](https://github.com/boykopovar/AnyPS5/blob/feb74b65c26e4c27f667a908439aec0d2350d2bd/docs/dev/debt/libSceHmd2.md#L5) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 6044](https://www.github.com/boykopovar/AnyPS5/pull/6044) | `core/libs/tests/GuestHmd2.cpp` |
primesoul-web commented 2026-10-19 07:00:00 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by primesoul-web on 2026-10-19T07:00:00Z.


Thanks for the heads-up, and for digging out the #7323 regression trail from frankea's #6350 report.

The two changes are complementary from this side: #7658 does not touch sceHmd2Initialize or sceHmd2Open — its Hmd2 surface is the reprojection session only (sceHmd2ReprojectionInitialize, SetTiming, EnableVrMode, QueryBufferSizeAlign). On a tree with both, GT7 checks sceHmd2Initialize first, gets 0x81110016, and skips the whole VR set-up, so it never walks into the reprojection session — exactly the "point for now" state you describe, with the session still in place for whenever a real VR backend exists. And sceHmd2ReprojectionQueryBufferSizeAlign in #7658 answers the console-measured 0x100828 / 0x100 (T3cm0's retail FW 13.60 measurement), so a title that ever gets past init on a future backend allocates what the console asks for rather than 16 bytes; the other four size queries stay throwing for #7463, which keeps your "three size queries unimplemented" wording true on the merged tree apart from the one you call out.

On the debt line: agreed, and the fixup is one line from this side too. Our branch rewords the reprojection section of docs/dev/debt/libSceHmd2.md; if #7760 lands first, our merge keeps your restored-init wording and drops only the now-stale sentence — the same arrangement we took with #7690's Hmd2::SizeAlign block. No dependency either way; happy with either merge order.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6261589192 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7760#issuecomment-6261589192). Originally posted by [primesoul-web](https://github.com/primesoul-web) on 2026-10-19T07:00:00Z. --- Thanks for the heads-up, and for digging out the #7323 regression trail from frankea's #6350 report. The two changes are complementary from this side: #7658 does not touch `sceHmd2Initialize` or `sceHmd2Open` — its Hmd2 surface is the reprojection session only (`sceHmd2ReprojectionInitialize`, `SetTiming`, `EnableVrMode`, `QueryBufferSizeAlign`). On a tree with both, GT7 checks `sceHmd2Initialize` first, gets `0x81110016`, and skips the whole VR set-up, so it never walks into the reprojection session — exactly the "point for now" state you describe, with the session still in place for whenever a real VR backend exists. And `sceHmd2ReprojectionQueryBufferSizeAlign` in #7658 answers the console-measured 0x100828 / 0x100 (T3cm0's retail FW 13.60 measurement), so a title that ever gets past init on a future backend allocates what the console asks for rather than 16 bytes; the other four size queries stay throwing for #7463, which keeps your "three size queries unimplemented" wording true on the merged tree apart from the one you call out. On the debt line: agreed, and the fixup is one line from this side too. Our branch rewords the reprojection section of `docs/dev/debt/libSceHmd2.md`; if #7760 lands first, our merge keeps your restored-init wording and drops only the now-stale sentence — the same arrangement we took with #7690's `Hmd2::SizeAlign` block. No dependency either way; happy with either merge order.
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!7760
No description provided.