Skip to content

steamcompmgr

professorkaos64 edited this page Aug 16, 2016 · 10 revisions

Table of Contents generated with DocToc

About

steamcompmgr is the dedicated SteamOS compositing and window manager for the default "steamos-session" Steam Machines / Steamboxes boot into. It talks to the X server, as does the Steam UI. It is the same compositor/session which handles launching your games. "Desktop mode," on the contrary, runs "gnome-session," the display session for the Gnome 3 environment, and is only conjuired upon exiting to the desktop. They are not one in the same. steamcompmgr runs as little as possible, keeping Steam, and by extension, the game itself, front and center.

Information has also been added to the following Wikipedia pages. Feel free to correct/edit them.

Warning:
The information in this article is not officially sanctioned, nor written by Valve. Information is subject to change.

Getting technical

LWN explains things fairly well here:

"The games also talk to the X server, but there is an LD_PRELOAD library that intercepts mode-switching calls. A game might make an RandR call to change the mode, and the intercepting library just "says yes and does nothing". It records the information for use in calculating the appropriate scaling, however.

Steamcompmgr is based on the original X compositing manager, which is some "really bad X code", he said. It is GL-based, which ensures VBLANK synchronization and provides the fastest drawing path. Window management is integrated into the compositing manager, which is common for X environments. There is just one full-screen application window that is scaled to fit the screen (with letterboxing or pillarboxing to preserve the aspect ratio), with the Steam UI overlay optionally on top of that. In many ways, SteamOS is simply using the X Window System to "do what it supposed to do", he said.

Many games use Simple DirectMedia Layer (SDL), which creates two windows, one application window centered inside the other, full-screen window. Steamcompmgr digs the second window out from within the first and uses that directly.

In order to fake mode switches, the LD_PRELOAD library hooks a bunch of X calls, which simply pretend that they worked. It also drops certain "fullscreen" input events so that steamcompmgr does not get confused. It uses the "zoom lock" in the XF86VidMode extension to prevent applications that somehow evade the LD_PRELOAD from causing mode switches.

The application output is scaled as needed in the compositor to make it fill the screen. The overlay is not scaled, however, so it will still be high-resolution even if the game itself has been scaled.

The cursor may also need scaling. To do that, the X server cursor is hidden and the compositor fetches the cursor image from the server. It then paints a scaled version into the display. Cursor position scaling also has to be done. The position will get "warped" if it ever goes outside the display boundaries. In addition, applications are prevented from grabbing the cursor themselves."1

Display resolutions

Community members agree that steamcompmgr, running the Steam Client under BPM, renders at 1080p. While in desktop mode, due to the separate display manager, you have to understand that you are then running a different display manager / compositor (gnome-session on Mutter) than BPM/Steam Client's (steamos-session on steamcompmgr).

Reddit user /u/ChaosDent notes:

The SteamOS compositor won't let games set the display mode. They do render at whatever resolution you tell them to and the compositor scales them to fit the screen. This is helpful when your target environment is TVs that may not support many display modes or may flicker badly when switching.

According to this post on the steam forums, you can edit /usr/bin/steamos-session to add an xrandr command that sets your display mode. It won't change the target resolution of BPM from 1080p, but it will let games rendering at 1440p display at their full pixel resolution.

I tested this out on my 4k TV, and it works as described. I switched it back to the default though since I can only get 30 FPS out of 4k with my hardware, and it probably wouldn't be powerful enough to handle high performing games at 4k anyway.2

So, what's really up with my game resolution?

LWN's article sums this up pretty well:

It turns out that for the living room, "mode switching is bad". A TV can go black for five or ten seconds if you switch modes. That is only getting worse with modern video links, Packard said. Also, the monitor may not support the mode that the game wants, especially if it wants a large mode. To combat that problem, SteamOS never changes the video mode, it simply scales the game to fit the size of the output display.

Display sizing

SteamOS BPM handles sizing via a "scaling" adjustment in the system settings > display area. Resolutions above 1080p seem to be downsized to 1080p @ 16:9 aspect. This means, 16:10 aspects may look strange.

Additional Media / Resources

References

  1. X and SteamOS (LWN)
  2. how do I run a game at 1440p on SteamOS ? (Reddit)
Clone this wiki locally