Archive for June, 2007

Recently, I got myself a Dell Inspiron 640m laptop. Looking at its spec: Core 2 T5300, 2GB RAM and Intel 945GM Express Integrated Graphics Controller, I realised, it is ideal to try out Compiz + AIGLX.

As I had done some reading over the net and knowing this time round, it seems this card should be quite simple to configured for Compiz + AIGLX. To my surprise, is not as simple as I had initially thought.

Today this article is about my attempt to get Compiz + AIGLX works with this system.


Let’s start by giving out some information of the system:

# lspci
00:00.0 Host bridge: Intel Corporation Mobile 945GM/PM/GMS, 943/940GML and 945GT Express Memory Controller Hub (rev 03)
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)
00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03)

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 2 (rev 01)
00:1c.3 PCI bridge: Intel Corporation 82801G (ICH7 Family) PCI Express Port 4 (rev 01)
00:1d.0 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #1 (rev 01)
00:1d.1 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #2 (rev 01)
00:1d.2 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #3 (rev 01)
00:1d.3 USB Controller: Intel Corporation 82801G (ICH7 Family) USB UHCI Controller #4 (rev 01)
00:1d.7 USB Controller: Intel Corporation 82801G (ICH7 Family) USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GBM (ICH7-M) LPC Interface Bridge (rev 01)
00:1f.2 IDE interface: Intel Corporation 82801GBM/GHM (ICH7 Family) SATA IDE Controller (rev 01)
00:1f.3 SMBus: Intel Corporation 82801G (ICH7 Family) SMBus Controller (rev 01)
02:00.0 Ethernet controller: Broadcom Corporation BCM4401-B0 100Base-TX (rev 02)
02:01.0 FireWire (IEEE 1394): Ricoh Co Ltd R5C832 IEEE 1394 Controller
02:01.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 SD/SDIO/MMC/MS/MSPro Host Adapter (rev 19)
02:01.2 System peripheral: Ricoh Co Ltd Unknown device 0843 (rev 01)
02:01.3 System peripheral: Ricoh Co Ltd R5C592 Memory Stick Bus Host Adapter (rev 0a)
02:01.4 System peripheral: Ricoh Co Ltd xD-Picture Card Controller (rev 05)
0c:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG Network Connection (rev 02)

Note the text in bold, there seems to be two display controllers in the system. Perhaps one is meant for external monitor, but in this little exercise, I only configure 00:02.0 not 00:02.1.


  • Setup X

The base system that I will be using is Slackware 12 rc1. Following the instructions from Intel I manage to build the kernel modules and activate it. As of now, it seems kernel 2.6.21.5 DRI for intel is older version than the link given by Intel.After that, run xorgcfg to create an initial xorg.conf at /etc/X11. From here, manually edit the generated xorg.conf:


Section “Module”
Load “dri”
Load “dbe”
Load “extmod”
Load “glx”
Load “xtrap”
Load “freetype”
Load “type1”
Load “record”
EndSection

and


Section “Device”
Identifier “Card0”
Driver “intel”
VendorName “Intel Corporation”
BoardName “Mobile 945GM/GMS/940GML Express Integrated Graphics Controller”
BusID “PCI:0:2:0”
Option “CacheLines” “32768”
Option “DRI” “true”
Option “AccelMethod” “EXA”
Option “PageFlip” “true”
Option “TripleBuffer” “true”
EndSection

I discover if I use the default X acceleration method of XAA, I can’t play any movies in XV. It keep giving error of lack of resources. Switching it to EXA solve the problem.

(update) Added Option for “PageFlip” and “TripleBuffer” – This should improve 3D performance (since I am using Compiz with all the visual stuff, I think this should be enabled).

Finally, make sure the following sections are added:

Section “DRI”
Mode 0666
EndSection

Section “Extensions”
Option “Composite” “Enable”
EndSection

Once we reached here, X should be configured with DRI+AIGLX+Composite. Next we need to setup compiz.


  • Setup Compiz

From here, install Compiz and gnome-compiz-manager. I am using DLG, so the following steps are more related with Gnome than KDE.

1st – Create shell script for starting compiz:

#!/bin/sh

LIBGL_ALWAYS_INDIRECT=1 compiz –replace –sm-disable gconf &
gtk-window-decorator –replace &

I name this file as compiz-start and save it in /usr/bin directory. LIBGL_ALWAYS_INDIRECT is needed here. If this is not set, compiz won’t start.

(update) add –sm-disable option fix the session problem.

2nd – Add compiz-start into the session.

compiz-start.jpg

Once this is done, exit and login again, compiz should be running now.

3rd – The next step will be configuring the plugins. Launch gconf-editor, edit /app/compiz/general/allscreens/options, make sure active_plugins is the following order:

gconf, dbus, svg, png, decoration, minimize, wobbly, fade, cube, rotate, switcher, move, resize, place, zoom, scale, annotate

4th – Fix the workspace switch problem by referring to this link: Workspace Switcher Fix

Once we reached here, compiz should be working with all the nice effect. Enjoy!


  • Issues:
  • Even though full acceleration is working, it is unable to run glxgear (a 3D application) properly. This will imply 3D application will encounter problem when execute. It is being reported as a known bug. Below is the link for the bug report:
    https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-intel/+bug/116793
    Since it is still a know bug, and resolution has not been work out, there is no suggestion to resolve this problem.
  • Movie playback is working. However, if GL is enable, playing movie in full screen will be jerky.
