fix(videoout): report unavailable output modes instead of throwing #709

Merged
merwie merged 2 commits from upstream-pr/709 into main 2026-10-07 02:15:22 +00:00
merwie commented 2026-10-05 17:31:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-05T17:31:37Z.


What

  • sceVideoOutIsOutputSupported threw VIDEO_OUT_ERROR_UNSUPPORTED_OUTPUT_MODE for every mode other than the default and 119.88 Hz. It now returns 1 for the default mode and 0 for any other mode.
  • sceVideoOutConfigureOutput threw VIDEO_OUT_ERROR_UNAVAILABLE_OUTPUT_MODE for an unavailable 119.88 Hz mode. It now returns that error code for every unsupported mode.
  • Flip.cpp controls: the default mode is supported and configurable; 119.88 Hz and 0xd000000a are not supported and configuring them returns VIDEO_OUT_ERROR_UNAVAILABLE_OUTPUT_MODE.
  • TechnicalDebt: the mode encoding is unknown, so values the console would reject with UNSUPPORTED_OUTPUT_MODE are reported as unavailable instead.

Evidence from PPSA12544 (Hollow Knight: Silksong, Unity):

  • It probes sceVideoOutIsOutputSupported(handle, 0xd000000a, ...) and selects a 7680-pixel output when the result is 1, 3840 otherwise.
  • Its sceVideoOutConfigureOutput caller switches on the returned code: it has cases for 0x80290001, 0x80290002, 0x8029000b, 0x80290016 (SCE_VIDEO_OUT_ERROR_UNSUPPORTED_OUTPUT_MODE), 0x80290019 (VIDEO_OUT_ERROR_UNAVAILABLE_OUTPUT_MODE, with a hint to enable HFR in param.json when the mode was 119.88 Hz) and 0x8029001e, and continues after logging. The console returns these codes; it does not stop the title.

Tested

