compiz screenshot

Some tips for using Compiz and Beryl with an ATI Radeon Video Card under Ubuntu Feisty

Now that we have the ability to run multiple Software Defined Radios at the same time on one computer, we need a way to display all of that data. There are two Linux Windows Managers that appear to be well suited to this task, Compiz and its offspring Beryl. Beryl broke free from Compiz in late 2006, and as of Summer 2007 they have reunited as Compiz Fusion. These programs provide a number of important enhancements over the standard windows managers. For our purposes the 'cube' display where 4 or more workspaces can be simultaneously displayed is important. But they also allow variable transparency, zoom, and resizing of individual windows plus much more.

I started with Compiz and then switched to Beryl, and am now using Compiz Fusion, as both Compiz and Beryl have individually been rendered obsolete since they merged to form Compiz Fusion. My remarks below apply to my initial attempts getting the now-retired Compiz and Beryl up and running. I plan to add to this page what to do to get Compiz Fusion up and running, but have not yet done so.

Compiz is included in Ubuntu as "Desktop Effects". Go to System:Desktop Effects" on the Ubuntu Top Toolbar and click on "Wooble" and "Cube" and you should have it enabled. If things are working properly you should be able to shake a window with the mouse and have it undulate like a plate of jello. If not, then you have work to do.

I couldn't get Compiz or Beryl to work right off because I am using an ATI Radeon X1300 card that requires a proprietary ATI driver to perform properly for me for other tasks, and the default X server GLX extension AIGLX won't work with proprietary ATI drivers. So I had to use the server XGL instead.

Compiz seems to work perfectly here under XGL and I have found so far no ill-effects of using XGL as my X server. Here I have installed most of the Compiz-related packages listed by Synaptic. Not all of them are needed but this is what I have:

compiz 1:0.3.6-1ubuntu13
compiz-core 1:0.3.6-1ubuntu13
compiz-dev 1:0.3.6-1ubuntu13
compiz-extra 0.3.6-1ubuntu12
compiz-gnome 1:0.3.6-1ubuntu13
compiz-gtk 1:0.3.6-1ubuntu13
compiz-plugins 1:0.3.6-1ubuntu13
desktop-effects 0.7.1-0ubuntu4
gnome-compiz-manager 0.10.3-0ubuntu1
libcm-dev 0.1.1-0ubuntu2
libcm7 0.1.1-0ubuntu2
libdecoration0 1:0.3.6-1ubuntu13
libdecoration0-dev 1:0.3.6-1ubuntu13
libgnome-compiz-manager0 0.10.3-0ubuntu1
libgnome-compiz-manager0-dev 0.10.3-0ubuntu1

If you don't already have XGL [xserver-xgl is the package name] installed you can install it via Synaptic. My version of xserver-xgl is 7.2.0.git.20070224-0ubuntu3.

You need to set up some scripts so that when you start Ubuntu, the XWindows session under XGL will be set up properly. To set up these scripts I used the instructions at the URL that start with the text "Alternate method: Using closed source FGLRX drivers from ATI" and end with the text "Disable the universe repositories (these provide Beryl software that is incompatible with the fglrx driver)". The instructions after this last text are for installing Beryl if you have an ATI proprietary video driver, and I will discuss this later.

Follow the instructions as outlined on this page.

My script for is slightly different:

Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &
cookie="$(xauth -i nextract - :0 | cut -d ' ' -f 9)"
xauth -i add :1 . "$cookie"
dbus-launch --exit-with-session gnome-session

NOTE that I do not have 'exec' before dbus-launch.

Once you have installed XGL and have created the scripts as indicated, you are ready to restart Xwindows. You can do this by typing ctl-alt-backspace. Then, start an XGL session from the login screen by clicking on "Options" and then "Select Sessions" at the lower left corner, and then selecting "Gnome with XGL" and then "Change Session". Then login as usual. Once you have things working OK you can make this your default.

Once you are logged into your XGL windows session, you can set the Compiz parameters by doing: System:Preferences:GL Desktop from your Top Ubuntu Toolbar, and then Click to enable GL Desktop and set the options from there.
If things don't work, check your /etc/X11/xorg.conf file.

The Section "Module" should include:

Load "dri"
Load "glx"
Load "vbe"

My Section "Device" starts with:
Identifier "ATI Radeon"
Driver "fglrx"
Busid "PCI:6:0:0"

and the xorg.conf file ends with:

Section "DRI"
Mode 0666
Section "Extensions"
Option "Composite" "0"

WIth things set up like this, running 'fglrxinfo' from the command-line gives:

display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: Radeon X1300 / X1550 Series
OpenGL version string: 2.0.6334 (8.34.8)

If you need more information on what is going on with GLX, you can run 'glxinfo' from the command line. Here it shows:

