Difference between revisions of "Gamescope"

From Linux Gaming
Jump to navigation Jump to search
(Add usage information and change formatting)
m (Add references and change formatting)
 
Line 1: Line 1:
[https://github.com/ValveSoftware/gamescope Gamescope] is a [https://en.wikipedia.org/wiki/Compositing_window_manager compositor]. It creates a virtual desktop and can upscale a game window. This can be beneficial if it doesn't play nicely with your desktop. For example, if the window doesn't grab your mouse or if it breaks when loosing focus.
[https://github.com/ValveSoftware/gamescope Gamescope] is a [https://en.wikipedia.org/wiki/Compositing_window_manager compositor]. It creates a virtual desktop and can upscale a game window. This can be beneficial if it doesn't play nicely with your desktop, if the window doesn't grab your mouse or if it breaks when loosing focus.


== Setup ==
== Setup ==
Line 5: Line 5:


== Usage ==
== Usage ==
To run Gamescope with your game, you just have to append your binary path. So, if you use Wine from the command-line and want to limit a game to 30 FPS use <code>gamescope -r 30 -- wine game.exe</code>. While you can use the command prefix field on launchers like [[Lutris]] or [[Bottles]], Gamescope should have its own sections with multiple options available.
To run Gamescope with your game, you just have to append your binary path. So, if you use Wine from the command-line and want to limit a game to 30 FPS use <code>gamescope -r 30 -- wine game.exe</code><ref>https://github.com/ValveSoftware/gamescope#examples</ref>. While you can use the command prefix field on launchers like [[Lutris]] or [[Bottles]], Gamescope should have its own sections with multiple options available.


=== Keyboard shortcuts ===
=== Keyboard shortcuts<ref>https://github.com/ValveSoftware/gamescope#keyboard-shortcuts</ref> ===
* '''Super + F''': Toggle fullscreen
* '''Super + F''': Toggle fullscreen
* '''Super + N''': Toggle nearest neighbour filtering
* '''Super + N''': Toggle nearest neighbour filtering
Line 14: Line 14:
* '''Super + I''': Increase FSR sharpness by 1
* '''Super + I''': Increase FSR sharpness by 1
* '''Super + O''': Decrease FSR sharpness by 1
* '''Super + O''': Decrease FSR sharpness by 1
* '''Super + S''': Take screenshot (goes to <code>/tmp/gamescope_$DATE.png)</code>
* '''Super + S''': Take screenshot (goes to <code>/tmp/gamescope_$DATE.png</code>)
* '''Super + G''': Toggle keyboard grab
* '''Super + G''': Toggle keyboard grab


=== Upscaling ===
=== Upscaling ===
Gamescope can be used for upscaling with [[FSR - FidelityFX Super Resolution|AMD FidelityFX™ Super Resolution]] or NVIDIA Image Scaling: set <code>gamescope -F fsr --sharpness 4 -- %command%</code> or <code>gamescope -F nis --sharpness 4 -- %command%</code> as a command prefix. "4" is an example value, replace it by something between "0" and "20". This also works for native games and can also be used with another resolution: <code>gamescope -w 1920 -h 1080 -W 3840 -H 2160 -F nis --sharpness 4 -- game</code>.
Gamescope can be used for upscaling with [[FSR - FidelityFX Super Resolution|AMD FidelityFX™ Super Resolution]] or NVIDIA Image Scaling: set <code>gamescope -F fsr --sharpness 4 -- %command%</code> or <code>gamescope -F nis --sharpness 4 -- %command%</code> as a command prefix. "4" is an example value, replace it by something between "0" and "20". This also works for native games and can also be used with another resolution: <code>gamescope -w 1920 -h 1080 -W 3840 -H 2160 -F nis --sharpness 4 -- game</code><ref>https://wiki.archlinux.org/title/Gamescope#Upscaling</ref>.


=== Downsampling ===
=== Downsampling ===
Line 24: Line 24:


== Troubleshooting ==
== Troubleshooting ==
* Try  running <code>gamescope --rt -r <desired_framerate> --immediate-flips -- %command%</code>, where <code><desired_framerate></code> is a number, if you experience stuttering and lag.
* If you experience stuttering and lag, try running <code>gamescope --rt -r <desired_framerate> --immediate-flips -- %command%</code> where <code><desired_framerate></code> is a number.
* Some games have issues like video playblack or black/white screens when the environment variable <code>ENABLE_GAMESCOPE_WSI</code> is set to "1": use <code>ENABLE_GAMESCOPE_WSI=0</code> to fix them.
* Some games have issues like video playblack or black/white screens when the environment variable <code>ENABLE_GAMESCOPE_WSI</code> is set to "1": use <code>ENABLE_GAMESCOPE_WSI=0</code> to fix them<ref>https://github.com/ValveSoftware/gamescope/issues/1182</ref>.
* On GNOME, [https://github.com/ValveSoftware/gamescope/issues/424 shortcuts might not work] but it can be fixed by unchecking the "Gamescope" option in the Lutris settings and using the command prefix field.
* Shortcuts might not work on GNOME<ref>https://github.com/ValveSoftware/gamescope/issues/424</ref> but they can be fixed by unchecking the "Gamescope" option in the Lutris settings and using the command prefix field.
* If you run a game from Steam with Gamescope, you could also [https://wiki.archlinux.org/title/Gamescope#Launching_gamescope_from_Steam,_stuttering_after_~24_minutes_(Gamescope_Lag_Bomb) experience stuttering after 30 minutes].  
* If you run a game from Steam with Gamescope, you could experience stuttering after 30 minutes<ref>https://wiki.archlinux.org/title/Gamescope#Launching_gamescope_from_Steam,_stuttering_after_~24_minutes_(Gamescope_Lag_Bomb)</ref>.  
* If you need to use MangoHud with Gamescope, don't chain both commands but use the <code>--mangoapp</code> argument with Gamescope.
* If you need to use MangoHud with Gamescope, don't chain both commands but use the <code>--mangoapp</code> argument with Gamescope<ref>https://github.com/flightlessmango/MangoHud#gamescope</ref>.

Latest revision as of 05:45, 12 May 2025

Gamescope is a compositor. It creates a virtual desktop and can upscale a game window. This can be beneficial if it doesn't play nicely with your desktop, if the window doesn't grab your mouse or if it breaks when loosing focus.

Setup

You can usually install Gamescope from your distribution official repository. To check if it's installed, run gamescope --help in a terminal emulator. To get a smooth gaming experience, run sudo setcap 'CAP_SYS_NICE=eip' $(which gamescope)[1].

Usage

To run Gamescope with your game, you just have to append your binary path. So, if you use Wine from the command-line and want to limit a game to 30 FPS use gamescope -r 30 -- wine game.exe[2]. While you can use the command prefix field on launchers like Lutris or Bottles, Gamescope should have its own sections with multiple options available.

Keyboard shortcuts[3]

  • Super + F: Toggle fullscreen
  • Super + N: Toggle nearest neighbour filtering
  • Super + U: Toggle FSR upscaling
  • Super + Y: Toggle NIS upscaling
  • Super + I: Increase FSR sharpness by 1
  • Super + O: Decrease FSR sharpness by 1
  • Super + S: Take screenshot (goes to /tmp/gamescope_$DATE.png)
  • Super + G: Toggle keyboard grab

Upscaling

Gamescope can be used for upscaling with AMD FidelityFX™ Super Resolution or NVIDIA Image Scaling: set gamescope -F fsr --sharpness 4 -- %command% or gamescope -F nis --sharpness 4 -- %command% as a command prefix. "4" is an example value, replace it by something between "0" and "20". This also works for native games and can also be used with another resolution: gamescope -w 1920 -h 1080 -W 3840 -H 2160 -F nis --sharpness 4 -- game[4].

Downsampling

You can use Gamescope for downsampling too. For example, use gamescope -f -w 3840 -h 2160 -- %command% as a command prefix, to downscale from 4K. The same can be achieved in Lutris by enabling Gamescope and setting "3840x2160" as resolution.

Troubleshooting

  • If you experience stuttering and lag, try running gamescope --rt -r <desired_framerate> --immediate-flips -- %command% where <desired_framerate> is a number.
  • Some games have issues like video playblack or black/white screens when the environment variable ENABLE_GAMESCOPE_WSI is set to "1": use ENABLE_GAMESCOPE_WSI=0 to fix them[5].
  • Shortcuts might not work on GNOME[6] but they can be fixed by unchecking the "Gamescope" option in the Lutris settings and using the command prefix field.
  • If you run a game from Steam with Gamescope, you could experience stuttering after 30 minutes[7].
  • If you need to use MangoHud with Gamescope, don't chain both commands but use the --mangoapp argument with Gamescope[8].