Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Windows: display mode not kept and revert fails when displays are powered off (regression from #5625)

Aperta
#5,942 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
22/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Start with the Windows display device code, WinDisplayDevice, where SDC_SAVE_TO_DATABASE is reportedly no longer set, and with the libdisplaydevice bump in commit e9b24114. Check how the mode is applied and reverted when the display is off, and compare against the earlier libdisplaydevice revision 6e9722f. Done means the requested mode survives stream start, and the original mode and HDR state are restored at stream end when the display is powered off.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is there an existing issue for this?
  • I have searched the existing issues
Is your issue described in the documentation?
  • I have read the documentation
Is your issue present in the latest beta/pre-release?

This issue is present in the latest pre-release

Describe the Bug

Since #5625 (and the libdisplaydevice update that came with it), display configuration breaks on my host if Windows has turned the displays off (display idle timeout) by the time a client connects. The mode change at stream start doesn't stick, and the revert at stream end fails. v2026.914.233613 handled the same setup fine every time.

At stream start the mode change reports success, but 0.2 s later the desktop is back at its original resolution, so the client gets a scaled-down 4K desktop:

[2026-10-15 21:07:52.469]: Info: Changing display modes to:
  "{4236e3ab-60af-5eba-8de2-b4f439c20277}": { "refresh_rate": 120/1, "resolution": { "height": 1080, "width": 1920 } }
[2026-10-15 21:07:52.522]: Info: Changing HDR states to:
  "{4236e3ab-60af-5eba-8de2-b4f439c20277}": "Disabled"
[2026-10-15 21:07:52.595]: Info: Display device configuration applied successfully.
[2026-10-15 21:07:52.598]: Info: Encoder reenumeration is required
[2026-10-15 21:07:52.804]: Info: Desktop resolution [3840x2160]

The HDR change does apply (capture is SDR afterwards). Only the mode gets lost. My guess: the mode isn't written to the display database anymore (SDC_SAVE_TO_DATABASE is now off in WinDisplayDevice), so Windows restores the saved mode while the displays are off.

At stream end the revert can't find the display, and it stays in the stream's state (HDR off) until I change it by hand:

[2026-10-15 21:11:07.790]: Info: Trying to revert applied display device settings. API is available: true
[2026-10-15 21:11:07.791]: Error: Device {4236e3ab-60af-5eba-8de2-b4f439c20277} does not exist in the available path source data!
[2026-10-15 21:11:07.791]: Error: Failed to change topology to:
[2026-10-15 21:11:07.792]: Warning: Some modified devices are unavailable, reverting settings for the remaining topology:
[]
[2026-10-15 21:11:07.793]: Error: Device {4236e3ab-60af-5eba-8de2-b4f439c20277} does not exist in the available path source data!
[2026-10-15 21:11:07.794]: Warning: Failed to revert display device configuration (will retry once devices are added or removed).

The display is connected and active the whole time (single display, no dock). Reverting e9b24114 together with the libdisplaydevice bump (back to 6e9722f) brings the old behaviour back.

Setup: one LG OLED TV on HDMI, nothing else connected. Desktop is 3840x2160 @ 120 Hz with HDR on, and the client (ROG Xbox Ally X) asks for 1920x1080 SDR.

Config: dd_configuration_option = ensure_active, dd_config_revert_delay = 3000, dd_config_revert_on_disconnect = enabled, resolution/refresh/HDR options left on their defaults (automatic). Windows had turned the displays off a few minutes before the client connected.

One thing about my build: the TV gets woken before Sunshine configures the display (it's on, screen off). That's done by one extra commit that runs a command before configure_display(). It doesn't change any display configuration code.

Expected Behavior

The client's mode (1920x1080) stays applied for the whole stream, and the original mode and HDR state come back when the stream ends, like on v2026.914.233613.

Additional Context

On my build of v2026.914.233613 (same extra commit), every connect I checked, 6 on Oct 13-14, applied 1920x1080 and reverted correctly; at least 4 of those were with the displays turned off by Windows. The first connect on a build with #5625, on Oct 15, broke both the mode change and the revert.

Host Operating System

Windows

Operating System Version

Windows 11 Pro 25H2 (10.0.26200)

Architecture

amd64/x86_64

Package

other (fork of this repo)

Sunshine commit or version

2026.1014.154843 (upstream master a178f465 plus one extra commit, see above). Last working: my build of 2026.914.233613 (commit 63d35f7, same extra commit)

GPU Type

NVIDIA

GPU Model

NVIDIA GeForce RTX 5080 (plus an AMD integrated GPU, not used for display)

GPU Driver/Mesa Version

617.42

Capture Method

Desktop Duplication API (Windows)

Apps

No response

Log output

The excerpts above are copied straight from the failing session's log. The full log got rotated away by later service restarts.

Online logs

No response

Lingua principale
C++
Stelle
42.2k
Fork
2.2k
Merge medio
1g 13h
PR unite (30g)
127

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di LizardByte/Sunshine

Tutte le issue di LizardByte/Sunshine

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.