Don't want to see articles from a certain category? When logged in, go to your User Settings and adjust your feed in the Content Preferences section where you can block tags!
We do often include affiliate links to earn us some pennies. See more here.

Gamescope from Valve developer Pierre-Loup A. Griffais is described as a micro-compositor that can spoof a virtual screen with a desired resolution and refresh rate and control/resize the output as needed. It can fulfil the same role as a desktop compositor, but it can also run on top of your regular desktop like any other application.

One use-case for gamescope is dealing with compatibility problems. This includes games that have trouble getting into fullscreen, or do not support your native screen resolution, or multi monitor setups. In my case I could not get Dirt Rally to go into fullscreen on Wayland, but it worked perfectly though gamescope.

Another use-case is if you want to game on a 4K TV/monitor, which is not uncommon anymore, but your graphics card does not have the horsepower to push all of those pixels at a decent framerate, which is still true for all but the most expensive offerings out there. Normally you would have to lower your desktop resolution and/or let the game change the screen resolution. But then you depend on your monitors scaling capabilities, which are usually not that impressive, and you will most likely end up with a blurry image. Instead you could run your desktop at the native resolution and use gamescope to upscale the games.

Right now there are not that many options for scaling, but there is a very interesting one - integer scaling. This allows turning 1x1 pixels into 2x2 (or whatever whole number) boxes that produces a more crisp image. Here we have an unscaled reference image at 2560x1440, and two rendered at 1280x720 and scaled up to 2560x1440. You can see that normal scaling produces quite a blurry image, whereas integer scaling produces a more crisp, yet more jagged-looking image.

Lowering the rendering resolution may also allow for enabling more taxing image fidelity options like post-processing effects and anti-aliasing. I noticed that integer scaling is even useful with AA. Of course a lot of this is a question of taste and preference, so I'll let you be the judge of that. Just to clarify, the AA demonstrated here is an option of the game itself, not gamescope.

Program arguments used in this comparison are as follows.

Fullscreen integer scaling:

gamescope -w 1280 -h 720 -W 2560 -H 1440 -b -n -- %command%

Fullscreen "normal" scaling:

gamescope -w 1280 -h 720 -W 2560 -H 1440 -b -- %command%

Fullscreen native:

gamescope -w 2560 -h 1440 -W 2560 -H 1440 -b -- %command%

Gamescope can be found on GitHub under active development.

Article taken from GamingOnLinux.com.
Tags: Misc, Open Source
30 Likes
About the author -
author picture
Professional Linux user, software developer, and competitive shooting instructor.
See more from me
The comments on this article are closed.
All posts need to follow our rules. For users logged in: please hit the Report Flag icon on any post that breaks the rules or contains illegal / harmful content. Guest readers can email us for any issues.
20 comments

Samsai Nov 2, 2020
I imagine this should also help with games that don't quite understand how multi-monitor setups work. You can just cage them to a single-monitor compositor and force them to behave nicely.
Avehicle7887 Nov 2, 2020
This will come in handy for me with stubborn games which don't scale particularly well on ultrawide. Will give it a shot later this week :)
libgradev Nov 2, 2020
Useful, I'm currently using a second Xorg instance as the 'gaming destop' with a different WM, monitor config.
Linas Nov 2, 2020
View PC info
  • Supporter Plus
