Skip to content

feat(libSceHmd2): report a console without a PS VR2 headset - #7323

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
MontyMcK:feat/psvr2-no-headset
Oct 18, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
MontyMcK:feat/psvr2-no-headset

Conversation

@MontyMcK

Copy link
Copy Markdown
Contributor

What

libSceHmd2 now acts like a PS5 with no PS VR2 plugged in. before this sceHmd2Initialize failed with libSceHmd's 0x81110016, which a real console never gives a game.

implemented sceHmd2Initialize, Terminate, Open, Close, GetDeviceInformation, GetDeviceInformationByHandle, GetFieldOfView, GetFieldOfViewWithoutHandle and SetVibration (1/31 -> 9/31). reprojection, gaze and all of libSceVrTracker2 still throw

where the behaviour comes from:

  • firmware 13.20 libSceHmd2.sprx pulled off my PS5 and disassembled: the error codes (0x8a72xxxx), check order, the 28 byte device info layout and its fixed values (4000x2040 panel, 5555/4160 latency, 2.0 image distance), the default FOV tangents and the SDK 7.00 checks
  • a payload on the same PS5 with no headset connected: the /dev/hmd2_cmd page the library reads says not connected, status 2, user -1, and the /dev/hmd2_imu open ioctl succeeds, so Open hands back a handle even with no headset. every call made before init matched the disassembly. Initialize itself crashes inside a payload (it's not an app), so results after init are the firmware code run against that measured state
  • the SDK version comes from the title's process params (+0x10). below 7.00 device info fills in the user id, from 7.00 Open rejects other users

what i couldn't settle is in the debt file (Initialize's app info checks and sceMbusInit aren't modelled, Open for a non initial user below SDK 7.00 throws)

heads up: PPSA01317, PPSA07411, PPSA09030, PPSA15878 and PPSA29866 used to skip VR because init failed. now they get further, so anything that then calls a reprojection/gaze/VrTracker2 export throws instead of skipping VR. i don't own any of them so they're not tested

ProcessParametersFixture.hpp sets up process params for the test. it keeps the page executable while patching the program headers. the copy in ApplicationHeap.cpp doesn't, which is why application_heap_lazy segfaults on my build (the PLT is on that page). left that one alone, separate thing

probe output, no headset connected
open /dev/hmd2_cmd = 8 errno 0
hmd2_cmd page:
  0000: 00 00 00 00 00 00 01 00 00 00 00 00 00 00 00 00
  0010: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0020: 00 00 00 00 02 00 00 00 ff ff ff ff 00 00 00 00
  (rest zero apart from the handle slots at 0x144, all -1)
open /dev/hmd2_imu = 8 errno 0
ioctl open-device(user 0xffffffff) = 234946560 (0xe010000) errno 0
ioctl close-device(234946560) = 0 errno 0
before init: GetDeviceInformation = 0x8a720002 (output cleared to 0)
before init: GetDeviceInformation(NULL) = 0x8a720008
before init: GetFieldOfViewWithoutHandle = 0x8a720002
before init: Close(0) = 0x8a720002
before init: Terminate = 0x8a720002
before init: SetVibration(0, 0) = 0x0
Initialize(NULL) = 0x8a720008

Tested

Fedora 44, GCC 16.2, full build. guest_hmd2 passes, select_tests.py ctest 186/186 on this branch, check_conventions.py passes. a wider run before rebasing (1382 tests) only failed agc_driver_tessellation, which segfaults on my RX 9070 XT and has nothing from this PR in it. not built on windows, no title run

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: none
  • GPUs tested: n/a
  • AI-assisted: yes

@github-actions

github-actions Bot commented Oct 18, 2026 •

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 L8-12, L34

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 5038 docs/dev/debt/libScePad.md
PR 6044 core/libs/prx/libSceHmd2/CMakeLists.txt
core/libs/tests/GuestHmd2.cpp
PR 6447 docs/dev/debt/libSceHmd2.md
docs/dev/debt/libScePad.md

@MarcZX10

Copy link
Copy Markdown
Contributor

I manually checked the #6844 overlap reported by the bot. main already contains sceHmd2ReprojectionGetStatus() in Export.cpp; #6844 adds a second copy of that same stub, so I asked its author to remove the duplicate. Your PR leaves the existing main definition in place and implements other HMD2 functions; I did not find a duplicate implementation between your changes and the rest of #6844. The shared Export.cpp/test edits may still need a rebase after either PR lands.

@oneandonlydean
oneandonlydean merged commit e999388 into boykopovar:main Oct 18, 2026
1 check passed
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
@mugurc mugurc mentioned this pull request Oct 18, 2026
@KernelPanicNT

Copy link
Copy Markdown
Contributor

@MontyMcK @T3cm0 a follow-up from the GT7 thread: frankea reports in #4697 that Gran Turismo 7 (PPSA01317) on current main now aborts 5 to 8 s in on sceHmd2ReprojectionQueryBufferSizeAlign not implemented (libSceHmd2.prx+0x1b70, called from module initialisation). Since this PR, sceHmd2Initialize and sceHmd2Open succeed, so the title's PS VR2 probe goes on to the reprojection size queries. Horizon Call of the Mountain follows the same chain.

I'd rather not guess sizes (#6272 was closed for that). Do your firmware 13.20 disassembly or a no-headset payload run cover sceHmd2ReprojectionQueryBufferSizeAlign, sceHmd2ReprojectionQueryDisplayBufferSizeAlign and sceHmd2ReprojectionQuerySeeThroughBufferSizeAlign? If you're already on it, I'll stay out of the way. If not, and you can share what the console returns, I'm happy to write the change with a test and a debt entry and credit the measurement.

alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
@MontyMcK

Copy link
Copy Markdown
Contributor Author

Thanks for tracing this. I don't have measurements for the ReprojectionQuery*SizeAlign functions, my work only covered Initialize and Open. That said, this is a regression from my PR, so I'll take it. I'm at work now but will write a fix when I get home in about 6 hours. My first step will be checking what Open should return with no headset connected, since reporting no device should stop GT7 and CotM before they reach the reprojection queries.

alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 18, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
@frankea frankea mentioned this pull request Oct 19, 2026
2 tasks done
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
alex73630 added a commit to alex73630/AnyPS5 that referenced this pull request Oct 19, 2026
Temporarily revert PR boykopovar#7323 after its successful initialization sends GT7 PPSA01317 into unimplemented reprojection APIs. Restore the prior startup policy and test, and document that this compatibility rollback does not represent firmware no-headset behavior.
oneandonlydean pushed a commit that referenced this pull request Oct 19, 2026
Since #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 #6350). AnyPS5 has no PS VR2 or PC VR support, so
initialization returns libSceHmd's UNSUPPORTED_FEATURE (0x81110016)
again, as before #7323, and titles skip their VR set-up. sceHmd2Open
then returns NotInitialized. The reprojection size queries stay
unimplemented.

Refs #6350
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants