Windows: display mode not kept and revert fails when displays are powered off (regression from #5625)
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
- Ambito
- desktop, operating-systems
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
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di LizardByte/Sunshine
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
LizardByte/Sunshine#5795 ·
I maintainer di solito rispondono entro 1 giorno
-
PIN pairing fails with "Missing CSRF token" - web UI never fetches/attaches the tokenForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
LizardByte/Sunshine#5467 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 15/100
LizardByte/Sunshine#5940 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 44/100
LizardByte/Sunshine#5903 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 22/100
LizardByte/Sunshine#5894 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di LizardByte/Sunshine
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Mac mini M6 (16 GB): Q2_0 streaming works - measured 11.7->27.2 tok/s + arena fix for sub-32 GB MacsAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
champion good first issue remake source/qq
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
metasequoiaime/msime-windows#1025 ·
I maintainer di solito rispondono entro 1 giorno
-
backlog bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
EchoTools/nevr-runtime#653 ·
I maintainer di solito rispondono entro 1 giorno
-
`--fail-require-skip` never fires: run_tests.py searches stdout, but the unittest binary writes the skip summary to stderrForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno