feat(libSceVideoOut): add the PS4 device capability and ModeSetAny exports #9880

Merged
ntamas94 merged 10 commits from upstream-pr/9880 into main 2026-11-05 11:03:51 +00:00
ntamas94 commented 2026-10-22 20:27:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ntamas94 on 2026-10-22T20:27:44Z.


What

Adds sceVideoOutGetDeviceCapabilityInfo_ and sceVideoOutModeSetAny_, which both measured PS4 titles (CUSA04865, CUSA12435) import and which the library did not export. Measured on a PS4 Pro with firmware 10.71: the capability call writes the 64-bit value 1 for size 8, answers VIDEO_OUT_ERROR_INVALID_VALUE for any other size and for a null info (as libSceVideoOut.sprx of firmware 10.71 does), and VIDEO_OUT_ERROR_INVALID_HANDLE for an unknown or closed handle; sceVideoOutModeSetAny_ returns nothing, stores the size in the first word and fills the rest of the struct with 0xFF. What the capability bit and the filled struct mean is not documented, so both are recorded under Unknown function info in docs/dev/debt/libSceVideoOut.md. The new guest test guest_video_out_device_capability covers the measured rows and skips (77) when no VideoOut port can be opened.

Tested

Windows 11, NVIDIA GeForce RTX 2080 (Vulkan): guest_video_out_device_capability passed on the final head, also with the Khronos validation layer (no VUID messages); the paired main/change logs are in the PR conversation. The rows were measured on a PS4 Pro (firmware 10.71) with a homebrew probe: size 8 gives 1, sizes 0, 4 and 16 give 0x80290001, handle -1 gives 0x8029000B, sceVideoOutModeSetAny_ with size 16 stores 0x00000010 followed by twelve 0xFF bytes. The same probe compiled against this branch on the host gives the same eight rows. Not run with a title.

Refresh — 2026-11-03 (Codex, AI-assisted): Merged main 086c0686c8, kept main's flip-rate and implemented flip-master entries, and removed the obsolete duplicate claiming flip-master is unimplemented. Conventions and whitespace checks pass. No new runtime or Vulkan tests; earlier results above predate this merge.

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: NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (the guest test opens the main port through the Vulkan device; the change itself touches no GPU path)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4973670815 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9880). Originally posted by [ntamas94](https://github.com/ntamas94) on 2026-10-22T20:27:44Z. --- ### What Adds `sceVideoOutGetDeviceCapabilityInfo_` and `sceVideoOutModeSetAny_`, which both measured PS4 titles (CUSA04865, CUSA12435) import and which the library did not export. Measured on a PS4 Pro with firmware 10.71: the capability call writes the 64-bit value 1 for size 8, answers `VIDEO_OUT_ERROR_INVALID_VALUE` for any other size and for a null `info` (as `libSceVideoOut.sprx` of firmware 10.71 does), and `VIDEO_OUT_ERROR_INVALID_HANDLE` for an unknown or closed handle; `sceVideoOutModeSetAny_` returns nothing, stores the size in the first word and fills the rest of the struct with 0xFF. What the capability bit and the filled struct mean is not documented, so both are recorded under Unknown function info in `docs/dev/debt/libSceVideoOut.md`. The new guest test `guest_video_out_device_capability` covers the measured rows and skips (77) when no VideoOut port can be opened. ### Tested Windows 11, NVIDIA GeForce RTX 2080 (Vulkan): `guest_video_out_device_capability` passed on the final head, also with the Khronos validation layer (no VUID messages); the paired main/change logs are in the PR conversation. The rows were measured on a PS4 Pro (firmware 10.71) with a homebrew probe: size 8 gives 1, sizes 0, 4 and 16 give 0x80290001, handle -1 gives 0x8029000B, `sceVideoOutModeSetAny_` with size 16 stores 0x00000010 followed by twelve 0xFF bytes. The same probe compiled against this branch on the host gives the same eight rows. Not run with a title. **Refresh — 2026-11-03 (Codex, AI-assisted):** Merged main 086c0686c8, kept main's flip-rate and implemented flip-master entries, and removed the obsolete duplicate claiming flip-master is unimplemented. Conventions and whitespace checks pass. No new runtime or Vulkan tests; earlier results above predate this merge. ### 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: none - [x] GPUs tested: NVIDIA GeForce RTX 2080, driver 617.14, Windows 11 (the guest test opens the main port through the Vulkan device; the change itself touches no GPU path) - [x] AI-assisted: yes
harisibrar1 commented 2026-10-24 12:32:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by harisibrar1 on 2026-10-24T12:32:06Z.

Review: COMMENTED


Checked against main 87666fc5d6 and shadPS4 396c2a09a3 (src/core/libraries/videoout/video_out.cpp):

  • The NIDs match (kGVLc3htQE8, pjkDsgxli6c). ModeSetAny_ matches shadPS4 (memset 0xFF over size, then size in the first word), and the test registration matches guest_video_out_resolution_status (77 / videoout_app0 / same link set). The branch still merges cleanly with main.
  • Small question: the test also requires ModeSetAny_(mode, 0) to write a zero first word, which writes 4 bytes for a 0-byte struct. Was size 0 among the PS4 probe rows? The description lists only size 16 for this call. If it wasn't measured, it may be better to drop that row or say so in the debt entry.
  • On the capability value: shadPS4 names 0x80 as BT2020_PQ and reports 0 without HDR, so the measured 1 is a different bit. It could help to note in the debt entry which display the PS4 Pro was connected to, since the value may depend on it.
  • The setup-order issue that oneandonlydean raised is the one that matters for CI; I have nothing to add there.

Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5638245194 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/9880#pullrequestreview-5638245194). Originally posted by [harisibrar1](https://github.com/harisibrar1) on 2026-10-24T12:32:06Z. **Review:** COMMENTED --- Checked against main 87666fc5d6 and shadPS4 396c2a09a3 (`src/core/libraries/videoout/video_out.cpp`): - The NIDs match (`kGVLc3htQE8`, `pjkDsgxli6c`). `ModeSetAny_` matches shadPS4 (`memset` 0xFF over `size`, then `size` in the first word), and the test registration matches `guest_video_out_resolution_status` (77 / `videoout_app0` / same link set). The branch still merges cleanly with main. - Small question: the test also requires `ModeSetAny_(mode, 0)` to write a zero first word, which writes 4 bytes for a 0-byte struct. Was size 0 among the PS4 probe rows? The description lists only size 16 for this call. If it wasn't measured, it may be better to drop that row or say so in the debt entry. - On the capability value: shadPS4 names `0x80` as BT2020_PQ and reports 0 without HDR, so the measured `1` is a different bit. It could help to note in the debt entry which display the PS4 Pro was connected to, since the value may depend on it. - The setup-order issue that oneandonlydean raised is the one that matters for CI; I have nothing to add there. Reviewed with AI assistance (Claude Code); the checks above were run locally on my machine.
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!9880
No description provided.