Sunday, October 28, 2007

MacBook Linux Live CDs

Last week, Ubuntu 7.10 came out, and so I thought I might give it a try on my August 2006 MacBook (non-Pro). Today, I tried out the Fedora 8 Test 3 Live CD - the same thing Ubuntu provides with its "Live Desktop" CD (boot system from CD, try it out, if you like it, you can install it to your hard disk).

Guess what? Ubuntu 7.10 crashed with a distorted screen, while Fedora 8 booted happily with a very nice boot splash that even had mouse support. It also seems like Fedora 8 is more advanced, technology-wise with its PulseAudio (very cool) and NetworkManager 0.7, although I think the version of NetworkManager in Fedora 8 Test 3 isn't the NM version that will be put in F8.

Anyway, testing these "new" releases of the flashy, user-friendly Linux distros showed me some really neat things (PulseAudio is what I want to have installed soon :), but I'm perfectly fine with my Debian testing/unstable system, which is cool, dpkg-based, fresh and already set up to my taste :) I also like the way Debian keeps most things "vanilla" and doesn't try to brand the whole Desktop with logos of the distro, and a special GTK+ and icon theme, opposed to the fully-branded Fedora and Ubuntu distros, although I'd like to see the new Fedora GTK, Metacity and GDM themes available as a package in Debian, because the look is quite nice.

Thursday, October 25, 2007

BSD-licensed Face Recognition Software

Curious as I am, I just tried to find some free software face recognition source code around the web. Among the two projects I found (one being very crude, unmaintained old C++ code), the Machine Perception Toolbox was the most interesting and advanced library, licensed under a BSD-style license.

On Debian, you have to install the "bjam" package, modify the "boost-build/user-config.jam" file (put "using darwin;" in comments and comment-out "using gcc;"). Then, cd into "Apps/unix/mpisearch" and simply run "bjam" (it's a make-like thingamoob). The resulting binary can be found in "bin/gcc/debug/optimization-speed/mpisearch", and you can simply call it with an image file as argument which will be processed and the result displayed on your X server. You might have to install the Magick++ development packages if compilation fails and fix some namespace problems in the C++ code (quite obvious after Googling for the error message).

The source code for the "mpisearch" is in "Apps/unix/mpisearch/main.cc", and it's very easy to understand, so you can modify the code to fit your needs (e.g. make it output the coordinates of the "face" rectangles and then parse the command's output in your scripts, etc..). Maybe that would be an interesting feature to add to photo websites :)

Saturday, October 6, 2007

Fixing Macbook problems

Today, I've set out to fix some problems and annoyances that I had with my MacBook (August 2006) for several months:
  • Suspend-to-RAM not working
  • CD-ROM drive works unreliably (hda: drive appears confused)
  • Newer kernels don't boot ("NMI appears to be stuck (0->0)!")
  • Random lock-ups when VT switching from Xorg to text console
Kernel command-line parameters
I figured some of these problems were related to having obsolete/old kernel command line parameters that were needed for older 2.6 kernels to get things working, but are not needed for recent kernels. I'm currently using Debian's stock 2.6.22-2-686 kernel. The "append=" line in my /etc/lilo.conf for the kernel was "noapic acpi=force irqpoll resume=/dev/sda4". Removing the "noapic" option fixed the "NMI appears to be stuck" problem. Additionally, removing the "irqpoll" option fixed the CD-ROM drive problem ("drive appears confused"). Now, I can boot newer (2.6.22) kernels and have a working CD-ROM drive again (previously, the CD-ROM drive spontaneously "detected" an inserted Audio CD when there really was no CD inserted).

Compiz Fusion/Beryl and the intel driver bug
I've been running Compiz Fusion (and previously Beryl) and it worked great, except that when VT switching to the text console, the whole Macbook locked up sometimes. This bug is described in bug #127101 on Launchpad.net. So, I have now disabled the whole Compiz Fusion stuff and things seem to be working fine now, I have not yet had a random lock-up and garbled screen since. Sure, Metacity is not as nice as Compiz Fusion, and some Compiz features are really useful (Scale plug-in and Expo plug-in among some others), but it's better to have reliable shutdown than some Desktop bling-bling. With this text VT switch bug fixed, I've tried Suspend-to-RAM, which also seems to work okay-ish now. That would make Linux (Debian) awesome on that Apple MacBook :)

Thursday, October 4, 2007

Hauppauge WinTV Nova-T Stick under Linux

I just got myself a Hauppauge WinTV Nova-T Stick (USB) and tried to get it working in Linux. With a bit of fiddling, I've got everything working, and also found an application to extract EPG info that can be displayed with OnTV.

First of all, you need to get the correct firmware. The file you need should be in the "dmesg" output after plugging in the stick. For me, the firmware file I needed was dvb-usb-dib0700-01.fw, so I googled around for it, found it and placed it in /lib/firmware/. After re-connecting the stick, the "dmesg" output should tell you that the firmware has been loaded. To get a working list of channels, I used w_scan with the "-X" parameter to generate a channels.conf.

Then, I downloaded xine (actually, I installed xine-ui in Debian) and placed the previously-generated channels.conf into ~/.xine/. This should already make things working: Start up xine, select "DVB" and wait for the channel to load. I had to change my window manager from Compiz to Metacity to prevent some errors related to the video stuff. With Metacity as window manager and xine, I get very good and performant video.

For EPG/XMLTV, I checked out the current Subversion trunk head of tv_grab_dvb. Compile it. To get the EPG data, you can't just simply tv_grab_dvb (or you can, but you would have to tune in somehow, which I didn't figure out). I solved this problem by simply running xine and watching TV, which tunes in into the right station, then running "tv_grab_dvb -e utf-8 -t 2 > ~/tv-guide.xml". This should result in a nice XMLTV file that can be parsed by other applications to give you EPG info. You can load this file into OnTV and have an EPG. To get OnTV for Debian, I downloaded the Ubuntu source package for "ontv" and compiled it on Debian. Then, add "OnTV" to your gnome-panel and configure it with the XMLTV you generated above. Then, select the TV channels to monitor and click on the TV icon. You should see the list of current programs.

So, DVB-T on Linux works fine with the Hauppauge WinTV Nova-T Stick. Neat!

Update: The stick was only for testing compatibility on Linux, I don't use it anymore. Please see the Linux TV websites for more information.