swaywm / sway

i3-compatible Wayland compositor
https://swaywm.org
MIT License
14.47k stars 1.1k forks source link

Sometime cannot unlock, keyboard input appears to not be registered #7533

Open StevenPine opened 1 year ago

StevenPine commented 1 year ago

sway version 1.8.1

Sometimes once swayidle and swaylock trigger I cannot unlock the system. Keyboard appears to become completely unresponsive, cannot open a tty to investigate, must reboot system to recover.

I attempted to provide information here: https://github.com/swaywm/sway/issues/6131 was told to make a new issue, but debug logs are there. Issue continues to happen, can provide additional debug logs.

Thank you for any and all assistance.

pielgrzym commented 1 year ago

Happened to me on 1.8.1 a couple of times, too. In my case you can wait 30-40s and swaylock becomes responsive again.

StevenPine commented 1 year ago

I appreciate the comment but this isn't my experience. This is still happening, it seems nothing from the keyboard is registered -- ie my monitor shows no input detected when trying to wake up from this broken idle state. logs also seem to have just cut out, but that could be data loss from the forced reboot.

Is there anything I can do besides abandoning sway as my window manager?

naibaf0 commented 1 year ago

If you suspended the system, is swaylock showing up at all after starting up again? I have been experiencing this for a while now, that after a suspend with swaylock, the computer turns on, the lights are blinking and fans turning, but the monitor has no signal at all and non of my keypresses seem to do anything. :/

As of now I also haven't captured any log indicating something.

Curiously my Notebook is completely fine, even though the software setup should be more or less identical.

StevenPine commented 1 year ago

The issue has not occurred again for me for some time now, maybe 5 or 6 weeks. At some point I adjusted the idle timeouts int he config from 300 to 3000 seconds:

exec swayidle -w \
         timeout 3000 'swaylock -f -c 000000' \
         timeout 3000 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
         before-sleep 'swaylock -f -c 000000'

It's difficult to diagnosis without keyboard input and logs seem to stop when the issue occurs (which suggests a much more significant issue especially if i am running logs as debug, they should have some output prior to failing).

ok-nick commented 1 year ago

I've been experiencing a similar issue for around a month or two now. In my case, it only happens when I resume from suspend and keyboard inputs don't register at all with swaylock, I'm forced to reboot. I'm using Hyprland on a Nvidia GPU if that makes any difference. I'll try to gather debug logs, if any.

StevenPine commented 1 year ago

spoke too soon, about a week ago, same incident, no input received, forced to reboot. logs show they stopped recording hours prior. when debug logs stop writing and I am forced to reboot, that is a serious failure of the WM right? hello?

Spartan1776 commented 8 months ago

@StevenPine not that it helps to solve the issue, but I'm experiencing the exact same thing with swayidle 1.8.0-1 and swaylock-effects-git r470.496059a-1.

Also running Hyprland but with an AMD Radeon RX 6800. Having to reboot on a seemingly random basis due to an inability to log back has moved beyond a mere annoyance. I'll see what I can figure out; if I find anything useful, I'll let y'all know.

ok-nick commented 8 months ago

If it helps, a few months ago setting Nvidia Optimus in my BIOS (instead of Dedicated GPU) seemed to fix the issue for me. I don't know if anything else changed.

Spartan1776 commented 8 months ago

@ok-nick thanks for the input -- to confirm, Nvidia Optimus just switches between the integrated GPU and added Nvidia graphics card to ensure the best performance, right? If so, I forced the AMD equivalent on in BIOS, but that didn't fix the issue.

I swapped out the direct Linux commands (i.e., "hyprctl dispatch dpms off") for script execution with the same/similar commands (i.e., "exec ~/user_idle"). I've been using that method for ~3 days now, and so far no keyboard issues. Not quite sure why this made a difference on my end...but so far so good...

@StevenPine said the keyboard disconnect popped up for him again 5-6 weeks later, though, so I want to keep testing this change over an extended period to see if the issue comes back for me, too.

StevenPine commented 8 months ago

It has not happened to my system for some time, maybe once since august. The most significant impact was increasing the default swayidle timeouts.