wyyadd / LaLa

LaLa Trainers Launcher
GNU Affero General Public License v3.0
130 stars 4 forks source link

flickering issue with trainer, because of wayland (+nvidia)? #6

Open ahjolinna opened 1 year ago

ahjolinna commented 1 year ago

as you can see from video below, this same flickering happens to me every time when I open the trainer.

my guess is because of wayland, and because of nvidia?....is this driver issue or can you fix this?

Screencast_20231105_212448.webm


my PC spec:

Operating System: openSUSE MicroOS 20231103
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version: 5.15.11
Kernel Version: 6.5.9-1-default (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5700G with Radeon Graphics
Memory: 46.8 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 3060 Ti/PCIe/SSE2
GPU Driver Version:  535.129.03
wyyadd commented 1 year ago

I've encountered the same issue as well. It appears to be related to the specific trainer; some trainers flicker while others do not. When I tried minimizing it and reopening, the flickering stopped. I suspect it might be related to how it detects the game process (as the flickering frequency seems consistent). Have you tried launching the game first and then starting the trainer? Does it still flicker in that case?"

ahjolinna commented 1 year ago

well I tried with Baldur's Gate 3, and minimizing thing you mentioned did help but not the launching the game first

ahjolinna commented 1 year ago

it seems this flickering issue is a nvidia driver issue on wayland, as it doesn't exist on x-server nor AMD gpu with wayland. (at least on the couple trainers that I have been testing with)

which isn't that surprising as nvidia wayland support has been behind/slow, okay the latest 545 branch seems really promising but sadly they rushed the release because of security thing and now there is a wayland bug that makes it unusable, hopefully the next release is soon'ish

wyyadd commented 1 year ago

Thank you for the information. After testing on my AMD GPU with Wayland, the flickering issue still occurs. However, if you've already started the corresponding game and then launch the trainer, once the trainer detects the game process, the flickering stops.

ahjolinna commented 1 year ago

oh it also happened on AMD, okay so its not just nvidia, so it seems to be xwayland issue

so as the trainers are getting opened in proton/wine, so we have to wait either xwayland support being fixed https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/967 https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1120 https://gitlab.freedesktop.org/xorg/xserver/-/issues/1317 or wait for native wayland support for wine/proton part 9 of the support is now in the works: https://gitlab.winehq.org/wine/wine/-/merge_requests/4203

PS. some of the nvidia 545 drivers wayland issues https://forums.developer.nvidia.com/t/feature-g-sync-freesync-under-wayland-session/220822/46 https://forums.developer.nvidia.com/t/new-545-beta-only-renders-update-game-if-window-is-unfocused-otherwise-it-will-have-0-fps/269759 https://forums.developer.nvidia.com/t/545-29-02-wayland-synchronization-issues-with-framerates-below-screen-refresh-rate/271577 and other ones

....so sometime 2024 this will be fixed, hopefully

wyyadd commented 1 year ago

You are Right. It is a Wayland-related issue. After some testing, I haven't experienced flickering when I switched my Ubuntu to X11. The flickering issue reappeared when I switched back to Wayland. Similarly, in SteamDeck's desktop mode (X11), I didn't observe any flickering. However, when switching to gaming mode, I did notice flickering.

well only thing that makes SteamOS different from others when in GamingMode is that it uses gamescope for wayland ...(desktop/KDE it still uses x-server)

You mentioned that gaming mode uses Wayland, so I suspect it might be a Wayland-related issue. So, I think temporary solution is switching to x11.

ahjolinna commented 1 year ago

yeah it seems to be a wayland issue, or more exactly xwayland as wine/proton doesn't have native wayland support yet.

when I mentioned gamescope I was mainly thinking about the flatpak issue where it wouldn't launch the trainer

ahjolinna commented 1 year ago

apparently activating the option for “Emulating a virtual desktop” in the Graphics Tab in winecfg would fix this issue, is it possible to make this default for all the trainers?

wyyadd commented 1 year ago

I'm so glad there's a solution :) Thank you for your suggestion, and I'll provide updates as soon as possible.

wyyadd commented 1 year ago

Activating "Emulating a virtual desktop" would make games and trainers run in a window. Running in a single window also prevents the use of "Alt+Tab" to switch between game and trainer, making it less user-friendly.
After several hours of online research, I couldn't find a method to make trainers and games run in separate windows. Making "Emulating a virtual desktop" the default for all trainers might not be the best solution. :(

ahjolinna commented 1 year ago

well to bad, it seems we have to wait for wine dev finish their native wayland support. It has progressed a lot just not sure how much they still need to do, hopefully when wine 9.x is released...soonish

wyyadd commented 1 year ago

Update: I wrote a tutotial on how to fix this issue at README FAQ.