LGFae / swww

A Solution to your Wayland Wallpaper Woes
GNU General Public License v3.0
2.26k stars 67 forks source link

Out-of-Sync and Overlapping animations #326

Open LGFae opened 4 months ago

LGFae commented 4 months ago

Hey there, so I am not sure whether it's related but I suppose so, so I'm reopening this weird swww crash issue.

Now, weirdly, after a bit of swww-daemon --format xrgb running, the monitors (I've got 3) get out of sync and what's more annoying, the wallpapers (I use animated gifs from waneella start overlapping randomly (see the screenshots of two of my monitors for both being out of sync and overlapping wallpapers).

swappy-20240602-155556 swappy-20240602-155602

Do you happen to have anything I could try / provide to help debug this issue? Should I start a new issue or is there any related one I just blindly missed?

Any help appreciated. No matter these issues (this happens after 20min or 1 hour or few hours sometimes, and restarting the daemon fixes it) I still enjoy swww dearly!

Cheers

Originally posted by @shinobiultra in https://github.com/LGFae/swww/issues/310#issuecomment-2143868691

LGFae commented 4 months ago

@shinobiultra, what happens if you just call swww clear instead of restarting the daemon, does that also fix it?

I think the issue with overlapping might be that we are not properly waiting for the animations thread to exit after receiving a new img request.

Regarding the monitors being out-of-sync, do they all have the same configuration (resolution and refresh-rate)? Right now, we only keep them in sync if that's the case.

shinobiultra commented 4 months ago

Thanks for such a fast reply!

@shinobiultra, what happens if you just call swww clear instead of restarting the daemon, does that also fix it?

I'll try it as soon as it happens next time.

Regarding the monitors being out-of-sync, do they all have the same configuration (resolution and refresh-rate)? Right now, we only keep them in sync if that's the case.

I did not realize this, so no, they all have different resolutions and different framerates. What happens in such a case then?

LGFae commented 4 months ago

I did not realize this, so no, they all have different resolutions and different framerates. What happens in such a case then?

We don't keep them in sync in this case. What we are currently doing is bundling together all monitors that have the same resolution in one Vec and updating all of them in sync. This is because they all have the exact same image. When the resolution changes, we need to resize the image, so it isn't the same anymore, and thus, monitors with different resolutions go with different Vec. I think we can improve this though and keep them in sync even if all monitors are different.

Framerates actually don't matter for the current implementation, but if we sync them up the animations would run with the slowest monitor's framerate.