Check out our Monthly Survey Page to see what our users are running.

Testing integer scaling with Valve's gamescope micro-compositor for Linux

By - | Views: 19,566

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, Who?
We do often include affiliate links to earn us some pennies. We are currently affiliated with GOG, Humble Store and Paradox Interactive. See more here.
About the author -
author picture
Professional Linux user, software developer, and competitive shooting instructor.
See more from me
23 comments
Page: 1/3»
  Go to:

Samsai 2 Nov
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.
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 2 Nov
Useful, I'm currently using a second Xorg instance as the 'gaming destop' with a different WM, monitor config.
raneon 2 Nov
I've tested gamescope quite a lot in the last weeks. It works quite well, there are just some input bugs on Wayland (Plasma) and mangohud sometimes doesn't work on Vulkan games. But I believe this will become very useful and I like that you can limit the refresh rate too.
Pit 2 Nov
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
Linas 2 Nov
View PC info
  • Supporter Plus
Quoting: PitSo 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?
Pit 2 Nov
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?)
Samsai 2 Nov
Quoting: PitSo 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:
QuoteIt 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 2 Nov
This is an interesting project, but why does it mention using XWayland instead of just Wayland? Sounds like it always relies on X?
minfaer 2 Nov
Quoting: ShmerlThis 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).
While you're here, please consider supporting GamingOnLinux on:

Patreon, Liberapay or PayPal Donation.

We have no adverts, no paywalls, no timed exclusive articles. Just 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!
Login / Register

Or login with...
Sign in with Steam Sign in with Twitter Sign in with Google
Social logins require cookies to stay logged in.

Livestreams & Videos
Community Livestreams