So would this help with old SDL games? When those go to full screen, they change the desktop resolution, which makes **** kwin re-shuffle all windows on all screens. At least for me, this is a major PITA
It should. Definitely worth a shot. Do you have an example of a game that does this?
Samsai Nov 2, 2020
So in the meantime I managed to compile it (they could at least provide some build instructions....). I wanted to try it on one of my favorites that has the FS issue, Einstein 2.0 (https://github.com/lksj/einstein-puzzle). But I do get an error "unsupported EGL Platform"
(Or is this not supposed to work outside of steam?)
That's a problem with your graphics card: accelerated Xwayland doesn't work on Nvidia thanks to Nvidia not conforming to standard.

From the repository:
It runs on Mesa+AMDGPU, and could be made to run on other Mesa/DRM drivers with minimal work. Can support NVIDIA if/when they support accelerated Xwayland.


Last edited by Samsai on 2 November 2020 at 12:28 pm UTC
Shmerl Nov 2, 2020
This is an interesting project, but why does it mention using XWayland instead of just Wayland? Sounds like it always relies on X?
minfaer Nov 2, 2020
This is an interesting project, but why does it mention using XWayland instead of just Wayland? Sounds like it always relies on X?

From the description on GitHub, I believe it always uses XWayland. Probably due to the fact that games tend to run in XWayland almost exclusively, I am not aware of any games running natively Wayland (among commercial games, that is).
Shmerl Nov 2, 2020
From the description on GitHub, I believe it always uses XWayland. Probably due to the fact that games tend to run in XWayland almost exclusively, I am not aware of any games running natively Wayland (among commercial games, that is).

I think any modern game shouldn't be using X, unless it somehow is coded with X directly? That's a bad practice. If it's using SDL and the like, it should work with Wayland directly, without X.


Last edited by Shmerl on 2 November 2020 at 2:58 pm UTC
BielFPs Nov 2, 2020
From the description on GitHub, I believe it always uses XWayland. Probably due to the fact that games tend to run in XWayland almost exclusively, I am not aware of any games running natively Wayland (among commercial games, that is).

This is an information, that personally I hope steam could inform us in the store page of the game. I would love to see if a (native) game can run through X.org / Xwayland or Wayland (or Both) in a specific field like the others tech info
dreamer_ Nov 2, 2020
I think any modern game shouldn't be using X, unless it somehow is coded with X directly? That's a bad practice. If it's using SDL and the like, it should work with Wayland directly, without X.

Unfortunately, it's not as easy :( Wayland is not enabled by default for SDL yet (users need to opt-in), and for good reason. Some Wayland compositors (Mutter-based) do not support Server Side Decoration extension (which is a requirement for SDL) - consequently, SDL Wayland Windows won't be resizable, have problems with going in/out fullscreen, etc. It's work in progress.
Shmerl Nov 2, 2020
Since Gamescope is its own compositor, it doesn't need to worry about Mutter.
Linas Nov 2, 2020
View PC info
  • Supporter Plus
I am pretty sure that Valve would never put anything about XOrg or Wayland on the store page. It's way too technical and is an implementation detail that users should really not care about. Whether it's native or Proton, XOrg or Wayland, it should just work. And it will, given a bit of time.
Shmerl Nov 2, 2020
Whether it's native or Proton, XOrg or Wayland, it should just work. And it will, given a bit of time.

Putting it on the store page shouldn't be an issue. Same goes if the game is using DosBox, ScummVM and etc.
minfaer Nov 2, 2020
Since Gamescope is its own compositor, it doesn't need to worry about Mutter.

Not quite, it acts as a nested compositor in the desktop usecase, so it is inside Mutter.

Edit: Typo


Last edited by minfaer on 2 November 2020 at 4:13 pm UTC
Shmerl Nov 2, 2020
Not quite, it acts as a nested compositor in the desktop usecase, so it is insider Mutter.

I mean it implements its own scaling and whatever needed. And can as well implement both server and client side decorations.
iskaputt Nov 2, 2020
Did anyone try this with a plain (tiling) window manager yet? I can't get it to work properly in DWM. Most things don't even start with `(EE) failed to read Wayland events: Broken pipe` and the one thing that does start (vkcube) doesn't use the expected resolution. Tried both current master and 3.7.


Last edited by iskaputt on 2 November 2020 at 6:24 pm UTC
Sir_Diealot Nov 2, 2020
Did anyone try this with a plain (tiling) window manager yet? I can't get it to work properly in DWM. Most things don't even start with `(EE) failed to read Wayland events: Broken pipe` and the one thing that does start (vkcube) doesn't use the expected resolution. Tried both current master and 3.7.

Oh I can run it in i3 alright.

I managed to get some newer games to run through Lutris so I'm not making a fundamental mistake. Example: Grim Dawn. That too is at least buggy. I only limited the framerate with -r 30, nothing else, and the result was that the mouse cursor was restricted to a part of the screen.

The real question for me is, does it work for old games? Those that could really benefit from scaling.
Take something like NOX as example, 640x480, DX 7? 8? 9?, made for Windows XP or something.
So far I couldn't get it to start (through Lutris). Same with LoM.

Scaling up old games would be the #1 use case for me.
scaine Nov 2, 2020
View PC info
  • Contributing Editor
  • Mega Supporter
I'm tempted to see if this helps 7 Days to Die performance. On OpenGL, at 4K on my 5700XT I'm lucky if I get 40fps. Luckily my system seems to like the Vulkan renderer which bumps me to 60fps (mostly...) but with this I could force the game's resolution back to 1920x1080, then use the integer scaling to view on the 4K desktop again?

That might be worth a shot, I reckon!
TheRiddick Nov 3, 2020
one more benefit to having a AMD GPU, (as I glare distastefully at my NVIDIA gpu)
dpanter Nov 6, 2020
with this I could force the game's resolution back to 1920x1080
There's nothing stopping you from doing that today, albeit without the integer scaling sweetness.

Forcing resolution in Unity games is fairly straightforward with launch options such as...
-screen-width 1920 -screen-height 1080
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.