Framerate limiting seems very broken in Wayland backend on Gnome session
Tested with tag 3.15.0 but present in every 3.14.x I tested as well. -o doesn't function at all, which I'm guessing is expected behavior under Wayland since there isn't a mechanism for the gamescope window to know it's out of focus. gamescope -r 30 -- vkcube does at least try to limit the framerate, but Mangoapp indicates an average framerate of 40fps with a very spiky frametime graph. When moving the cursor within the window, the framerate drops to 20fps with a flat frametime graph. With --backend sdl framerate limiting with -r and with -o work as expected. Additionally, gamescopectl debug_set_fps_limit 30 produces a proper 30fps limit with flat frametimes under the Wayland backend.
A possible clue is this line from the log:
[gamescope] [Info] xdg_backend: Changed refresh to: 60.000hz
Which doesn't appear when using the SDL backend or when using gamescopectl to set the framerate limit while running the Wayland backend.
Additionally, --framerate-limit simply hasn't worked in quite awhile, but I'm not sure whether that is intentional. Both gamescopectl debug_set_fps_limit and -r / -o seem to work in the manner gamescope --help indicates --framerate-limit is supposed to, eg: on a 60hz monitor gamescope -r 50 -- vkcube runs at 60fps, while gamescope -r 40 -- vkcube runs at 30fps. Is this the expected behavior? Has --framerate-limit been deprecated?
Tested on Ubuntu 24.04 with Gnome 46.2 and mesa 24.2.0~kisak2~n.
I'm seeing something similar in a KDE 6.x session (on Ubuntu 24.10) with tag 3.16.1. In my case, I can't use --backend sdl at all (because it looks like it didn't find any supported DRM formats), and gamescopectl debug_set_fps_limit 30 has no impact.
Bumping to say that I've got the exact same issue while attempting to launch Team Fortress 2 natively. I've tried both -r and --framerate-limit to apply limits, and unfortunately nothing seems to do the trick, the game still continues to spit out hundreds of frames per second.
I'm running under Plasmashell 6.4.5 as a Wayland session. Interestingly however, this only appears to be the case for Team Fortress 2. vkcube runs as you would expect.
I can confirm that I'm having this issue with gamescope-git version 9ac4c56b364c3a20b5165cb7997997abd8f7ab69 provided through chaotic nyx.
Games ran through gamescope do not respect --nested-refresh and continue to spew frames well above the predetermined limit. This happens when running games through wayland native drivers and xwayland while using proton. I have yet to test with native linux games.
I am also seeing this using CachyOS. I have both Wayland and X11 sessions of KDE installed and I see frame limiting while using X11, but not with Wayland. I was using Proton Experimental with my testing. My hardware is all AMD for reference.
I was playing Hunt Showdown and using the launch command gamescope -w 3440 -h 1440 -r 100 -f --force-grab-cursor -- %command%
Wayland I would see it regularly go over 100 fps and on X11 it properly limits. I at least have a work around but it does seem like frame limiting isn't working properly on Wayland.
Someone corrects me if I'm mistaken but I believe the -r option is used to set the refresh rate of the virtual display. I don't think it's meant to limit framerate in any way.
If you enable Vsync in game, it'll lock the framerate to the value specified in the -r flag.
There is a --framerate-limit flag though but I never managed to get it to work.
Edit = as per the documentation, the --framerate-limit flag is used a divisor of the refresh rate to set a fps limit, 0 being the default value meaning it is completely disabled, therefore, no framerate limiter.
Now I thought setting it at 1 would mean -r value / 1 = fps limit would be equal to -r value but that does not seem to work. In fact, no matter what value I put in that argument, it does absolutely nothing.
I have the feeling that the FPS limiter in SteamOS on the Steam Deck simply changes the refresh rate value (-r) and enabled Vsync, resulting in a locked framerate.
Again, not entirely sure that it's correct.
Sort of "fixed" it by loading mangohud after gamescope on the game instead of using mangoapp: gamescope -W 3840 -H 2160 -r 240 -f --force-grab-cursor -- mangohud MANGOHUD_CONFIG=fps_limit=60 %command%. Not recommended, but it worked on my case.