Compiz Fusion under Debian Lenny on my laptop

I have a previous post with what I’ve done to my laptop, and in that post it’s not mentioned, but I managed (quite a while ago) to make Beryl work under Ubuntu Dapper Drake. Dapper is getting older, but I am not having good experiences installing Edgy and Feisty on the laptop. I have managed to install Debian Etch with no problem, but the wireless driver was not working properly (for me, a showstopper) until Lenny.

So now I have a Debian Lenny partition, plus three other: the original WinXP, the Ubuntu Dapper I am still using as “main” OS, and a Fedora 7 I installed just because it came in a DVD with a magazine I bought for a train trip I had not brought any reading material with me :^)

Since I am on vacation, and I have plenty of time (although I don’t want to spend all of it on my comp), I decided to give Compiz Fusion a try, mostly after seeing what it its capable of.

First things first, the specs of my laptop are:

Fujitsu-Siemes Amilo PI1536
CPU: Intel Core 2 Duo T7200 2×2.0GHz
RAM: 2x1Gb
HD: 120Gb SATA
Display: 15.4 WXGA
Graphics: ATI Mobility Radeon X1400 (128Mb dedicated/512Mb shared)

The only relevant parts above are that it has an ATI graphics card (which, under Linux, sucks), and that it has Core 2 CPUs, which are amd64-capable (which is both great, for performance, and sucks, for drivers and software compatibilities). So, my second step was:

Installation of ATI drivers

If you want to take the best out of your ATI card, you have to tell your X.org graphics server to use the fglrx driver, and not the default vesa one. You can install this driver from the official Debian repositories, but for me those packages (fglrx-driver and related ones) didn’t do it.

So, I googled a bit, and followed the most widespread recommendation: to install the latest non-free (sigh) driver from the ATI site. For that, I chose the options: Linux x86_64 -> Mobility Radeon -> Mobility Radeon X1400 -> Go, reaching this page, and downloading this 38MB binary (for the record, the 32bit version of the drivers is exactly the same .run file).

Next, I followed the remaining information in this excelent thread in linuxquestions.org. Namely, I downloaded the needed packages (the code is copy-paste-able):

% aptitude install module-assistant build-essential dh-make debhelper debconf libstdc++5 linux-headers-$(uname -r) ia32-libs

Beware that the ia32-libs packages is not mentioned in the linuxquestions.org thread (assuming that you already have it installed), but it is required.

Next, run the ATI binary inside a dedicated directory (I did it as root, but it is not compulsory):

% mkdir /root/fglrx
% cd /root/fglrx
% mv wherever-I-downloaded-it/ati-driver-installer-8.32.5-x86.x86_64.run .
% chmod +x ati-driver-installer-8.32.5-x86.x86_64.run
% ./ati-driver-installer-8.32.5-x86.x86_64.run --buildpkg Debian/lenny
% rm or mv the .run file wherever you want

This generates a bunch of .debs in the /root/fglrx dir. Next, install them, and compile the driver (for this, you do need to be root):

% dpkg -i fglrx-*.deb
% cd /usr/src
% m-a prepare
% m-a a-i fglrx

The linuxquestion.org thread mentions modifying the /etc/X11/xorg.conf file in two ways. First, disable compositing, adding:

Section "Extensions"
Option "Composite" "Disable"
EndSection

to it, and then running:

% aticonfig --initial
% aticonfig --overlay-type=Xv

For me, both were superfluous, because I made a copy of my Ubuntu xorg.conf, and them made minimal changes (if at all). However, the first change (disabling compositing) was straightforward wrong. If I want to use Compiz Fusion, I need to have it. Relevant excerpts from my xorg.conf:

Section "Module"
  Load  "i2c"
  Load  "bitmap"
  Load  "ddc"
  Load  "dri"
  Load  "extmod"
  Load  "freetype"
  Load  "glx"
  Load  "int10"
  Load  "type1"
  Load  "vbe"
EndSection

...

Section "Device"
  Identifier  "aticonfig-Device[0]"
  Driver      "fglrx"
  Option      "VideoOverlay" "on"
  Option      "OpenGLOverlay" "off"
EndSection

...

Section "Screen"
  Identifier "aticonfig-Screen[0]"
  Device     "aticonfig-Device[0]"
  Monitor    "aticonfig-Monitor[0]"
  DefaultDepth     24
  SubSection "Display"
    Viewport   0 0
    Depth     24
    Modes    "1280x800" "800x600" "640x480"
  EndSubSection
