sway: One monitor won't wake up after swayidle
sway version
sway version v1.5
log
Note the log is quite big as sway was running for a few hours before it happened.
config
Description
Using a dual monitor setup and about 1 in 10 times one of the monitors wont wake up after swayidle have put them to sleep. Which monitor that fails to wake up varies. After I’ve unlocked the swaylock screen it usually comes back but will blink every 10s or so. This time it didn’t come back after unlock. I have a mode in my config:
mode "$toggle_outputs" {
bindsym l output $left toggle; mode "default"
bindsym r output $right toggle; mode "default"
bindsym Escape mode "default"
}
That allows me to toggle each monitor off and on. And toggling the monitor that failed to wake up off and on will fix the issue. It’s really hard to reproduce, only seem to happen after swayidle have put them to sleep. I have had no issue toggling a monitor off and on manually using the mode above.
Thanks
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 14
- Comments: 45 (4 by maintainers)
Relevant DRM/AMD (kernel driver) bug for the people still subscribed to this issue: https://gitlab.freedesktop.org/drm/amd/-/issues/1376
Please react to this comment with a thumbs up if you are experiencing this bug on AMD hardware or a thumbs down if you are experiencing it on non-AMD hardware
Repro steps:
A dpms toggle doesn’t turn it back on either, eg:
swaymsg reloadalso doesn’t fix it I need toswaymsg exitthen startswayagain.The DP-2 will start fine on wake if the laptop was suspended in the docking station:
Logs here:
WLR_DRM_NO_MODIFIERS=1 sway -d > sway.log 2>&1
wlroots-git is at commit https://github.com/swaywm/wlroots/commit/3364eec07e91eb51f770f2f7d619a07d96c0b5c4Most relevant part:
Full logs: https://gist.github.com/3nuc/6c9112485258b0dab36ce2a67e0594dc
Could the people affected please check:
It didn’t solve this problem for me (this is a long time issue for me), but I use an old-school non-usb-c dock.
I noticed my monitor firmware version (in the built-in overlay monitor menu) is M2103, but then I went to Dell’s page for my 4317Q model and there was a M2104 version whose changelog says “fix issue with wake-up with USB-C docks” so I was hopeful, but as I said, it didn’t work.
Please react with thumbs down to this comment if either your firmware is the newest possible and this issue is still happening, or if you updated from old FW (where it didn’t work) to newest, and the issue persists
I’ve noticed that after upgrading to sway 1.8 & wlroots 0.16.0 this issue occurs every time the monitor goes to sleep, regardless of the delay between
dpms offanddpms on. i.e.: with sway 1.7 & wlroots 0.15.1 runningswaymsg "output * dpms off" && swaymsg "output * dpms on"causes this bug 0/10 times with sway 1.8 & wlroots 0.16.0 runningswaymsg "output * dpms off" && swaymsg "output * dpms on"causes this bug 10/10 timesPlease react with a thumbs up if you experience this change in behavior after upgrading to sway 1.8 and/or wlroots 0.16.0 or a thumbs down if you have both sway 1.8 and wlroots 0.16.0 and you are not seeing this change in behavior
Hi chaps, until there is an actual solution, I got a perfectly working (for me) workaround ( Debian 11 bullseye / Kernel: 6.1.0-0.deb11.5-amd64) :
In your sway config:
swayidle -w timeout 300 'swaylock -f -c 000000' timeout 480 'swaymsg "output * dpms off"' resume '$HOME/.config/sway/sway-resume.sh' before-sleep 'swaylock -f -c 000000'And the sway-resume.sh contains:
If for your system the sway_tty number is known, you can replace the logic in the script with static assignments. You can confirm if your system’s tty number for sway is the same across reboots number using LShift + LAlt + [F1, F2, F3, F4].
Don’t forget to visudo and make the use of ‘chvt’ not requiring a passwd for your user (or sudoers group):
%sudo ALL=(root) NOPASSWD: /usr/bin/chvtSorry, I didn’t meant my comment as response to @itaranto. I just got notified and decided to leave this breadcrumb. I see such issue mentioned there and there in the WEB, but no clear answer to it. Might be some Kernel thing. Not an expert. But what I said above definitely influenced the behavior of my system. I will try to explore it on my next reinstall.
I experienced this same problem with current master branch version of sway (90c2d631). The problem started occurring after I updated my (archlinux) AUR sway-git package.
The fix for me was to build and install sway from 1.8 release branch combined with wlroots release 0.16.2.
Simplest repro: $ swaymsg “output * dpms off” && sleep 1 && swaymsg “output * dpms on”
With the newest version I got this error in sway log:
The machine is Lenovo Thinkpad X1C Gen 7, Intel Whiskey Lake, UHD 620 iGPU using “i915” kernel driver. I tested with kernels 6.2 (6.2.6-arch1-1) and 6.1 (arch “linux-lts”).
Interestingly this is different from @RunningDroid 's issue, since they experienced problems with sway version 1.8 while for me going from 1.9=>1.8 fixed the issue.
When I have some free time I might try bisecting this further.
Just to give a brief update, it’s still happening to me with
sway-1.6usingliunx-5.11.16-arch1-1andmesa-21.0.3-2on Arch Linux. But it is less frequent, I think this is the second time this is happening in a span of a month, before this was happening everyday. Just a quickdpms on/offbrings it back, no issue with resolution.@dvzrv I tested your waylock configuration and sadly it is still happening to me. Power cycling the sleeping monitor brings it back, but sometimes I need to turn it off and on again with sway to get the correct resolution back.
FWIW: I have experienced the same(?) issue using swayidle (1.6) and swaylock (1.5) on sway (1.5.1) on two separate machines (one intel/nvidia based laptop, one amdgpu based desktop) using a dual monitor setup (the same monitors in both setups). One of the monitors (
Dell Inc. DELL P2715Q 32R1F52CAMBL) would sometimes not wake up (note: it generally takes around 1s longer to wake up, than the 2nd monitor) and I would have to switch it off and on again to have it wake up and being used again. The other monitor (Dell Inc. DELL2407WFPHC DR47478U0TMS) in that setup did not exhibit this behavior (and is generally the one waking up faster).I have switched to waylock about two weeks ago and I have not experienced this behavior since.
My config currently includes:
With swaylock it used to include:
This can of course also be a red herring, but so far the above setup has been stable for my hardware setup.
I’m having what might be the same issue on and off with a Dell Precision 5550 (Intel GPU) with an external monitor When it happens again, I’ll try to grab some logs from
dmesg