Archive for October, 2006

DRI with ATI Cards under Ubuntu Edgy Eft

Saturday, October 28th, 2006

By following this thread I was able to get DRI (for hardware accelerated 3D) to work for my ATI Radeon 9250 card.

If you’re too lazy to dig it up, here’s the low-down on things:

  • DRI is broken because the kernel drm.ko module refuses to load on start up.
  • This is linked to recent updates concerning AIGLX.

Indications of this error:

$ grep WW /var/log/Xorg.0.log
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(WW) The directory "/usr/share/X11/fonts/cyrillic" does not exist.
(WW) fglrx: No matching Device section for instance (BusID PCI:1:0:1) found
(WW) fglrx(0): board is an unknown third party board, chipset is supported
(WW) fglrx(0): Probed monitor is 320x240 mm, using Displaysize 336x269 mm
(WW) fglrx(0): ***********************************************
(WW) fglrx(0): * DRI initialization failed!                  *
(WW) fglrx(0): * (maybe driver kernel module missing or bad) *
(WW) fglrx(0): * 2D acceleraton available (MMIO)             *
(WW) fglrx(0): * no 3D acceleration available                *
(WW) fglrx(0): ********************************************* *

Then when you try to manually load the drm module:

$ sudo modprobe drm
Password:
FATAL: Error inserting drm (/lib/modules/2.6.17-10-generic/kernel/drivers/char/drm/drm.ko): Cannot allocate memory

To fix it you should edit your /etc/X11/xorg.conf and add the following lines if you don’t already have them:

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

If you have been using the Open Source X.org drivers for ATI (ati) while you switched to fglrx, you must reboot your computer. Simply zapping your X server will not do the job. It seems that the kernel is left in a complete mess when you switch drivers. Additionally before rebooting, make sure that the fglrx module is loaded by the kernel on startup. Do:

$ grep fglrx /etc/modules

You should get fglrx as a result. If nothing is displayed, then do:

$ sudo nano /etc/modules

add fglrx on a line of its own, save the file and reboot.

Note that it’s no longer required to use an older libGL.so.1.2 if you have an RV2xx card. The current driver version that ships with Edgy seems to work with these low-end cards.

Ubuntu Edgy Eft… Yay!

Saturday, October 28th, 2006

I just finished upgrading to Ubuntu 6.10, code named “Edgy Eft”. On the surface, it looks no different from 6.06 (Dapper) but Gnome certainly feels a lot faster. Startup is still a bit slow, but mostly because I have a lot of startup programs (Apache, MySQL, and Postgres). Firefox 2.0, Gnucash 2.0.1, OpenOffice 2.0.4, Mono 1.1.17, Beagle, F-Spot, Tomboy, and Gnome 2.16 were all very compelling reasons for an upgrade.

Upgrade went smoothly and it was all done via the Update Manager GUI. A few minor niggles to the upgrade:

  • 3D acceleration is broken again for my ATI Radeon 9250 graphics card. This time, it appears there is no workaround as the kernel drm module flat out refuses to load.
  • I don’t like the new “silent” usplash where only a progress bar is shown. I liked the Dapper version better where you get to see what’s happening.
  • Firefox 2.0 appears to have some issues with regards to the Flash plugin. Hopefully this does not have an effect on the upcoming Flash 9 player for Linux.

Flash Player 9 Beta for Linux: Get it while it’s hot!

Thursday, October 19th, 2006

It’s here! I haven’t gotten around to trying it out yet seeing as I have a lot of work to do around here. But from initial reports on Digg, it looks like Mike Melanson and his team at Adobe have done a good job. They did the right thing in releasing a Beta early instead of having to rely on themselves to do a lot of the testing work on the multitude of Linux distributions out there.

Go here. I prefer to sit this one out at this stage…

PHP4 Tricks: The Singleton Pattern – Part I

Thursday, October 19th, 2006

This is the first of a series of “PHP4 Tricks” articles detailing programming techniques that I have used with PHP4. These tricks are centered on object-oriented programming. They were necessary during the pre-PHP5 days when OOP was a bit of a pain to implement OOP constructs and GoF patterns in PHP4. These days, PHP5 is gaining rapid widespread adoption. But there are still systems and shared webhosts out there that do not support PHP5 at the time of writing. There are also a lot of systems out there that are written in PHP4 that do not translate well into PHP5.

PHP5 supports a whole slew of object-oriented keywords and features. This makes it easier to properly implement the design patterns featured in the GoF book. That said, new systems that are based on GoF patterns and practices should be programmed using PHP5 instead of PHP4. PHP4 does not have all the necessary OOP keywords and features required to fully implement these patterns. But for the rest of us who are stuck with PHP4, we have no choice but to resort to tricks in order to implement most of the commonly used patterns.

We begin with one of the most commonly used patterns (at least in my experience), the Singleton design pattern.

5 May 2007: Fixed assignment operator based on “References with global and static variables” section and as pointed out in one of the comments.

(more…)