EndSection

...

Section "DRI"
  Mode         0666
EndSection

Section "Extensions"
  Option "Composite" "1"
EndSection

After all this fuss, and to ensure you have it all running OK, try to insert the module as root:

% modprobe fglrx

Then, make sure it loads everytime you reboot (include it in /etc/modules if necessary, but it shouldn’t be).

Next, reload the X server, and check that now it is running the fglrx driver, by doing the following (as user is fine):

% fglrxinfo

It should display something like the following:

display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI Mobility Radeon X1400
OpenGL version string: 2.0.6650 (8.39.4)

If, instead, it says something about mesa3d, it didn’t work.

Now, the second step is…

Installing Xgl

With the standard X.org server we have a problem. We can load the fglrx driver, but we can not activate compositing (see last three lines of my xorg.conf file above). If we activate compositing in the xorg.conf file, the ATI driver will not be loaded (don’t ask me why, it just seems to happen). If we deactivate compositing, the ATI driver gets loaded, but without compositing, we can not use Compiz.

The solution is to install Xgl which is an X server (or, I think, a kind of layer that runs on top of the X.org server) that allows for the above trick. There seem to be two “ways” of getting proper compositing: Xgl and AIGLX. The general agreement on the net seems to be that the latter is “better”, but only the former seems to work with ATI cards (read the “AIGLX with AMD (ex-ATI) Proprietary Drivers” section in the AIGLX Wikipedia article, because it hits the problem dead-on). With Xgl I can make use of the fglrx driver and have compositing at the same time.

We are lucky here, because there are Debian repositories for Xgl. I found out about them in this howto in tuxmachines.org. Most of the info there is mostly… ehem… useless (for me), but reading it I found a repo for Xgl. I just have to add the following line to my /etc/apt/sources.list (beware that the original mention in the tuxmachines.org page says “binary-i386”, and I had to change it to “binary-amd64”):

deb http://www5.autistici.org/debian-xgl/debian/ binary-amd64/

I then had to do aptitude update, and I (of course) got an error telling me that some signatures couldn’t be verified (read my own article about secure APT and/or the wonderful Debian wiki to know more). I think the key is 11F6E468, and it corresponds to Francesco Cecconi (mantainer of the repo). It is downloadable from pgpkeys.mit.edu (follow instructions on my previous post, or the ones in the Debian wiki). If you want, do not skip reading the parent page of the repository.

After the keys are OK, it’s just a matter of doing (as root):

% aptitude update
% aptitude install xgl

Now you are done installing, but will have to actually use Xgl. This gave me some headaches, not because I didn’t know where to put things, but because I didn’t know exactly what to put. I read, and followed, the instructions in freedesktop.org, and (after all, the blog seems to be useful for someone: myself) a previous post of my own.

I am using GDM, so my final setup was the following: first generate a suitable entry in the GDM menu, by creating a file named /usr/share/xsessions/xfce4-xgl.desktop (or whatever, but in the same dir, and ending in “.desktop”), and putting the following inside:

[Desktop Entry]
Encoding=UTF-8
Name=Xfce-Xgl
Exec=/usr/local/bin/startxgl_xfce
Icon=Type=Application

The string after “Name=” is the one that will appear in the GDM menu, and the one after “Exec=” what will be executed when selecting that entry.

Next, we have to create the string we promise above (/usr/local/bin/startxgl_xfce), and put the following inside:

# Start the Xgl server:
Xgl -fullscreen :0 -ac -accel glx:pbuffer -accel xv:pbuffer -fp /usr/share/X11/fonts/misc & sleep 5 && DISPLAY=:0
# Start Xfce:
exec xfce4-session

As you can see, I am telling Xgl to load a font (with -fp) that was giving me headaches, because the server would die saying that the font was missing when I didn’t include that option. Your mileage may vary.

Now, everytime we select the entry labeled “Xfce-Xgl” in the GDM menu, we will have the Xgl server running.

Installing Compiz Fusion packages

I think the aforementioned autistici.org repo has compiz packages, as well as the default Debian Lenny repos. But net consensus seems to be that they are not the way to go. Everyone praises two repositories: Treviño’s and Shame’s. I chose the latter, adding the following line to my /etc/apt/sources.list:

deb http://download.tuxfamily.org/shames/debian-sid/desktopfx/unstable/ ./

I think I went through the same chores as above for key verification, Shame’s key being A42A6CF5.

After that, I installed the following package (it installs all of the needed packages):

% aptitude install compiz-fusion-all

After that, and inside my “Xfce-Xgl” session, I just did the following, as some googling revealed:

% compiz --replace

But… it didn’t work :^( It complained in the following manner:

Fatal: Failed test: texture_from_pixmap support
Checks indicate that it's impossible to start compiz on your system.

I found a lot of pages, threads and howtos in the net stumbling upon this same problem (for example, this one at ubuntuforums.org), but none with the answer. Really. None. The most enlightening tips where the use of the -v, -h and --help switches for compiz. The first one requests verbose output, the second one help about “short” options, and the third one help about the “long” options. With the latter I discovered the --force-fglrx switch, which saved the day! Yes, I now use the following command to start Compiz:

% compiz --replace -c emerald --force-fglrx

I have two things to say at that point. First: this Compiz Fusion is visually astonishing! It is full of great ideas, and has a lot of settings to play with. The second thing is not so nice: some glitches are present. For example, my Konsole windows get transparent background for no reason, and the refresh is horrible (when text reaches the bottom on the terminal, it starts to overwrite itself. One must hide and un-hide the window for proper refreshing, which is unacceptable). The latter also affects other windows, which, all in all, makes it unsuitable for much comfort.

However, Compiz Fusion is new, hot and experimental. I love playing with it, but right now it can not be relied upon. On the bright side, in the three days from my installation, the packages have been updated three times! I suppose some aptitude upgrade cycles will fix the issues eventually.

And that’s it, dear reader.

6 Comments »

  1. Compiz Fusion under Debian Lenny on my home desktop « handyfloss said,

    November 7, 2007 @ 16:56 pm

    […] 2006  (24) May 2006  (17) April 2006  (24) March 2006  (4) « Compiz Fusion under Debian Lenny on my laptop Be nice in Wikipedia […]

  2. What I’ve done to my laptop « handyfloss said,

    November 7, 2007 @ 17:22 pm

    […] Comments Compiz Fusion under Debian Lenny on my laptop « handyfloss on Compiz Fusion effectsCompiz Fusion under Debian Lenny on my laptop « […]

  3. 3 days with Linux | info.michael-simons.eu said,

    February 8, 2008 @ 10:40 am

    […] i give it a try and followed the instructions and used the instructions for the xorg.conf from here without that Xgl thingies. What can i say: It works and looks great. The wobbling windows are […]

  4. Compiz Fusion under Debian Lenny on my laptop « handyfloss said,

    September 13, 2008 @ 15:55 pm

    […] Entry available at: http://handyfloss.net/2007.08/compiz-fusion-under-debian-lenny-on-my-laptop/ […]

  5. JC said,

    September 28, 2009 @ 22:48 pm

    I also have an Amilo Pi 1536, ATI Mobility Radeon X1400 etc. etc. – I tried to install fglrx drivers etc. but then it did freeze before I even got as far as to the login screen. I have restored the default graphic drivers and can now use Ubuntu again. Since you have the same hardware setup (except that my dvd is totally broken, it’s even lost in the bios) I hope that you have tried Ubuntu 9.04, Jaunty, so that a Linux newbie as I am can get some tips on how to get the ATI graphic card to work as expected. The main reason for me to get the fglrx drivers to work is that the S-VHS/TV-out doesn’t work with the default non-prepretary drivers – and that’s annoying – I really do want S-VHS/TV-out to work.

    I’ve read somewhere that the new propretary drivers doesn’t work for the X1400 – and in addition the working drivers don’t work in the core that Jaunty is running on.

    If someone has had this problem and solved it somehow it would be greatly appreciated if that experience and solution could be shared.

  6. isilanes said,

    September 29, 2009 @ 9:20 am

    Hi, JC. I have Ubuntu 8.10 Intrepid currently in that laptop, and everything seems to work properly. I don’t know if Jaunty would break anything (it shouldn’t). Please take into account that all of the info in this post is sorely outdated. Recent versions of modern Linux distros (e.g. Ubuntu 8+) should work well with this somewhat outdated hardware, but you seem to have more experience on that than I do.

RSS feed for comments on this post · TrackBack URI

Leave a Comment