name of display: :1.0
Xlib: extension "XFree86-DRI" missing on display ":1.0".
display: :1 screen: 0
direct rendering: No
server glx vendor string: SGI
server glx version string: 1.2
server glx extensions:
GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_OML_swap_method,
GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_hyperpipe,
GLX_SGIX_swap_barrier, GLX_SGIX_fbconfig
client glx vendor string: ATI
client glx version string: 1.3
client glx extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context,
GLX_ARB_get_proc_address, GLX_SGI_video_sync, GLX_ARB_multisample,
GLX_ATI_pixel_format_float, GLX_ATI_render_texture
GLX version: 1.2
GLX extensions:
GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_import_context,
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: Radeon X1300 / X1550 Series
OpenGL version string: 1.2 (2.0.6334 (8.34.8))
OpenGL extensions:
GL_ARB_multitexture, GL_ARB_texture_border_clamp, GL_ARB_texture_cube_map,
GL_ARB_texture_env_add, GL_ARB_texture_env_combine,
GL_ARB_texture_env_dot3, GL_ARB_transpose_matrix, GL_EXT_abgr,
GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_subtract,
GL_EXT_texture_env_add, GL_EXT_texture_env_combine,
GL_EXT_texture_env_dot3, GL_EXT_texture_lod_bias

visual x bf lv rg d st colorbuffer ax dp st accumbuffer ms cav
id dep cl sp sz l ci b ro r g b a bf th cl r g b a ns b eat
0x2c 24 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 0 0 None
0x2d 24 tc 0 32 0 r . . 8 8 8 8 0 0 0 0 0 0 0 0 0 None
0x2e 32 tc 0 32 0 r y . 8 8 8 8 0 24 8 0 0 0 0 0 0 Ncon
0x2f 32 tc 0 32 0 r . . 8 8 8 8 0 0 0 0 0 0 0 0 0 Ncon

Once you have things working, you can switch workspaces just by moving the mouse to the right edge or left edge of the screen; that will rotate the cube to the next face. Or you can do cntl-alt right-arrow or cnto-alt-left-arrow. Other Compiz commands are detailed here: Compiz Commands

If you have an ATI Radeon card, note that not just any proprietary driver will work with XGL. For me, the newest ATI drivers right off their website DO NOT work! I use the Proprietary ATI driver that comes as Ubuntu "Restricted Software" with Feisty, and it works fine.

Although Beryl and Compiz will be reuniting, you might want to run Beryl instead of Compiz [though I am happy with Compiz]. The current Ubuntu version of Beryl will not work with the ATI proprietary driver, because the packagers left beryl-xgl out of the package. Fortunately, the URL noted above gives instructions. Use the instructions at the URL that begin with the text "Disable the universe repositories (these provide Beryl software that is incompatible with the fglrx driver)". You should have already completed out the preceding instructions to set up XGL as noted above.

Basically, this installs from a non-standard repository a version of beryl / beryl-xgl that is compatible with the proprietary ATI fglrx drivers .

In order to avoid a blank white screen I first learned to start my session with the command:

LD_PRELOAD=/usr/lib/fglrx/ beryl & emerald &

I did this by adding this to a script file that is run at startup.

However, this led to unpredictable behavior with the desktop going white after a while, and it was suggested that instead of using this line, I start beryl with the line

beryl-xgl --use-copy

By starting it with this method, beryl is working well here with no issues or glitches. Just create this file with your text editor and then set it to run on startup by going to:

System:Preferences:Sessions: and adding it using the "New" button. In my case I combined the necessary line with a line to set up my Logitech Marble Mouse trackball [see below].

While you are experimenting and trying to get things running, you will likely want to use one of these commands from the command line. You can type the line for beryl-xgl just as shown above. If for some reason you need to use the LD_PRELOAD line, try this variant:

LD_PRELOAD=/usr/lib/fglrx/ beryl --replace

Beryl commands are listed here. If you are having problems, it may be helpful for you to see my Xorg.0.log and xorg.conf files. My Xorg.0.log is here. It indicates that DRI is installed and working, even though glxinfo says "Xlib: extension "XFree86-DRI" missing on display ":1.0"". My xorg.conf file is here.

If you get into trouble because of the white screen or some other issue and 'can't get out of beryl' then you can ctl-alt-F2 and sign on to a non-XWindows session and modify the file /root/.beryl-managerrc [or /home/your_user_name/.beryl-managerrc] by setting "active_wm=1" and then beryl-manager can be started without automatically invoking beryl as the window manager.

You can restart XWindows without rebooting by just typing ctl-alt-backspace while you are in the session with the white screens [if you went to a non-XWindows session via ctl-alt-F2, just ctl-alt-F7 to get back to your session and then ctl-alt-backspace].

Finally, I should note that I needed to improve the functionality of my trusty Logitech Marble Mouse trackball in order to make full use of the many options available in Compiz. I had to modify the "InputDevice" section in /etc/X11/xorg.conf for the "mouse" as noted below. The appropriate xorg.conf settings are:

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ExplorerPS/2"
Option "Buttons" "9"
Option "ZAxisMapping" "4 5"
Option "EmulateWheel" "1"
Option "EmulateWheelButton" "8"

I also had to reassign the small right button and did this by adding to the startup scripts the script /root/xmodmap-settings:

xmodmap -e "pointer = 1 9 3 4 5 6 7 8 2 10 11 12 13"

Just create this file with your text editor and then set it to run on startup by going to:
System:Preferences:Sessions: and adding it using the "New" button.
This assigns the Logitech Marble Mouse Trackball buttons as follows:

left large button is 1
left small button is 8
right small button is 9
right small button is 3.

You can check how the mouse buttons are assigned with xev [a command line utility].

If you have xorg.conf set up as above, then with Compiz the small right button will work with the trackball to resize windows and the small left button will work for setting transparency and zooming.

Copyright 1997-2007 COPYRIGHT Roger Rehr W3SZ. All Rights Reserved

Brought to you by the folks at W3SZ