Skip to content

feat(libSceVideoOut): answer the HMD2 bus open as the console does - #7786

Merged
adriadam10 merged 1 commit into
boykopovar:mainfrom
T3cm0:feat/videoout-hmd2-bus
Oct 20, 2026
Merged

adriadam10 merged 1 commit into
boykopovar:mainfrom
T3cm0:feat/videoout-hmd2-bus

Conversation

@T3cm0

@T3cm0 T3cm0 commented Oct 19, 2026

Copy link
Copy Markdown

What

sceVideoOutOpen with bus type 0x20, the PS VR2 output that PPSA05666 (Horizon Call of the Mountain) opens right after sceHmd2ReprojectionEnableVrMode(0x2000F) and that its own log names SCE_VIDEO_OUT_BUS_TYPE_HMD2_MAIN, used to throw VIDEO_OUT_ERROR_INVALID_VALUE and abort the title. The console returns that error code to a process that is not a game, headset connected and worn or not, for users 255 and 0 and for a null or a zeroed open parameter, so the bus now returns it before the other argument checks (VIDEO_OUT_BUS_TYPE_HMD2_MAIN constant). The title then carries on with the error code as its handle, as it does on the console without a headset. What a game gets with a headset attached is not measurable from a payload and is left to a VR backend.

The debt entry records what the title does on that handle (captured with a local build that handed out a handle): sceVideoOutRegisterBuffers2 with set 0, two buffers, a 4000x2040 attribute with pixel format 0x8100000022000000, category 16 and a null option, where each buffer entry points at a 16-byte {pointer, 2} whose pointer is the structure passed to sceHmd2ReprojectionEnableMirroring holding per-eye 2000x2040 texture descriptors; then ConfigureOutput and IsOutputSupported with mode 0x2000F, and a GPU wait on buffer 0. The test gains the bus checks and the HMD modes 0x20001, 0x2000C to 0x20010, which the console answers with 0x8029001E on the TV bus, as main already does.

Console measurements: payload vo2 run from the websrv Homebrew Launcher (app FAKE00000) on firmware 13.60, twice without and once with the PS VR2 connected and worn; log attached.

