hyprwm / hyprlock

Hyprland's GPU-accelerated screen locking utility
BSD 3-Clause "New" or "Revised" License
803 stars 59 forks source link

[nvidia] Text only updates on input trigger #249

Closed anders130 closed 3 months ago

anders130 commented 7 months ago

Description

When using Hyprlock with Nvidia configuration, I've encountered a problem in the updating of text in label and input field. When locking the screen i only get a new time on the clock when i move my mouse all the time or type something on the keyboard. The text for the authentication error behaves the same.

This is my hyprlock configuration:

general {
    hide_cursor = false
}
background {
    monitor =
    path = /home/jesse/Pictures/Wallpapers/main.png

    brightness = 0.5

    blur_passes = 3
    blur_size = 4
}
input-field {
    monitor = DP-2
    size = 250, 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 = false
    dots_rounding = -2 # -1 default circle, -2 follow input-field rounding
    outer_color = rgb(404040)
    inner_color = rgb(151515)
    font_color = rgb(255, 255, 255)
    fade_on_empty = true
    fade_timeout = 1000 # Milliseconds before fade_on_empty is triggered.
    placeholder_text = <i><span foreground='##aaaaaa'>Input Password...</span></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 = rgb(51, 204, 255)
    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

    position = 0, -20
    halign = center
    valign = center
}
label {
    monitor = DP-2
    text = cmd[update:1000] echo "<span foreground='##ff2222'>$(date)</span>"
    font_family = CaskaydiaCove NFM
}

System Information

Operating System: NixOS 23.11 (flake-based config Hyprland: v0.37.1 Hyprlock: v0.2.0

Logs ``` [LOG] | got iface: wl_shm v1 [LOG] | got iface: wl_drm v2 [LOG] | got iface: zwp_linux_dmabuf_v1 v4 [LOG] > Bound to zwp_linux_dmabuf_v1 v4 [LOG] | got iface: wl_compositor v6 [LOG] > Bound to wl_compositor v6 [LOG] | got iface: wl_subcompositor v1 [LOG] | got iface: wl_data_device_manager v3 [LOG] | got iface: zwlr_export_dmabuf_manager_v1 v1 [LOG] | got iface: zwlr_data_control_manager_v1 v2 [LOG] | got iface: zwp_primary_selection_device_manager_v1 v1 [LOG] | got iface: wp_viewporter v1 [LOG] > Bound to wp_viewporter v1 [LOG] | got iface: zwlr_gamma_control_manager_v1 v1 [LOG] | got iface: zwlr_output_power_manager_v1 v1 [LOG] | got iface: xdg_wm_base v6 [LOG] | got iface: wl_seat v9 [LOG] > Bound to wl_seat v9 [LOG] | got iface: wp_presentation v1 [LOG] | got iface: ext_idle_notifier_v1 v1 [LOG] | got iface: zwlr_layer_shell_v1 v4 [LOG] | got iface: org_kde_kwin_server_decoration_manager v1 [LOG] | got iface: zxdg_decoration_manager_v1 v1 [LOG] | got iface: zwlr_output_manager_v1 v4 [LOG] | got iface: zwp_keyboard_shortcuts_inhibit_manager_v1 v1 [LOG] | got iface: zwp_pointer_constraints_v1 v1 [LOG] | got iface: zwp_relative_pointer_manager_v1 v1 [LOG] | got iface: zwp_virtual_keyboard_manager_v1 v1 [LOG] | got iface: zwlr_virtual_pointer_manager_v1 v2 [LOG] | got iface: zwlr_foreign_toplevel_manager_v1 v3 [LOG] | got iface: wp_drm_lease_device_v1 v1 [LOG] | got iface: zwp_tablet_manager_v2 v1 [LOG] | got iface: zwp_idle_inhibit_manager_v1 v1 [LOG] | got iface: zxdg_exporter_v1 v1 [LOG] | got iface: zxdg_importer_v1 v1 [LOG] | got iface: zxdg_exporter_v2 v1 [LOG] | got iface: zxdg_importer_v2 v1 [LOG] | got iface: zwp_pointer_gestures_v1 v3 [LOG] | got iface: zwp_text_input_manager_v3 v1 [LOG] | got iface: zwp_input_method_manager_v2 v1 [LOG] | got iface: xdg_activation_v1 v1 [LOG] | got iface: ext_session_lock_manager_v1 v1 [LOG] > Bound to ext_session_lock_manager_v1 v1 [LOG] | got iface: wp_cursor_shape_manager_v1 v1 [LOG] > Bound to wp_cursor_shape_manager_v1 v1 [LOG] | got iface: wp_tearing_control_manager_v1 v1 [LOG] | got iface: wp_single_pixel_buffer_manager_v1 v1 [LOG] | got iface: xwayland_shell_v1 v1 [LOG] | got iface: hyprland_toplevel_export_manager_v1 v2 [LOG] | got iface: wp_fractional_scale_manager_v1 v1 [LOG] > Bound to wp_fractional_scale_manager_v1 v1 [LOG] | got iface: zwp_text_input_manager_v1 v1 [LOG] | got iface: hyprland_global_shortcuts_manager_v1 v1 [LOG] | got iface: zwlr_screencopy_manager_v1 v3 [LOG] > Bound to zwlr_screencopy_manager_v1 v3 [LOG] | got iface: zxdg_output_manager_v1 v3 [LOG] | got iface: wl_output v4 [LOG] > Bound to wl_output v4 [LOG] | got iface: wl_output v4 [LOG] > Bound to wl_output v4 [LOG] | got iface: wl_output v4 [LOG] > Bound to wl_output v4 [LOG] [core] dmabufFeedbackMainDevice [LOG] output 49 make Samsung Electric Company model SMB2430L [LOG] output 49 name HDMI-A-1 [LOG] output 49 description Samsung Electric Company SMB2430L H9XZA07633 (HDMI-A-1) [LOG] output 49 done [LOG] output 50 make AOC model U34G2G4R3 [LOG] output 50 name DP-2 [LOG] output 50 description AOC U34G2G4R3 0x000022A3 (DP-2) [LOG] output 50 done [LOG] output 51 make Samsung Electric Company model S25HG5x [LOG] output 51 name DP-3 [LOG] output 51 description Samsung Electric Company S25HG5x H4ZJ300210 (DP-3) [LOG] output 51 done [LOG] Running on Hyprland [LOG] Locking session [LOG] onLockLocked called [LOG] got fractional 1 [LOG] got fractional 1 [LOG] configure with serial 12235 [LOG] Configuring surface for logical [Vector2D: x: 1920, y: 1080] and pixel [Vector2D: x: 1920, y: 1080] [LOG] got fractional 1 [LOG] got fractional 1 [LOG] configure with serial 12236 [LOG] Configuring surface for logical [Vector2D: x: 3440, y: 1440] and pixel [Vector2D: x: 3440, y: 1440] [LOG] got fractional 1 [LOG] got fractional 1 [LOG] configure with serial 12237 [LOG] Configuring surface for logical [Vector2D: x: 1920, y: 1080] and pixel [Vector2D: x: 1920, y: 1080] [ERR] Invalid key down event (stray release event?) [LOG] Framebuffer created, status 36053 [LOG] Framebuffer created, status 36053 [LOG] Framebuffer created, status 36053 [LOG] Framebuffer created, status 36053 [LOG] Framebuffer created, status 36053 [LOG] Framebuffer created, status 36053 [LOG] Framebuffer created, status 36053 [LOG] Framebuffer created, status 36053 [LOG] Framebuffer created, status 36053 [LOG] Authenticating [ERR] auth: Authentication failed for hyprlock [LOG] auth: authenticated for su [LOG] Unlocking session [LOG] Unlocked, exiting! [LOG] Reached the end, exiting fish: Job 1, 'hyprlock' terminated by signal SIGABRT (Abort) ```
vaxerski commented 7 months ago

have you tried hyprlock-git? it was fixed there iirc.

anders130 commented 7 months ago

I am very new to the nixos and hyprland stuff, so I don't know if this is right. As I think you suggested I have done the following: I have tried to add the hyprlock repo as a flake input with this:

        hyprlock.url = "github:hyprwm/Hyprlock";

then I imported the home-manager module inside the modules array of the nixpkgs.lib.nixosSystem of my flake

{
    home-manager.users.${username} = {
        imports = [
            hyprlock.homeManagerModules.hyprlock
        ];
    };
}

to enable i have set programs.hyprlock.enable = true; I hope, this is the thing you suggested. Unfortunately I still have the same behavior with the labels not updating.

PaideiaDilemma commented 7 months ago

Looks fine. Make sure you do hyprlock.inputs.nixpkgs.follows = "nixpkgs" Then do nix flake lock --update-input hyprlock and you should run the latest version.

anders130 commented 7 months ago

Ah thanks for the clarification @PaideiaDilemma. I applied your suggestions but it unfortunately didn't change the behavior.

cmhulbert commented 7 months ago

I think I'm in a similar position. I'm also using the github hyprlock module, and seeing this same issue, where the labels are only updating on input trigger. Let me know if there is any info I can help provide!

cenunix commented 7 months ago

hyprlock 0.pre+date=2024-03-31_071ebce -> 0.pre+date=2024-04-08_bc87adf

updated, still wont refresh the time unless i move the mouse around. Also, Hyprlock will lag/freeze up half the time when typing and unlocking, pretty sure this is an nvidia issue. Even though its gpu accelerated it looks like half of the screen is slowly fading over the span of 3-5 seconds from the lock screen into my desktop.

nnra6864 commented 6 months ago

Same here, using nvidia and it doesn't load unless I move the mouse/type. Another weird thing compared to others is that the time I am displaying like this: text = cmd[update:1000] echo "<span foreground='##eceff4'>$(date)</span>" doesn't update consistently even if I move the mouse, sometimes it updates per second, sometimes 2 and sometimes 5, it's really odd.

PaideiaDilemma commented 6 months ago

I installed hyprlock on a pc with a 1080ti today using the 550.67 drivers. When starting hyprlock cmd[update:500] date updated just fine, but after entering a wrong password it started to miss some seconds and get "out of sync". It was visible through the logs (-v) that some timer updates did not render. My guess is that the frameCallback does not get fired on time.

svyatoclav commented 6 months ago

Artix with 1080Ti, last pacman build and drivers, same issue here and it feels really laggy...

olterman commented 5 months ago

I have the same issue on Debian 13 with nvidia, clock only updates when mouse moves or button is pressed, works fine on other box where I do not have dual monitors.

NichtSylph commented 5 months ago

Same issue here with Nvidia driver v550, I have 4 monitors in total, 1 of them has all the labels and time/labels only update when doing an input on the monitor that has the labels.

cenunix commented 5 months ago

I guess we’ll see how things turn out with the upcoming 555 drivers then eh? Not sure if that would have any affect, we’ll have to see.

nnra6864 commented 5 months ago

Still happening for me on nvidia 555, although it seems just slightly better, visuals update occasionally without me providing any input.

FelipeFMA commented 5 months ago

I have the same issue on the beta 555 nvidia driver

cenunix commented 5 months ago

yup, still broken asf for nvidia users :(

Tisteos commented 5 months ago

Same on beta 555 driver

PaideiaDilemma commented 4 months ago

I investigated a bit more and found that wl_display_read_events takes a long time and that causes the stutters. Weirdly enough it takes exactly 1 second for it to execute.

nnra6864 commented 4 months ago

I just tested it out with 0.41 and it's... better? I got a red flash when starting it, followed by accurate timer updates and... It just went downhill from there. Timer started skipping, deleting characters was fairly laggy(3+ deleted usually causes the lag and not present in hyprlock-git) and finally entering the password made the hyprlock disappear smoothly. However, I couldn't do anything, all I could do was switch to another tty and back to Hyprland which gave me back the control.

a-usr commented 4 months ago

For me this issue also happens with upstream hyprland and hyprlock. When starting hyprlock the ui only updates when receiving input, and if I try to exit hyprlock by entering my password without some amount of updates having occured it returns to hyprland, but hyprland is unresponsive. If that amount of updates has occured however (whatever amount it may be) the session unlocks just fine upon entering my password correctly.

anders130 commented 3 months ago

I recently switch to using an AMD GPU and the issue is gone. So nvidia seemed to be the problem.

a-usr commented 3 months ago

I just went trough the output produced by hyprlock, and I noticed that according to the logs hyprlock got 2 wp_drm_lease_device_v1 v1 ? That doesn't seem right?

Entire Log ``` [LOG] | got iface: wl_seat v9 [LOG] > Bound to wl_seat v9 [LOG] | got iface: wl_data_device_manager v3 [LOG] | got iface: wl_compositor v6 [LOG] > Bound to wl_compositor v6 [LOG] | got iface: wl_subcompositor v1 [LOG] | got iface: wl_shm v1 [LOG] | got iface: wp_viewporter v1 [LOG] > Bound to wp_viewporter v1 [LOG] | got iface: wp_tearing_control_manager_v1 v1 [LOG] | got iface: wp_fractional_scale_manager_v1 v1 [LOG] > Bound to wp_fractional_scale_manager_v1 v1 [LOG] | got iface: zxdg_output_manager_v1 v3 [LOG] | got iface: wp_cursor_shape_manager_v1 v1 [LOG] > Bound to wp_cursor_shape_manager_v1 v1 [LOG] | got iface: zwp_idle_inhibit_manager_v1 v1 [LOG] | got iface: zwp_relative_pointer_manager_v1 v1 [LOG] | got iface: zxdg_decoration_manager_v1 v1 [LOG] | got iface: wp_alpha_modifier_v1 v1 [LOG] | got iface: zwlr_gamma_control_manager_v1 v1 [LOG] | got iface: ext_foreign_toplevel_list_v1 v1 [LOG] | got iface: zwp_pointer_gestures_v1 v3 [LOG] | got iface: zwlr_foreign_toplevel_manager_v1 v3 [LOG] | got iface: zwp_keyboard_shortcuts_inhibit_manager_v1 v1 [LOG] | got iface: zwp_text_input_manager_v3 v1 [LOG] | got iface: zwp_pointer_constraints_v1 v1 [LOG] | got iface: zwlr_output_power_manager_v1 v1 [LOG] | got iface: xdg_activation_v1 v1 [LOG] | got iface: ext_idle_notifier_v1 v1 [LOG] | got iface: ext_session_lock_manager_v1 v1 [LOG] > Bound to ext_session_lock_manager_v1 v1 [LOG] | got iface: zwp_input_method_manager_v2 v1 [LOG] | got iface: zwp_virtual_keyboard_manager_v1 v1 [LOG] | got iface: zwlr_virtual_pointer_manager_v1 v2 [LOG] | got iface: zwlr_output_manager_v1 v4 [LOG] | got iface: org_kde_kwin_server_decoration_manager v1 [LOG] | got iface: hyprland_focus_grab_manager_v1 v1 [LOG] | got iface: zwp_tablet_manager_v2 v1 [LOG] | got iface: zwlr_layer_shell_v1 v5 [LOG] | got iface: wp_presentation v1 [LOG] | got iface: xdg_wm_base v6 [LOG] | got iface: zwlr_data_control_manager_v1 v2 [LOG] | got iface: zwp_primary_selection_device_manager_v1 v1 [LOG] | got iface: xwayland_shell_v1 v1 [LOG] | got iface: wl_drm v2 [LOG] | got iface: zwp_linux_dmabuf_v1 v5 [LOG] > Bound to zwp_linux_dmabuf_v1 v5 [LOG] | got iface: hyprland_toplevel_export_manager_v1 v2 [LOG] | got iface: zwp_text_input_manager_v1 v1 [LOG] | got iface: hyprland_global_shortcuts_manager_v1 v1 [LOG] | got iface: zwlr_screencopy_manager_v1 v3 [LOG] > Bound to zwlr_screencopy_manager_v1 v3 [LOG] | got iface: wp_drm_lease_device_v1 v1 [LOG] | got iface: wp_drm_lease_device_v1 v1 [LOG] | got iface: wl_output v4 [LOG] > Bound to wl_output v4 [LOG] [core] dmabufFeedbackMainDevice [LOG] output 47 make Samsung Electric Company model LC49G95T [LOG] output 47 name DP-2 [LOG] output 47 description Samsung Electric Company LC49G95T H4ZT800513 (DP-2) [LOG] output 47 done [LOG] Running on Hyprland [LOG] Locking session [ERR] Pam module "hyprlock" not found! Falling back to "su" [WARN] Extension: .png [LOG] PAM_PROMPT: Password: [LOG] onLockLocked called [LOG] got fractional 1 [LOG] got fractional 1 [LOG] configure with serial 10303 [LOG] Configuring surface for logical [Vector2D: x: 3840, y: 1080] and pixel [Vector2D: x: 3840, y: 1080] [LOG] got fractional 1 [LOG] Framebuffer created, status 36053 [LOG] Framebuffer created, status 36053 [LOG] Framebuffer created, status 36053 [LOG] Authenticating [LOG] auth: authenticated for su [LOG] Unlocking session [LOG] Unlocked, exiting! [LOG] Reached the end, exiting ```

Can anyone reproduce this?

ilolm commented 3 months ago

The same issue guys

eptastic commented 3 months ago

I also have this same issue with an nvidia GTX 1080. Anything we can do except pray for a fix in the next driver update?

nnra6864 commented 3 months ago

Update. It got even worse :skull: I just updated my system and hyprlock is a just a red screen for a few seconds. After that, it skips seconds as usual. A thing that's slightly better is typing, it feels completely smooth now. What's 10x worse tho is not being able to do anything after I unlock, unless I switch to another tty and back.

ilolm commented 3 months ago

Guys, Nvidia 560 fixed it!

nnra6864 commented 3 months ago

Guys, Nvidia 660 fixed it!

560 Fixed it for me too!

dasanibroto commented 3 months ago

Guys, Nvidia 660 fixed it!

What do you mean nvidia 660? I can only find nvidia 560, and I still have the bug on this driver.

ilolm commented 3 months ago

Guys, Nvidia 660 fixed it!

What do you mean nvidia 660? I can only find nvidia 560, and I still have the bug on this driver.

yay -Sy nvidia-beta-dkms \
nvidia-settings-beta \
nvidia-utils-beta \
lib32-nvidia-utils-beta

I meant 560, sorry. Delete all nvidia drivers you have and try this command(make backup before doing anything).

dasanibroto commented 3 months ago
yay -Sy nvidia-beta-dkms \
nvidia-settings-beta \
nvidia-utils-beta \
lib32-nvidia-utils-beta

I meant 560, sorry. Delete all nvidia drivers you have and try this command(make backup before doing anything).

Apologies but I'm using nixos. I had to make a flake to point to 560 manually, so I'd have to do the same for those as well (I think?). Appreciate the help, but I'm gonna wait for 560 (and associated utils) to be upstreamed to nixpkgs I think.

gloomDev commented 3 months ago

For me it's still happening on the 560 drivers ¯_(ツ)_/¯ Nix unstable.

dasanibroto commented 3 months ago

It stopped happening to me on Nvidia 560 after enabling explicit sync in hyprland.

On Mon, 5 Aug 2024, 7:25 am gloomDev, @.***> wrote:

For me it's still happening on the 560 drivers ¯*(ツ)*/¯

— Reply to this email directly, view it on GitHub https://github.com/hyprwm/hyprlock/issues/249#issuecomment-2268028458, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTYVUTCC4SHINTIQI6RPVDZP3LRJAVCNFSM6AAAAABFPZ5FDSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRYGAZDQNBVHA . You are receiving this because you commented.Message ID: @.***>

gloomDev commented 3 months ago

It stopped happening to me on Nvidia 560 after enabling explicit sync in hyprland.

Cheers.