fix(libSceVideoOut): fall back to 59.94 Hz when display drops below 120 Hz #8095

Merged
Unkown607 merged 1 commit from upstream-pr/8095 into main 2026-10-21 01:59:25 +00:00
Unkown607 commented 2026-10-19 21:23:37 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Unkown607 on 2026-10-19T21:23:37Z.


What

When a title has configured 119.88 Hz output (mode 15) and the window moves to a display below 120 Hz, the presenter aborted with std::terminate. This replaces the abort with a graceful fallback.

How

In processFlip, the require() that threw when SupportsHighFrameRate() returned false while mode 15 was active is replaced with:

  1. Reset outputMode to VIDEO_OUT_OUTPUT_MODE_DEFAULT (mode 1)
  2. Fire VIDEO_OUT_EVENT_SET_MODE so the title is notified
  3. Log a diagnostic line to stderr
  4. Continue presenting at 59.94 Hz

After the fallback:

  • sceVideoOutGetOutputStatus reports refreshRate 3 (59.94 Hz)
  • sceVideoOutGetResolutionStatus reports refreshRate 3
  • Vblanks run at 59.94 Hz (the existing every-other-tick skip resumes)
  • sceVideoOutIsOutputSupported(mode=15) returns VIDEO_OUT_ERROR_UNSUPPORTED_OUTPUT_MODE
  • sceVideoOutConfigureOutput(mode=15) succeeds again once the window is back on a >= 120 Hz display

Rationale

A PS5 connected to a 120 Hz TV cannot keep outputting 120 Hz when the TV is replaced by a 60 Hz display or the user disables 120 Hz output in Settings. HDMI output mode renegotiation requires a fallback to a compatible mode. Aborting the title is not what the console does in any display-change scenario.

The console's exact API-level behaviour (which status fields change, whether the output-mode event fires, whether the vblank period adjusts immediately) has not been measured; the fallback and its unverified status are recorded in the debt file.

Tested

  • video_out_output_mode_policy: passed
  • guest_video_out_output_mode: passed
  • guest_video_out_high_frame_rate: skipped (host display below 120 Hz)
  • Conventions check: passed
  • Linux, GCC, Release

Checklist

  • I have read CONTRIBUTING.md
  • Depends on: none
  • Fixes: #7877
  • Unblocks: PPSA99141, PPSA99350
  • GPU tests: not applicable (no shader or AGC driver change)
  • AI-assisted: yes (Claude Code)
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4927616025 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8095). Originally posted by [Unkown607](https://github.com/Unkown607) on 2026-10-19T21:23:37Z. --- ### What When a title has configured 119.88 Hz output (mode 15) and the window moves to a display below 120 Hz, the presenter aborted with `std::terminate`. This replaces the abort with a graceful fallback. ### How In `processFlip`, the `require()` that threw when `SupportsHighFrameRate()` returned false while mode 15 was active is replaced with: 1. Reset `outputMode` to `VIDEO_OUT_OUTPUT_MODE_DEFAULT` (mode 1) 2. Fire `VIDEO_OUT_EVENT_SET_MODE` so the title is notified 3. Log a diagnostic line to stderr 4. Continue presenting at 59.94 Hz After the fallback: - `sceVideoOutGetOutputStatus` reports `refreshRate` 3 (59.94 Hz) - `sceVideoOutGetResolutionStatus` reports `refreshRate` 3 - Vblanks run at 59.94 Hz (the existing every-other-tick skip resumes) - `sceVideoOutIsOutputSupported(mode=15)` returns `VIDEO_OUT_ERROR_UNSUPPORTED_OUTPUT_MODE` - `sceVideoOutConfigureOutput(mode=15)` succeeds again once the window is back on a >= 120 Hz display ### Rationale A PS5 connected to a 120 Hz TV cannot keep outputting 120 Hz when the TV is replaced by a 60 Hz display or the user disables 120 Hz output in Settings. HDMI output mode renegotiation requires a fallback to a compatible mode. Aborting the title is not what the console does in any display-change scenario. The console's exact API-level behaviour (which status fields change, whether the output-mode event fires, whether the vblank period adjusts immediately) has not been measured; the fallback and its unverified status are recorded in the debt file. ### Tested - `video_out_output_mode_policy`: passed - `guest_video_out_output_mode`: passed - `guest_video_out_high_frame_rate`: skipped (host display below 120 Hz) - Conventions check: passed - Linux, GCC, Release ### Checklist - [x] I have read [CONTRIBUTING.md](https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md) - [x] Depends on: none - [x] Fixes: #7877 - [x] Unblocks: PPSA99141, PPSA99350 - [x] GPU tests: not applicable (no shader or AGC driver change) - [x] AI-assisted: yes (Claude Code)
aneeqakbar commented 2026-10-19 21:32:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by aneeqakbar on 2026-10-19T21:32:54Z.


Lgtm

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6277808312 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8095#issuecomment-6277808312). Originally posted by [aneeqakbar](https://github.com/aneeqakbar) on 2026-10-19T21:32:54Z. --- Lgtm
github-actions[bot] commented 2026-10-19 21:33:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T21:33:23Z.


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 7814 docs/dev/debt/libSceVideoOut.md L20-21
PR 7965 docs/dev/debt/libSceVideoOut.md L20-21

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 674 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
PR 4040 docs/dev/debt/libSceVideoOut.md
PR 5021 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
PR 6879 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
PR 6977 docs/dev/debt/libSceVideoOut.md
PR 7201 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
PR 7622 core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6277822235 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8095#issuecomment-6277822235). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T21:33:23Z. --- <!-- pr-overlap --> 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 7814](https://www.github.com/boykopovar/AnyPS5/pull/7814) | `docs/dev/debt/libSceVideoOut.md` [L20-21](https://github.com/boykopovar/AnyPS5/blob/557682ca44b08c51e5a51a42ecb2d8a9e3d41f9c/docs/dev/debt/libSceVideoOut.md#L20-L21) | | | | [PR 7965](https://www.github.com/boykopovar/AnyPS5/pull/7965) | `docs/dev/debt/libSceVideoOut.md` [L20-21](https://github.com/boykopovar/AnyPS5/blob/557682ca44b08c51e5a51a42ecb2d8a9e3d41f9c/docs/dev/debt/libSceVideoOut.md#L20-L21) | | | 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 674](https://www.github.com/boykopovar/AnyPS5/pull/674) | `core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp` | | [PR 4040](https://www.github.com/boykopovar/AnyPS5/pull/4040) | `docs/dev/debt/libSceVideoOut.md` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp` | | [PR 6879](https://www.github.com/boykopovar/AnyPS5/pull/6879) | `core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `docs/dev/debt/libSceVideoOut.md` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp` | | [PR 7622](https://www.github.com/boykopovar/AnyPS5/pull/7622) | `core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp` |
MarcZX10 commented 2026-10-19 23:27:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-19T23:27:25Z.


I reviewed the current diff. The new fallback runs in processFlip after mode 15 has already been configured, but the PR changes no tests. The existing video_out_output_mode_policy test covers initial mode validation, and guest_video_out_high_frame_rate covers mode 15 on a display that supports it; neither appears to exercise losing high-refresh support while mode 15 is active. Could you add a focused regression for the transition to mode 1, the VIDEO_OUT_EVENT_SET_MODE notification, and the resumed 59.94 Hz vblank cadence, or point me to existing coverage for that path? This would protect the behavior the issue reports without requiring a physical two-monitor setup.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6279604770 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8095#issuecomment-6279604770). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-19T23:27:25Z. --- I reviewed the current diff. The new fallback runs in `processFlip` after mode 15 has already been configured, but the PR changes no tests. The existing `video_out_output_mode_policy` test covers initial mode validation, and `guest_video_out_high_frame_rate` covers mode 15 on a display that supports it; neither appears to exercise losing high-refresh support while mode 15 is active. Could you add a focused regression for the transition to mode 1, the `VIDEO_OUT_EVENT_SET_MODE` notification, and the resumed 59.94 Hz vblank cadence, or point me to existing coverage for that path? This would protect the behavior the issue reports without requiring a physical two-monitor setup.
dantdmdarealguy commented 2026-10-20 20:04:01 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by dantdmdarealguy on 2026-10-20T20:04:01Z.


Windows check, related to #7877.

Windows 11 Pro, Intel Core i9-14900K, 128 GB, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON. Head dd523997da and its merge base 283cde8987, built one after the other in the same build directory. Two displays: the window opens on a 2560x1440 239.76 Hz monitor and moves to a 1280x720 60 Hz TV about a second after start. That is the two-monitor case #7877 describes. Mortalfin (PPSA99141) and Steam Remote Play (PPSA99350) were relinked from each build with relinker --windows --registry, each with a fresh run directory.

Titles, 60 s each, both titles running side by side

  • Base: both abort, exit 0xC0000409, Mortalfin after 12.0 s and Steam Remote Play after 39.8 s (its window is black from the abort on):
    [videoout] presentation failed: VideoOut: display no longer supports 119.88 Hz output
    terminate called after throwing an instance of 'std::runtime_error'
      what():  VideoOut: display no longer supports 119.88 Hz output
    
  • Head: both run the full 60 s, then exit 0 on WM_CLOSE. Each logs the new line once:
    [videoout] display no longer supports 119.88 Hz; fell back to 59.94 Hz
    
    • Window-title FPS at 15, 30 and 57 s: Mortalfin 59.95, 59.94, 59.94; Steam Remote Play 59.93, 59.92, 59.96. So flips continue at the 59.94 Hz cadence after the reset.
    • Mortalfin shows its "Choose your Jellyfin server" screen. Steam Remote Play shows "Looking for a PC running Steam" and finds the host PC.
    • Steam Remote Play queries sceVideoOutGetResolutionStatus once, at 1 s, before the move (refresh id 13). It doesn't query again, so neither title shows whether it reacts to the new status or to the SET_MODE event.
    • The head logs have no other failure lines, apart from the titles' own missing-file probes, which the base logs have too.

Tests

  • ctest -R "^(video_out_output_mode_policy|guest_video_out_output_mode|guest_video_out_high_frame_rate|patched_libraries)$": 4 of 4 pass on both base and head. Here guest_video_out_high_frame_rate runs on the 240 Hz monitor and passes, so it doesn't skip as it did in the PR's Linux run.
  • No test reaches the new branch, so these results only show that nothing regressed. I agree with MarcZX10's request for a regression test of the transition.
  • The incremental head build has no warnings. The branch merges into current main 2185dbf92 without conflicts, and line 545 there still has the require.

Notes on the change

  • The fallback runs only in processFlip. A title that stops flipping while it is on the slower display keeps 119.88 Hz vblanks (vblankEnd skips no tick) until its next flip.
  • The debt text says the console's behaviour when it loses a 120 Hz sink hasn't been measured. CONTRIBUTING asks for exact behaviour or a throw, so whether an unmeasured reset to mode 1 plus a SET_MODE event is acceptable here is for the maintainers to decide. On this machine it does what the description says.

Mortalfin on the head at 57 s, 59.94 FPS after the move to the 60 Hz display

Mortalfin on the head at 57 s. On the base it exited before the first capture at 15 s.

Verdict: works on Windows with an RTX 5080. Both titles that abort on the base after the move to the 60 Hz display keep running at 59.94 Hz with the change. It still needs a test for the new path, and maintainer sign-off on an unmeasured fallback.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6300295614 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/8095#issuecomment-6300295614). Originally posted by [dantdmdarealguy](https://github.com/dantdmdarealguy) on 2026-10-20T20:04:01Z. --- Windows check, related to #7877. Windows 11 Pro, Intel Core i9-14900K, 128 GB, NVIDIA GeForce RTX 5080 (driver 32.0.16.1742), WinLibs GCC 15.2.0, Release, `BUILD_TESTING=ON`. Head `dd523997da` and its merge base `283cde8987`, built one after the other in the same build directory. Two displays: the window opens on a 2560x1440 239.76 Hz monitor and moves to a 1280x720 60 Hz TV about a second after start. That is the two-monitor case #7877 describes. Mortalfin (PPSA99141) and Steam Remote Play (PPSA99350) were relinked from each build with `relinker --windows --registry`, each with a fresh run directory. **Titles, 60 s each, both titles running side by side** - Base: both abort, exit `0xC0000409`, Mortalfin after 12.0 s and Steam Remote Play after 39.8 s (its window is black from the abort on): ``` [videoout] presentation failed: VideoOut: display no longer supports 119.88 Hz output terminate called after throwing an instance of 'std::runtime_error' what(): VideoOut: display no longer supports 119.88 Hz output ``` - Head: both run the full 60 s, then exit 0 on WM_CLOSE. Each logs the new line once: ``` [videoout] display no longer supports 119.88 Hz; fell back to 59.94 Hz ``` - Window-title FPS at 15, 30 and 57 s: Mortalfin 59.95, 59.94, 59.94; Steam Remote Play 59.93, 59.92, 59.96. So flips continue at the 59.94 Hz cadence after the reset. - Mortalfin shows its "Choose your Jellyfin server" screen. Steam Remote Play shows "Looking for a PC running Steam" and finds the host PC. - Steam Remote Play queries `sceVideoOutGetResolutionStatus` once, at 1 s, before the move (`refresh id 13`). It doesn't query again, so neither title shows whether it reacts to the new status or to the `SET_MODE` event. - The head logs have no other failure lines, apart from the titles' own missing-file probes, which the base logs have too. **Tests** - `ctest -R "^(video_out_output_mode_policy|guest_video_out_output_mode|guest_video_out_high_frame_rate|patched_libraries)$"`: 4 of 4 pass on both base and head. Here `guest_video_out_high_frame_rate` runs on the 240 Hz monitor and passes, so it doesn't skip as it did in the PR's Linux run. - No test reaches the new branch, so these results only show that nothing regressed. I agree with MarcZX10's request for a regression test of the transition. - The incremental head build has no warnings. The branch merges into current `main` `2185dbf92` without conflicts, and line 545 there still has the `require`. **Notes on the change** - The fallback runs only in `processFlip`. A title that stops flipping while it is on the slower display keeps 119.88 Hz vblanks (`vblankEnd` skips no tick) until its next flip. - The debt text says the console's behaviour when it loses a 120 Hz sink hasn't been measured. CONTRIBUTING asks for exact behaviour or a throw, so whether an unmeasured reset to mode 1 plus a `SET_MODE` event is acceptable here is for the maintainers to decide. On this machine it does what the description says. ![Mortalfin on the head at 57 s, 59.94 FPS after the move to the 60 Hz display](https://raw.githubusercontent.com/dantdmdarealguy/AnyPS5/pr-assets/reviews/8095-mortalfin-head-57s.png) Mortalfin on the head at 57 s. On the base it exited before the first capture at 15 s. Verdict: works on Windows with an RTX 5080. Both titles that abort on the base after the move to the 60 Hz display keep running at 59.94 Hz with the change. It still needs a test for the new path, and maintainer sign-off on an unmeasured fallback.
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!8095
No description provided.