Advertisements

My Desktop screenie

After playing around with my newly install Compiz on Slack-current, I decided to try rebuild the entire DLG from source.

Hey, since I had successfully upgraded my Slack11 to Slack-current, I think rebuilding DLG with new gcc and X should improve overall performance.

Oh, ya, Slack 12 RC1 has been released, and, DLG finally reached beta! Hurrah!

Edit: I just discovered that Drivel (comes with DLG) can remotely update my WordPress blog!

I know the official recommendation is not to use current for DLG, but hey, I guess I was bored, and after reading about Compiz and seeing how all the fancy stuff it can make from here, it is very tempting for me to give is a try.

I have been using Slack11, reading from Compiz, it needs Xorg7.0 or above and since Slack11 is using Xorg6.9, either I upgrade to Slack-current now (as of now, it already comes with Xorg7.2) or build Xorg7.2 myself. These days, I rather lazy to compile it myself, so I decided to upgrade to Slack-current as the easiest method for me.

I usually use swaret to automate my updating and upgrading process. I was hoping that I can do the same upgrading through swaret. However, after reading the ChangeLogs, I realize is not a good idea. Since there a big change in GLIBC version and sysinit scripts also changes quite a bit (just to name a few). I hate the idea of doing a complete new installation, since it implies I need to nuke my existing setup and it is running beautifully with DLG 2.18.1.

So, this little article is simply my little attempt to upgrade my existing Slack11 to the latest Slack-current.


1st – Download the latest Slack-current and burn it into DVD. This is simple, first create a empty directory, cd into it, and after that, use rsync:

$ rsync -arzv –stats –progress -I –delete-after rsync://rsync.slackware.at/slackware/slackware-current ./

After rsync finished, a new directory slackware-current should be created. CD into it and just follow the instruction in ./isolinux/README.TXT:

$ mkisofs -o /tmp/slackware-dvd.iso -R -J -A “Slackware Install” -hide-rr-moved -v -d -N -no-emul-boot -boot-load-size 32 -boot-info-table -sort isolinux/iso.sort -b isolinux/isolinux.bin -c isolinux/isolinux.boot -V “SlackDVD”

$ growisofs -Z /dev/dvdrw=slackware-dvd.iso

Actually, I don’t really need to burn it to DVD since I can mount it as loop device and install from there. However, having a bootable DVD can come in handy if hitting problem – we can use it as a rescue disk.

2nd – Mount the DVD and following the instructions in CHANGES_AND_HINTS.TXT in the DVD, but do it until step 7. For kernel configuration, make sure dm_mod is built into the kernel.

3rd – Switch back to runlevel 3 and use swaret! Modify /etc/swaret.conf:

  • version=current
  • ROOT=file://mnt/cdrom (if CDROM is mounted here)
  • NIC=lo
  • EXCLUDE=swaret python pilot-link
    EXCLUDE=aaa_
    EXCLUDE=MANIFEST.bz2$
    EXCLUDE=.*dl$ . *PACKAGER$ . *MYBUILD$

DLG needs python 2.4.3 and pilot-link 0.11.8, so we can’t upgrade them. Now, run swaret:

$ swaret –update
$ swaret –upgrade

From here, just follow instruction as it prompt. NOTE: swaret is my choice, since it will just update and upgrade all the packages that I use, the default guide from Slack suggest to install all, which is not my preference. However, our taste may varies.

4th – Install packages that were not upgraded by swaret: file, findutils, which, sysvinit, sysvinit-functions and sysvinit-scripts from A series. Make sure all the *.new files in /etc/rc.d/ is properly rename to its corresponding target. This is important!

5th – Install all the packages in X series.

$ installpkg slackware/x/*.tgz

From here, do a reboot and make sure everything boot up properly (it should be, at least for my system). Remember to set default run level as 3 in inittab before reboot since X has not yet configured.

Once system boot up successfully, built compiz and gnome-compiz-manager from source. Just do ./configure in the source directory. I use checkinstall to create the Slackware packages, so I can easily manage them later. The instructions found at this link is helpful for installing compiz:

http://forum.compiz.org/viewtopic.php?t=239

Use gnome-compiz-manager to play around with the settings.

If we reach here, this mean, the upgrade has been completed. Have fun!

Here are some basic instructions that I found from the net for using Compiz:

  • Ctrl + Alt + Mouse Drag on Desktop rotates the Cube
  • Super + Right Click zooms the display. Mouse wheel or Enter will un-zoom.
  • Alt + Mouse Wheel on a Window adjusts the Window Transparency
  • Ctrl + Alt + Up Arror also gets you the Expose effect
  • Ctrl + Alt + Down Arrow gives a panoramic view of all the desktops
  • You can drag a Window from one cube surface to another
  • Every Gnome desktop has it’s own independent cube

NOTE:

  1. I am not going to cover the configuration of graphic drivers, since this maybe varies between different graphic devices. I am using NVIDIA GeForce4 MX 4000 – The setup and configuration is fairly simple. There are documentation at Compiz that cover this as well.
  2. Remember to read the CHANGES_AND_HINTS.TXT carefully. Our setup will most likely be different, thus, the requirements maybe different as well. This article should be used as reference, not a generic guide.