|
|
Log in / Subscribe / Register

X and SteamOS

By Jake Edge
September 17, 2014

LinuxCon North America

In a talk entitled "SteamOS Magic", longtime X developer Keith Packard looked at the new Linux "distribution" and the effort to turn the Linux desktop into a gaming console. It turns out that, with a fairly small amount of code, Steam and SteamOS creator, Valve, was able to take the existing X-based desktop and turn it into a "living-room experience". He gave the talk at LinuxCon North America in Chicago on August 21.

Packard's employer, Intel, has been "working closely with Valve" on graphics issues for some time now. Valve's interest is to see more Linux gaming and, to that end, the Steam game-management client was ported to Linux with Intel's help. Packard said that Valve was "happy to work with us", since Intel has a "nice, compliant OpenGL" running on its GPUs.

[Keith Packard]

Steam and SteamOS

From the perspective of a game developer, there is not much difference between Steam and SteamOS. The latter is a way to create a new console, without developing new hardware. Instead, a standard PC platform is used, which might sound familiar. The architecture is similar to that of the Xbox, he said. SteamOS is meant to support the existing catalog of Steam games, many of which now run on Linux.

There are three basic elements to the Steam experience. First, there is the "enormous library of games" that have been ported to Steam and are tested to ensure they run well on Steam. There is a store to sell hats and other merchandise. Finally, there is a social network in Steam that uses both voice and text integrated into the game. "Even gamers have friends", Packard said with a chuckle.

The user interface revolves around the "Steam overlay", which is an in-game interface that "sits on top of your game". It is "amazing" that the overlay works at all, he said. To make it work, it redirects the internals of OpenGL to show the overlay. He is not really a video gamer (instead preferring a different game that "involves Emacs and typing"), though his children are, so he has seen the overlay in action both in testing and with them.

SteamOS is based on Debian Linux, with the standard X Window System on top of it. There are a number of customizations, as well as the SteamOS compositing manager (steamcompmgr). There is also "a long list of kluges" that make X work for SteamOS, he said.

Steam and SteamOS use essentially the same software, but provide a different experience for users, which embodies the difference between the desktop and console worlds. On the desktop, there may be many applications running on multiple monitors, with desktop widgets, icons, menus, and so forth. On a console, there is just one full-screen application. Any system UI in a console is either an overlay, as in Steam, or simply replaces the game entirely.

The ecosystems for the desktop and console are quite different as well. Developers focus on the newest CPU/GPU combinations for the desktop, typically developing on pre-release hardware and targeting future hardware configurations. Desktop games will tolerate a wide range of systems, with configurable rendering options and output sizes. The console ecosystem is more homogeneous, with the same CPU, GPU, monitor size, and basic input devices on every system. It also features limited configuration, no screen-size changes, and few rendering options.

So the "SteamOS challenge" is to take a desktop operating system and window system, add in desktop-oriented games, and run it all on desktop hardware—all while providing a living-room experience, Packard said.

Enter X

X makes for a good user experience (UX) toolkit because it focuses on "mechanism, not policy", he said. There is no built-in UX and there are hooks that can be used to design any UX, such as external window management and external compositing. In addition, of course, the source is available to be hacked up in whatever way is needed.

The SteamOS UX has two modes. "Desktop mode" is a standard GNOME desktop running the Steam client. "Big picture mode" uses the SteamOS Console UX, which is what the rest of the talk would be covering, he said.

Desktop computers have keyboards, but consoles have controllers. In addition, desktop games expect to get their input from a keyboard and mouse. So Valve built a custom, programmable controller that looks like a keyboard and mouse to the game. The user sees and interacts with a controller, though, that maps various buttons and other controls to keyboard and mouse events.

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.

UI components

SteamOS has several different UI components, starting with an X server that has some "custom modifications". There is also the steamcompmgr, which is a custom compositing and window manager. It talks to the X server, as does the Steam UI, which appears to be the same as the desktop version, though there is no source available for that piece. The Steam UI is a proprietary piece of code that is "watching everything you do", he said, which might be a bit worrisome for some.

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.

Some implementation details

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.

Future