Tested

  • Windows 11 (26200), WinLibs GCC 15.2.0 r7 (UCRT), Release, on main c4d6dbe: libs, guest_video_out_output_mode_tests and patched_libraries_tests built; ctest -R "guest_video_out_output_mode|patched_libraries" 2/2 passed.
  • Linux (Ubuntu 26.04 under WSL2, GCC 15.2.0), Release, on main 64a9caa: same targets built, same two tests passed.
  • PPSA05666 under this change (with feat(libSceVrTracker2): answer as the console's module before initialization #7463, feat(libSceHmd2): return the console's display and mirroring buffer sizes #7690 and local successes for sceVrTracker2Initialize and the Hmd2 reprojection stubs so the title reaches this point): sceVideoOutOpen(255, 0x20, 0, nullptr) returns 0x80290001 and the title logs it and carries on; it now stops at its next call, sceVideoOutRegisterBuffers2 with that error code as the handle, which throws invalid output handle here (the console's answer to that call is not measured).
  • tools/check_conventions.py --base origin/main and tools/pr_overlap.py clean (the PRs sharing Output.cpp, VideoOutDriver.hpp, the test and the debt file implement other things).

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: PPSA05666 (no bring-up discussion yet); related design in Vr compatibity? #7649
  • GPUs tested: NVIDIA GeForce RTX 5070 Ti, driver 616.56, Windows 11 (26200)
  • AI-assisted: yes

🤖 Generated with Claude Code

sceVideoOutOpen with bus type 0x20, the PS VR2 output PPSA05666 opens as
SCE_VIDEO_OUT_BUS_TYPE_HMD2_MAIN after sceHmd2ReprojectionEnableVrMode, threw
VIDEO_OUT_ERROR_INVALID_VALUE and aborted the title. The console returns that
code to a process that is not a game, with the headset connected and worn or
not, for users 255 and 0 and for a null or zeroed open parameter, so the bus
is answered that way before the other argument checks and the title carries
on with the error as its handle, as it does on the console without a headset.

The debt entry records the sequence the title follows on that handle
(RegisterBuffers2 with category 16 and 4000x2040 descriptors that point at
Hmd2 per-eye textures, ConfigureOutput and IsOutputSupported with 0x2000F, a
GPU wait on buffer 0), which a VR backend will have to model, and the test
covers the bus and the HMD output modes 0x20001 and 0x2000C to 0x20010, which
the console and this implementation answer with VIDEO_OUT_ERROR_UNKNOWN_OUTPUT_MODE
on the TV bus.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@github-actions github-actions Bot added the unblocks title Names a title ID on the Unblocks line label Oct 19, 2026
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

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 4040 core/libs/prx/libSceVideoOut/src/Output.cpp
docs/dev/debt/libSceVideoOut.md
PR 6044 core/libs/tests/GuestVideoOutOutputMode.cpp
PR 6879 core/libs/prx/libSceVideoOut/include/VideoOutDriver.hpp
PR 6977 core/libs/prx/libSceVideoOut/include/VideoOutDriver.hpp
core/libs/prx/libSceVideoOut/src/Output.cpp
docs/dev/debt/libSceVideoOut.md
PR 7201 core/libs/prx/libSceVideoOut/include/VideoOutDriver.hpp

@T3cm0

T3cm0 commented Oct 19, 2026

Copy link
Copy Markdown
Author

Console log behind the measurements in the description: probe vo2 (sceVideoOutOpen on bus 0x20 for users 255 and 0 with a null and a zeroed parameter, then the TV bus: IsOutputSupported for the TV and HMD modes, GetOutputStatus, GetResolutionStatus, ConfigureOutput(0x2000F), GetFlipStatus, ConfigureOutput(1), Close), run from the websrv Homebrew Launcher app on firmware 13.60. Run 1 is the first probe revision (its open fallbacks did not run because of a sign bug in the probe, so the calls after the failed open hit the error code as a handle and answer 0x8029000B); runs 2 (no headset) and 3 (headset connected and worn) are the corrected probe.

/data/vo2.txt
== vo2 pid 129
load libSceVideoOut -> 0x41 (0)
sceVideoOutOpen(bus 0x20, user 255, param NULL) -> 0x80290001
  IsOutputSupported(mode 0x1) -> 0x8029000b
  IsOutputSupported(mode 0xf) -> 0x8029000b
  IsOutputSupported(mode 0x2000c) -> 0x8029000b
  IsOutputSupported(mode 0x2000d) -> 0x8029000b
  IsOutputSupported(mode 0x2000e) -> 0x8029000b
  IsOutputSupported(mode 0x2000f) -> 0x8029000b
  IsOutputSupported(mode 0x20010) -> 0x8029000b
  IsOutputSupported(mode 0x20001) -> 0x8029000b
  GetOutputStatus -> 0x8029000b:
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
  GetResolutionStatus -> 0x8029000b:
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
  GetDeviceCapabilityInfo: unresolved
  ConfigureOutput(0x2000F) -> 0x8029000b
  GetOutputStatus after -> 0x8029000b:
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
  GetResolutionStatus after -> 0x8029000b:
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
  GetFlipStatus -> 0x8029000b:
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
    aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa
  ConfigureOutput(1) -> 0x8029000b
  Close -> 0x8029000b
sceVideoOutOpen(bus 0, user 255) -> 0x4e100100
  IsOutputSupported(mode 0x1) -> 0x1
  IsOutputSupported(mode 0xf) -> 0x80290016
  IsOutputSupported(mode 0x2000c) -> 0x8029001e
  IsOutputSupported(mode 0x2000d) -> 0x8029001e
  IsOutputSupported(mode 0x2000e) -> 0x8029001e
  IsOutputSupported(mode 0x2000f) -> 0x8029001e
  IsOutputSupported(mode 0x20010) -> 0x8029001e
  IsOutputSupported(mode 0x20001) -> 0x8029001e
  GetOutputStatus -> 0x0:
    01 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  GetResolutionStatus -> 0x0:
    00 0f 00 00 70 08 00 00 00 0f 00 00 70 08 00 00
    03 00 00 00 00 00 00 00 00 00 70 42 00 00 00 00
  GetDeviceCapabilityInfo: unresolved
  ConfigureOutput(0x2000F) -> 0x8029001e
  GetOutputStatus after -> 0x0:
    01 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  GetResolutionStatus after -> 0x0:
    00 0f 00 00 70 08 00 00 00 0f 00 00 70 08 00 00
    03 00 00 00 00 00 00 00 00 00 70 42 00 00 00 00
  GetFlipStatus -> 0x0:
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00
  ConfigureOutput(1) -> 0x0
  Close -> 0x0
done

== vo2 pid 131
load libSceVideoOut -> 0x41 (0)
sceVideoOutOpen(bus 0x20, user 255, param NULL) -> 0xffffffff80290001
sceVideoOutOpen(bus 0x20, user 255, zero param) -> 0xffffffff80290001
sceVideoOutOpen(bus 0x20, user 0, param NULL) -> 0xffffffff80290001
sceVideoOutOpen(bus 0, user 255) -> 0x4e100100
  IsOutputSupported(mode 0x1) -> 0x1
  IsOutputSupported(mode 0xf) -> 0x80290016
  IsOutputSupported(mode 0x2000c) -> 0x8029001e
  IsOutputSupported(mode 0x2000d) -> 0x8029001e
  IsOutputSupported(mode 0x2000e) -> 0x8029001e
  IsOutputSupported(mode 0x2000f) -> 0x8029001e
  IsOutputSupported(mode 0x20010) -> 0x8029001e
  IsOutputSupported(mode 0x20001) -> 0x8029001e
  GetOutputStatus -> 0x0:
    01 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  GetResolutionStatus -> 0x0:
    00 0f 00 00 70 08 00 00 00 0f 00 00 70 08 00 00
    03 00 00 00 00 00 00 00 00 00 70 42 00 00 00 00
  ConfigureOutput(0x2000F) -> 0x8029001e
  GetOutputStatus after -> 0x0:
    01 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  GetResolutionStatus after -> 0x0:
    00 0f 00 00 70 08 00 00 00 0f 00 00 70 08 00 00
    03 00 00 00 00 00 00 00 00 00 70 42 00 00 00 00
  GetFlipStatus -> 0x0:
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00
  ConfigureOutput(1) -> 0x0
  Close -> 0x0
done

== vo2 pid 133
load libSceVideoOut -> 0x41 (0)
sceVideoOutOpen(bus 0x20, user 255, param NULL) -> 0xffffffff80290001
sceVideoOutOpen(bus 0x20, user 255, zero param) -> 0xffffffff80290001
sceVideoOutOpen(bus 0x20, user 0, param NULL) -> 0xffffffff80290001
sceVideoOutOpen(bus 0, user 255) -> 0x4e100100
  IsOutputSupported(mode 0x1) -> 0x1
  IsOutputSupported(mode 0xf) -> 0x80290016
  IsOutputSupported(mode 0x2000c) -> 0x8029001e
  IsOutputSupported(mode 0x2000d) -> 0x8029001e
  IsOutputSupported(mode 0x2000e) -> 0x8029001e
  IsOutputSupported(mode 0x2000f) -> 0x8029001e
  IsOutputSupported(mode 0x20010) -> 0x8029001e
  IsOutputSupported(mode 0x20001) -> 0x8029001e
  GetOutputStatus -> 0x0:
    01 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  GetResolutionStatus -> 0x0:
    00 0f 00 00 70 08 00 00 00 0f 00 00 70 08 00 00
    03 00 00 00 00 00 00 00 00 00 70 42 00 00 00 00
  ConfigureOutput(0x2000F) -> 0x8029001e
  GetOutputStatus after -> 0x0:
    01 00 00 00 01 00 00 00 03 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  GetResolutionStatus after -> 0x0:
    00 0f 00 00 70 08 00 00 00 0f 00 00 70 08 00 00
    03 00 00 00 00 00 00 00 00 00 70 42 00 00 00 00
  GetFlipStatus -> 0x0:
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    00 00 00 00 00 00 00 00 ff ff ff ff 00 00 00 00
  ConfigureOutput(1) -> 0x0
  Close -> 0x0
done

AI-assisted: yes.

@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@adriadam10
adriadam10 merged commit 049a826 into boykopovar:main Oct 20, 2026
11 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Checked the diff against the description and the console measurements: bus 0x20 returns 0x80290001 before the other argument checks, the new open checks throw on main and pass here, and the debt entry lists what is not measured; merged.

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

Labels

docs prx unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants