feat(videoout): keep the host screen awake while a title runs #17347

Merged
MarcZX10 merged 25 commits from upstream-pr/17347 into main 2026-11-24 15:21:00 +00:00
MarcZX10 commented 2026-11-08 18:24:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-08T18:24:46Z.


What

Keeps the host screen saver and display sleep off while a title runs, through SDL's own default. SDL 2 disables the screen saver when its video subsystem starts and main never allows it back, so the default stays as it is. ANYPS5_KEEP_AWAKE=0 is the opt-out: in VideoOutDriver.cpp it sets SDL_VIDEO_ALLOW_SCREENSAVER=1 before SDL's video subsystem starts, so the host screen saver can run. Unset or any other value keeps SDL's default.

Reduction from the earlier version of this PR: the HostKeepAwake holder, its SDL backend, the refused-hold logging, the display window hooks, the test and the CMake lines are gone. That version took an explicit SDL_DisableScreenSaver hold on window create and released it on destroy; it duplicated SDL's default, so it is removed. No host where the screen sleeps on main has been named or measured, so none is claimed here. The only remaining behaviour is the opt-out.

Scope: libSceVideoOut VideoOutDriver.cpp, one row in the environment reference, and one debt fragment, docs/dev/debt/changes/feat-host-keep-screen-awake.md, for the platforms that were not checked. Net change against origin/main: those three files. The earlier feature commits remain in the branch history; the reduction is 90c5e0cc99 and the debt fragment is 1a7634ca14.

Tested

On the head 1a7634ca14, against origin/main bd9a6c00a6:

  • python3 tools/check_conventions.py --base origin/main: passed.
  • git diff --check origin/main...HEAD: clean.
  • python3 tools/debt_fold.py --check: passed.
  • Compile of core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp with the build-gcc15 flags (GCC 15, Release, Windows): exit 0.
  • Standalone probe on a Windows host, linked against the build-gcc15 SDL2 static library (not the test suite): SDL_IsScreenSaverEnabled() returned 0 with ANYPS5_KEEP_AWAKE unset, 1 with ANYPS5_KEEP_AWAKE=0, and 0 with ANYPS5_KEEP_AWAKE=1. This reads SDL's flag after the hint; it does not observe whether the OS screen sleeps.

Not run on this head:

  • The libSceVideoOut test targets (guest_video_out_*, pad_keyboard_mouse) were not built. No test covers the new hint line.
  • The Windows test suite and Wayland were not rerun. Wayland cannot be run here. The Linux results in the earlier body were on the superseded head and are not repeated.

Overlap: PR #18502 touches core/libs/prx/libSceVideoOut/CMakeLists.txt; this PR no longer touches CMake, so the two do not overlap there. The earlier body named PR 12863 as overlapping; I did not recheck that on this head. This PR adds one row to docs/dev/ENVIRONMENT.md and one fragment, so a text conflict is possible there if another PR changes the same table.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: n/a; the change only sets an SDL hint, and no GPU run was made on this head
  • AI-Assisted: Yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5213904882 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/17347). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-08T18:24:46Z. --- ### What Keeps the host screen saver and display sleep off while a title runs, through SDL's own default. SDL 2 disables the screen saver when its video subsystem starts and main never allows it back, so the default stays as it is. `ANYPS5_KEEP_AWAKE=0` is the opt-out: in `VideoOutDriver.cpp` it sets `SDL_VIDEO_ALLOW_SCREENSAVER=1` before SDL's video subsystem starts, so the host screen saver can run. Unset or any other value keeps SDL's default. Reduction from the earlier version of this PR: the `HostKeepAwake` holder, its SDL backend, the refused-hold logging, the display window hooks, the test and the CMake lines are gone. That version took an explicit `SDL_DisableScreenSaver` hold on window create and released it on destroy; it duplicated SDL's default, so it is removed. No host where the screen sleeps on main has been named or measured, so none is claimed here. The only remaining behaviour is the opt-out. Scope: libSceVideoOut `VideoOutDriver.cpp`, one row in the environment reference, and one debt fragment, `docs/dev/debt/changes/feat-host-keep-screen-awake.md`, for the platforms that were not checked. Net change against `origin/main`: those three files. The earlier feature commits remain in the branch history; the reduction is `90c5e0cc99` and the debt fragment is `1a7634ca14`. ### Tested On the head `1a7634ca14`, against `origin/main` `bd9a6c00a6`: - `python3 tools/check_conventions.py --base origin/main`: passed. - `git diff --check origin/main...HEAD`: clean. - `python3 tools/debt_fold.py --check`: passed. - Compile of `core/libs/prx/libSceVideoOut/src/VideoOutDriver.cpp` with the `build-gcc15` flags (GCC 15, Release, Windows): exit 0. - Standalone probe on a Windows host, linked against the `build-gcc15` SDL2 static library (not the test suite): `SDL_IsScreenSaverEnabled()` returned 0 with `ANYPS5_KEEP_AWAKE` unset, 1 with `ANYPS5_KEEP_AWAKE=0`, and 0 with `ANYPS5_KEEP_AWAKE=1`. This reads SDL's flag after the hint; it does not observe whether the OS screen sleeps. Not run on this head: - The libSceVideoOut test targets (`guest_video_out_*`, `pad_keyboard_mouse`) were not built. No test covers the new hint line. - The Windows test suite and Wayland were not rerun. Wayland cannot be run here. The Linux results in the earlier body were on the superseded head and are not repeated. Overlap: PR #18502 touches `core/libs/prx/libSceVideoOut/CMakeLists.txt`; this PR no longer touches CMake, so the two do not overlap there. The earlier body named PR 12863 as overlapping; I did not recheck that on this head. This PR adds one row to `docs/dev/ENVIRONMENT.md` and one fragment, so a text conflict is possible there if another PR changes the same table. ### 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) and the licence notice of code adapted from upstream (see AGENTS.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: n/a; the change only sets an SDL hint, and no GPU run was made on this head - [x] AI-Assisted: Yes
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!17347
No description provided.