omarchy icon indicating copy to clipboard operation
omarchy copied to clipboard

Lock screen blank loops indefinitely on displays that drop HDMI HPD in power save

Open blueedgesolutions-tom opened this issue 2 months ago • 16 comments

Summary

On a display that deasserts HDMI hotplug-detect when it enters power save, the lock screen's blank step puts the session into an infinite blank/wake loop. The monitor cycles on and off roughly every 6 seconds for as long as the session stays locked, with a full workspace migration on every cycle. GPU fans spool up and stay up.

Measured on one overnight lock: 4,190 cycles, and a 51 MB Hyprland log.

System details

Omarchy 4.0.0.r2014.gf99d33a-1
Hyprland 0.56.2
aquamarine 0.14.0-2
quickshell 0.3.1-1
Kernel 7.2.2-arch1-1
Mesa 26.2.2
CPU AMD Ryzen 7 5700
GPU AMD Radeon RX 7600 (Navi 33), amdgpu
Display MSI MP341CQ, [email protected], HDMI

Expected

Locking the session blanks the display, and it stays blank until there is user input.

Actual

The display blanks, wakes ~1 second later, blanks again 5 seconds after that, and repeats indefinitely.

Steps to reproduce

  1. Use a display that drops HDMI HPD when it enters power save (MSI MP341CQ here; this is common monitor firmware behaviour, not specific to this model).
  2. Lock the session, via idle timeout or omarchy system lock.
  3. Leave it locked and watch ~/.local/state/.../hyprland.log, or just listen to the fans.

Root cause

omarchy.lock arms a 5-second timer on lock and then blanks the display:

  • shell/plugins/lock/Service.qml:415 — idleBlankTimer, interval: 5000
  • shell/plugins/lock/Service.qml:410 — blankProcess runs omarchy-brightness-keyboard off; omarchy-brightness-display off
  • bin/omarchy-brightness-display:62 — off issues hyprctl dispatch 'hl.dsp.dpms({ action = "disable" })'

DPMS-off stops the TMDS clock. The monitor enters power save and deasserts HPD. From there:

  1. Kernel reports the connector disconnected.
  2. aquamarine tears the output down — drm: HDMI-A-2 is not connected, clearing stale crtc 376.
  3. Hyprland creates a headless FALLBACK monitor and migrates every workspace and window onto it, at 1920x1080.
  4. The link re-asserts, the connector reconnects, and the output is recreated — with DPMS back on, because the DPMS state lived on the output object that was just destroyed.
  5. Windows migrate back to 3440x1440, idleBlankTimer re-arms, and 5 seconds later we are back at step 1.

The loop is self-sustaining because nothing re-asserts the blank state onto the recreated output, and nothing records that the session is still locked and was deliberately blanked.

Evidence

From a single session's logs, all four counts agreeing:

Signal Count
drm: Connector HDMI-A-2 disconnected 4,190
drm: Connector HDMI-A-2 connected 4,191
quickshell.hyprland.ipc: Got removal for monitor "FALLBACK" 4,190
ERR drm: Cannot commit when a page-flip is awaiting 8,382

The page-flip errors are the compositor colliding with its own in-flight flips while churning through modesets.

Quickshell cannot build a lock surface during the gap:

DEBUG: Not creating lock surface for screen QScreen(...) as it is not backed by a valid wayland output.
INFO qt.qpa.wayland: There are no outputs - creating placeholder screen
WARN: Layershell screen does not correspond to a real screen. Letting the compositor pick.

That is worth a look on its own: for part of each cycle the session is locked with no lock surface.

The flapping windows line up exactly with the lock windows, which is what rules out a flaky cable:

Flapping Lock state
overnight → 07:05 unlocked at 07:05
07:50 → 07:59 locked 07:50:18, unlocked 07:59:20
08:36 → 09:34 locked 08:35:55, unlocked 09:34:22

Workaround

Force the connector to always report connected, so the output is never destroyed and the DPMS-off state survives:

# /etc/limine-entry-tool.d/hdmi-force-connected.conf
KERNEL_CMDLINE[default]+=" video=HDMI-A-2:e"

Applied here but not yet verified across a reboot at time of filing; I will update this issue once it has been through a full locked overnight. Even if it works, it is a per-machine, per-connector kernel change, and it costs the ability to detect a genuine unplug.

Suggested fixes

Omarchy side. Treat "blanked while locked" as session state rather than output state. On monitoradded while lockRequested is true, re-assert the blank instead of letting the fresh output come up lit. That alone would not stop the physical HPD flap, but it would stop Omarchy driving it, which is what makes it infinite.

A cheaper mitigation regardless of the above: back off idleBlankTimer if a blank has already been attempted several times during one lock, rather than re-arming at a fixed 5 seconds forever.

Hyprland side. DPMS state is lost when a connector is re-added, which looks like the underlying defect. Happy to file that separately upstream if you'd rather it live there — I have the full logs.

Attachments

Raw log excerpts, permanent: https://gist.github.com/blueedgesolutions-tom/944e1adbd2fd7332edd88eaba1a69115

  • 01-hyprland-one-cycle.log — one complete disconnect/reconnect cycle from the aquamarine log, from the udev hotplug through CRTC teardown, the 1920x1080 FALLBACK buffer allocation, and the modeset back to 3440x1440.
  • 02-quickshell-lock-start.log — the shell's own timeline for the start of one lock: secure=true at 08:35:55.6, first There are no outputs at 08:36:07.
  • 03-flap-histogram-per-minute.txt — cycles per minute across the whole boot, so the lock-window correlation can be checked directly.

Note on captures

No screen recording attached: the misbehaviour only occurs while the session is locked, and the session lock blocks screen capture. The log counts above are the substitute.

blueedgesolutions-tom avatar Sep 11 '26 14:09 blueedgesolutions-tom

Same loop here on Omarchy 4.0.3 with aquamarine 0.15.0, so the 0.14 → 0.15 bump did not fix it. Different monitor, and one consequence that I think raises the severity of this issue: the loop crashes GTK4 applications.

Confirmation on a second display

BenQ EL2870U over HDMI, 3840x2160@60, scale 1.5 — so this is not MSI-specific, as you suspected. The period here is ~14 s rather than ~6 s.

One session, 502 cycles, matching your signatures:

Signal Count
drm: HDMI-A-2 is not connected, clearing stale crtc 376 502
drm: Connector HDMI-A-2 disconnected 1004
drm: Cannot commit when a page-flip is awaiting 1006
qt.qpa.wayland: There are no outputs - creating placeholder screen 1004

The flapping lines up exactly with the lock windows, same as yours: five lock windows this boot, cycling starts and stops with each one, nothing in the gaps between them. No kernel [drm] events at all outside boot.

New: it crashes GTK4 apps

Nautilus 50.3.1 sat idle through one of these locks and took a SIGSEGV 56 minutes in, on one of the cycle ticks:

nautilus[744328]: segfault at 5585b8cce008 ip 00007f0744ec2c46 error 4
  in libgtk-4.so.1.2200.4[4c2c46,7f0744a89000+57c000]

The crashing thread is in GDK's Wayland backend, inside a listener callback dispatched from the event queue:

#0    libgtk-4.so.1 + 0x4c2c46
#1-3  libffi.so.8 ... ffi_call
#4-6  libwayland-client.so.0 ... wl_display_dispatch_queue_pending
#7-8  libgtk-4.so.1 + 0x4ba19b, + 0x4b6723
#9-11 libglib-2.0.so.0 ... g_main_context_iteration
#12   g_application_run

The faulting code is a teardown path running on an already-freed pointer:

mov  0x28(%rdi),%rbx     ; stashed pointer
movq $0x0,0x28(%rdi)     ; clear the field
test %rbx,%rbx / jz
mov  0x8(%rbx),%rdi      ; <-- SIGSEGV, rbx = 0x5585b8cce000
call *...                ; g_ptr_array_unref
call *...                ; g_free(rbx)

rbx points into memory already returned to the OS (SEGV_MAPERR; gdb reads neighbouring heap fine, but not this page). Arch ships no gtk4 debuginfo — debuginfod 404s that build-id — so I cannot name the function and will not guess it. What is certain is that it sits in the GDK Wayland backend and is reached from Wayland event dispatch, which is where output add/remove is handled.

I cannot prove the output churn is what produces the stale pointer. What I can say is that the crash landed on a cycle tick, in that code path, in a process that had been driven through roughly 236 of these cycles.

New: the cycles leak shm buffers

At crash time the process held 1,183 distinct deleted /dev/shm mappings, out of 2,308 mappings total — roughly 5 per output cycle, never reclaimed, in a 107 MB process that was otherwise completely idle (3.0 s CPU over 69 minutes).

So the cost of this loop is not only fan noise and log volume: every GTK4 app left open across a lock leaks steadily and is repeatedly driven through GDK's output teardown path.

System

Omarchy 4.0.3-1
Hyprland 0.56.2-2
aquamarine 0.15.0-2
quickshell 0.3.1-1
gtk4 1:4.22.4-1
nautilus 50.3.1-1
Mesa 1:26.2.2-1
Kernel 7.2.3-arch1-3
CPU AMD Ryzen 9 7900
GPU AMD Raphael iGPU (amdgpu) drives the display; RTX 5070 Ti present but drives none
Display BenQ EL2870U, 3840x2160@60, HDMI

Filed by Claude Opus 5 via Claude Code.

jerik avatar Sep 13 '26 15:09 jerik

I believe I fixed this issue. Do you want to try asking your agent to apply my PR https://github.com/omacom/omarchy/pull/13129 in your machine?

davidguilherme avatar Sep 24 '26 10:09 davidguilherme

I checked this report against the current quattro lock code and against #13129, the open pull request that says it fixes this issue. GitHub already links the two, so this issue closes if #13129 merges.

What I found on quattro (1ac31e55a): when a locked output is removed and comes back, the shell does not blank it again by itself. onScreensChanged in shell/plugins/lock/Service.qml only gives up the blank state. The new blank most likely starts from the fresh lock surface: its MouseArea in shell/plugins/lock/LockView.qml has hoverEnabled, and onPositionChanged raises wakeRequested. That runs runWake(), which re-arms the 5 s idleBlankTimer, the timer blanks again, and the output drops again. I have not reproduced this, so it is an explanation, not a confirmed mechanism. The loop needs a panel that drops HPD in power save, and a virtual worker display never does that.

#13129 works in the driver. It turns on amdgpu's HDMI HPD debounce (hdmi_hpd_debounce_delay_ms=1500) and rebuilds the initramfs on AMD machines, so a short HPD drop with the same EDID never removes the output. Both setups reported here use amdgpu over HDMI, so it reaches them. It does nothing for HDMI on other drivers, and nothing for the shell re-arming the blank when an output returns.

Related, but not the same report: #8580 (an output that comes back lit and stays lit), #8863 (a loop blamed on HDMI audio jack events counting as activity) and #10778 (a dual-monitor loop). #13129 also says it fixes those.

There was no second opinion on this: the configured reviewer (Codex Medium) answered a ping, but its daily review budget was used up before it could review this issue. So this is one model's reading. #13129 gets its own review and test run as a separate item.

Next: this waits on the maintainer's decision on #13129. @blueedgesolutions-tom, if your video=HDMI-A-2:e workaround has now held through a locked night, please say so here. A result from your machine with #13129's options amdgpu hdmi_hpd_debounce_delay_ms=1500 instead would also help, since none of our machines can show this loop.

omarchybot avatar Oct 11 '26 13:10 omarchybot

Still present on Omarchy 4.5.0-3, and on this machine the loop doesn't just cost power: it kills omarchy-shell after ~16.6 hours locked, through a file-descriptor leak in the shell. That leaves no lock UI and no bar until a reboot. It happened on two consecutive Saturday mornings (locked Friday afternoon, the shell died on Saturday morning).

System

Omarchy 4.5.0-3
quickshell 0.3.2.r7.g2b4501a-1
Hyprland 0.56.2-4
aquamarine 0.15.1-1
qt6-base / qt6-wayland 6.12.0
Kernel 7.2.15-1-omarchy
GPU Intel Alder Lake-N UHD (i915)
Displays 2× iiyama over HDMI. Only one flaps: GE2288HS (EDID PL2288H, 2016) on HDMI-A-2. The PL2445H on HDMI-A-1 goes into standby properly (orange LED).

The GE2288HS's OSD has no standby, deep-sleep or CEC options. Setting Input Select to fixed HDMI instead of Auto makes no difference.

The loop (Hyprland socket2 + hyprctl monitors -j, one cycle)

08:08:56.9  lock idleBlankTimer -> both outputs dpmsStatus=false
08:09:00.879 monitorremoved>>HDMI-A-2        (~4 s after DPMS off)
08:09:01.643 monitoraddedv2>>1,HDMI-A-2,iiyama Corporation PL2288H 0   (comes back dpmsStatus=true)
08:09:02.047 shell rebuilds all per-screen surfaces (every ShellIpc/IpcHandler re-registers)
08:09:07.5   blanked again -> repeat

Period ~11 s, steady: 14 cycles in a 2.5-minute lock. In the journal it ran all night, every night: ~5,400 cycles/day.

The new part: a 12-fd-per-cycle leak in omarchy-shell, released only at unlock

Count of /proc/$(pidof quickshell)/fd, sampled just before each monitorremoved:

177 → 189 → 201 → 213 → 225 → 237 → 249 → 261 → 273 → 285 → 297 → 309 → 321 → 333
unlock → 180

Exactly +12 per cycle. I took per-second readlink snapshots across 6 cycles and classified the growth:

/dev/shm/<uuid> (deleted)   +9 distinct files over 5 cycles, each held by 6 fds  (~+11 fds/cycle)
anon_inode:[eventfd]        32 -> 36                                              (~+0.8/cycle)
everything else (inotify, pipes, sockets, dri) flat

All of the /dev/shm fds, and most of the eventfds, are closed at unlock. My inference, not verified: these are Qt Wayland shm buffers for the per-screen WlSessionLockSurface on the output that went away. They stay referenced until the session lock itself is destroyed, so each remove/add cycle under one lock stacks another set.

With the shell's RLIMIT_NOFILE soft limit of 65536 and 12 fds every ~11 s, the shell runs out after about 16.6 h locked. Weeknight locks (~16.3 h) survive. Friday afternoon → Saturday morning (16.7 h) doesn't. The journal on both Saturdays:

07:55:51 omarchy-shell: QProcess: Cannot create pipe (Too many open files)
07:56:02 omarchy-shell: The Wayland connection experienced a fatal error: Too many open files

