feat(videoout): implement sceVideoOutGetCurrentOutputMode_ and sceVideoOutGetHdmiRawEdid_ #7259

Closed
adhimiw wants to merge 1 commit from upstream-pr/7259 into main
adhimiw commented 2026-10-17 20:05:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adhimiw on 2026-10-17T20:05:35Z.


What

Implement sceVideoOutGetCurrentOutputMode_ (NID W0iQAbGaTBg) and sceVideoOutGetHdmiRawEdid_ (NID +sXvR1JH9Aw) in libSceVideoOut.

  • sceVideoOutGetCurrentOutputMode_: takes the AvSetting bus ID (0x7000) or 0, queries the active display configuration, and writes the 32-byte OutputMode structure with the resolution and refresh rate. Non-bus handles return 0x80290018.
  • sceVideoOutGetHdmiRawEdid_: validates destination pointer and buffer size, clearing the buffer and reporting 0 EDID blocks when raw HDMI sink descriptors are not exposed.

Tested

  • Linux x86_64 (Mesa 26.2.0, Wayland, NVIDIA RTX 4050 Laptop GPU / AMD Radeon 660M).
  • Verified python3 tools/check_conventions.py --base origin/main passes with zero errors.
  • Verified python3 tools/pr_overlap.py --branch feat/videoout-output-mode-and-edid completes with no conflicting export implementations.
  • Tested live on Overdrive (PPSA99058): previously blocked on missing +sXvR1JH9Aw and W0iQAbGaTBg; after this change, all 430 unique imports resolve (0 absent), eboot relinks cleanly, launches and presents live at 1920x1080@60Hz via Wayland with working input, audio, and React UI.

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: PPSA99058
  • GPUs tested: NVIDIA GeForce RTX 4050 Laptop GPU, driver 570.124.04, Linux 6.13; AMD Radeon 660M (RADV Mesa 26.2.0)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4903501081 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7259). Originally posted by [adhimiw](https://github.com/adhimiw) on 2026-10-17T20:05:35Z. --- ### What Implement `sceVideoOutGetCurrentOutputMode_` (NID `W0iQAbGaTBg`) and `sceVideoOutGetHdmiRawEdid_` (NID `+sXvR1JH9Aw`) in `libSceVideoOut`. - `sceVideoOutGetCurrentOutputMode_`: takes the AvSetting bus ID (`0x7000`) or 0, queries the active display configuration, and writes the 32-byte `OutputMode` structure with the resolution and refresh rate. Non-bus handles return `0x80290018`. - `sceVideoOutGetHdmiRawEdid_`: validates destination pointer and buffer size, clearing the buffer and reporting 0 EDID blocks when raw HDMI sink descriptors are not exposed. ### Tested - Linux x86_64 (Mesa 26.2.0, Wayland, NVIDIA RTX 4050 Laptop GPU / AMD Radeon 660M). - Verified `python3 tools/check_conventions.py --base origin/main` passes with zero errors. - Verified `python3 tools/pr_overlap.py --branch feat/videoout-output-mode-and-edid` completes with no conflicting export implementations. - Tested live on Overdrive (PPSA99058): previously blocked on missing `+sXvR1JH9Aw` and `W0iQAbGaTBg`; after this change, all 430 unique imports resolve (0 absent), eboot relinks cleanly, launches and presents live at 1920x1080@60Hz via Wayland with working input, audio, and React UI. ### Checklist - [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: PPSA99058 - [x] GPUs tested: NVIDIA GeForce RTX 4050 Laptop GPU, driver 570.124.04, Linux 6.13; AMD Radeon 660M (RADV Mesa 26.2.0) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-17 20:34:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T20:34:29Z.


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 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
PR 7690 docs/dev/debt/libSceVideoOut.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6240591757 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7259#issuecomment-6240591757). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-17T20:34:29Z. --- <!-- pr-overlap --> 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](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `core/libs/prx/libSceVideoOut/src/Output.cpp`<br>`docs/dev/debt/libSceVideoOut.md` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/libs/prx/libSceVideoOut/include/VideoOutDriver.hpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libSceVideoOut/include/VideoOutDriver.hpp`<br>`core/libs/prx/libSceVideoOut/src/Output.cpp`<br>`docs/dev/debt/libSceVideoOut.md` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceVideoOut/include/VideoOutDriver.hpp` | | [PR 7690](https://www.github.com/boykopovar/AnyPS5/pull/7690) | `docs/dev/debt/libSceVideoOut.md` |
oneandonlydean commented 2026-10-17 21:39:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-17T21:39:55Z.


Full CI on 90959a23f (merged into main) fails only the new video_out_output_mode_policy test, on both lanes:

linux:   what():  SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
windows: Exit code 0xc0000409   what():  param.json not found

The cause is the two success queries the PR adds to tests/OutputModePolicy.cpp: sceVideoOutGetCurrentOutputMode_(0x7000, &testMode) and (0, &testMode). Both reach VideoOutDriver::Get(), and its constructor initialises SDL video and reads the title's metadata (VideoOutDriver.cpp:271-280). Until now this test only called ValidateVideoOutOutputMode_nid_no_patch, which needs neither. That's why it's registered as a plain unit test, without SKIP_RETURN_CODE 77, RESOURCE_LOCK videoout_app0 or an app0 environment. On a headless runner the constructor throws (Linux), and on Windows it finds no param.json.

Suggested fix (tests only):

  • Keep the null-address, invalid-bus and EDID asserts in OutputModePolicy.cpp. They return before VideoOutDriver::Get(), so they stay plain unit checks.
  • Move the two success queries into core/libs/tests/GuestVideoOutOutputMode.cpp, after sceVideoOutOpen(SYSTEM_USER, MAIN_BUS, 0, nullptr). That test already sets up VideoOutTestEnvironment, skips with 77 when there is no display (unless ANYPS5_REQUIRE_DISPLAY is set), and is registered with SKIP_RETURN_CODE 77 RESOURCE_LOCK videoout_app0. There you can also check the result against the opened handle's configured resolution instead of accepting either 0x0b or 0x0c.

Optional, while you're there:

  • Where do 0x80290018 (invalid bus) and the resolution codes 0x09/0x0b/0x0c/0x0f come from? A named constant or a reference would help the next reader. They're a different set from the 1/2 that outputStatus writes in the same file.
  • GetConfig(VIDEO_OUT_BUS_TYPE_MAIN + 1) assumes the main bus is handle 1. Handles are given out from 1 in open order (VideoOutDriver.cpp:334), so a title that opens another bus first would get that bus's config. Looking up the open main-bus handle would avoid that.
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241571462 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7259#issuecomment-6241571462). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-17T21:39:55Z. --- Full CI on 90959a23f (merged into main) fails only the new `video_out_output_mode_policy` test, on both lanes: ``` linux: what(): SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available windows: Exit code 0xc0000409 what(): param.json not found ``` The cause is the two success queries the PR adds to `tests/OutputModePolicy.cpp`: `sceVideoOutGetCurrentOutputMode_(0x7000, &testMode)` and `(0, &testMode)`. Both reach `VideoOutDriver::Get()`, and its constructor initialises SDL video and reads the title's metadata (`VideoOutDriver.cpp:271-280`). Until now this test only called `ValidateVideoOutOutputMode_nid_no_patch`, which needs neither. That's why it's registered as a plain unit test, without `SKIP_RETURN_CODE 77`, `RESOURCE_LOCK videoout_app0` or an app0 environment. On a headless runner the constructor throws (Linux), and on Windows it finds no `param.json`. Suggested fix (tests only): - Keep the null-address, invalid-bus and EDID asserts in `OutputModePolicy.cpp`. They return before `VideoOutDriver::Get()`, so they stay plain unit checks. - Move the two success queries into `core/libs/tests/GuestVideoOutOutputMode.cpp`, after `sceVideoOutOpen(SYSTEM_USER, MAIN_BUS, 0, nullptr)`. That test already sets up `VideoOutTestEnvironment`, skips with 77 when there is no display (unless `ANYPS5_REQUIRE_DISPLAY` is set), and is registered with `SKIP_RETURN_CODE 77 RESOURCE_LOCK videoout_app0`. There you can also check the result against the opened handle's configured resolution instead of accepting either `0x0b` or `0x0c`. Optional, while you're there: - Where do `0x80290018` (invalid bus) and the resolution codes `0x09`/`0x0b`/`0x0c`/`0x0f` come from? A named constant or a reference would help the next reader. They're a different set from the `1`/`2` that `outputStatus` writes in the same file. - `GetConfig(VIDEO_OUT_BUS_TYPE_MAIN + 1)` assumes the main bus is handle 1. Handles are given out from 1 in open order (`VideoOutDriver.cpp:334`), so a title that opens another bus first would get that bus's config. Looking up the open main-bus handle would avoid that.
github-actions[bot] commented 2026-10-19 13:20:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T13:20:55Z.


Progress report (922dc89 → 90959a2)

➖ System libraries: 89.65% (+0.0%, +2 implemented functions)

✅ 2 implemented
Library Name
libSceVideoOut sceVideoOutGetCurrentOutputMode_
libSceVideoOut sceVideoOutGetHdmiRawEdid_
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6268222318 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7259#issuecomment-6268222318). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T13:20:55Z. --- <!-- progress-report --> ### Progress report (922dc89 → 90959a2) ➖ **System libraries**: 89.65% (+0.0%, +2 implemented functions) <details> <summary>✅ 2 implemented</summary> | Library | Name | | - | - | | libSceVideoOut | `sceVideoOutGetCurrentOutputMode_` | | libSceVideoOut | `sceVideoOutGetHdmiRawEdid_` | </details>
adriadam10 commented 2026-10-19 13:21:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T13:21:24Z.

Review: CHANGES_REQUESTED


Thanks. Open points:

  • Still needed from @oneandonlydean's review above: the two success queries in OutputModePolicy.cpp (sceVideoOutGetCurrentOutputMode_(0x7000/0, &testMode)) fail the full CI on both lanes because they reach VideoOutDriver::Get(). Move them to GuestVideoOutOutputMode.cpp (display skip, RESOURCE_LOCK videoout_app0) and check against the opened handle's resolution.
  • Sources: none of KytyPS5, shadPS4 or fpPS4 defines these two exports, so please say where the resolution codes (0x09/0x0b/0x0c/0x0f), the refresh values, 0x80290018 and the "success with zeroed EDID" behaviour come from (disassembly of the title's call site, a measurement), and name them as constants. Whatever is not backed by evidence should throw instead of returning a plausible value, with the TechnicalDebt line under the matching section.
  • GetConfig(VIDEO_OUT_BUS_TYPE_MAIN + 1) assumes the main bus is handle 1 (see Dean's note); look up the open main-bus handle.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5572162095 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7259#pullrequestreview-5572162095). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T13:21:24Z. **Review:** CHANGES_REQUESTED --- Thanks. Open points: - Still needed from @oneandonlydean's review above: the two success queries in `OutputModePolicy.cpp` (`sceVideoOutGetCurrentOutputMode_(0x7000/0, &testMode)`) fail the full CI on both lanes because they reach `VideoOutDriver::Get()`. Move them to `GuestVideoOutOutputMode.cpp` (display skip, `RESOURCE_LOCK videoout_app0`) and check against the opened handle's resolution. - Sources: none of KytyPS5, shadPS4 or fpPS4 defines these two exports, so please say where the resolution codes (`0x09/0x0b/0x0c/0x0f`), the refresh values, `0x80290018` and the "success with zeroed EDID" behaviour come from (disassembly of the title's call site, a measurement), and name them as constants. Whatever is not backed by evidence should throw instead of returning a plausible value, with the TechnicalDebt line under the matching section. - `GetConfig(VIDEO_OUT_BUS_TYPE_MAIN + 1)` assumes the main bus is handle 1 (see Dean's note); look up the open main-bus handle.
adhimiw commented 2026-10-20 02:08:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adhimiw on 2026-10-20T02:08:42Z.


Temporarily closed so a second pull request could be opened: this account has no pull request merged into main yet, and the intake bot allows only one open pull request per such author. The branch and the review history are untouched, so this pull request can be reopened as soon as the other one is merged or closed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281677554 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7259#issuecomment-6281677554). Originally posted by [adhimiw](https://github.com/adhimiw) on 2026-10-20T02:08:42Z. --- Temporarily closed so a second pull request could be opened: this account has no pull request merged into `main` yet, and the intake bot allows only one open pull request per such author. The branch and the review history are untouched, so this pull request can be reopened as soon as the other one is merged or closed.
adhimiw commented 2026-10-20 02:08:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adhimiw on 2026-10-20T02:08:44Z.


Closed to free the account's single open pull request slot for #8107. See the comment above; reopening is a single click once the other pull request is merged or closed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281677820 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7259#issuecomment-6281677820). Originally posted by [adhimiw](https://github.com/adhimiw) on 2026-10-20T02:08:44Z. --- Closed to free the account's single open pull request slot for #8107. See the comment above; reopening is a single click once the other pull request is merged or closed.
github-actions[bot] commented 2026-10-20 02:13:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-20T02:13:10Z.


Thank you for your contribution! Authors with no pull requests merged into main can have 1 open pull request at a time, authors with at least 1 merged can have 20, and from 20 merged there is no limit. This PR has been automatically closed and labeled "open PR limit" because that limit was reached. This is not a judgment of the quality of your changes: reopen it once one of your open pull requests is merged or closed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6281732076 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7259#issuecomment-6281732076). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-20T02:13:10Z. --- Thank you for your contribution! Authors with no pull requests merged into `main` can have 1 open pull request at a time, authors with at least 1 merged can have 20, and from 20 merged there is no limit. This PR has been automatically closed and labeled "open PR limit" because that limit was reached. This is not a judgment of the quality of your changes: reopen it once one of your open pull requests is merged or closed.

Pull request closed

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!7259
No description provided.