Skip to content

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

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
MontyMcK:fix/hmd2-no-headset-regression
Oct 19, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
MontyMcK:fix/hmd2-no-headset-regression

Conversation

@MontyMcK

@MontyMcK MontyMcK commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

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 Gran Turismo 7 (PPSA01317 v01.680) on Linux/RADV: deterministic SIGSEGV in guest code (null deref r14+0x48) while the title's video-out/flip frame-pacing loop runs #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 Gran Turismo 7 (PPSA01317) #4697, PPSA05666 Horizon Call of the Mountain (PPSA05666) #6214
  • GPUs tested: n/a
  • AI-assisted: yes

Since boykopovar#7323 sceHmd2Initialize succeeds and sceHmd2Open returns a handle,
so PPSA01317 runs its PS VR2 set-up and aborts on
sceHmd2ReprojectionQueryBufferSizeAlign, which is not implemented
(reported in boykopovar#6350). AnyPS5 has no PS VR2 or PC VR support, so
initialization returns libSceHmd's UNSUPPORTED_FEATURE (0x81110016)
again, as before boykopovar#7323, and titles skip their VR set-up. sceHmd2Open
then returns NotInitialized. The reprojection size queries stay
unimplemented.

Refs boykopovar#6350
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 19, 2026
@github-actions

Copy link
Copy Markdown

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

@oneandonlydean oneandonlydean self-assigned this Oct 19, 2026
@primesoul-web

Copy link
Copy Markdown
Contributor

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.

@oneandonlydean
oneandonlydean merged commit e0a6f31 into boykopovar:main Oct 19, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants