sway icon indicating copy to clipboard operation
sway copied to clipboard

Screen corruption after return from suspend by open laptop's lid

Open Sunderland93 opened this issue 3 years ago • 6 comments

Please read the following before submitting:

  • Please do NOT submit bug reports for questions. Ask questions on IRC at #sway on Libera Chat.
  • Proprietary graphics drivers, including nvidia, are not supported. Please use the open source equivalents, such as nouveau, if you would like to use Sway.
  • Please do NOT submit issues for information from the github wiki. The github wiki is community maintained and therefore may contain outdated information, scripts that don't work or obsolete workarounds. If you fix a script or find outdated information, don't hesitate to adjust the wiki page.

Please fill out the following:

  • Sway Version:

    • 1.7
  • Debug Log:

    • Run sway -d 2> ~/sway.log from a TTY and upload it to a pastebin, such as gist.github.com.
    • This will record information about sway's activity. Please try to keep the reproduction as brief as possible and exit sway.
    • Attach the full file, do not truncate it.

sway.log

  • Configuration File:

bindswitch --reload --locked lid:on output LVDS-1 exec "~/.config/swaylock/lock.sh

### Idle configuration
# This will lock your screen after 300 seconds of inactivity, then turn off
# your displays after another 300 seconds, and turn your screens back on when
# resumed. It will also lock your screen before your computer goes to sleep.
#
set $idle_timeout 240
set $locking_timeout 300
set $screen_timeout 600
set $idle swayidle -w \
    timeout $idle_timeout 'light -G > /tmp/brightness && light -S 10' resume 'light -S $([ -f /tmp/brig>
    timeout $locking_timeout "~/.config/swaylock/lock.sh" \
    timeout $screen_timeout 'swaymsg "output * dpms off"' \
    resume 'swaymsg "output * dpms on"' \
    before-sleep 'playerctl pause' \
    before-sleep "~/.config/swaylock/lock.sh" & \
    lock "~/.config/swaylock/lock.sh" &

~/.config/swaylock/lock.sh

#!/bin/bash

cd /tmp
grim screen.png

# Delete existing image
rm screen-out.png

#Adds a blur, vignette and lock logo
ffmpeg -i screen.png -vf "gblur=sigma=10, vignette=PI/5" -c:a copy screen-out.png

#Uses output image with Swaylock
swaylock \
--image screen-out.png \
--indicator-caps-lock \
--ignore-empty-password \
--show-failed-attempts \
--show-keyboard-layout \
--font=Ubuntu \
--inside-color 1b1b1b \
--inside-clear-color eeeeee \
--ring-color 3B758C \
--ring-clear-color 9fca56 \
--ring-ver-color 2980b9 \
--daemonize
  • Description: I'm using Sway on Ubuntu 22.04. After I close laptop's lid, the system is going to suspend, but after lid is open - the screen has a garbage https://imgur.com/WPHX9Fd

Hardware: Asus K55N, AMD A10-4600M with integrated Radeon-HD-7660G Software: Ubuntu 22.04, Mesa 22.0.1, Linux 5.15

Sunderland93 avatar May 25 '22 12:05 Sunderland93

Looks like https://gitlab.freedesktop.org/drm/amd/-/issues/2026

emersion avatar May 25 '22 12:05 emersion

The problem does not always appear, WLR_DRM_NO_MODIFIERS=1 does not help. Same as moving cursor

Sunderland93 avatar May 25 '22 12:05 Sunderland93

00:00:00.026 [INFO] [wlr] [backend/drm/backend.c:183] Initializing DRM backend for /dev/dri/card0 (radeon)

That's not related to AMDGPU.

vyivel avatar May 27 '22 13:05 vyivel

I have the same problem, sill haven't managed to solve this

lorenzo9uerra avatar Sep 04 '22 12:09 lorenzo9uerra

The problem is in Swaylock on lid close (sleep) with Nvidia drivers running on wayland. I uninstall nvidia, nvidia-dkms, nvidia-gtklibs, nvidia-libs and problem solved.

It doesnt happen when you manually invoke "swaylock -f" but when you close lid and open it back, mouse, keyboard wont response, also it wont allow to go to tty.

eqn-grp avatar Oct 06 '22 15:10 eqn-grp

the current version has not this problem anymore, now suspending works as expected

lorenzo9uerra avatar Oct 09 '22 19:10 lorenzo9uerra