There are two separate features that are likely to lead to future work in X. Handling the cursor scaling in the server, rather than having to do it in the compositor is one. Another is handling applications that are larger than the screen. Packard presented several possibilities for supporting these features in X.

"Hack number one" would be to add a "mouse proxy window" that would redirect and scale mouse events from one window to another. That would work for both windowed and full-screen mode, and have no impact on the output path, but it might be hard to position menus and other pop-up windows correctly.

Another option would be to run the game within a nested X server instance. It would be easy to implement with Xephyr, he said, and not require any server changes. But inter-client communication (to, say, cut and paste between client applications) would be hard to do and there is some potential for added latency on input and output.

Finally, there is an RandR-based screen scaling option. It has several advantages, including that there would be no issues with window and input positions, but there are some problems as well. For one thing, the code to do the output scaling would need to be changed to allow the compositing manager to do it, rather than being done only by the X server, as it is today. Also, the existing code does an unnecessary mode switch even when the mode doesn't need to change.

In answer to a question, Packard said that Valve's code has been released, but not proposed for upstream inclusion. "Their requirements are useful", but not the implementation.

Packard wrapped up by noting that SteamOS shows "how easy it was" to take an existing Linux desktop, add a bit of code, and turn it into a living-room, console experience. We will have to wait and see how successful it is in the market, however.

[I would like to thank the Linux Foundation for travel assistance to Chicago for LinuxCon North America.]

Index entries for this article
ConferenceLinuxCon North America/2014


to post comments

X and SteamOS

