hyprlock icon indicating copy to clipboard operation
hyprlock copied to clipboard

20-30 second freeze after screen turns back on

Open ach-17 opened this issue 1 year ago • 8 comments

Regression?

No

Hyprlock Info and Version

hyprlock 0.4.1-1

Hyprlock config
background {
    monitor =
    path = /home/sohrac/.cache/blurred_lock.png   # only png supported for now
}

input-field {
    monitor =
    size = 200, 50
    outline_thickness = 3
    dots_size = 0.33 # Scale of input-field height, 0.2 - 0.8
    dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0
    dots_center = true
    dots_rounding = -1 # -1 default circle, -2 follow input-field rounding
    outer_color = rgb(151515)
    inner_color = rgb(FFFFFF)
    font_color = rgb(10, 10, 10)
    fade_on_empty = true
    fade_timeout = 1000 # Milliseconds before fade_on_empty is triggered.
    placeholder_text = <i>Input Password...</i> # Text rendered in the input box when it's empty.
    hide_input = false
    rounding = -1 # -1 means complete rounding (circle/oval)
    check_color = rgb(204, 136, 34)
    fail_color = rgb(204, 34, 34) # if authentication failed, changes outer_color and fail message color
    fail_text = <i>$FAIL <b>($ATTEMPTS)</b></i> # can be set to empty
    fail_transition = 300 # transition time in ms between normal outer_color and fail_color
    capslock_color = -1
    numlock_color = -1
    bothlock_color = -1 # when both locks are active. -1 means don't change outer color (same for above)
    invert_numlock = false # change color if numlock is off
    swap_font_color = false # see below
    position = 0, -20
    halign = center
    valign = center
}

label {
    monitor =
    #clock
    text = cmd[update:1000] echo "$TIME"
    color = rgba(200, 200, 200, 1.0)
    font_size = 55
    font_family = JetBrainsMono NFM SemiBold
    position = -100, 70
    halign = right
    valign = bottom
    shadow_passes = 5
    shadow_size = 10
}

label {
    monitor =
    text = $USER
    color = rgba(200, 200, 200, 1.0)
    font_size = 20
    font_family = JetBrainsMono NFM SemiBold
    position = -100, 160
    halign = right
    valign = bottom
    shadow_passes = 5
    shadow_size = 10
}

image {
    monitor = #DP-1
    path = /home/sohrac/.cache/square_lock.png
    size = 280 # lesser side if not 1:1 ratio
    rounding = -1 # negative values mean circle
    border_size = 4
    border_color = rgb(221, 221, 221)
    rotate = 0 # degrees, counter-clockwise
    reload_time = -1 # seconds between reloading, 0 to reload with SIGUSR2
    #reload_cmd =  # command to get new path. if empty, old path will be used. don't run "follow" commands like tail -F
    position = 0, 200
    halign = center
    valign = center
}

Compositor Info and Version

System/Version info
Hyprland, built from branch  at commit 9a09eac79b85c846e3a865a9078a3f8ff65a9259  (props: bump version to 0.42.0).
Date: Wed Aug 7 19:17:10 2024
Tag: v0.42.0, commits: 5069

flags: (if any)


System Information:
System name: Linux
Node name: arch-desktop
Release: 6.10.4-arch2-1
Version: #1 SMP PREEMPT_DYNAMIC Sun, 11 Aug 2024 16:19:06 +0000


GPU information: 
03:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 32 [Radeon RX 7700 XT / 7800 XT] [1002:747e] (rev c8) (prog-if 00 [VGA controller])
12:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raphael [1002:164e] (rev c7) (prog-if 00 [VGA controller])


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:

Description

I have my PC (using hypridle) set to lock after 10 minutes of inactivity with hyprlock and then turn the screen off (with hyprctl dispatch dpms off) after 30 minutes.

If I get back to my PC BEFORE the screen turns off, everything works as expected: I enter my password and it unlocks as normal.

If I get back to my PC AFTER the screen has turned off, the problem occurs:

  • As soon as I press a key to turn the screen on, my first monitor turns on and shows hyprlock but is frozen. My second monitor stays black with no signal
  • It stays in this state for 20-30 seconds until the second monitor turns on and everything unfreezes
  • I can type while it is frozen (eg. entering my password and presing enter). Nothing will show on the screen, but once everything unfreezes it will instantly enter what I typed and log me in properly

I tried testing a script to see if just the "hyprctl dispatch dpms on/off" was the problem:

hyprctl dispatch dpms off
sleep 10
hyprctl dispatch dpms on

but this worked fine (no freeze)

Trying a similar script resulted in the freezing behaviour described before:

hyprlock &
sleep 5
hyprctl dispatch dpms off &
sleep 10
hyprctl dispatch dpms on

I will post the logs below for hyprlock and dpms on

How to reproduce

  • Setup hypridle and hyprlock so that hyprctl dispatch dpms turns the screen off/on after calling hyprlock (I will attach my hypridle.conf below)
  • Press a key to turn the screen back on and login
  • The freeze should occur

Crash reports, logs, images, videos

Wouldn't let me upload hypridle.conf so I copied it to a text file: hypridle.txt

hyprlock-freeze.log - Obtained with "WAYLAND_DEBUG=1 hyprlock -v >> hyprlock-freeze.log"

dpms-on-freeze.log - Obtained with "WAYLAND_DEBUG=1 hyprctl dispatch dpms on >> dpms-on-freeze.log"

Let me know if you need anything else. I'm new to debugging/problems like this so I looked through other threads that were somewhat related to this issue for things to try.

I also tried "journalctl -b0 --user -u hypridle" but there were no entries

ach-17 avatar Aug 19 '24 02:08 ach-17

The exact same thing happens to me. In my case, when I manually lock using keybind, and then close laptop's lid to suspend (again a bind), swayidle kicks in and turns off dpms and also runs the lock script. Though, I have pidof hyprlock || hyprlock in that script to prevent it from running twice.

Now as soon as I open the lid, dpms turns on (swayidle) and hyprlock freezes. Can do absolutely nothing, cannot change tty, nothing. BUT, after the first timeout in swayidle happens (lowering the brightness), hyprlock comes back to life.

This doesn't happen when I let swayidle lock if I just close the lid

HarshNarayanJha avatar Aug 26 '24 02:08 HarshNarayanJha

Similar thing happens to me, when suspending, I run hyprlock via hypridle's before_sleep_cmd:

general {
  lock_cmd = pidof hyprlock || hyprlock -q --immediate-render
  before_sleep_cmd = killall waybar; loginctl lock-session
  after_sleep_cmd = hyprctl dispatch dpms on
}

listener { # Decrease brightness after 2 minutes 40 seconds
    timeout = 160
    on-timeout = brightnessctl s 10%-
    on-resume = brightnessctl s 10%+
}

listener { # Lock after 3 minutes
  timeout = 180
  on-timeout = loginctl lock-session
}

listener { # Switch off screen after 3 minutes 10 seconds
  timeout = 190
  on-timeout = run_if_not_plaing.sh hyprctl dispatch dpms off
  on-resume = hyprctl dispatch dpms on
}

listener { # Suspend after 20 minutes
  timeout = 1200
  on-timeout = systemctl suspend
}

Very often (ususally after longer suspensions, like for 15+ minutes) the screen turns on just fine, but hyprlock is frozen for a very long time (the clock on it shows more or less the hour at which it has been locked), however. it still takes in input, and will unlock upon unfreezing if the password was inputted.

n0op3 avatar Sep 02 '25 14:09 n0op3

@n0op3, please provide your hyprlock config. It would also be nice, if you could make a screen recording of the problem. Thanks!

Regarding the original issue and OPs description. I can't reproduce it. Logs also seem fine.

PointerDilemma avatar Sep 03 '25 07:09 PointerDilemma

Recording wouldn't help much, all there is to it is the lock screen stuck on the same time, not updating in any manner. TTYs work though.

source = ~/.cache/wal/colors-hyprland.conf

general {
  hide_cursor = true
  grace = 1
}

background {
  monitor =
  path = ~/.cache/current_wallpaper
  blur_passes = 2
  blur_size = 4
  brightness = 0.6
  vibrancy_darkness = 0.0
}

input-field {
  monitor =
  size = 460, 70
  rounding = 16
  inner_color = rgba(27, 27, 27, 1)
  outer_color = $color1 $color4
  font_color = rgb(255, 255, 255)
  outline_thickness = 2
  dots_size = 0.2 # Scale of input-field height, 0.2 - 0.8
  dots_spacing = 0.15 # Scale of dots' absolute size, 0.0 - 1.0
  dots_center = true
  fade_on_empty = false
  placeholder_text = <i>パスワード入力</i>
  halign = center
  valign = center
}

label {
  monitor =
  text = $TIME
  color = rgba(200, 200, 200, 1)
  font_size = 80
  font_family = JetBrains Mono NF

  position = -20, -20
  halign = right
  valign = top
}

Also, here is the hypridle config, it may have something to do with the issue:

general {
  lock_cmd = pidof hyprlock || hyprlock -q --immediate-render
  before_sleep_cmd = killall waybar; loginctl lock-session
  after_sleep_cmd = hyprctl dispatch dpms on; waybar
}

listener { # Decrease brightness after 2 minutes 40 seconds
    timeout = 160
    on-timeout = brightnessctl s 10%-
    on-resume = brightnessctl s 10%+
}

listener { # Lock after 3 minutes
  timeout = 180
  on-timeout = loginctl lock-session
}

listener { # Switch off screen after 3 minutes 10 seconds
  timeout = 190
  on-timeout = run_if_not_plaing.sh hyprctl dispatch dpms off
  on-resume = hyprctl dispatch dpms on
}

listener { # Suspend after 20 minutes
  timeout = 1200
  on-timeout = systemctl suspend
}

hyprctl systeminfo:

Hyprland 0.50.1 built from branch  at commit 4e242d086e20b32951fdc0ebcbfb4d41b5be8dcc  ([gha] Nix: update inputs).
Date: Sat Jul 19 21:37:06 2025
Tag: v0.50.1, commits: 6291
built against:
 aquamarine 0.9.2
 hyprlang 0.6.3
 hyprutils 0.8.1
 hyprcursor 0.1.12
 hyprgraphics 0.1.5


no flags were set


System Information:
System name: Linux
Node name: odysseus
Release: 6.16.5-arch1-1
Version: #1 SMP PREEMPT_DYNAMIC Thu, 04 Sep 2025 23:18:13 +0000


GPU information: 
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation TU106M [GeForce RTX 2060 Mobile] [10de:1f15] (rev a1) (prog-if 00 [VGA controller])
NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  580.82.07  Release Build  (root@)  


os-release: NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo


plugins:

Also, sorry for the delay.

n0op3 avatar Sep 07 '25 13:09 n0op3

Try turning VRR off if you have it on. I think this is what fixed it for me last year when I tried it.

ach-17 avatar Sep 07 '25 15:09 ach-17

I have it off, unfortunately. Maybe I will try turning it on though, who knows what could happen?

n0op3 avatar Sep 07 '25 16:09 n0op3

Shot in the dark: Try to remove killall waybar and restarting the waybar after sleep. Doubt that is it, but worth trying.

Post the hypridle logs when adding -v to your hyprlock commands in hypridle.conf and reproducing the freeze. That would maybe help.

PointerDilemma avatar Sep 09 '25 14:09 PointerDilemma

Woah that actually helped. Thanks! Sometimes the weirdest solutions are the best, huh. I just came back after a 40+ minute break with the PC suspended, and the lock worked flawlessly, showed the right time, and unlocked right away. I wonder why that config caused a problem...

n0op3 avatar Sep 14 '25 17:09 n0op3