|
| 1 | +--- |
| 2 | +author: Major Hayden |
| 3 | +date: '2025-12-18' |
| 4 | +summary: | |
| 5 | + After coming back from lunch multiple times to a blank locked screen in Hyprland, |
| 6 | + I found a workaround with a DPMS toggle. |
| 7 | +tags: |
| 8 | + - fedora |
| 9 | + - linux |
| 10 | + - hyprland |
| 11 | +title: Blank lock screen in Hyprland |
| 12 | +coverAlt: | |
| 13 | + A peaceful winter evening settles over a snow-covered European village, where warm Christmas lights glow softly against the blue tones of dusk. In the foreground, a historic church tower rises above the rooftops, crowned with snow and a golden weather vane, evoking a timeless holiday spirit. The surrounding hills and forests are blanketed in white, creating a serene alpine Christmas scene full of calm, warmth, and seasonal magic. |
| 14 | +coverCaption: | |
| 15 | + Photo by <a href="https://unsplash.com/@debrupas?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Pascal Debrunner</a> on <a href="https://unsplash.com/photos/snowy-town-with-church-steeple-at-dusk-3BmQiYQCQEw?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a> |
| 16 | +--- |
| 17 | + |
| 18 | +I moved over to Hyprland as my primary desktop environment several months ago after wrestling with some other Wayland desktop environments. |
| 19 | +It does plenty of things well and finally allowed me to do screen sharing during meetings without much hassle. |
| 20 | + |
| 21 | +A couple of small utilities, `hyperidle` and `hyprlock`, handle idle time and locking the screen when I step away from my desk. |
| 22 | +However, I kept coming back after lunch and found that both of my displays were often unresponsive with a blank screen after unlocking. |
| 23 | + |
| 24 | +# Diagnosing the issue |
| 25 | + |
| 26 | +I ran into this issue when I'd come back from lunch, hit the spacebar, and both monitors remained in power save mode. |
| 27 | +The power lights on both monitors were blinking, indicating that they were still in a low-power state. |
| 28 | + |
| 29 | +If I turned off each monitor and turned it back on, the displays would come back on about 80% of the time. |
| 30 | +Power cycling the displays was annoying and it became more annoying when I found that my workspaces had migrated between the monitors. |
| 31 | +Nothing was in the right place any longer! π |
| 32 | + |
| 33 | +I finally got in a situation where one monitor powered up and the other was still off! |
| 34 | +Time to run some diagnostic commands! |
| 35 | + |
| 36 | +# Digging in |
| 37 | + |
| 38 | +You can list the monitors in hyprland with `hyprctl monitors all`. |
| 39 | +Narrow that down by specifically looking for the DPMS (Display Power Management Signaling) status with this command: |
| 40 | + |
| 41 | +``` |
| 42 | +$ hyprctl monitors | grep -E "(Monitor|dpms|disabled)") |
| 43 | +
|
| 44 | +Monitor DP-1 (ID 0): |
| 45 | + dpmsStatus: 1 |
| 46 | + disabled: false |
| 47 | +Monitor DP-2 (ID 1): |
| 48 | + dpmsStatus: 1 |
| 49 | + disabled: false |
| 50 | +``` |
| 51 | + |
| 52 | +In my case, the DPMS status for both monitors was `1`, which means both monitors are on. |
| 53 | +Neither monitor is disabled. |
| 54 | +However, the monitor connected to `DP-1` was still blank! |
| 55 | + |
| 56 | +Even `ddcutil` said the same thing: |
| 57 | + |
| 58 | +``` |
| 59 | +$ ddcutil detect |
| 60 | +
|
| 61 | +Display 1 |
| 62 | + I2C bus: /dev/i2c-9 |
| 63 | + DRM_connector: card1-DP-1 |
| 64 | + EDID synopsis: |
| 65 | + Mfg id: DEL - Dell Inc. |
| 66 | + Model: DELL U2723QE |
| 67 | + Product code: 17016 (0x4278) |
| 68 | + Serial number: 85P0F34 |
| 69 | + Binary serial number: 1128482124 (0x4343454c) |
| 70 | + Manufacture year: 2024, Week: 38 |
| 71 | + VCP version: 2.1 |
| 72 | +
|
| 73 | +Display 2 |
| 74 | + I2C bus: /dev/i2c-10 |
| 75 | + DRM_connector: card1-DP-2 |
| 76 | + EDID synopsis: |
| 77 | + Mfg id: DEL - Dell Inc. |
| 78 | + Model: DELL U2723QE |
| 79 | + Product code: 17016 (0x4278) |
| 80 | + Serial number: 55P0F34 |
| 81 | + Binary serial number: 1128481356 (0x4343424c) |
| 82 | + Manufacture year: 2024, Week: 38 |
| 83 | + VCP version: 2.1 |
| 84 | +``` |
| 85 | + |
| 86 | +Then I wondered if I could just cycle the DPMS and bring them both back: |
| 87 | + |
| 88 | +``` |
| 89 | +$ hyprctl dispatch dpms off; sleep 1; hyprctl dispatch dpms on |
| 90 | +``` |
| 91 | + |
| 92 | +Both monitors turned on and displayed my desktop! |
| 93 | +But why? |
| 94 | + |
| 95 | +# Could it be amdgpu? |
| 96 | + |
| 97 | +Checking the system journal with `journalctl` revealed an interesting message: |
| 98 | + |
| 99 | +``` |
| 100 | +kernel: amdgpu 0000:03:00.0: [drm] REG_WAIT timeout 1us * 100 tries - dcn32_program_compbuf_size line:139 |
| 101 | +``` |
| 102 | + |
| 103 | +This suggests there's some kind of a drm timeout when the AMD GPU driver is trying to do something. |
| 104 | + |
| 105 | +The [Arch Linux wiki](https://wiki.archlinux.org/title/AMDGPU#System_freezes_or_reboots_when_idle) suggests that disabling AMD's low power state, GFXOFF, might help with similar issues. |
| 106 | +You can set a kernel parameter such as `amdgpu.ppfeaturemask=0xfffd7fff` to disable it. |
| 107 | +I've had bad luck in the past with these `amdgpu` parameters, so I wanted a workaround for now until I could test it more. |
| 108 | + |
| 109 | +# A (sorta) elegant workaround |
| 110 | + |
| 111 | +Hyprland has a key binding system that allows you to execute certain key combinations even when the screen is locked. |
| 112 | +I was already using some of these key bindings so that I could adjust my music even with the screen locked[^family]: |
| 113 | + |
| 114 | +``` |
| 115 | +> grep bindl ~/.config/hypr/hyprland.conf |
| 116 | +
|
| 117 | +bindl = , XF86AudioNext, exec, playerctl next |
| 118 | +bindl = , XF86AudioPause, exec, playerctl play-pause |
| 119 | +bindl = , XF86AudioPlay, exec, playerctl play-pause |
| 120 | +bindl = , XF86AudioPrev, exec, playerctl previous |
| 121 | +``` |
| 122 | + |
| 123 | +The normal key bindings in hyprland use `bind`, but `bindl` works even when the screen is locked. |
| 124 | +Here's what I added: |
| 125 | + |
| 126 | +``` |
| 127 | +> grep bindl ~/.config/hypr/hyprland.conf |
| 128 | +
|
| 129 | +bindl = , XF86AudioNext, exec, playerctl next |
| 130 | +bindl = , XF86AudioPause, exec, playerctl play-pause |
| 131 | +bindl = , XF86AudioPlay, exec, playerctl play-pause |
| 132 | +bindl = , XF86AudioPrev, exec, playerctl previous |
| 133 | +bindl = $mainMod SHIFT, D, exec, hyprctl dispatch dpms off && sleep 1 && hyprctl dispatch dpms on |
| 134 | +``` |
| 135 | + |
| 136 | +Now I can hold down `Mod + Shift + D` when I return to my desk after lunch and both monitors come back on instantly! |
| 137 | + |
| 138 | +I'll let you know if I get around to messing with `amdgpu.ppfeaturemask` to see if that resolves the underlying issue. π€ |
| 139 | + |
| 140 | +[^family]: This was a family request after I went for a run and left some slightly-too-aggressive music playing by accident. π
|
0 commit comments