gamescope icon indicating copy to clipboard operation
gamescope copied to clipboard

Gamescope bugs in fullscreen

Open sonic2kk opened this issue 2 years ago • 20 comments

When most games are fullscreened using -f, while the framerate for the application remains high it has a constant stutter, for instance in Astroneer (361420) and DOOM Eternal (782330), using Proton 7.0-2 and Proton Experimental.

This is even worse for games that are fullscreened using Meta+F after launch. For Steam games the FPS is actually shown to decrease but the framerate does not match MangoHUD. Outside of Steam MangoHUD displays a stable framerate (for example gamescope -- mangohud glxgears and then using Meta+F to fullscreen it) but the game/application itself will be unbearably stuttery. Also, fullscreened applications do not scale up when the window is fullscreened. CPU usage does not seem to increase but my system fans spin up and become noticeably loud when Gamescope is running.

It renders several games I attempt to play with Gamescope unplayable. When not using Gamescope, games perform as expected. I can reproduce this issue on my PC and my 4700U laptop with the same operating system. It could be an issue with Mesa or KDE Plasma but I am unsure, as using Gamescope is the only instance where I encounter performance issues.

I have attached a video of the issue to further illustrate the issue when a game is fullscreened with Meta+F after launch. I am using the latest Gamescope version built from source, as of commit a515153a93f877d5e306a59568ba701120ac95c8.

https://user-images.githubusercontent.com/7917345/170173240-911a704d-6167-4a1e-ba14-3eae1d80ce0f.mp4

System Information:

  • OS: Arch Linux w/ KDE Plasma 5.24.5
  • Kernel: 5.17.9-zen1-1-zen (was also present before using Zen kernel)
  • CPU: Ryzen 3700X
  • GPU: RX 5700XT 8GB
  • Drivers: Mesa 22.1.0 (but was present prior to these this driver version)

sonic2kk avatar May 25 '22 03:05 sonic2kk

It appears the issue is more complex than I had initially reported, and I have updated the issue to correct my description of the behaviour after further testing. To summarise:

  • Games/Applications will stutter greatly when fullscreened using Meta+F after launch
  • Several games have a severe performance penalty when fullscreened using the -f flag at launch
  • Games play normally without Gamescope

Apologies for the confusion caused by my initial issue description. This should be more accurate.

sonic2kk avatar May 25 '22 04:05 sonic2kk

After further investigation, not all games started with -f have this problem, it is only when a game's "windowing" changes that this becomes a problem. For example if you change a game's resolution in-game, it starts to stutter very bad as shown in the video with glxgears being fullscreened. Likewise if a game shows something like a launcher or another smaller window such as a splash (which Astroneer) does, this causes a performance penalty. However if a game is launched in fullscreen and the game window does not change at all, there is no performance penalty.

There is some log output of note when closing a game opened in fullscreen mode:

xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_MAXIMIZED_VERT
xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_MAXIMIZED_HORZ
(EE) failed to read Wayland events: Broken pipe

I believe the error about a broken pipe has always been present, but the unhandled property change errors are definitely new and were not there when I used Gamescope before this issue started occuring.

sonic2kk avatar May 26 '22 18:05 sonic2kk

This problem can be slightly mitigated by running a game with Gamescope but not in fullscreen, and then fullscreening it using KDE Plasma's window options menu (Alt+F3 > More Options > Fullscreen). Performance is still noticeably worse when using Gamescope compared to running a game without Gamescope, similar (though less noticeable) than #319.

Perhaps this has more to do with KDE Plasma than Gamescope, as the issue seems to be changing with different Plasma versions.

sonic2kk avatar May 28 '22 23:05 sonic2kk

I'm seeing the same with Guild Wars 2 on Gnome 42 using the gamescope packaged with Fedora 36 (3.11.9). The further above ~30 FPS the game goes, the worse it seems to stutter. It acts as above, with the game initially launching in a "window", and then fullscreening itself. I also see all manner of unhandled property errors:

xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_DEMANDS_ATTENTION
xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_ABOVE
xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_MAXIMIZED_VERT
xwm: Unhandled NET_WM_STATE property change: _NET_WM_STATE_MAXIMIZED_HORZ

bniels707 avatar Jun 03 '22 01:06 bniels707

Games just black screen for me on fullscreen

LethalManBoob avatar Jun 04 '22 19:06 LethalManBoob

@LethalManBoob I have a similar experience, but gamescope freezes when I go to fullscreen. https://forums.developer.nvidia.com/t/515-48-07-gamescope-window-freezes-in-fullscreen/216489

I can reproduce that on Cinnamon and KDE Plasma, but not in Sway.

NoXPhasma avatar Jun 10 '22 10:06 NoXPhasma

@NoXPhasma

I have a similar experience, but gamescope freezes when I go to fullscreen.

Can confirm, but for me it's random. (KDE Plasma + nv) gamescope -- glxgears can withstand several Meta+F, and on next run it can freeze on first or second Meta+F.

Seems always ok for gamescope -f -- glxgears

pchome avatar Jun 10 '22 13:06 pchome

I was hoping this was maybe a KDE Wayland issue but on 5.25 it's still a problem, Gamescope has been unusable for some games for nearly a month :disappointed:

sonic2kk avatar Jun 19 '22 21:06 sonic2kk

