Sun, 02 Feb 2014
Oh, X

It's been a very long time since I've played around configuring X Windows on Linux but I've recently had the "pleasure" again. X mostly just works now, and there's no more need to fight monitor modelines or an arcane xorg.conf file (the file usually doesn't even exist anymore). This is a very good thing because X setup was sometimes a nightmare.

For the past few years, I've done well to steer clear of proprietary graphics drivers as well, drivers for hardware like ATI/AMD or NVIDIA. I've choosen Intel graphics hardware because Intel's writing good open-source drivers. If I happen to be using ATI/AMD or NVIDIA hardware, I try and use the nouveau or the radeon driver.

X was the only big component of the Linux desktop stack that I never compiled from source, back in the mid-1990's (when X was "XFree86"). Too scary, and perhaps my 486 CPU, 128MB RAM and 33.6 baud modem weren't so up to it.

Not my graphics card

When I bought a cheap(ish) laptop to use as my "desktop" (TV/HDMI connected) a year or so ago, I hit a small snag in that it's based around an AMD chipset for graphics (and HDMI audio) and an Atheros for ethernet. I had to download, compile and load an out-of-tree Linux kernel module to get the ethernet working. Very 1990's.

An out-of-tree module means you have to remember to rebuild it if you ever upgrade your kernel. Luckily, the ethernet module (alx) is now "in-tree" from 3.11 and I'm using Debian Wheezy backports.

Generally, all's been well. I don't play computer games so have no need for fast 3D, just decent 2D performance. I'm not sure what happened but a while ago I noticed that full-screen desktop video had got very choppy (tearing). The desktop felt "stickier" than usual. So, I decided to (perhaps foolishly) try the proprietary AMD Catalyst driver and see if things are better.

Past experience with graphics driver updates on Linux have been varied, to say the least. I recall painful times and black screens, but this was a long time ago and I have much more experience and confidence now. This stuff is generally still a bit of a black art if things don't work out though!

Got the Catalyst 13.12 release driver installed and working, after a bit of messing around. A bit more playing with xrandr on the laptop to sort out display outputs to laptop, TV and/or both. Made sure I was using kernel 3.11 from backports as well and that the AMD driver supported this. Result? Video playback seemed good now and all appeared well (plus it didn't take long). Success! Or so I thought ...

A Key Problem

A problem quickly manifested itself during the week: key press delays in X applications.

Pressing a key in the web browser search box (for instance), would exhibit 1/2 second delays occasionally. Maybe 1 or 2 seconds sometimes. Consoles were fine: at least konsole and rxvt. Laptop keyboard directly or USB keyboard showed the same issue ... very annoying.

So, on the merry-go-round again ...

To investigate, I planned another look at X for a Saturday. This time I updated the kernel to a new backports version 3.12, and downloaded and installed the AMD Catalyst driver 13.11-beta (which said it supports kernel 3.12). A bit of trouble :

  • I had to do a force install because the previous AMD driver didn't want to --uninstall.
  • I had to do some symlinking to link* from /usr/lib to /usr/lib64 (not sure why this was wrong - poor AMD/ATI Debian x64 support?).

But still the same key press problem ...

Key presses worked fine with the radeon driver but not the AMD driver. So I started to look at X Server options, starting with the "easy" stuff via the memorably named amdcccle, the AMD graphics control centre (a graphical application).

I enabled the "tear free" control (sync to vertical refresh), which was off, and this seemed to fix my key press delay trouble.

Apparently, I could have used the following command to enable this as well :

aticonfig --set-pcs-u32=DDX,EnableTearFreeDesktop,1

Thank goodness for that!

At the end here, I was going to start up the control centre and get a small screenshot of it. But it gave me a segmentation fault ... ugghh.

X Windows is due to get a replacement in Wayland at some point in the future. I can't say I'll miss it. In fact, there are a few quite exciting developments happening in desktop Linux-land just now so it should be an interesting year or two.