Windows 11, WinLibs GCC 15.2.0 r7, Ryzen 7 9800X3D, Radeon RX 9070 XT.

  • ctest: 286/288 passed. agc_driver_lds_atomics64 and agc_driver_vopc_compare_table fail on this machine on main as well (Vulkan device tests).
  • video_out_flip_tests controls (not registered with ctest): passed.
  • PPSA12544 with #698, #699, #700, #702, #705, #648: passes both calls and continues to param.json parsing, the Vulkan device and the swapchain.

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 in TechnicalDebt
  • 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 (#518 also edits Output.cpp, in other functions)
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4748626622 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/709). Originally posted by [merwie](https://github.com/merwie) on 2026-10-05T17:31:37Z. --- ### What - `sceVideoOutIsOutputSupported` threw `VIDEO_OUT_ERROR_UNSUPPORTED_OUTPUT_MODE` for every mode other than the default and 119.88 Hz. It now returns 1 for the default mode and 0 for any other mode. - `sceVideoOutConfigureOutput` threw `VIDEO_OUT_ERROR_UNAVAILABLE_OUTPUT_MODE` for an unavailable 119.88 Hz mode. It now returns that error code for every unsupported mode. - `Flip.cpp` `controls`: the default mode is supported and configurable; 119.88 Hz and `0xd000000a` are not supported and configuring them returns `VIDEO_OUT_ERROR_UNAVAILABLE_OUTPUT_MODE`. - TechnicalDebt: the mode encoding is unknown, so values the console would reject with `UNSUPPORTED_OUTPUT_MODE` are reported as unavailable instead. Evidence from PPSA12544 (Hollow Knight: Silksong, Unity): - It probes `sceVideoOutIsOutputSupported(handle, 0xd000000a, ...)` and selects a 7680-pixel output when the result is 1, 3840 otherwise. - Its `sceVideoOutConfigureOutput` caller switches on the returned code: it has cases for `0x80290001`, `0x80290002`, `0x8029000b`, `0x80290016` (`SCE_VIDEO_OUT_ERROR_UNSUPPORTED_OUTPUT_MODE`), `0x80290019` (`VIDEO_OUT_ERROR_UNAVAILABLE_OUTPUT_MODE`, with a hint to enable HFR in `param.json` when the mode was 119.88 Hz) and `0x8029001e`, and continues after logging. The console returns these codes; it does not stop the title. ### Tested Windows 11, WinLibs GCC 15.2.0 r7, Ryzen 7 9800X3D, Radeon RX 9070 XT. - `ctest`: 286/288 passed. `agc_driver_lds_atomics64` and `agc_driver_vopc_compare_table` fail on this machine on `main` as well (Vulkan device tests). - `video_out_flip_tests controls` (not registered with ctest): passed. - PPSA12544 with #698, #699, #700, #702, #705, #648: passes both calls and continues to `param.json` parsing, the Vulkan device and the swapchain. ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in TechnicalDebt - [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 (#518 also edits `Output.cpp`, in other functions) - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
oneandonlydean commented 2026-10-05 19:45:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T19:45:50Z.


Thanks. The change in Output.cpp looks right to me. The new test lines in libSceVideoOut/tests/Flip.cpp don't compile with GCC, though:

Flip.cpp:200:85: error: unable to deduce 'std::initializer_list<auto>&&' from '{VIDEO_OUT_OUTPUT_MODE_119_88HZ, 3489660938}'

The braced list mixes the enum with an unsigned long long. video_out_flip_tests is EXCLUDE_FROM_ALL and not in ctest, so CI never builds it. Spelling the list type out fixes it, for example for (const uint64_t unsupported : std::initializer_list<uint64_t>{VIDEO_OUT_OUTPUT_MODE_119_88HZ, 0xd000000aull}). #647 has since landed and added a line in the same place in TechnicalDebt.md (after the sceAvPlayerAddSource entry), so this also needs a one-line rebase keeping both lines.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6001774476 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/709#issuecomment-6001774476). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-05T19:45:50Z. --- Thanks. The change in `Output.cpp` looks right to me. The new test lines in `libSceVideoOut/tests/Flip.cpp` don't compile with GCC, though: ``` Flip.cpp:200:85: error: unable to deduce 'std::initializer_list<auto>&&' from '{VIDEO_OUT_OUTPUT_MODE_119_88HZ, 3489660938}' ``` The braced list mixes the enum with an `unsigned long long`. `video_out_flip_tests` is `EXCLUDE_FROM_ALL` and not in ctest, so CI never builds it. Spelling the list type out fixes it, for example `for (const uint64_t unsupported : std::initializer_list<uint64_t>{VIDEO_OUT_OUTPUT_MODE_119_88HZ, 0xd000000aull})`. #647 has since landed and added a line in the same place in `TechnicalDebt.md` (after the `sceAvPlayerAddSource` entry), so this also needs a one-line rebase keeping both lines.
merwie commented 2026-10-05 20:49:05 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-05T20:49:05Z.


Thanks for catching that. Fixed and rebased:

  • The loop now spells out std::initializer_list<uint64_t>{VIDEO_OUT_OUTPUT_MODE_119_88HZ, 0xd000000aull} (with <initializer_list> included). WinLibs GCC 15.2 had accepted the mixed list, so I did not see it locally.
  • Rebased onto main after #647; TechnicalDebt.md keeps both lines (#647's STRICT_COLORIMETRY entry, then this one).

Retested on the rebased branch: video_out_flip_tests controls passes, ctest 315/317 (the two agc_driver Vulkan tests that fail on this machine on main too).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6002651951 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/709#issuecomment-6002651951). Originally posted by [merwie](https://github.com/merwie) on 2026-10-05T20:49:05Z. --- Thanks for catching that. Fixed and rebased: - The loop now spells out `std::initializer_list<uint64_t>{VIDEO_OUT_OUTPUT_MODE_119_88HZ, 0xd000000aull}` (with `<initializer_list>` included). WinLibs GCC 15.2 had accepted the mixed list, so I did not see it locally. - Rebased onto `main` after #647; `TechnicalDebt.md` keeps both lines (#647's STRICT_COLORIMETRY entry, then this one). Retested on the rebased branch: `video_out_flip_tests controls` passes, `ctest` 315/317 (the two `agc_driver` Vulkan tests that fail on this machine on `main` too).
oneandonlydean commented 2026-10-05 23:37:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-05T23:37:41Z.


This needs a one-line rebase now that #648 has landed: docs/dev/TechnicalDebt.md conflicts with current main, where #648 added the sceVideoOutRegisterBuffers2 (DCC buffers) line at the same place as your sceVideoOutIsOutputSupported line. Keeping both lines (#648's first, then yours) resolves it; nothing else conflicts, and the code merges cleanly with #648's Flip.cpp changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6005565291 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/709#issuecomment-6005565291). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-05T23:37:41Z. --- This needs a one-line rebase now that #648 has landed: `docs/dev/TechnicalDebt.md` conflicts with current `main`, where #648 added the `sceVideoOutRegisterBuffers2` (DCC buffers) line at the same place as your `sceVideoOutIsOutputSupported` line. Keeping both lines (#648's first, then yours) resolves it; nothing else conflicts, and the code merges cleanly with #648's `Flip.cpp` changes.
merwie commented 2026-10-06 07:59:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by merwie on 2026-10-06T07:59:48Z.


Merged main (a merge, not a rebase, so the review history stays) and kept both TechnicalDebt.md lines in the order you suggested. Nothing else changed.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6011984646 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/709#issuecomment-6011984646). Originally posted by [merwie](https://github.com/merwie) on 2026-10-06T07:59:48Z. --- Merged `main` (a merge, not a rebase, so the review history stays) and kept both `TechnicalDebt.md` lines in the order you suggested. Nothing else changed.
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!709
No description provided.