No coredump (consistent with the _exit() path noted in #7150), and omarchy-launch-shell did not relaunch it. The session stayed locked behind Hyprland's fallback until a reboot on Monday.

Suggestions

  1. Break the loop in the lock plugin, for any monitor. A monitorremoved → monitoradded for the same output while the lock has blanked is the faulty-standby signature. Disabling that output (hl.monitor({ output = ..., disabled = true })) until unlock, instead of re-blanking it, stops the loop. The monitor then goes into real standby, because a disabled output stays disabled across the hotplug. I verified this with a small user service doing exactly that: the GE2288HS flaps ~3 times in the first ~13 s after being disabled, then stays off with an orange LED. There are no more shell rebuilds, the fd count stays flat, and it restores the captured mode/position/scale at unlock. (This is the generic form of the workaround in #8863. No list of bad monitors is needed.)
  2. Free lock-surface resources when an output is removed during a lock. Even without this monitor, any repeated output churn under one long lock drains the same fds.
  3. Relaunch the shell when it leaves via the Wayland-fatal _exit() path. That turns a lost weekend into a few seconds without a bar.

The workaround service is available if it's useful as a reference.

Filed by Claude Opus 5.5 via Claude Code.

Samji avatar Nov 16 '26 08:11 Samji

@Samji, the Intel report extends this beyond #13129: that pull request configures amdgpu and does not cover i915.

There is also a direct re-arm path now: at quattro commit 419a5a7095d118a218d5f84548dbd83ce90067e6, shell/plugins/lock/Service.qml:827–832 restarts the five-second blank timer when the screen count increases while locked. It does not need a pointer event. #15342 filters synthetic pointer wakes but leaves this path in place.

I checked that commit on a disposable Omarchy worker, retaining one virtual display and adding/removing a second: six unlocked control cycles and eight locked cycles. The same shell process stayed at 144 file descriptors throughout the locked cycles, with no /dev/shm descriptors. This did not reproduce the leak. The worker has Hyprland 0.57.2 and a virtio display, so it cannot establish what happens on your Hyprland 0.56.2/i915/HDMI setup. Quickshell's upstream 2b4501a source already schedules removed lock surfaces for deletion; the retained descriptors still need to be traced before attributing them to missing surface cleanup.

The launcher already supervises nonzero shell exits in both v4.5.0 and current quattro. Its nine focused regression checks passed on the worker, including the exit-255 case; those checks do not reproduce file-descriptor exhaustion. The journal is needed to establish why recovery failed on your machine.

Please share your workaround service, omarchy-debug --no-sudo --print, and the journalctl -b -t omarchy-shell excerpt spanning a recorded fatal exit and the following minute, including any “relaunching” or “Giving up” lines and whether omarchy-launch-shell was still running after the death. One short check would help localize the leak: after several flaps, count the shell’s fds, wake the displays with mouse motion without unlocking and count again while they are still lit, then unlock and count once more. Please also note whether HDMI-A-1 lights during a flap. That separates release on rendering from release on unlock and distinguishes output return from a wake of both displays.

Codex High checked the source and ran the worker diagnostics. Opus 5.5 High and muse-wonder (via pi, thinking high) reviewed the same evidence and agreed that no contained fix is established; their agreement is not guaranteed to be independent. Opus added the wake-without-unlock check above.

The generic HDMI loop mitigation still needs a maintainer decision; the short checks above would help trace the separate leak and failed recovery.

omarchybot avatar Nov 18 '26 03:11 omarchybot

Thanks. I ran the wake-without-unlock check this morning with the workaround service stopped. It moves the leak away from the session lock and towards blanked outputs.

Versions are unchanged from my first comment (Omarchy 4.5.0-3, quickshell 0.3.2.r7.g2b4501a-1, Hyprland 0.56.2-4, aquamarine 0.15.1-1, qt6-base 6.12.0-3, qt6-wayland 6.12.0-1, kernel 7.2.15, i915). There is no omarchy-debug in 4.5.0-3 (Unknown Omarchy command: omarchy debug --no-sudo --print), so these come from pacman -Q.

Wake without unlock

I sampled once a second: total fds, fds pointing at /dev/shm, eventfd count, omarchy-shell lock status, and dpmsStatus from hyprctl monitors -j. I also logged socket2 monitor* events. Condensed:

time      fds  shm  eventfd  locked  A1 dpms  A2      event
08:32:15  207    0    35     true    on       on      locked
08:32:21  199    0    35     true    off      off     idle blank
08:32:25  214   13    35     true    off      absent  monitorremoved HDMI-A-2
08:32:27  181    7    30      -      off      on      monitoradded (shell IPC busy: rebuild)
08:32:36  182   14    33     true    off      absent  removed
08:32:38  235   21    33     true    off      on      added
08:32:47  196   28    33     true    off      absent  removed
08:32:49  219   35    33      -      off      on      added
08:32:59  210   42    33     true    off      on      removed/added
08:33:10  244   63    33      -      off      on      removed/added
08:33:20  238   70    33     true    off      on      removed/added
08:33:31  252   84    33     true    off      on      removed/added
08:33:43  281  105    33      -      off      on      removed/added
08:33:47  207    0    39     true    on       on      mouse motion: both lit, STILL LOCKED
08:33:56  203    0    39     true    off      off     re-blanked (no flap before next wake)
08:34:19  202    0    31     false   on       on      unlocked
08:34:20  193    0    29     false   on       on

(- = lock status IPC timed out during the surface rebuild.)

8 flaps between 08:32:25 and 08:33:42, at the same ~11 s period as before.

  • All 105 /dev/shm fds were released at the wake, about 1 s after mouse motion, while the session was still locked and secure. Unlocking 30 s later released nothing further. So my earlier reading ("released only at unlock" / "held until the session lock is destroyed") was wrong. Before, the first time the displays lit up again was always at unlock, which is why the two looked the same.
  • /dev/shm fds grew by about +14 per remove/add cycle (+7 at removal, +7 at re-add). Total fds grew by about +14 per cycle at the same phase (214 → 242 → 266 → 280 → 294).
  • eventfd did not grow this time: it oscillated between 33 and 39 and was back to 29 after unlock. My earlier +0.8/cycle figure was probably noise from sampling at different points in the rebuild.
  • HDMI-A-1 does not light during a flap. It stayed in standby until the mouse moved, and dpmsStatus was false throughout. Only HDMI-A-2 came back, visibly going black and then showing the lock screen each cycle. So each flap is the output returning, not a wake of both displays. After the first wake the displays re-blanked once (08:33:56). I kept the mouse moving from 08:33:58 until the unlock, and there were no monitorremoved events once they were lit.

My inference (not verified): the shell creates new lock surfaces and buffers for the re-added output on every flap, but buffers attached while the outputs are DPMS-off are never released. When an output is presented again, everything is released at once. That fits Quickshell already deleting removed surfaces, and it might explain why the worker didn't reproduce it: if its locked cycles ran with the displays awake, buffers would be released as normal. A reproduction would need the remove/add while dpms off is in effect.

Recovery after the fatal exit

Neither death has a relaunching or Giving up line. The full journal, all units, in the minute after each fatal exit, with hostname removed and unrelated firewall lines omitted:

2026-11-14T07:55:51 omarchy-shell[889]:   WARN : QProcess: Cannot create pipe (Too many open files)
2026-11-14T07:56:02 omarchy-shell[889]:   WARN : QProcess: Cannot create pipe (Too many open files)
2026-11-14T07:56:02 omarchy-shell[889]:   WARN: The Wayland connection experienced a fatal error: Too many open files
2026-11-14T07:56:02 org.remmina.Remmina[983]: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
(no further omarchy-shell lines in this boot; rebooted 2026-11-16 07:55)

2026-11-07T07:48:21 omarchy-shell[1262042]:   WARN : QProcess: Cannot create pipe (Too many open files)
2026-11-07T07:48:23 omarchy-shell[1262042]:   WARN: The Wayland connection experienced a fatal error: Too many open files
2026-11-07T07:48:23 org.remmina.Remmina[990]: gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed
(no further omarchy-shell lines in this boot; rebooted 2026-11-09 07:56)

The 14 Nov shell (pid 889) was started at boot on 2026-11-09 by the 4.5.0-3 launcher (upgraded 2026-11-05), so the supervising loop should have been running. I didn't check at the time whether omarchy-launch-shell was still alive after the death, and the machine has since rebooted, so I can't say. Today it is running as the shell's parent (omarchy-launch-shell 908 → quickshell 918).

The launcher has two ways to exit without logging: status == 0, and compositor_alive failing three hyprctl -j monitors calls 0.5 s apart. In both cases the death happened during a HDMI-A-2 remove/add, so a busy compositor at that moment is plausible. That is a guess with no evidence either way. A logger line on those two exits would settle it next time.

Workaround service

~/.local/bin/lock-output-guard:

script
#!/bin/bash
# Turns listed monitors fully off while the session is locked, and back on at
# unlock with exactly the settings they had just before.
#
# Why: on DPMS-off some monitors (here the iiyama GE2288HS, EDID "PL2288H")
# drop their HDMI hotplug signal instead of going into standby. Hyprland
# re-adds them switched on and the lock re-blanks them - an ~11s loop that
# leaks 12 fds per cycle in omarchy-shell until it dies after ~16.6h locked.
# A disabled output stays disabled across the hotplug, and the monitor then
# goes into proper standby. See omacom/omarchy#11330 / #8863.
#
# Monitors are matched by identity (Hyprland "description"), so the port they
# are plugged into and their position in the layout don't matter.

MONITORS=(
  "iiyama Corporation PL2288H 0"
)

STATE_DIR="${XDG_RUNTIME_DIR:-/tmp}/lock-output-guard"
mkdir -p "$STATE_DIR"

state_file() { printf '%s/%s.lua' "$STATE_DIR" "$(printf '%s' "$1" | tr -c 'A-Za-z0-9' '_')"; }

# Build a restore rule from the monitor's live settings.
capture_rule() {
  hyprctl monitors -j | jq -r --arg d "$1" '
    .[] | select(.description == $d) |
    "hl.monitor({ output = \"desc:\(.description)\", mode = \"\(.width)x\(.height)@\(.refreshRate)\", position = \"\(.x)x\(.y)\", scale = \(.scale), transform = \(.transform), disabled = false })"'
}

disable_monitors() {
  local desc rule file
  for desc in "${MONITORS[@]}"; do
    file=$(state_file "$desc")
    [[ -e $file ]] && continue            # already disabled by us
    rule=$(capture_rule "$desc")
    [[ -n $rule ]] || continue            # not connected / already off
    printf '%s\n' "$rule" >"$file"
    if hyprctl eval "hl.monitor({ output = \"desc:$desc\", disabled = true })" >/dev/null; then
      echo "locked: disabled $desc"
    else
      rm -f "$file"
    fi
  done
}

enable_monitors() {
  local file
  # Only restore what this script disabled - never override a disable made elsewhere.
  for file in "$STATE_DIR"/*.lua; do
    [[ -e $file ]] || continue
    if hyprctl eval "$(cat "$file")" >/dev/null; then
      echo "unlocked: restored $(cat "$file")"
      rm -f "$file"
    fi
  done
}

is_locked() { [[ $(omarchy-shell lock isLocked 2>/dev/null) == true ]]; }
is_secure() { omarchy-shell lock status 2>/dev/null | jq -e '.secure == true' >/dev/null; }

trap 'enable_monitors; exit 0' TERM INT

# Recover from a previous run that died while a monitor was off.
is_locked || enable_monitors

while :; do
  if is_locked; then
    # Wait for the lock to be fully up before touching outputs.
    is_secure && disable_monitors
  else
    enable_monitors
  fi
  sleep 2 &
  wait $!
done

~/.config/systemd/user/lock-output-guard.service:

[Unit]
Description=Disable the GE2288HS output while locked (stops DPMS hotplug loop)
PartOf=graphical-session.target
After=graphical-session.target

[Service]
ExecStart=%h/.local/bin/lock-output-guard
Restart=on-failure
RestartSec=5

[Install]
WantedBy=graphical-session.target

Filed by Claude Opus 5.5 via Claude Code.

Samji avatar Nov 18 '26 08:11 Samji

@Samji, the wake-without-unlock measurement rules out session-lock destruction as a requirement for releasing those descriptors: all 105 /dev/shm fds cleared while the lock remained secure. This run also does not show continuing eventfd growth. HDMI-A-1 remaining DPMS-off supports the returned-output path rather than a wake of both displays; current lock code still re-arms its blank timer on output arrival.

I repeated the worker diagnostic at quattro commit 01a902913d36cbd69acaaf3ca26d7a3bd564569d, this time checking DPMS at every checkpoint. Through eight locked add/remove cycles, the original virtual output stayed DPMS-off and the added headless output blanked after arrival. The same shell returned to 144 fds after every removal, with no /dev/shm fds at the sampled checkpoints; waking kept the session locked and secure, and authentication then unlocked it. This does not reproduce your i915/HDMI leak: the worker has virtio/headless outputs, Hyprland 0.57.2, and different package revisions.

The failure-time journals show no relaunch message, but without the launcher process state they cannot identify which exit path was taken. No contained fix is established for either the retained buffers or the failed recovery. The workaround service and package versions are now recorded; there is no need to repeat the unavailable debug command or run another overnight test for this review.

Codex High checked the source and ran the worker diagnostic; Opus 5.5 High and muse-wonder via pi, thinking high reviewed the evidence through omabot review. Both found no established, contained fix and recommended leaving this with the maintainer. Their agreement is not proof of independence. Opus added a useful limit: waking changes DPMS, output configuration and rendering together, so this capture cannot distinguish which releases the buffers. The retained-buffer owner and the failed recovery remain unresolved; #13129 still cannot cover the Intel case.

omarchybot avatar Nov 18 '26 09:11 omarchybot

Another case, on a driver that #13129 can't reach: Apple Silicon (apple-drm). Here the loop's worst effect isn't power or log volume. It eventually leaves the external monitor dead until it is replugged.

System

Omarchy 4.5.0-3
Hyprland 0.56.2-7
Kernel linux-aurora 7.2.11.aurora14-1
Machine MacBook Pro 16" M1 Pro (apple,j316s / t6000)
Display Acer ED343CUR, 3440x1440@60, built-in HDMI (HDMI-A-1), no adapter

The loop

The same signature as above. About 18 s after the lock blanks the outputs, the Acer drops HPD and reasserts it 0.6 s later. Hyprland re-adds HDMI-A-1, onScreensChanged (shell/plugins/lock/Service.qml:827–831 in 4.5.0) re-arms the 5 s idleBlankTimer, the outputs blank again, and the cycle repeats every ~26 s. That came to 1418 HPD drops in one boot, steady at about 141 an hour all night.

New: it can strand the output

On Apple Silicon each HPD bounce makes the DCP firmware re-establish the HDMI link. It did that ~1400 times, then once it didn't: after the last reassert the kernel saw HPD high but never got the link back. The connector stays disconnected with an empty EDID, the monitor stays in standby (red LED) after unlock, and only a replug recovers it. That driver bug is filed on the kernel side as omacom/linux-aurora#217. It happened once in ~1400 bounces, but at 140 bounces an hour that is roughly once per night-long lock.

Suggestion

A known output coming back while the lock is blanked shouldn't count as a new screen. Simply skipping armBlankTimer() there isn't enough, because Hyprland re-adds the output with DPMS on and it would then stay lit. Blanking it again is what keeps the loop going. The fix that stops the hotplugs is @Samji's suggestion 1 above. When an output the lock already knew (same name or description) returns while blanked, disable it until unlock instead of re-blanking it. Doing this in the shell would cover every driver, which a per-driver HPD debounce like #13129 can't.

stamdrovas avatar Nov 20 '26 10:11 stamdrovas

@stamdrovas, the new Apple Silicon report extends the affected hardware beyond AMD and Intel. At current quattro commit b20d7876f, the screen-count increase in shell/plugins/lock/Service.qml:827–832 still restarts the five-second blank timer while locked; omarchy-brightness-display off still uses DPMS. This path does not require pointer motion. #13129 changes amdgpu configuration and an AMD-gated initramfs migration, so it cannot address this apple-drm case.

I also read your t6000 logs in linux-aurora#217. They record the last HPD reassertion without subsequent external-DCP link recovery. They do not establish whether a connect was omitted or attempted and failed, or prove a race with the internal panel. The stuck output is an additional reported consequence; a kernel root cause and a generic shell fix remain unverified.

This follow-up reviewed source and the supplied logs; no new worker test or physical Apple-DCP reproduction ran. Codex High checked the source and logs; Opus 5.5 High and muse-wonder via pi, thinking high reviewed the evidence through omabot review. Both agreed that no contained fix is established; their agreement is not proof of independence. Opus highlighted existing clamshell and configuration-reload paths that an output-disable approach would need to handle, which I checked in the source.

The issue remains open for maintainer review of the generic mitigation. No further overnight run is needed for that decision.

omarchybot avatar Nov 20 '26 10:11 omarchybot

Reporting a fourth driver family, and an ablation that I think changes one of the assumptions in this thread.

Setup — Omarchy 4.0.0.alpha, Hyprland 0.57.0, aquamarine 0.16.0, quickshell 0.3.2 (Debian 0.3.2-1, empty revision string), BPI M7 (RK3588, aarch64), single output HDMI-A-1 at 2560x1440@144, KTC H32S17 over HDMI. Same loop, 14–19 s period, same signature: placeholder screen → Got removal for monitor "FALLBACK" → Connector HDMI-A-1 disconnected → connected → CRTC reassignment. Counting one boot: the cycle starts with the lock's blank and stops when the session unlocks, as reported above.

The ablation. Two runs, identical binaries on disk, differing only in shell/plugins/lock/LockView.qml, sampled with hyprctl -j monitors every 250 ms, plus the lock journal for hotplug lines:

LockView.qml Result
stock (hoverEnabled: true, onPositionChanged: root.wakeRequested()) loop, false 08:56:42.4 → true 08:57:00.6 → false 08:57:15.4
hoverEnabled: false, onPositionChanged removed 120/120 samples dpmsStatus=false over 32 s, and zero hotplug / placeholder / FALLBACK lines in the same window

onScreensChanged is untouched in both, with if (root.lockRequested) root.armBlankTimer() intact and firing — the screen count does change in the looping run, and the output is destroyed and rebuilt every cycle.

What that suggests on this hardware: the re-arm path re-blanks, it does not relight. The relight comes from the pointer event delivered to the remapped lock surface, and on this panel the HPD drop happens once per blank transition — so one relight manufactures the next drop. Remove the pointer wake and the loop terminates after the cycle already in flight instead of repeating. That narrows "this path does not require pointer motion": true of the re-arm itself, but the motion is what keeps the cycle alive here.

A correction to my own earlier report. In #20518 I argued from the absence of omarchy-system-wake in the journal. That argument was invalid: the script logs nothing. I ran it by hand and it produced no journal output at all, only No keyboard backlight device found on stderr. Absence of that string in a journal says nothing about whether runWake() ran. Please don't use it as evidence, and I've marked it wrong where I published it.

Caveat, because it matters for what you conclude. The stable run also had a patched compositor and a patched Service.qml, so this does not show that filtering the synthetic hover is sufficient on its own. What it isolates is the opposite direction: with those two in place, stock LockView.qml still loops and the filtered one does not. It also does not test #15342 — my guard is cruder (hover disabled entirely, so mouse-move wake is lost) and I have not run the PR itself.

Happy to paste the full sample series and journal windows. Measurements and write-up with an AI assistant, on my hardware; the compositor binaries compared are a stock 0.57.0 I rebuilt from Debian source and a locally patched one, not quattro packages.

monotonytony avatar Nov 28 '26 08:11 monotonytony

@monotonytony, the 32-second run with hover disabled gives us a lead on RK3588. Current quattro re-arms the blank timer when the screen count rises during lock, and the lock view can separately request a wake from a pointer-position event. Hyprland can also light a recreated output during reconnect. The stable run used local Hyprland and Service.qml patches, so the order of the disconnect and DPMS-on matters for interpreting the result. Lock service · Hyprland connect path

Please share the paired DPMS samples and hotplug logs you offered, and confirm whether both runs used the same Hyprland and Service.qml patches. If the loop also reproduces on a compatible quattro test setup with stock Hyprland, compare it with the same checkout plus #15342 at c2064cb91d55d87b2f575ad4157de7bf43e888f9. In a dedicated checkout, fetch refs/pull/15342/head, merge that commit into quattro, then use omarchy dev link <checkout> and reboot. Three minutes per run covers several of the reported cycles. Please also check that moving the mouse still wakes the display. Pointer-wake PR

GPT-6 High in Codex checked the source and the earlier virtual hotplug results. Opus 5.5 High and muse-wonder via pi, thinking high reviewed the same evidence and agreed that #15342 still needs a test on this hardware. Their independence is unverified. This follow-up is waiting on the Rockchip traces.

omarchybot avatar Nov 28 '26 08:11 omarchybot

Two items: the patch-state confirmation and the logs you asked for, then the #15342 result.

Patch state of the pair. Both runs used the same binaries on disk, md5 checked before and after each one:

  • /usr/bin/Hyprland 85236b4d156cf725107a527f8dee3cc6 (0.57.0, locally patched)
  • Service.qml 18512efcde449781e3536e17a022f144 (patched, the displayBlanked guard)
  • only LockView.qml differs: 6b4dcf0e57fdf58ff682b80bfd5fba98 stock vs 9d330f22dd7f97913fbf410cc5bb6c1a (hoverEnabled: false, onPositionChanged removed)

So yes — same compositor, same lock service, one file changed.

Paired DPMS series, hyprctl -j monitors every 250 ms with the session locked, same panel and cable:

Stock LockView, 45 s:

10:11:29.285 lock requested
10:11:33.481 true -> false
10:11:51.869 false -> true   +18.4 s
10:12:06.654 true -> false   +14.8 s

Filtered LockView, 60 s:

10:12:45.474 lock requested
10:12:50.322 true -> false
10:13:45.142 last sample, false   (168/168 samples false over 55 s)

A second stock-LockView run at 10:19 reproduced the first: false at 10:19:36.430, true at 10:19:40.309, false again at 10:19:41.431.

Hotplug in the same windows. The connector drops and reconnects in both configurations. What differs is the relight.

Filtered LockView:

10:13:05.566 drm: Disabling output HDMI-A-1
10:13:05.574 Connector HDMI-A-1 enabledState changed true -> false
10:13:05.774 drm: Got a hotplug event for /dev/dri/card1
10:13:05.874 drm: Connector HDMI-A-1 disconnected
10:13:05.980 drm: Got a hotplug event for /dev/dri/card1
10:13:06.026 drm: Connector HDMI-A-1 connected

No enabledState changed false -> true, no relight, dpmsStatus stays false.

Stock LockView:

10:19:40.319 drm: Disabling output HDMI-A-1
10:19:40.320 drm: Connector HDMI-A-1 enabledState changed true -> false
10:19:40.353 drm: Connector HDMI-A-1 enabledState changed false -> true
10:19:40.396 drm: Got a hotplug event for /dev/dri/card1
10:19:40.413 drm: Connector HDMI-A-1 disconnected
10:19:41.018 drm: Got a hotplug event for /dev/dri/card1
10:19:41.098 drm: Connector HDMI-A-1 connected

The false -> true at 40.353, before the reconnect is even processed, is the relight; dpmsStatus reads true 1.1 s later.

#15342. I did not replace the running shell with a quattro checkout. This box runs the Armabian-packaged 4.0.0.alpha shell, and omarchy dev link means rebooting my desktop into a checkout I cannot fully validate on aarch64 — I would rather not hand you a number that mixes a new tree with a new test. Instead I applied the PR's two hunks verbatim to this build's LockView.qml: the MouseArea block is byte-identical in both files (md5 330c99d6 over those lines), so the hunks land on their exact context. Everything else in this LockView differs from quattro's base (no displaysBlank / powerSaverActive), so treat it as a port, not the PR in situ.

Stock Hyprland rebuilt from Debian source (5b65dd40), stock Service.qml (5fdbc3cd), PR LockView, 90 s:

10:15:29.019 lock requested
10:15:34.233 true -> false
10:15:37.629 false -> true   +3.4 s
10:15:52.942 true -> false   +15.3 s
10:16:08.067 false -> true   +15.1 s
10:16:19.368 true -> false
10:16:34.486 false -> true   +15.1 s
10:16:41.477 true -> false
10:16:56.591 false -> true   +15.1 s

#15342 alone does not hold on this panel. In the same window the compositor logs enabledState changed false -> true at 10:16:07.021, 35 ms after Disabling output at 10:16:06.986, and the panel is back a second later. Filtering the pointer event removes one way to wake the display; it does not stop Hyprland from enabling an output it has just re-created. That matches your #11330 reading, and on this hardware the two changes are independent: #15342 covers the spurious pointer wake, the compositor still must not commit a DPMS-on modeset for an output created while the session is blanked.

Three caveats:

  • Mouse wake: not tested. There is no synthetic motion source here — hyprctl's movecursor is a warp and ydotool is not installed — and a warp is not motion, which is exactly the distinction the PR draws. I am not claiming it either way.
  • quickshell died once during that run on output loss: wl_display#1: error 0: invalid object 151 then The Wayland connection experienced a fatal error. systemd restarted it and the loop kept its period across the restart. No QML error was logged, so I do not attribute it to the diff, but it is a third thing this setup does when the output vanishes.
  • Same as before: measurements and analysis with an AI assistant, on my hardware.

If you want the in-situ quattro number, say which base you want — stock Hyprland or with the compositor guard — because on this panel that is the variable that decides the outcome.

monotonytony avatar Nov 28 '26 09:11 monotonytony

@monotonytony, both runs on the patched base logged an HDMI disconnect and reconnect. The filtered view stayed DPMS-off through the recorded window, and the port of #15342 still cycled with stock Hyprland 0.57.0 and your stock lock service. In the 10:19 trace, the DRM re-enable precedes the recorded disconnect, which leaves the exact wake caller unresolved.

I traced a compositor path for relighting. Hyprland’s monitor-state refactor dropped the DPMS-off check for returning outputs. On an unlocked Omarchy ISO worker with Hyprland 0.57.2-9, recreating a virtual output after global blanking brought it back DPMS-on while the original output stayed off. The Rockchip HDMI loop on current quattro remains unverified. Hyprland #15139 proposes deferring the enable and currently has conflicts with upstream main. Hyprland refactor · Upstream PR

GPT-6.2 Sol High in Codex checked the traces, source and worker result. Opus 5.5 High and muse-wonder via pi, thinking high reviewed the traces and agreed they leave the wake caller unresolved. Opus 5.5 High also checked the refactor and agreed the reconnect check was dropped. Reviewer independence is unverified. This is waiting on maintainer follow-up for the compositor path. A hardware comparison specifically for #15342 would use your same patched compositor and lock service in both runs, changing only the view.

omarchybot avatar Nov 28 '26 09:11 omarchybot

Second hardware platform, plus the lock-view ablation requested in #15342.

Platform: Raspberry Pi CM5 (BCM2711 / vc4), kernel 7.3.6-edge-bcm2711, aarch64. Omarchy 4.0.0.alpha, Hyprland 0.57.0 (Debian 0.57.0+ds-1, locally patched, 85236b4d156cf725107a527f8dee3cc6), aquamarine 0.16.0, quickshell 0.3.2 (Debian 0.3.2-1). Panel: KTC H32S17, 2560x1440@144 on HDMI-A-1. That is a fourth driver family after AMD, Intel and apple-drm.

1. HPD cycling with no session lock at all

Session unlocked, DPMS disabled with hl.dsp.dpms({ action = "disable" }), connector status and DPMS read from sysfs every 250 ms:

+0.26 s   dpms On -> Off
+13.73 s  connector HDMI-A-1 connected -> disconnected
+14.54 s  connector disconnected -> connected
+28.25 s  disconnected
+28.80 s  connected
          dpms stays Off for the whole 120 s

Reproduced twice with the same timings. The panel drops and reasserts HPD about 14 s after the signal stops, with no lock, no lock surface and no blank timer involved. With the compositor patch in place, nothing re-enables DPMS across either cycle.

2. Lock-view ablation

Same binaries on disk in both runs, same patched Service.qml, same patched compositor. Only LockView.qml differs. Session locked with omarchy-shell lock lock, DPMS and connector sampled every 250 ms for 60 s.

Stock LockView.qml:

+5.90 s   dpms On -> Off        (lock blank)
+19.62 s  connector disconnected
+20.15 s  connected
+22.32 s  dpms Off -> On        relight, 2.2 s after the output returned
+37.50 s  dpms On -> Off        loop restarts

Filtered LockView.qml (hoverEnabled: false, onPositionChanged removed):

+5.13 s   dpms On -> Off
+18.84 s  disconnected
+19.37 s  connected
+33.31 s  disconnected
+33.95 s  connected
          no relight for the whole 60 s run

Checksums: LockView.qml stock 6b4dcf0e57fdf58ff682b80bfd5fba98, filtered 9d330f22dd7f97913fbf410cc5bb6c1a; Service.qml patched 18512efcde449781e3536e17a022f144 (blank re-arm guarded on displayBlanked).

So on this hardware the view is an independent trigger: with the compositor and the lock service already fixed, the stock view still relights the panel 2.2 s after the connector returns, and the filtered one does not.

3. Side effect seen while cycling

The shell logged Not creating lock surface for screen ... as it is not backed by a valid wayland output, then repeated attempted to use dangling screen object and Got removal for monitor "FALLBACK" which was not previously tracked, and stopped answering IPC until it was restarted. Consistent with the after-effects reported for a locked night on this display.

Disclosure: written with AI assistance from measurements I ran and reviewed myself; the traces above are raw sampler output.

monotonytony avatar Nov 28 '26 16:11 monotonytony

Correction to the trace in my comment above, since I published it while the sampler was still running: it cut off at +37.50 s. Here is the complete 60 s run with the stock LockView.qml — the loop repeats, period about 31 s.

+5.904 s   dpms On -> Off        (lock blank)
+19.621 s  connector disconnected
+20.154 s  connected
+22.316 s  dpms Off -> On        relight 1
+37.504 s  dpms On -> Off        re-blank
+51.215 s  connector disconnected
+51.756 s  connected
+53.635 s  dpms Off -> On        relight 2

Same session, same binaries, 60 s of sampling. The filtered LockView.qml run stayed DPMS-off for its full 60 s with two HPD cycles in between (+18.8/+19.4 s and +33.3/+33.9 s) and no relight, so the difference is not a matter of one lucky window.

Disclosure: written with AI assistance, from sampler output I reviewed.

monotonytony avatar Nov 28 '26 16:11 monotonytony

@monotonytony, on the CM5 the stock lock view relit the display twice in 60 seconds. With hover disabled, DPMS stayed off through two reconnects. The unlocked run also shows that HDMI can disconnect and reconnect while the display is off. On current quattro, the lock view can request a wake on any position event. The traces leave the input event that triggered each relight unresolved.

Could you repeat the CM5 test with your same patched Hyprland and Service.qml, applying only the LockView.qml hunks from #15342 at c2064cb91d55d87b2f575ad4157de7bf43e888f9 to the stock view? Leave the mouse still for at least 60 seconds and two reconnects, then move it to see whether the display wakes while the session stays locked. If you can log wakeRequested() alongside DPMS, that will tell us whether the wake came through the lock view. This is waiting on that CM5 comparison.

GPT-6 High in Codex traced the wake path on current quattro. Opus 5.5 High and muse-wonder via pi, thinking high reviewed the traces and agreed the view comparison isolates a relight on the patched setup and leaves the candidate untested there. Reviewer independence is unverified.

omarchybot avatar Nov 28 '26 16:11 omarchybot