How To: Compiz on an ATI — die, fglrx

I cannot for the life of me understand why every guide out there that explains how to use Compiz-Fusion on an ATI card pushes you to use the proprietary fglrx. Please understand — I hate the GPL; I am not an open source zealot; being non-proprietary does not make things better.

Being able to open Firefox and Calculator, scroll in Firefox, and not have the Calculator scroll into Firefox because of piss-poor VRAM management, on the other hand, does.

If you have one of a handful of ATI cards, fglrx is probably a wonderful driver. However, for most users, it will be a failed piece of shit.

Ubuntu’s default driver, the xorg “ati” driver, is equally bad. Everything runs choppy, you cannot scroll without maxing your CPU out, and there is no 3D support at all.

It took me seven months of tweaking and trying various drivers, setting combinations and Xorg servers to find the all-around best settings for this card. The winner? Xorg’s “radeon” driver by a land slide.

Before we go any farther, let me note that for users who only care about playing World of Warcraft in Wine or running Japanese 3D porn games, “fglrx” is probably the way to go. On the ATI M24 1P Radeon Mobility X600, it performs at nearly double the frames per second the “radeon” driver does.

On the other hand, no matter what settings you use with “fglrx,” you will see random black bars attached to your mouse, randomly garbled windows as wrong areas of VRAM are accessed and frequent locking with certain OpenGL visual codes. On top of that, should you wish to use Compiz, you will be forced to run a second Xgl X server on top of your default one, since replacing with Xgl will break the GNOME desktop manager. The Xgl server runs in your GL later, thus videos and games cannot access it. In fact, you will lose every single video driver except x11/xshm — the software one. Even a 2GHz Dothan does not have the power needed to scale a video to full screen in software in real time. Mednafen will be unusable. ScummVM will die hard. Basically, any application that has … oh … graphics I guess, will completely fail.

So your options are a good, all-around driver that will let you run most things you want in perfect harmony, or a driver that will make you choose between a 12-million texel Dark Orc and a pretty desktop.

My choice is made. If you just have to have those 12-million texel Dark Orcs and wobbling Japanese texel boobs, you should go read an fglrx guide.

Now, for everyone else who actually uses their computer and will not reformat every three weeks to try new distributions, read on.

Everything you need, you already have.

Isn’t that refreshing to read in a guide?

Open up your Xorg configuration file in your favorite text editor. Be sure to make a backup of its current state — not because this will break your machine, but because it’s a good habit.

Next, enter this in. I removed the Wacom sections because I don’t have a tablet, and I removed the totally useless “i2c” driver because the M24 has no video inputs.

Section "Files"
  FontPath "/usr/share/X11/fonts/misc"
  FontPath "/usr/share/X11/fonts/100dpi/:unscaled"
  FontPath "/usr/share/X11/fonts/75dpi/:unscaled"
  FontPath "/usr/share/X11/fonts/Type1"
  FontPath "/usr/share/X11/fonts/100dpi"
  FontPath "/usr/share/X11/fonts/75dpi"
  FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
  FontPath "/usr/share/fonts/VeraSansYuanTi"
EndSection
 
Section "Module"
  Load "bitmap"
  Load "dbe"
  Load "ddc"
  Load "dri"
  Load "extmod"
  Load "freetype"
  Load "glx"
  Load "int10"
  Load "type1"
  Load "vbe"
EndSection
 
Section "InputDevice"
  Identifier "Generic Keyboard"
  Driver "kbd"
  Option "CoreKeyboard"
  Option "XkbRules" "xorg"
  Option "XkbModel" "pc105"
  Option "XkbLayout" "us"
  Option "XkbOptions" "lv3:ralt_switch"
EndSection
 
Section "InputDevice"
  Identifier "Configured Mouse"
  Driver "mouse"
  Option "CorePointer"
  Option "Device" "/dev/input/mice"
  Option "Protocol" "ExplorerPS/2"
  Option "ZAxisMapping" "4 5"
  Option "Emulate3Buttons" "true"
EndSection
 
Section "InputDevice"
  Identifier "Synaptics Touchpad"
  Driver "synaptics"
  Option "SendCoreEvents" "true"
  Option "Device" "/dev/psaux"
  Option "Protocol" "auto-dev"
  Option "HorizScrollDelta" "0"
EndSection
 
Section "Device"
  Identifier "ATI Technologies, Inc. M24 1P [Radeon Mobility X600]”
  BusID “PCI:1:0:0″
  Driver “radeon”
  Option “SWcursor” “0″
  Option “EnablePageFlip” “1″
  Option “AGPMode” “8″
  Option “AGPFastWrite” “1″
  Option “AccelMethod”   “XAA”
  Option “ColorTiling” “1″
  Option “DynamicClocks” “1″
  Option “XAANoOffscreenPixmaps”
  Option “RenderAccel” “1″
  Option “no_accel” “0″
EndSection
 
Section “Extensions”
  Option “Composite” “Enable”
EndSection
 