I did some more tests, and on KDE Plasma there is an option for "Fullscreen" in a window's menu (Alt+F3 > More Options > Fullscreen". When pressing Meta+F with Gamescope, this option is selected. Using Meta+F still causes stuttering. However manually selecting this option when Gamescope is windowed will fullscreen the window (the same way Meta+F does, the Fullscreen box is ticked both times in the window menu) will not cause stuttering.

I'm not sure if this also works for games that have the framedrops when their window contents changes (such as games that show a splash dialog before the game loads, as this used to cause stuttering even in windowed mode). I wonder if this bug is caused by something changing in KDE, maybe Gamescopep isn't fullscreening properly when Meta+F is pressed?

EDIT: Not sure why the window closed or why this issue submitted early, very strange (I must've pressed some weird keyboard shortcut). Either way, apologies for that.

EDIT2: On further testing it seems like games that have a splash before they load can be worked around by fullscreening using KDE's window menu. So this is something related to how Meta+F works specifically I think?

sonic2kk avatar Jun 30 '22 23:06 sonic2kk

i've noticed similar behaviour on manjaro kde

I did some more tests, and on KDE Plasma there is an option for "Fullscreen" in a window's menu (Alt+F3 > More Options > Fullscreen". When pressing Meta+F with Gamescope, this option is selected. Using Meta+F still causes stuttering. However manually selecting this option when Gamescope is windowed will fullscreen the window (the same way Meta+F does, the Fullscreen box is ticked both times in the window menu) will not cause stuttering.

VoodaGod avatar Jul 04 '22 17:07 VoodaGod

@LethalManBoob I have a similar experience, but gamescope freezes when I go to fullscreen. https://forums.developer.nvidia.com/t/515-48-07-gamescope-window-freezes-in-fullscreen/216489

I can reproduce that on Cinnamon and KDE Plasma, but not in Sway.

Have you found a fix for this? I also have the same issue

Guttles avatar Jul 12 '22 21:07 Guttles

@Guttles I did not, this is still happening, over several Nvidia driver versions and gamescope updates.

NoXPhasma avatar Jul 12 '22 21:07 NoXPhasma

@Guttles it simply does not work in fullscreen on nvidia rn.

LethalManBoob avatar Jul 13 '22 10:07 LethalManBoob

@Guttles it simply does not work in fullscreen on nvidia rn.

That sucks, because it works well in windowed mode for me, its just less immersive.

Guttles avatar Jul 13 '22 15:07 Guttles

@Guttles It does also work in borderless window but it doesnt respect cursor focus so the dash to panel extention intellihide taskbar keeps showing up when the cursor moves down. so its worthless for me

LethalManBoob avatar Jul 13 '22 16:07 LethalManBoob

I was able to reproduce the behaviour I'm seeing with Gamescope outside of Gamescope, in Duckstation of all things. Very strange, I guess this is a KDE issue.

sonic2kk avatar Jul 14 '22 23:07 sonic2kk

as of last commit im getting this : gamescope: backend/multi/backend.c:192: wlr_multi_backend_add: Assertion `_multi && backend' failed. zsh: IOT instruction (core dumped) gamescope -- glxgears

LethalManBoob avatar Jul 15 '22 11:07 LethalManBoob

@LethalManBoob I have a similar experience, but gamescope freezes when I go to fullscreen. https://forums.developer.nvidia.com/t/515-48-07-gamescope-window-freezes-in-fullscreen/216489

I can reproduce that on Cinnamon and KDE Plasma, but not in Sway.

Can confirm, same GPU, OS, Driver, same blackscreen / freezes when trying to launch in Fullscreen or using Meta + F to fullscreen.

I did get it working in Cinnamon, somewhat @NoXPhasma. In the panel options at the top the option Auto-hide panel was set to Intelligently hide panel. With this and the steam launch options

gamescope -w 1920 -h 1080 -W 1920 -H 1080 -b -- mangohud %command%

the borderless window extends onto the full screen. If the panel is set to be always shown, then the borderless window is slightly smaller than the whole screen with the same launch options.

the-science-guy avatar Aug 01 '22 00:08 the-science-guy

I can reproduce that on Cinnamon and KDE Plasma, but not in Sway.

sway has a default keybind for fullscreen on Meta+F which has priority over the gamescope one. If you unbind it and let gamescope handle fullscreening it happens for me there too.

Same problem on labwc (a wlroots based compositor, so similar to sway I guess), gamescope Super+F stutter and not properly scaled, but the labwc native fullscreen shortcut works fine.

On weston it works fine as long as I don't resize the window, if I do and then fullscreen the stutter and placement/scaling issues appear.

To clarify, I don't have the issue when starting a game in fullscreen, just when using Super+F to toggle it.

Flrian avatar Aug 11 '22 20:08 Flrian

Extreme stuttering after a while (but not immediately) running gamescoped -f Back 4 Blood in Fedora Silverblue / Gnome 43. Frame time graph jumping all over the place.

ghost avatar Oct 13 '22 16:10 ghost

Why has this issue been closed @sonic2kk ? This is definitely still an issue for me.

Mushoz avatar May 22 '23 19:05 Mushoz

The issue is no longer an issue for me. I have thoroughly tested and the bugs are gone since a while back, currently I am using Plasma 5.27.5 and GameScope built from Git.

The issue was closed because the issue is solved for me and has been for a significant amount of time without regression.

sonic2kk avatar May 22 '23 19:05 sonic2kk