As we highlighted in our initial XDC 2020 article, one of the presentations this year was from a Valve developer who is working on Gamescope.
Gamescope, something we revealed before across two articles (#1, #2), was started by Valve dev Pierre-Loup Griffais, who is one of the most prominent Linux people at Valve after joining them in 2012. Griffais has also been heavily involved in Valve's various external open source contracting, with things like ACO for Mesa and more.
Created as an evolution of steamcompmgr, the original SteamOS session compositing window manager but it's come a long way since then. Being a rewrite to be based on Wayland (and XWayland for what doesn't work with Wayland directly) rather than GLX, giving them much more direct control over everything with Vulkan. From the talk, Griffais mentioned how they began with using wlroots (a modular Wayland compositor library), from there they hacked away at it and merged it with a bunch of what was in steamcompmgr.
One of the aims here ended up being to have it work on a normal desktop, not just in a single-screen / single-activity like SteamOS did with steamcompmgr. The idea is that with Gamescope the game cannot interfere with your Linux desktop, while you also get more direct control over it for things like input, resolution, refresh rate and more. Griffais showed an example of Portal not working well with an Ultrawide monitor, and then when run with Gamescope at least the rendering was correct due to the sandboxing. Example below, launched as normal and then launched with Gamescope.
Another useful feature of Gamescope is that you can set it up so if a Gamescope window is out of focus, it throttles it down so you can interact properly with your desktop without the game sucking away all your juice. Something that would be seriously useful for lower powered devices / laptops and even on a high-powered PC there's certain games that bring your entire PC to a crawl when you ALT+TAB - so there's lots of uses there.
Plenty of work is still left to do, various polishing features still to be done but Griffais thinks it could be quite useful with a nice UI to go along with it. Lots more was talked about during the short presentation, it's well worth a watch if you're interested in one possible way of how games will be run on Linux in future.
You can see the video below, which begins at around 7:08:17. Our embed video should begin there for you to make it easy.
Direct Link
Quite an exciting project that will currently work with AMD drivers, and Intel is probably "not too far off". Eventually, once NVIDIA actually decide how they will be properly supporting Wayland and XWayland it might work there too.
Learn more about Gamescope on GitHub.
Very excited about how this will progress.
The Neptunia games (thanks again to GoL for the bundle-key), are fixed at a maximum resolution of 1080p, which Proton effortlessly scales up just fine to 1440p. So generally no worries.
However, if you take a screenshot from Steam (F12-key) the resulting screenshot is of the upscaled version which makes it a bit blurry. Running the game through gamescope I ended up with 2 screenshots after the session, one of the final upscaled version and one in 1080p.
If this is the intended behaviour or not, I don't know. But I very much appreciate the choice given me as to which I want to keep.
I love that Valve is doing this stuff, but it bothers me that I don't know their motivation!Development of linux gaming is a moderately profitable hobby for them that hedges their platform dependencies. That's it.
"Sure I'd love to talk about Wayland"
I really hope that's how it actually went down. Seems like it has been well received (and I have no idea if there is any "bad blood" between X and Wayland devs, hopefully there is a unified "make Linux better" camaraderie).
I have no idea if there is any "bad blood" between X and Wayland devs
The X devs turned into Wayland devs; no one is really working on X11 any more.
Seems as if X11 has been on Life Support for the last several years (5? more?), though they are still actively fixing bugs and polishing some features. Wayland needed and still does need much more work to get to the point where it can finally substitute X completely (getting there, though). Some times I see Wayland catching up to the X features in the same way as Wine is catching up to Windows (though much, much faster, LOL! )I have no idea if there is any "bad blood" between X and Wayland devs
The X devs turned into Wayland devs; no one is really working on X11 any more.
[Some times I see Wayland catching up to the X features
I think most of the "catching up" the last couple years has just been about improving XWayland, i.e. backwards compatibility. It seems Wayland already has features that X11 never will. But since I'm playing games on Nvidia drivers, I'm still running X11! Eventually, enough games will be using SDL2 and thus run on Wayland natively, and XWayland support for Nvidia drivers will have improved enough.
Gave this a try last night with the old Touhou games, which can be peculiar about screen resolution, and it Just Worked™!I tried compiling Gamescope and kept getting errors. How did you get it working? I wasn't able to find any mention of dependencies or installation instructions on the GitHub page.
I have no idea if there is any "bad blood" between X and Wayland devs
The X devs turned into Wayland devs; no one is really working on X11 any more.
Well, it makes a lot of sense if you just think Wayland = X12.
Gave this a try last night with the old Touhou games, which can be peculiar about screen resolution, and it Just Worked™!I tried compiling Gamescope and kept getting errors. How did you get it working? I wasn't able to find any mention of dependencies or installation instructions on the GitHub page.
Had to install a few development packages to get it going but at least all are in the Fedora repos, not sure what the Debian/Ubuntu naming for them are so you might have to adjust accordingly.
The deps are listed in meson.build, what you are interested in are lines 24-46, written in this fashion:
dep_x11 = dependency('x11')
The name in quotes are the pkg-config name of the package you want.
Then it is just a matter of compiling the meson project thusly:
$ mkdir build
$ meson setup build
$ meson compile -C build
$ sudo meson install
The install command requires sudo, if you want to install it anywhere else I refer you to the meson documentation for setting prefix.
I will look into setting up a basic spec file to generate RPM packages tomorrow, and I can take a look at a debian build using the power of virtual machines, though I don't know how to make deb packages, I should at least be able to make some compile instructions.
Had to install a few development packages to get it going but at least all are in the Fedora repos, not sure what the Debian/Ubuntu naming for them are so you might have to adjust accordingly.Thanks for that! I'll give it a go after I'm done with work for the day. Didn't realize the dependencies were listed in there. So much I don't know even after using linux for nearly twenty years.
The deps are listed in meson.build, what you are interested in are lines 24-46, written in this fashion:
dep_x11 = dependency('x11')
The name in quotes are the pkg-config name of the package you want.
Then it is just a matter of compiling the meson project thusly:
$ mkdir build
$ meson setup build
$ meson compile -C build
$ sudo meson install
The install command requires sudo, if you want to install it anywhere else I refer you to the meson documentation for setting prefix.
I will look into setting up a basic spec file to generate RPM packages tomorrow, and I can take a look at a debian build using the power of virtual machines, though I don't know how to make deb packages, I should at least be able to make some compile instructions.
Gave this a try last night with the old Touhou games, which can be peculiar about screen resolution, and it Just Worked™!I tried compiling Gamescope and kept getting errors. How did you get it working? I wasn't able to find any mention of dependencies or installation instructions on the GitHub page.
Had to install a few development packages to get it going but at least all are in the Fedora repos, not sure what the Debian/Ubuntu naming for them are so you might have to adjust accordingly.
The deps are listed in meson.build, what you are interested in are lines 24-46, written in this fashion:
dep_x11 = dependency('x11')
The name in quotes are the pkg-config name of the package you want.
Then it is just a matter of compiling the meson project thusly:
$ mkdir build
$ meson setup build
$ meson compile -C build
$ sudo meson install
The install command requires sudo, if you want to install it anywhere else I refer you to the meson documentation for setting prefix.
I will look into setting up a basic spec file to generate RPM packages tomorrow, and I can take a look at a debian build using the power of virtual machines, though I don't know how to make deb packages, I should at least be able to make some compile instructions.
Just a short update for anyone waiting; I didn't get as much free time this weekend as I was hoping to get so this will take a little longer than expected.
Standard disclaimer applies to this, no warrenty, make sure you know what you are doing etc.
On a newly installed and fully updated Fedora 32:
sudo dnf install meson gcc-g++ cmake libcap-devel gslang-devel "pkgconfig(x11)" "pkgconfig(sdl2)" "pkgconfig(vulkan)" "pkgconfig(libinput)" "pkgconfig(xdamage)" "pkgconfig(xcomposite)" "pkgconfig(xrender" "pkgconfig(xext)" "pkgconfig(xxf86vm)" "pkgconfig(xtst)" "pkgconfig(pixman-1)" "pkgconfig(libdrm)" "pkgconfig(wayland-server)" "pkgconfig(wayland-protocols)" "pkgconfig(xkbcommon)" "pkgconfig(gbm)" "pkgconfig(libudev)"
(the quotation marks have to be like that in order to satisfy both the shell and dnf)
On a newly installed and fully updated Ubuntu 20.4 (focal)
sudo apt install build-essential git meson cmake libx11-dev libxdamage-dev libxcomposite-dev libxrender-dev libxxf86vm-dev libxtst-dev libpixman-1-dev libdrm-dev libvulkan-dev libwayland-dev wayland-protocols libinput-dev libxkbcommon-dev libcap-dev libsdl2-dev libgbm-dev glslang-tools libxcbcomposite0-dev libxcm-icccm4-dev libx11-xcb-dev libxcb-xinput-dev libsystemd-dev
Focal does not package an up-to-date version of meson so we need to install that separately from apt
$ sudo apt install python3-pip
$ pip3 install --user -I meson
Check which meson the system picks for you, if it isn't the one we just installed you probably don't have ~/.local/bin in your path, just log out and back in again and it should pick up this path per ~/.profile
$ which meson
/home/<user>/.local/bin/meson
$ meson --version
0.55.3 (or newer)
Build instructions (common)
$ git clone --recurse-submodules https://github.com/Plagman/gamescope
$ cd gamescope
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install
Edit:
Updating works like this
$ cd gamesope
$ rm -rf build
$ git pull
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install
Last edited by Cloversheen on 22 September 2020 at 12:07 pm UTC
So, if I understand it correctly, all this hassle is to get rid of micro freezes and tearing, i.e. to sync between GPU and app layer so that monitor driver could handle sync with the screen, right? I think there was a talk about limits of X from Ryan C. Gordon (Icculus) few years back that mentioned something like that is badly needed. So, yeah, finally. Way to go Pierre.
It is also for dealing with multi-monitor and different resolutions. Some games don't deal well with a multi-monitor setup and make their own (sometimes wrong) decision about which screen you want it to use and refuse to move. And sometimes they just don't want to work with certain resolutions etc. Previously you could use something like xpra for it, but doing it this way means you can essentially optimize it for the very specific case of games.
And as you said, "Way to go Pierre".
Ok... *phew* I think I got it.Thanks for taking the time to put this together for internet strangers. Hopefully others see your post and it isn't buried here.
Standard disclaimer applies to this, no warrenty, make sure you know what you are doing etc.
On a newly installed and fully updated Fedora 32:
sudo dnf install meson gcc-g++ cmake libcap-devel gslang-devel "pkgconfig(x11)" "pkgconfig(sdl2)" "pkgconfig(vulkan)" "pkgconfig(libinput)" "pkgconfig(xdamage)" "pkgconfig(xcomposite)" "pkgconfig(xrender" "pkgconfig(xext)" "pkgconfig(xxf86vm)" "pkgconfig(xtst)" "pkgconfig(pixman-1)" "pkgconfig(libdrm)" "pkgconfig(wayland-server)" "pkgconfig(wayland-protocols)" "pkgconfig(xkbcommon)" "pkgconfig(gbm)" "pkgconfig(libudev)"
(the quotation marks have to be like that in order to satisfy both the shell and dnf)
On a newly installed and fully updated Ubuntu 20.4 (focal)
sudo apt install build-essential git meson cmake libx11-dev libxdamage-dev libxcomposite-dev libxrender-dev libxxf86vm-dev libxtst-dev libpixman-1-dev libdrm-dev libvulkan-dev libwayland-dev wayland-protocols libinput-dev libxkbcommon-dev libcap-dev libsdl2-dev libgbm-dev glslang-tools libxcbcomposite0-dev libxcm-icccm4-dev libx11-xcb-dev libxcb-xinput-dev libsystemd-dev
Focal does not package an up-to-date version of meson so we need to install that separately from apt
$ sudo apt install python3-pip
$ pip3 install --user -I meson
Check which meson the system picks for you, if it isn't the one we just installed you probably don't have ~/.local/bin in your path, just log out and back in again and it should pick up this path per ~/.profile
$ which meson
/home/<user>/.local/bin/meson
$ meson --version
0.55.3 (or newer)
Build instructions (common)
$ git clone --recurse-submodules https://github.com/Plagman/gamescope
$ cd gamescope
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install
Edit:
Updating works like this
$ cd gamesope
$ rm -rf build
$ git pull
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install
I got it up and running and it makes CS:GO (and a couple Proton titles) much better looking at 1920x1080 on my ultra wide monitor. I'm guessing it'll help people with multiple monitors even more. It's a pretty sweet tool.
Ok... *phew* I think I got it.Thanks for taking the time to put this together for internet strangers. Hopefully others see your post and it isn't buried here.
Standard disclaimer applies to this, no warrenty, make sure you know what you are doing etc.
On a newly installed and fully updated Fedora 32:
sudo dnf install meson gcc-g++ cmake libcap-devel gslang-devel "pkgconfig(x11)" "pkgconfig(sdl2)" "pkgconfig(vulkan)" "pkgconfig(libinput)" "pkgconfig(xdamage)" "pkgconfig(xcomposite)" "pkgconfig(xrender" "pkgconfig(xext)" "pkgconfig(xxf86vm)" "pkgconfig(xtst)" "pkgconfig(pixman-1)" "pkgconfig(libdrm)" "pkgconfig(wayland-server)" "pkgconfig(wayland-protocols)" "pkgconfig(xkbcommon)" "pkgconfig(gbm)" "pkgconfig(libudev)"
(the quotation marks have to be like that in order to satisfy both the shell and dnf)
On a newly installed and fully updated Ubuntu 20.4 (focal)
sudo apt install build-essential git meson cmake libx11-dev libxdamage-dev libxcomposite-dev libxrender-dev libxxf86vm-dev libxtst-dev libpixman-1-dev libdrm-dev libvulkan-dev libwayland-dev wayland-protocols libinput-dev libxkbcommon-dev libcap-dev libsdl2-dev libgbm-dev glslang-tools libxcbcomposite0-dev libxcm-icccm4-dev libx11-xcb-dev libxcb-xinput-dev libsystemd-dev
Focal does not package an up-to-date version of meson so we need to install that separately from apt
$ sudo apt install python3-pip
$ pip3 install --user -I meson
Check which meson the system picks for you, if it isn't the one we just installed you probably don't have ~/.local/bin in your path, just log out and back in again and it should pick up this path per ~/.profile
$ which meson
/home/<user>/.local/bin/meson
$ meson --version
0.55.3 (or newer)
Build instructions (common)
$ git clone --recurse-submodules https://github.com/Plagman/gamescope
$ cd gamescope
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install
Edit:
Updating works like this
$ cd gamesope
$ rm -rf build
$ git pull
$ mkdir build
$ meson setup build
$ cd build
$ meson compile
$ sudo meson install
I got it up and running and it makes CS:GO (and a couple Proton titles) much better looking at 1920x1080 on my ultra wide monitor. I'm guessing it'll help people with multiple monitors even more. It's a pretty sweet tool.
Happy it was of use! I'll see about sending a pull request upstream where it will be more useful.
See more from me