Section “Monitor”
  Identifier “Builtin LCD”
  HorizSync 28.0 - 70.0
  VertRefresh 43.0 - 60.0
  Option “DPMS”
EndSection
 
Section “Screen”
  Identifier “Default Screen”
  Device “ATI Technologies, Inc. M24 1P [Radeon Mobility X600]”
  Monitor “Builtin LCD”
  DefaultDepth 24
  SubSection “Display”
    Depth 1
    Modes “1280×800″
  EndSubSection
  SubSection “Display”
    Depth 4
    Modes “1280×800″
  EndSubSection
  SubSection “Display”
    Depth 8
    Modes “1280×800″
  EndSubSection
  SubSection “Display”
    Depth 15
    Modes “1280×800″
  EndSubSection
  SubSection “Display”
    Depth 16
    Modes “1280×800″
  EndSubSection
  SubSection “Display”
    Depth 24
    Modes “1280×800″
  EndSubSection
EndSection
 
Section “ServerLayout”
  Option “AIGLX” “true”
  Identifier “Default Layout”
  Screen “Default Screen”
  InputDevice “Generic Keyboard”
  InputDevice “Configured Mouse”
  InputDevice “Synaptics Touchpad”
EndSection
 
Section “DRI”
  Mode 0666
EndSection

Note the “AIGLX” line in there. That’s right, by using the “radeon” driver we are able to run Compiz in AIGLX. This means our xv and OpenGL buffers are completely free since no Xgl layer is completely devouring them. Rock on!

Also of note is that I have set the “AGPMode” to “8.” According to the official “radeon” driver documentation, the highest setting is “4″ and any settings besides “1,” “2″ and “4″ are invalid and ignored. I ran “glxgears” with each of these settings, and found marked improvement when I set it to “8.” Is this a hidden feature? Beats me, but it is measurably faster.

Log out and log back in to refresh GDM and come up under the new X server we just configured. Run the command “glxinfo | grep string” and be sure you are getting this output:

server glx vendor string: SGI
server glx version string: 1.2
client glx vendor string: SGI
client glx version string: 1.4
OpenGL vendor string: Tungsten Graphics, Inc.
OpenGL renderer string: Mesa DRI R300 20060815 x86/MMX/SSE2 TCL
OpenGL version string: 1.3 Mesa 6.5.2

If you match up, congrats! Everything is running beautifully. The rest of this guide will explain how to install Beryl or Compiz-Fusion — your pick. The last settings are for Xfce users. If you use GNOME, you will need to add the executable lines to your startup services.

Open the file /etc/apt/sources.list as your root user and add this line to the end.

deb http://download.tuxfamily.org/3v1deb feisty eyecandy

Save and exit, and run the following command to update your repository:

# apt-get update

When that finishes, it’s time to pick Compiz-Fusion or Beryl. Beryl is a dead project, but is faster on some setups and comes with very nice defaults. Compiz-Fusion takes a lot of configuring to make it behave like Beryl, but can be faster for other users. Some of its effects take noticeably less CPU power.

If you want Compiz-Fusion, enter this command:

# apt-get install compiz compiz-gnome compizconfig-settings-manager compiz-fusion-plugins-extra compiz-fusion-plugins-unofficial emerald emerald-themes libcompizconfig-backend-gconf

If you want Beryl, enter this command:

# apt-get install beryl beryl-manager emerald emerald-themes

Don’t let the command length fool you — they install about the same amount of stuff, but Compiz-Fusion is just more segmented.

When that is done, it’s time to test. Try running these two commands:

compiz -- replace &
emerald &

For Beryl users, run:

beryl &
emerald &

If you had no errors returned and you now have windows with window borders, everything is working perfectly. If you got errors, I’m sorry :(

The last step is to make Compiz-Fusion or Beryl start automatically in place of Xfwm4, the default Xfce window manager.

Open up Thunar, unhide files, and browse to /home/USERNAME/.config/autostart. We are going to make two program entries for Compiz-Fusion/Beryl and Emerald which will start automatically when you log in.

Right click and pick “Create new document.” Add the following text to the first one.

For Compiz-Fusion users:

[Desktop Entry]
Exec=compiz
Name=Compiz Window Manager
Encoding=UTF-8
Terminal=false
Type=Application

For Beryl users:

[Desktop Entry]
Exec=beryl
Name=Beryl Window Manager
Encoding=UTF-8
Terminal=false
Type=Application

Save this file as “compiz.desktop” or “beryl.desktop.”

Next, make a file with this in it:

[Desktop Entry]
Exec=emerald
Name=Emerald Theme Manager
Encoding=UTF-8
Terminal=false
Type=Application

Save this one as “emerald.desktop.”

You are all set! Log out and log back in. Xfsession and Xfdesktop will come up immediately, then there will be a slight delay as the Compiz-Fusion/Beryl window manager loads, and then the Emerald window decorations load.

Enjoy your speedy new 3D desktop and be sure to thank Mesa3D, the wonderful, free OpenGL implementation which works so well with this card.


About this entry