#16356·rustdesk

[unattended-wayland] DRM display wake fires on every hourly --server restart, waking idle-off monitors with no session

Author: rishubilCreated Sep 26, 2026Updated Sep 28, 2026

Bug Description

With the rustdesk-unattended-wayland build (drm + drm-wake), the monitors are powered back on once an hour while the machine is idle and locked, even though no client ever connects.

Cause, as far as I can trace it in master (47a2a3c83d):

  1. src/platform/linux.rs: --service kills and restarts --server when last_restart.elapsed().as_secs() > 3600 ("restart server if new connections all closed, or every one hour").
  2. src/server/drm_capturer.rs: the new --server runs warm_availability(), which calls query_displays(). That opens a _drm connection only to read DrmDisplayList (log: drm: consumer cache warmed (3 displays) at startup).
  3. src/ipc/drm.rs: handle_drm_conn() spawns drm_capture_worker() for every accepted connection, and the worker calls drm_enumerate_settled("a consumer connected") before any DrmStart arrives.
  4. The compositor has idle-disabled the connectors, so drm_enumerate_settled finds undriven connectors. enable-drm-display-wake defaults to on, so drm_wake_displays() creates the RustDesk DRM display wake uinput device and wakes the outputs.

The display wake exists so that a real session can capture idle-off outputs (#15420). In this path it fires for a cache-warming probe instead. The other query_displays() callers (the availability refresh) go through the same handshake.

How to Reproduce

  1. Install the unattended-wayland build on a KDE Plasma Wayland session and start the service.
  2. Lock the screen and let the outputs idle off (DPMS).
  3. Don't connect any client. Wait for the hourly --server restart.
  4. The monitors turn back on. The kernel log shows the wake device being created at the same moment:
05:55:36 kernel: input: RustDesk UInput Keyboard as /devices/virtual/input/input110
05:55:36 kernel: input: mouce-library-fake-mouse as /devices/virtual/input/input111
05:55:36 kernel: input: RustDesk DRM display wake as /devices/virtual/input/input112

This repeats every hour. In my retained log it happened 37 hours in a row (2026-09-25 02:55 to 2026-09-26 14:56), each time at the --server restart, with no incoming connection in the server/cm logs during that period. Every wake was followed by DRM hotplug uevents on the GPU, and the lock screen came up on the woken outputs.

Expected Behavior

A display-list probe (cache warm-up or availability refresh) should not wake the displays. The wake should only run when a capture is actually requested for a session. Two possible ways: run the wake/settle step after DrmStart instead of at connection time, or let the consumer mark a connection as a probe so the producer skips the wake.

Setting enable-drm-display-wake=N is not a workaround, because then a real session against idle-off outputs has nothing to capture.

Operating system(s) on local (controlling) side and remote (controlled) side

N/A (no client connected) -> CachyOS (Arch-based), KDE Plasma 6.7.5 Wayland, kwin 6.7.5, NVIDIA 615.71.09, 3 monitors

RustDesk Version(s) on local (controlling) side and remote (controlled) side

N/A -> rustdesk-unattended-wayland 1.4.9 nightly (the official .deb repackaged for Arch). The 1.5.0 nightly .deb and master (47a2a3c83d) contain the same code path.

Screenshots

N/A. Nothing appears in the RustDesk UI, because no session is involved. The evidence is the kernel log above.

Additional Context

On KDE with NVIDIA, each wake causes a DRM hotplug burst. On this machine that repeatedly left plasmashell hung after long idle periods: its panels were gone after the next unlock. That hang is a Plasma bug in its own right, but the hourly wake raises the exposure to 24 hotplug cycles a day on an idle machine.