Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updating background with swaymsg causes brief system freeze #5606

Open
Neeek opened this issue Aug 5, 2020 · 7 comments
Open

Updating background with swaymsg causes brief system freeze #5606

Neeek opened this issue Aug 5, 2020 · 7 comments
Labels
bug Not working as intended

Comments

@Neeek
Copy link

Neeek commented Aug 5, 2020

Sway version v1.5

https://gist.github.com/Neeek/c60fed165b002ccc68d39be3fadd4b7d
default config

Once sway is started, open up gears or glxgears or eglgears_X11 in a terminal and in another terminal enter the command
swaymsg output "*" bg solid_color fill "#000000"

observe about 40 dropped frames in gears (at 144Hz, more like 15 at 60Hz), so about 200ms of delay.
Sway doesn't receive input during the downtime also, which can be quite jarring while using the system with a wallpaper script or background manager. Downgrading to sway version 1.4 and wlroots 10 fixed the issue for me.
Thanks

@Neeek Neeek added the bug Not working as intended label Aug 5, 2020
@emersion
Copy link
Member

emersion commented Aug 5, 2020

Might have something to do with 3de1a39

@tarmack
Copy link
Contributor

tarmack commented Aug 5, 2020

I too am experiencing this issue, but only with an external screen connected (DisplayPort). This may corroborate emersion's suspicion. To make matters worse, I suspect this problem to be the cause of Firefox and sometimes other applications crashing with, what looks like, a compositor error.

@Anakael

This comment has been minimized.

@emberfade
Copy link

@emersion I tried git bisect and I get the commit you pointed out as the bad one.

3de1a3958eb43521fe5d8e3773b9a1141efb18cb is the first bad commit
commit 3de1a3958eb43521fe5d8e3773b9a1141efb18cb
Author: Tudor Brindus <me@tbrindus.ca>
Date:   Mon Apr 20 17:52:52 2020 -0400

    config/output: reconfigure input devices on new output

    Some input rules, like `map_to_output`, are dependent on a specific
    screen being present. This currently does not work for hotplugged
    outputs, or outputs that are processed after the input device is
    initially probed.

    This commit fixes both cases, by reconfiguring inputs on each output
    addition.

    Fixes #5231.

 sway/config/output.c | 11 +++++++++++
 sway/input/seat.c    |  4 +++-
 2 files changed, 14 insertions(+), 1 deletion(-)

Would it be possible to exclude some of the swaymsg output options from causing a reconfigure of inputs?

@mikesbytes
Copy link

I have also been experiencing this issue with a wallpaper changer script I wrote. It also seems to mess with inputs such that holding down a key when the change happens will cause that key to get "stuck" down until you release and press it again, although sometimes the opposite happens where the key will release itself and you have to release and press again to get it to go. Very annoying when playing games.

@emersion
Copy link
Member

The commit re-configures input devices when output commands are run. Instead we could do it when a new output is plugged in and see how it goes.

Gigadoc2 added a commit to Gigadoc2/dotfiles that referenced this issue Oct 26, 2020
emmaliddell added a commit to emmaliddell/variety that referenced this issue Oct 28, 2021
Sway's default background setter causes a brief system freeze. swaywm/sway#5606
Updating to use swaybg instead when available.
jlu5 pushed a commit to varietywalls/variety that referenced this issue Nov 12, 2021
Sway's default background setter causes a brief system freeze. swaywm/sway#5606
Updating to use swaybg instead when available.
@justman1548
Copy link

I have also been experiencing this issue with a wallpaper changer script I wrote. It also seems to mess with inputs such that holding down a key when the change happens will cause that key to get "stuck" down until you release and press it again, although sometimes the opposite happens where the key will release itself and you have to release and press again to get it to go. Very annoying when playing games.

system freeze doesn occur if background is changed by killing and launching swaybg proccess using timeout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Not working as intended
Development

No branches or pull requests

7 participants