Posted Sep 17, 2014 19:42 UTC (Wed) by jonquark (guest, #45554) [Link] (16 responses)

Was a Wayland-based future for SteamOS mentioned in the talk/questions? I'd be interested to know if they were already talking about using it (it works very nicely on my phone which is a similar, one app full screen type environment).

X and SteamOS

Posted Sep 17, 2014 19:45 UTC (Wed) by Plagman (guest, #98902) [Link] (15 responses)

Switching to Wayland is addressed by one of the audience questions from this presentation:

https://www.youtube.com/watch?feature=player_detailpage&...

Alternate link:

http://meetings-archive.debian.net/Public/debian-meetings...

X and SteamOS

Posted Sep 17, 2014 19:57 UTC (Wed) by wahern (subscriber, #37304) [Link] (1 responses)

Here's a better link

https://www.youtube.com/watch?v=gWaG9hOvNn0#t=1887

It starts at the 31:27 mark, which is when the question is asked.

Short story (according to my interpretation): Wayland doesn't look interesting yet. Steam is focused on OpenGL, so Wayland doesn't bring much to the table as far as features. And hundreds of games depend on X, so if the X-compatibility isn't good enough then it's just needless headache.

X and SteamOS

Posted Sep 19, 2014 3:20 UTC (Fri) by liam (guest, #84133) [Link]

The more concerning part is that he seems to be saying that they are now wedded to X behaviors.

X and SteamOS

Posted Sep 17, 2014 20:13 UTC (Wed) by jonquark (guest, #45554) [Link] (12 responses)

Thanks. Questions is at 31:30. The speakers take is that Wayland won't give them much as they are so OpenGL focussed and has the potential to break their existing games. (So we're unlikely to see a Wayland-SteamOS in the very near future)

X and SteamOS

Posted Sep 17, 2014 21:04 UTC (Wed) by raven667 (subscriber, #5198) [Link] (11 responses)

I for one am concerned about their lack of investigation and curiosity about Wayland, it seems to me that the best way to make sure that Wayland doesn't break their games is to spend some small amount of time testing and playing with it in the lab and forwarding bug reports or patches upstream. The worst time to find out about any Wayland problems is after it start shipping by default, especially if there are architectural problems which can be easily fixed now but become difficult to fix later.

If there are things which Wayland can make better and easier for SteamOS, now would be the time to find out and get started.

X and SteamOS

Posted Sep 18, 2014 7:37 UTC (Thu) by deepfire (guest, #26138) [Link]

It is impossible to overestimate the importance of what you said.

It would be very very sad, indeed, if Valve doesn't see that..

X and SteamOS

Posted Sep 18, 2014 8:22 UTC (Thu) by kragil (guest, #34373) [Link] (3 responses)

I am also concerned. If what Linus is saying( that SteamOS will be the one true backwards compatibility story and bring domination to the Linux desktop) is true than it is very bad that SteamOS seems stuck with X.
Could be really bad for Wayland.

X and SteamOS

Posted Sep 18, 2014 10:24 UTC (Thu) by daniels (subscriber, #16193) [Link] (1 responses)

Our X11 compatibility has to be perfect anyway, so not a lot of difference from the status quo there. Obviously I'd prefer for them to be shipping a native Wayland platform, not least as it would make all the hacks to X11 redundant, but I know that they've thought through the tradeoffs internally and come to a reasoned conclusion, even if it's not the one I'd like.

X and SteamOS

Posted Sep 18, 2014 17:35 UTC (Thu) by raven667 (subscriber, #5198) [Link]

I wonder if it makes any sense for them to build a SteamOS Wayland compositor that includes the X server in the compositor itself, so it's essentially a multi-protocol deal, with the Wayland libraries for hardware enablement but able to run existing X11 games without additional round-trips between processes, maybe do-able because SteamOS doesn't need to run more than one game at a time so doesn't need to run multiple X servers under Wayland.

X and SteamOS

Posted Sep 22, 2014 1:05 UTC (Mon) by Baylink (guest, #755) [Link]

I've yet to be convinced that Wayland, like systemd, isn't merely more evidence that it is *too* possible to break *nix by trying to turn it into Windows.

X and SteamOS

Posted Sep 19, 2014 2:45 UTC (Fri) by fdrs (subscriber, #85858) [Link]

We must remember that, first of all, they must finish their product and ship. I dont think that now is the time for them to take a look at it yet. Their first steam machines will be X, and that makes sense now. After they ship, then it's time to look at it.

X and SteamOS

Posted Sep 19, 2014 10:32 UTC (Fri) by robbe (guest, #16131) [Link] (1 responses)

SteamOS being its own distribution won't be affected by the defaults of others.

Steam on (regular) Linux will be affected, but, it being much more niche, maybe Valve foresees no big pressure when it breaks. If it breaks at all.

X and SteamOS

Posted Sep 19, 2014 13:47 UTC (Fri) by jospoortvliet (guest, #33164) [Link]

yeah, that is nice in theory, but it usually doesn't work out that way in the longer term. If you use something nobody else does, it will start breaking - because nobody notices. Think about Mesa, drivers, input devices perhaps... Once apps start to appear exclusively written on Wayland and never tested on X, things will break.

X and SteamOS

Posted Sep 25, 2014 6:55 UTC (Thu) by Olosta (guest, #98669) [Link] (2 responses)

Keep in mind that "OpenGL focused" actually means: we want proprietary NVIDIA and AMD drivers.

Wayland has nothing to offer here yet, the SteamOS project is already turning into something that is moving slower than expected. It's understandable to not hook with another project that might not be ready soon and risking other delays.

That's sad because Wayland Drivers and Wayland Games is a chicken and eggs problem that could be handled by a Valve/GPU vendor collaboration.

I also think that this SteamOS/Steam on Linux team is actually not very big, I don't know if the actual number is know, but the entire Steam Machine (HW and SW) team was 40 people in late 2013[1]. That does not leave a lot of room for a team of people not directly working on the product.

[1]: http://blogs.seattletimes.com/brierdudley/2013/11/04/a-gl...

X and SteamOS

Posted Sep 25, 2014 17:16 UTC (Thu) by raven667 (subscriber, #5198) [Link] (1 responses)

So maybe the right answer is to see if an interested party is willing to look at their compositor and X patches which are available (just the Steam client app is not) and see how one would replicate their needs in Wayland. That's a lot of volunteering which may not be palatable, there isn't necessarily an itch being scratched or any benefit to the developer doing the work.

X and SteamOS

Posted Sep 25, 2014 22:28 UTC (Thu) by filipjoelsson (guest, #2622) [Link]

Err, excuse me? No itch being scratcehed? I do believe there is a game or two that a developer might be itching to play. I'm not a Wayland hacker, but that does actually sound like a fun project to tinker with! :-)

X and SteamOS

Posted Sep 17, 2014 19:52 UTC (Wed) by The_Barbarian (guest, #48152) [Link] (5 responses)

People always talk about the Steam overlay thing, but I have never used it, or wanted to. I have seen it a few times when I accidentally pressed the key combo...

Really, I don't get what it is even used for. The vast majority of modern games that you would want/need a chat system in, have one built in, at least text, sometimes voice too. Aside from that people use 3rd party voice chat programs and those normally don't need anything onscreen. So I can't imagine what the Steam overlay could be doing that would be useful.

X and SteamOS

Posted Sep 17, 2014 20:38 UTC (Wed) by Plagman (guest, #98902) [Link] (1 responses)

In the context of SteamOS the overlay is extra important; it's your only handle on the rest of the system while a game is running, and lets you browse the web, change your controller bindings, exit the game, etc. In that sense it acts as the system shell, and all these modifications ensure that it remains fully interactive despite what the game might be doing, which is not possible with the in-process mechanism used for desktop Steam.

X and SteamOS

Posted Sep 17, 2014 23:58 UTC (Wed) by whiprush (guest, #23428) [Link]

Not to mention, music control!

X and SteamOS

Posted Sep 17, 2014 23:36 UTC (Wed) by mathstuf (subscriber, #69389) [Link]

Not everyone I want to chat with is on the same server as I am or even the same game maybe? Other than that, it's nice because it has a clock in it which is very handy when games don't show it to you.

X and SteamOS

Posted Sep 19, 2014 21:42 UTC (Fri) by k8to (guest, #15413) [Link]

If you are a steam user and know other steam users who know your steam name, you can chat when playing totally unrelated games.

The value is clearly lower if you dont' want to buy into steam as a social connector. Peronsally I just use it to talk to people I already know from elsewhere who I also play games with sometimes.

X and SteamOS

Posted Sep 30, 2014 3:18 UTC (Tue) by imunsie (guest, #68550) [Link]

Among other things it provides a convenient way to bring up a web browser without leaving the game - e.g. to look up a guide when stuck, report a bug on the forums or whatever. As others have already mentioned it also provides quick access to Steam text & voice chat services as well as music player controls, etc.

On Windows & desktop Linux some fullscreen games behave badly (crash) when alt+tabbing out of them, on desktop Linux some games grab the keyboard and prevent alt+tabbing (bringing up the overlay also has the benefit that any such grabs are released) and others are just really really *really* slow to reload their state onto the GPU when returning to them. Using the overlay avoids these issues.

For SteamOS alt+tabbing isn't an issue since you only have one full-screen application, but accessing other features of your system is still important - which the overlay allows you to do.

X and SteamOS

Posted Sep 17, 2014 20:43 UTC (Wed) by dlang (guest, #313) [Link] (17 responses)

The mode switching issue is interestng.

Back in the days of CRT screens, switching modes actually changed how the display works.

But now in the days of LCD/DLP screens, switching modes just means that the display scales your image instead of your video card. Either way, the image needs to be scaled to match the fixed resolution of the display.

There may be some corner case where it makes sense to change the frequency of the display (probably something along the lines of power savings by not running things as hard to send at a high frame rate), but until we get to the point where the communication between the video card and display is a "send an update if something changed" instead of "keep sending the entire screen contents, even when nothing has changed", there really isn't any value in changing the mode of the display from it's highest resolution, fastest update and doing all the scaling in the video card.

X and SteamOS

Posted Sep 18, 2014 11:08 UTC (Thu) by patrakov (subscriber, #97174) [Link] (7 responses)

Well, there is one point where changing refresh rate is useful: smooth video playback if the video has been shot with 24, 25, 48 or 50 fps instead of the usual 30 or 60. To fix this, we need motion interpolation in video players. We already have that in TVs, and let me mention it is incompatible with frame-doubling done by the traditional computer-based video playback process (where the video card runs at 60 Hz, effectively shows each frame twice, and thus destroys the motion-vector idea in e.g. the Sony Bravia engine by resetting such vectors to 0 every other frame).

X and SteamOS

Posted Sep 18, 2014 13:30 UTC (Thu) by drag (guest, #31333) [Link] (1 responses)

One of the first things many users do when they have a television with motion compensation is to disable it as soon as they try to watch a movie with it. The effect that most of these things seem to have on the quality of the output and 'feeling' of movement is pretty disastrous.

X and SteamOS

Posted Sep 18, 2014 17:42 UTC (Thu) by raven667 (subscriber, #5198) [Link]

For playing games you also want low latency on the screen output, which doesn't matter at all for normal video, so many TVs have a "Game Mode" that turns off most of the filtering and whatnots that can add latency to the output.

X and SteamOS

Posted Sep 19, 2014 5:07 UTC (Fri) by dlang (guest, #313) [Link]

That's a good case for changing the refresh rate that I hadn't thought of, thanks.

X and SteamOS

Posted Sep 20, 2014 23:12 UTC (Sat) by MrWim (subscriber, #47432) [Link] (3 responses)

It gets even more interesting for live (e.g. broadcast) video. In that case not only does the TV need to be synchronised with the PC, but the PC needs to be synchronised with the cameras recoding the video. Otherwise the slight differences between the clocks in the PC and the video camera could cause drift resulting in a buffer-underrun (PC clock is faster) or overflow (PC clock is slower) in the PC.

As the broadcast is one-way and one-to-many synchronising the broadcast to the PC would be impossible, so instead all the PCs must be synchronised to the broadcaster's clock. At least with DVB-T this is accomplished via the MPEG-TS PCR which is a counter embedded in the broadcast MPEG-TS media container. As MPEG-TS packets are received the output clock rate in the PC is adjusted similar in principal to a Phase-Locked loop to prevent drift.

So it's not even the case that the TV must run at 50Hz sometimes and 60Hz at other times, there's also the question of 50Hz according to whom? I wonder how KMS and Wayland deals with these issues? Or perhaps this it considered outside of the scopes of their interfaces.

X and SteamOS

Posted Sep 20, 2014 23:38 UTC (Sat) by dlang (guest, #313) [Link] (2 responses)

I know that was the case in the days of analog TV, but is digital really still the same? or do the clocks run independently with an occasional frame glitch if the two ends get too far apart?

Given that there are glitches anyway from transmission issues, I don't think that people would notice.

Modern computer systems (including all TVs) have pretty accurate clocks, so such glitches would be pretty rare

X and SteamOS

Posted Sep 21, 2014 12:58 UTC (Sun) by MrWim (subscriber, #47432) [Link] (1 responses)

I know that was the case in the days of analog TV, but is digital really still the same?

Yes, it's the same now. Interestingly the concerns of broadcast relate more to audio than video. People are far more forgiving of dropped/corrupted video frames than pops, clicks or drop-outs in their audio.

Either way, broadcast engineers are a whole different breed, single frames being out of place would be considered a serious issue, and these are the kinds of problems they spend their time solving.

Modern computer systems (including all TVs) have pretty accurate clocks, so such glitches would be pretty rare

I used to work on set-top-boxes but with a history of development on and for what amounts to desktop Linux. One thing I learnt is that the industry doesn't think about them in those terms. With a history of playing with PCs I would think about our target systems as an underpowered PC with some special media handling capabilities. But to much of the rest of the industry, especially the SoC vendors, these boxes are for showing live broadcast TV, and they happen to have a bit of CPU power on the side for doing ancillary things like adjusting settings or showing the TV guide.

X and SteamOS

Posted Sep 22, 2014 7:20 UTC (Mon) by dlang (guest, #313) [Link]

my most recent direct experience with digital broadcasting is dealing with the directtv feeds recorded by Tivo, which frequently has corrupted frames that it has to deal with. I assumed that other digital broadcasts would end up working the same way.

X and SteamOS

Posted Sep 18, 2014 17:05 UTC (Thu) by hechacker1 (guest, #82466) [Link] (5 responses)

Well and I have to wonder if the video card can do the scaling itself, saving a lot of trouble. I know in Windows with AMD/Nvidia there's an option to let the GPU scale, or let the monitor scale. Often the GPU scaling is better than whatever poor internal LCD scaler they put in. But, then I wonder if that's purely a Windows driver function, or part of the hardware.

X and SteamOS

Posted Sep 18, 2014 18:00 UTC (Thu) by flussence (guest, #85566) [Link] (4 responses)

On modern Xorg it's trivial to make the video card upscale an output to native resolution, though there's no option to use a nice-looking interpolation (yet):

xrandr --output LVDS1 --scale-from 800x480

This even works for downscaling, I'm not sure what that'd be useful for though.

X and SteamOS

Posted Sep 19, 2014 11:20 UTC (Fri) by patrakov (subscriber, #97174) [Link] (1 responses)

It doesn't work for downscaling, because it breaks mouse input. See https://bugs.freedesktop.org/show_bug.cgi?id=40063 and https://bugs.freedesktop.org/show_bug.cgi?id=39949

Note: one of these bugs was marked as a blocker for the Xorg-1.12 release. A working-for-me patch exists (but it may be insufficient for the keystone-correction case). And still, nobody looked!

If nobody looks within 6 months from now, I will start trolling on the mailing lists by sending patches that remove the scaling feature completely.

X and SteamOS

Posted Oct 2, 2014 0:04 UTC (Thu) by daenzer (subscriber, #7050) [Link]

Was the patch submitted to the xorg-devel mailing list? That would be better for drawing attention to it than just attaching it in bugzilla.

X and SteamOS

Posted Sep 19, 2014 21:59 UTC (Fri) by yokem_55 (subscriber, #10498) [Link] (1 responses)

Downscaling is the sledge hammer of Anti-Aliasing. Any game will work with it, and the results are gorgeous, but you'd better have a really powerful graphics card.

X and SteamOS

Posted Sep 30, 2014 3:27 UTC (Tue) by imunsie (guest, #68550) [Link]

You do have to be careful with downscaling - if the UI/HUD is drawn by the game expecting every pixel to be visible (e.g. use of small fonts) it can easily become unreadable when downscaled. If the UI/HUD is already being scaled by the game to a percentage of the display or a fixed physical size it should be fine.

X and SteamOS

Posted Sep 18, 2014 19:00 UTC (Thu) by pflugstad (subscriber, #224) [Link]

> until we get to the point where the communication between the video card and display is a "send an update if something changed" instead of "keep sending the entire screen contents, even when nothing has changed", ...

Note that the industry is actually moving that direction. Nvidia introduced G-Sync a while back, AMD demo'd "free sync" and now VESA is standardizing Adaptive-Sync in the latest Display Port spec. These are primarily focused on gaming, but they're obviously useful for video display as well.

I expect how well they work depends on the level of integration with the monitor. IIUC, the initial Nvidia G-Sync monitor add-on basically added a buffer to the LCD side of the display cable so the GPU could vary the sync dynamically based on game behavior - this let the games continue on without waiting for monitor sync, but the monitor still updated at 60Hz re-using previously buffered frame. My guess is that in a couple more years, we'll see monitors start actually changing their refresh rate directly (instead of buffering), making this smoother (I think that's what AMDs free sync demo showed).

X and SteamOS

Posted Sep 28, 2014 12:01 UTC (Sun) by nim-nim (subscriber, #34454) [Link] (1 responses)

The problem of course are the GPU capabilities. People usually scale down to improve GPU responsiveness. In fact one reason high dpi displays were so late to arrive is that they exposed GPU weaknesses (people would brag about gigantic screens and paper over the fact the pixel density was terrible, and disparage higher density screens that would make their GPU suck)

Now of course pretty much everyone can check on modern smartphones how nice text rendering can be if you give it enough pixel density, but old reflexes remain.

I don't think any game allows driving the text parts at full density while scaling down the bits the GPU cna't handle at full speed.

X and SteamOS

Posted Oct 12, 2014 15:42 UTC (Sun) by blujay (guest, #39961) [Link]

The ARMA engine and its descendants can scale the UI independently from the 3D.

X and SteamOS

Posted Sep 17, 2014 21:38 UTC (Wed) by jonabbey (guest, #2736) [Link]

I'd love to hear about how Wayland will function in that kind of environment, and how soon. ;-)

X and SteamOS

Posted Sep 18, 2014 0:12 UTC (Thu) by Merovius (guest, #95489) [Link] (11 responses)

Using LD_PRELOAD for hooking into the X calls is a very bad decision, imho. It means steam will only work well for games dynamically loading an X-library of some sort (and likely only Xlib and possible xcb will be supported). Statically linked binaries are a no-go, as is using languages with a pure implementation of the X-protocol. Also LD_PRELOAD does not really play well with multiarch and afaict there are more games than I like that are actually compiled for 32bit CPUs and running on 64bit ones.

A cleaner and more portable way would be to actually hijack the X-protocol, by running a proxy X-server that filters these calls and starting the game with a corresponding DISPLAY variable. This would reliably intercept *every* attempt to talk to the X-Server (as every software that wants to do this has to get it's connection parameters from DISPLAY and talk to X via a socket) as well as avoid possible problems with loading foreign code into a binary not expecting that.

X and SteamOS

Posted Sep 18, 2014 0:27 UTC (Thu) by dlang (guest, #313) [Link] (6 responses)

Actually, the best way would be for the X server to have a 'no modechange' mode where it implements exactly what is being needed here. As Keith apparently said in the presentation, this is a problem and use case that they care about, even if they don't like the implementation.

All your issues make it so that it's not the ideal Linux wide implementation of the idea, but it has the huge advantage that it works for the users and is shipping.

Now that a real use case and a way of addressing the problem is showsn and working, it's possible to go back and figure out the best way to do this.

If they had posted this idea a year ago and tried to get everyone to agree on a solution, they wouldn't have shipped anything yet.

X and SteamOS

Posted Sep 18, 2014 0:36 UTC (Thu) by Plagman (guest, #98902) [Link] (4 responses)

Both 32-bit and 64-bit variants of these hooks are preloaded into game processes, and server-side measures are also implemented to counteract modeswitches for games that statically link code that sends X protocol, as there are indeed a few of them in the wild.

X and SteamOS

Posted Sep 18, 2014 5:22 UTC (Thu) by raven667 (subscriber, #5198) [Link] (1 responses)

Another point which was made explicit in the presentation is that any hack that SteamOS implements only applies to games that they sell in the Steam store, and no game gets shipped that isn't QA tested for compatibility with their hacks, or until they've implemented the right hacks to make it work reliably. Their techniques don't have to be generally applicable, they just have to work for the walled garden.

X and SteamOS

Posted Sep 18, 2014 7:41 UTC (Thu) by deepfire (guest, #26138) [Link]

I have seen at least one game which failed hard at the cursor position remapping game. Pardon my pun.

X and SteamOS

Posted Sep 18, 2014 10:27 UTC (Thu) by Merovius (guest, #95489) [Link] (1 responses)

> and server-side measures are also implemented to counteract modeswitches
> for games that statically link code that sends X protocol, as there are
> indeed a few of them in the wild.

Well, okay then, if they cover this, that's okay. Still don't understand why LD_PRELOAD is necessary at all, then… But oh, well.

X and SteamOS

Posted Sep 20, 2014 6:40 UTC (Sat) by alankila (guest, #47141) [Link]

If I have to hazard a guess, I think they started out with LD_PRELOAD which will work for most cases, and then had to add the server-side bits later on.

X and SteamOS

Posted Sep 25, 2014 23:17 UTC (Thu) by ssokolow (guest, #94568) [Link]

Given how often my window positions don't get restored, I used to implement "no modechange" on my nVidia setup by using the TwinView MetaModes option to lock the resolution at 2560x1024.

(I "fullscreen" games which want to change modes by using Openbox's per-application settings to position, always-on-top, and un-border a 1280px-wide window at whatever aspect ratio the game desires)

It worked nicely as a way to ensure that games didn't trash things while I was hunting down the "windowed mode" toggle... except for certain games which reacted badly to discovering that their desired 4:3 or 16:9 resolution was unavailable. (Luckily, most of those also run nicely in Wine with the "virtual desktop" option)

I'd still be doing it, but I forgot to restore my xorg.conf after a reinstall, didn't notice because the autodetection had improved so significantly, and now I keep forgetting to set it back up.

Of the ones that did cause problems, the most "insult to injury" example was Dungeons of Dredmor, which did work... but forced windowed mode to use one of the reported fullscreen resolutions and ignored attempts to force the issue by manually editing the config file.

I've been meaning to write an LD_PRELOAD hook for SDL which resolves that by wrapping SDL_ListModes and SDL_SetVideoMode to ensure that things like 640x480, 800x600, and so on are always available and simply force windowed mode if necessary, but I couldn't get around a syntax error when I last tried it a couple of years ago with copy-pasted SDL function signatures as a starting point.

(I'll have to get back to that code. In retrospect, I was probably missing some C dialect flag that SDL's Makefile was passing.)

X and SteamOS

Posted Sep 18, 2014 9:26 UTC (Thu) by edeloget (subscriber, #88392) [Link] (3 responses)

> Using LD_PRELOAD for hooking into the X calls is a very bad
> decision, imho. It means steam will only work well for games
> dynamically loading an X-library of some sort (and likely only
> Xlib and possible xcb will be supported). Statically linked
> binaries are a no-go, as is using languages with a pure
> implementation of the X-protocol.

Since They control the games that are available on the platform, dynamic linking is a requirement they can actually enforce, as well as using a specific X library and so on. Anyway, most games won't even try to deal with that. They just use SDL - which in turn uses X - or another engine (Unity, Source...). They don't want to deal with platforms stuff - this is hard, error prone, and not portable (remember that most games are ported to linux - they are not developped for Linux and then ported to another platform).

Thus LD_PRELOAD makes a lot of sense.

> A cleaner and more portable way would be to actually hijack the
> X-protocol, by running a proxy X-server that filters these calls
> and starting the game with a corresponding DISPLAY variable.
> This would reliably intercept *every* attempt to talk to the
> X-Server (as every software that wants to do this has to get
> it's connection parameters from DISPLAY and talk to X via a
> socket) as well as avoid possible problems with loading foreign
> code into a binary not expecting that.

That sounds a bit complex to handle the interception of a few functions - not to mention that the request still have to go through some ICP mechanism. If you LD_PRELOAD the library you need to preload then you can return immediately, without contacting anyone. It sounds more reasonable to me.

X and SteamOS

Posted Sep 18, 2014 10:26 UTC (Thu) by Merovius (guest, #95489) [Link] (2 responses)

> Since They control the games that are available on the platform, dynamic
> linking is a requirement they can actually enforce, as well as using a
> specific X library and so on.

I don't think it is wise or ethically correct to ban specific technologies from steam. Any by the way, with this argument they won't need LD_PRELOAD either. They can just provide their own implementation of the X-Protocol and enforce use of that.

> That sounds a bit complex to handle the interception of a few
> functions

It's really not. I would actually argue, it is a *lot* easier then doing an LD_PRELOAD mechanism in a portable and stable way.

> not to mention that the request still have to go through some
> ICP mechanism.

You add a roundtrip through a UDS or a loopback device, yes. That won't make any practical difference. I am not entirely sure about "a few functions" either, by the way, depending on how they implemented the rescaling. But they quite possibly might have to rescale on pretty much *any* function that handles coordinates, which would mean pretty much any function. With triplication for Xlib, xcb and the serverside-fallback. And since Xlib has such a non-uniform API you would actually have to touch all functions it provides.
With a protocol-interception you can generate code for all X-request in an automated way (e.g. from the xcb protocol descriptions) and handle in one catch *all* ways to communicate with the X-Server.

X and SteamOS

Posted Sep 18, 2014 15:42 UTC (Thu) by jwarnica (subscriber, #27492) [Link]

One of the reasons why consoles are popular, and why Steam has become a successful tool (on Windows) is because it "just works". Consoles are not general purpose computing devices, Steam is not a platform for distributing arbitrary software.

If you want to write games doing something... unusual... or run those games, feel free. If you want to be very confident an arbitrary game from the store will work, or be very confident your game will have near zero compatibility related support questions, use Steam.

X is designed to do... pretty much anything. Getting to a state of "always works" requires limiting that down. Ethics has nothing to do with it.

X and SteamOS

Posted Sep 30, 2014 3:35 UTC (Tue) by imunsie (guest, #68550) [Link]

They aren't banning anything. They do have a runtime which they highly recommend developers use to guarantee that the libraries in the runtime will be available on any Steam Linux desktop or SteamOS system, but it's not required to sell a game on Steam.


Copyright © 2014, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds