Wednesday, May 23, 2007

An Open Source Google Base

I think Google Base is far too good an idea to see only an implementation from Google, accessible only through their APIs.

Is there an open source clone?

Or wanna build one? *grin*

At the very least, it'd require the following components:
  1. A frontend to convert and store the XML data into the backend. See the "* Feeds" reference documentation for the formats.
  2. A query engine to understand and execute the URL query syntax. At high-speeds. This is the hard part. See also: Query Lang Specification.
  3. A mechanism to store data in such a way to enable high-speed lookups as well as support all those different types of data. This is the very hard part, in my humble opinion.
Think of it, at a minimum, as a way of putting an URL query mechanism to an existing database like PostgreSQL. We could probably take it from there.

What's the use? Well, the web could do with a database service that can do everything Google Base can, but without any Google-specific idiosyncracies. Plus, it'd be compatible with Google Base!

Unlike most of my projects, this one is not so well thought out, as you can probably see from the fact that I don't even have a name for this project yet. Suggestions?

Friday, May 18, 2007

Why FOSS is Better, Yet another Case Study

Recently developers at Intel released a tool called PowerTOP. For users familiar with top on Unix systems, this tool is similar, except it displays information on programs that are "waking" up the CPU often. What does this mean? To cut a long story short, it means you can now identify which programs are interrupting a CPU's sleep, and determine if that interruption could have been handled in a better way, letting the CPU sleep longer. That way, battery power could be saved.

Why is this tool a good example of Free Software at work? Not only did the developers create this tool, they also identified many free/open source software programs where things could be done better. Because the source was available, they were even able to make patches -- or modifications -- available so that battery life was extended by "an hour or more!" This is amazing. Imagine doing this on your insert-favorite-proprietary-operating-system here. It'd take years for the OS vendor to get it, then the programmers to get it, and then for them to get together and do it.

Why is this on my blog? I use liferea, a feed reader that manages my RSS feeds, and the latest release has this cryptic changelog: "This release decreases CPU power consumption for laptop users". My life is already better, thanks to PowerTOP.

Oh yeah, bonszai says, "Thank you, Intel!"

Monday, May 07, 2007

Summer Surprise




This is a PicoPeta Simputer...you are assimilated!


blob version 2.0.5-pre2 for PicoPeta Simputer

Copyright (C) 1999 2000 2001 Jan-Derk Bakker and Erik Mouw

Simputer platform Copyright (C) 2002 Vivek K S, PicoPeta Simputers Pvt. Ltd.

blob comes with ABSOLUTELY NO WARRANTY; read the GNU GPL for details.

This is free software, and you are welcome to redistribute it

under certain conditions; read the GNU GPL for details.

Memory map:

0x01000000 @ 0xc0000000 (16 MB)

0x01000000 @ 0xc8000000 (16 MB)

Loading blob from flash . done

Loading kernel from flash ... done

Autoboot in progress, press any key to stop ..

Starting kernel ...


Uncompressing Linux............................................ done, booting the kernel.


Simputer login: root
[root@Simputer /dev]$cat /proc/cpuinfo /proc/meminfo
Processor : Intel StrongARM-1110 rev 8 (v4l)
BogoMIPS : 127.38

Features : swp half 26bit fastmult

Hardware : Picopeta-Simputer
Revision : 0000
Serial : 0000000000000000
total: used: free: shared: buffers: cached:
Mem: 31494144 19243008 12251136 0 1429504 9195520
Swap: 0 0 0
MemTotal: 30756 kB
MemFree: 11964 kB
MemShared: 0 kB
Buffers: 1396 kB
Cached: 8980 kB
SwapCached: 0 kB

Active: 3452 kB
Inactive: 11716 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 30756 kB
LowFree: 11964 kB
SwapTotal: 0 kB
SwapFree: 0 kB

[root@Simputer /dev]$


Saturday, May 12.

Monday, April 30, 2007

The Feisty Fawn Upgrade

I finally did it last Thursday, upgrading from Edgy to Feisty. I thought it would be fun to relax by installing Feisty after a rather tough academic session. Oh boy, was I wrong! Regressions, a root file system corruption, and the eventual re-installation kinda disappointed me. But I'm running Feisty now! Here's how it went off.

After burning the DVD, I noticed the cdromupgrade script on the DVD, and decided to run it, instead of the normal aptitude dist-upgrade. A couple of clicks and one hour later, my system was upgraded to Feisty Fawn. Such simplicity -- I thought -- it can't be this easy! Yet it was. In a way.

Unfortunately the reboot failed. It would come to the boot screen and simply hang. Turns out, I had installed a custom kernel in Edgy, which was also set to be the default. This was simple to solve. Just select the Feisty kernel in the grub boot menu, and later reconfigure the previous kernel, dpkg-reconfigure linux-image-old, and it booted fine. I guess upstart's not really working well with the old kernel's initrd. Boot time is now 45s, down from 55s for Edgy.

The nv driver, as I mentioned in an earlier post, works perfectly. The coolest feature about X.org 7.2, is its ability to run without a xorg.conf file. Just remove the xorg.conf file, and see it run perfectly! It did, for me, atleast. I did have problems with the scrolling on the touchpad, but that was easy to fix, just add options psmouse proto=exps to /etc/modprobe.d/options.

Unfortunately, there were two regressions. The most evident, and a show-stopper for my laptop was support for the headphone jack. Unlike Edgy, where it wasn't even recognized, and I had to install the latest ALSA, in Feisty, both speakers and headphones work, but have a single volume control. Unfortunately the speakers aren't muted when I plug in my headphones. Incredibly annoying, as my labmates will testify, as I blasted Jonny Quest's theme song again and again. Feisty ships with ALSA 1.0.14rc1, and I had to compile and install 1.0.14rc3 from Debian, which was, thanks to make-kpkg, a breeze. Now, plugging in my headphones automatically mutes my speaker, and vice-versa. It's not perfect yet, I've to trigger the detection by muting/unmuting, but this is how it should be. The speakers also seem to sound much louder. FYI, the sound card/codec is a NVIDIA/Conexant CX20549 (Venice).

The second regression was Suspend/Hibernate. I use Suspend rarely, and it used to work beautifully in Edgy. Unfortunately it's broken in Feisty. I first thought it was a problem with nv, but the nvidia driver has the same problems. Also it turned out that my forced shutdowns ended up in me corrupting the root filesystem. Ouch.

Recover or re-install? Well, I always wanted to re-install Feisty (just for kicks), and here was the opportunity. So I wiped the root partition, and re-installed Feisty. Took about another hour, and I'm still re-installing apps -- but thanks to aptitude that's not much of a pain. All of my settings and data were not affected -- thanks to the good fortune of having a separate /home partition. What is a painful is that main in Feisty does not fit on the DVD, and you'll need the web repositories too. Irritating.

Oh yes, beryl 0.2.1 doesn't work either. The window decorator (emerald) doesn't work.

After all of this, what's Feisty worth to you? If you're using Edgy on a laptop and it's working, I recommend you continue. However, Feisty's GNOME feels much faster and lighter (and is too!), and having the latest and greatest applications always feels good. As I said, fun, but not relaxing. It works, but keep your fingers crossed!

What's really different about this install is the amount of software I had to add to make it all work. For Feisty, only ALSA. For Edgy, I had to do ALSA, ndiswrapper, network-manager, and some other stuff I've forgotten. So, this is progress. Two steps forward and one step backward, but progess nevertheless. Now to wait for the Gutsy Gibbon.

Update: May 7, 2007 Monty is my hero! Here are the options to add to the screen section in xorg.conf to get beryl working:

Options "AddARGBGLXVisuals" "True"
Options "DisableGLXRootClipping" "True"

Thursday, April 26, 2007

Flash 9.0 on 64-bit Ubuntu with Firefox 2.0

I'm watching the Mac vs. PC ads on Youtube, in the 64-bit Firefox 2.0 browser. This shouldn't be working, Adobe does not have an official 64-bit Flash player for any operating system, let alone Linux. You ask how? Here's the trick:

  1. Get nspluginwrapper sources from the Debian website.
  2. Compile and install.
  3. Get the Flash 9.0 player from Adobe.
  4. Untar, and copy libflashplayer.so and flashplayer.xpt to ~/.mozilla/plugins/
  5. Run nspluginwrapper -i ~/.mozilla/plugins/libflashplayer.so
  6. Enjoy!
I've done this before, with an older version of nspluginwrapper, but could never get sound working. Maybe the fact that I used RPMs (converted by alien) messed things up. Even now, however, nspluginwrapper segfaults. Thankfully it works for nspluginwrapper -i, which is all I that's required.

As an aside, swfdec is a free software Flash viewer that plays Flash videos, and so is gnash.

Furthermore, youtube-dl allows you to download the flash videos to your hard disk, where mplayer or ffplay (better) can play them.

Freedom in Sight?

I justed booted into Feisty Fawn today, using the live CD. Some pleasant surprises were in store.

Video worked perfectly. With the nv driver. Yes, the free nv driver. And from what I can tell by reading the X log, it seemed to have detected the external video outputs as well. If this really works, drivers from nvidia get thrown out.
Not only did the nvidia driver give me fewer resolutions, it also messed up my console. I used it only because it gave me VGA-out support, which is needed for presentations using bonszai. If nv can do that, well, nv it is then!

And bcm43xx, the free driver for Broadcom-based chipsets? It works too. Not only can the latest bcm43xx-cutter (006) use the drivers provided by Compaq, it also warns me that support is not in mainline yet for those drivers. So I must use the older drivers. Which is fine with me. So far web-browsing works. Web downloading does not, with speeds of 4--5 KByte/s (which is worse than dial-up)But to be fair, I really haven't tried wireless from my new location, so maybe I better check out my older version. Ubuntu now has network manager, which is really a painless way to configure networks, across operating systems I must add.

Given that video and wireless were the only two components of bonszai that used non-free drivers, I'm looking forward to running a fully-free bonszai!

Saturday, April 14, 2007

We're now Doctors!

Found when browsing a list of not-so-well categorized books:

Under section "Medical Books"
  1. Artificial Neural Networks
  2. Genetic Algorithms
:D

Thursday, March 08, 2007

The Death of the Web 2.0 Company?

I recently attended a talk by a Yahoo! executive on "Socially Immersive Media". That's the term they use for the phenomenon of user-generated content and other Web 2.0 elements. He was rather gung-ho about the prospects of these new Social Media companies, and how traditional media was finding it difficult to compete.

And then it hit me right in the middle of the talk. These "Web 2.0 companies" will be going the traditional way very soon. Their victory is a short victory.

Let's take a look at the web as being composed of "content", "applications" and "infrastructure". Early on, all these three components were supplied by one central, logical entity, not unlike how "old media" does it. And then came these new media companies, the "social media" companies, who ceded control over creation of content to the masses. They just provided the application (like Blogger, Flickr, etc.) and the infrastructure, but content was by the masses, of the masses and for the masses.

Of course, it's not written anywhere that applications or infrastructure are the exclusive domain of these social media companies. Open source applications, community-owned, have existed for a very long time now. Indeed, many users are already constructing applications (or "mashups") using APIs provided by some of these companies. These companies are the lucky ones. They'll go, but slower. It's not difficult to surmise that a few years on, these companies will be relegated to just providing infrastructure on which the masses write and run their applications.

But to truly democratize the web, we must own the infrastructure too. Now, this is a difficult problem. Can we set up a masses-owned Google, for instance, that meets similar standards of quality and performance and even exceeds them? Peer-to-Peer applications have already demonstrated that infrastructure can be owned by the masses, but how long is it before these protocols go "mainstream"?

Pipe-dream? Science fiction? Thanks to the Democracy TV/Player, it's not. This is a perfect example of what I'm talking about. The content for this Wired Magazine's "future of Net TV" application is all user-generated. It's a Free Software application written by the community. And it uses BitTorrent to get around the nasty problem of hosting video broadcast infrastructure. And it works!

Me doth think these companies rejoice too soon.

Saturday, March 03, 2007

On the Mechanics of Code Writing

Code writing contains some mechanical activities which are best automated by your editor. Here are some features any decent code editor should provide, to make your code writing more pleasurable. If you didn't know that these features existed, you should revisit your editor's manual now!

Block commenting and uncommenting of code

You've written some code, and you want to try out some other approach. You don't think this is worth a version control system, so you comment out code, and write new code. You probably do this frequently.

So it makes sense for your editor to support automatic code commenting and uncommenting features. You select a piece of code, press a few keystrokes, and the code selection is commented out. Beats inserting comment characters, especially when certain languages don't have a single-character comment delimiter.


Indenting and Re-indenting

Indenting improves code readability. I do not find reading badly indented code a pleasure. Perhaps the editor they used to write the code didn't support code indentation. Indentation affect newly written code, or old already written code. A good editor supports both.

When new code is being entered, the editor keeps track of the current indenting level, and then automatically indents the next line of code for you. Most editors do this.

Then re-indenting old code, some editors provide manual block indent and un-indent block features. You select a block, and then you can indent the block in or out, but manually. This is better than nothing.

The really good editors will allow you to select a region of code, and re-indent that region as per surrounding code.


Syntax Highlighting

After indenting, the next best feature that improves readability is syntax highlighting. Unlike most other features, this is something that you don't invoke, but something that always works in the background.


"Locate Symbol" Feature

Most editors have a Find feature, but a "locate" feature isbetter. You position the cursor underneath a symbol (function name,constant, etc.) and invoke locate. You'll find yourself at the definition of that symbol, regardless of whether it's in the current file or somewhere else.


Autocomplete Features

Autocompletion of variable names, function names, and other symbols. Very very productivity enhancing when done right. Unfortunately it's not easy to do this for some languages, and hence not many editors support it.

Wednesday, February 28, 2007

Copyright Myths and Misunderstandings

I first learnt about copyright the "hard" way. I was on the verge of releasing a program, and that entailed that I learn as much as possible on copyright and software licensing --- I'm one of those guys who actually reads the license agreements! As a pleasant side effect, I learnt about "copyleft", the GNU GPL and Free Software, which eventually led me to stop considering licenses for my software: my software is usually in the public domain (i.e. no copyright) or is GPLed (i.e. copylefted).

Here are some things you should know about copyright:
  1. Copyright registration is not required. It's very useful if you ever expect to go to court, but as a friend pointed out, just e-mailing the source to yourself at some public e-mail service, such as Gmail, would probably establish that you did it earlier. And you can keep your work secret too.
  2. Copyright is assigned automatically to you. There is absolutely no need to even say "Copyright (c) Year, Author". At least after 198x, I think.
  3. Copyright is available for all works, regardless of quality. It protects both your kindergarten drawings and Escher's complicated and beautiful works equally.
  4. Copyright covers only distribution. That should be evident from the name, but a lot of people put restrictions on use and ascribe them to "copyright". If you intend to distribute the work, for profit or otherwise, you need permission from the author. Note that if your use of the material falls under "fair-use", permission might not be required. However, fair-use is never defined explicitly, it's upto the courts to decide what exactly is fair-use.
  5. Copyright is limited. It expires. However, current copyright time limits are so generous that you may have to wait for a very long time for any part of current culture to fall into the public domain.
  6. The public domain, as a legal expression, means that there is no copyright asserted. A public domain work belongs to all, and everybody is free to do whatsoever he/she desires with it. Copyright and public-domain are mutually exclusive. You can put your works in the public domain by stating so, without having to wait for the expiry of your copyright.
Note that I'm not a lawyer, and the US Copyright Office's Copyright FAQ page has lot more information.

Wednesday, February 14, 2007

I'm Kewler than You Think (!)

Behold! My new SHE-F18P MP3 Music player!


This little baby brings me into that hallowed land of people who possess hardware digital audio players! Well, these days that's about almost everybody, and so nothing "kewl" about it, but who goes for technicalities anyway?

It's a 1GB player with MP3/WAV support. Unfortunately. Why did I get this? Well, it was gifted to me, and I couldn't refuse a freebie. I had my eyes on the Cowon iAudio family of players, which would have set me back a couple of thousand bucks, but no price can beat FREE when it comes to a poor student :)

Removable LiIon battery, with both wall and USB-based charging, support for about a dozen languages---it started up in Traditional Chinese! (This is probably why I got it!) I concentrated and hit the right buttons, and there was the French interface! Soon after there was the English interface. Some fumbling on part, Japanese followed by German/Deutsch and then finally English. I bet I can now do this in my sleep now.

In other notable features, supports LRC (Lyric files), can display text files as well, easy USB transfer mechanism (though seems very very slow on the download path). Notable anti-features: MP3-only support (no OGG!), doesn't seem to support M3U playlists (haven't tried PLS), no FM radio (though the manual does hint at FM support, I can't read Chinese!) and tacky buttons.

Amarok seems pretty happy with it, though it does seem to have it's own individual ideas of how to place files (configurable, of course), though the player doesn't seem to mind. But I do want playlist support.

As another sweet thing, I also got that old 256MB player that I lugged around once or twice in Jan 2006 (remember?), which means I can get down to reverse engineering it. My folks were kind enough to send rechargeable batteries and a charger too!

It does have firmware upgrade support, but I doubt the manufacturer has released anything at all. Retails for 199 Yuan (around 1200 rupees) in Walmart China I suppose.

Now I can get down to practising for Marathon 2008!

Update: It does play OGG! I've never been so happy to be wrong! Can't seem to read the metadata, but who cares (for now)! Note that the OGG support isn't advertised anywhere, it justed started playing the files! Whoo-hoo!

[Photo courtesy: NP]

Tuesday, February 13, 2007

Open your Data!

[Warning: Long long rant]

I'm scratching a rather irritating itch. I'd like to travel around in Bangalore, but I don't have the money to move around in rickshaws, nor can read Kannada to figure out where a particular bus goes (No dual language boards here!). After having been pampered by BEST, the BMTC is getting to be a royal pain.

I've bought maps, guide books, route maps, time tables, but they've all been "designed" without even consideration for the most common use-case. Just know the stop names? You're out of luck. No source lists stop names, only stage names (which is what the BEST also does, BTW).

Well, not exactly no source, for there is one source that has stop-level granularity. The superbly detailed large-format BMTC route map (50 bucks!) is that only source, but nobody intended it to be used that way. In fact, it's a mystery to me how people are supposed to use this thing. Only a laborious search through the entire map will reveal the locations of the stops, and once that is done, correlating that information to route numbers is next to impossible. In fact, the map wastes precious space on "segment numbers" (which I guess actually constitute routes), but that information in its present format is only intelligible to somebody on the inside--it's not used by any other information on the map.

Well, this is Bangalore, the IT capital of India, and so the BMTC provides a web-based interface to search. Except that it sucks big time. There are two versions, (and I'm guessing here) a "professional" JSP edition, and a "final-year project" PHP version. Forget the technical mistakes---using POST for idempotent data---the UI design is horrid. It's what most UI designers would say is the perfect example of the programmer-designed interface. Letting the UI reflect your code, and not the opposite. Both the "search engines" present drop-downs, presenting stage-to-stage information. Wow. I imagine that everybody travels from stage to stage only.

So what do I do? I do what I do best. I'm now writing a search engine for finding information about buses. Its called busfinder, and will initially provide "similar" functionality to the existing "search engines". Except, of course, it won't be tied down to the BMTC. I intend it to be used by any bus service. It will be small, fast, and featureful. It'll be written with the traveller in mind, and not the backend database structure. I've got a little experience doing this sorta thing, and hoping this will also clear up some of my programming blues.

Which brings me to the real topic of this post. Which is data. Everyone who's spent some time in this industry knows that programs are a dime a dozen. It's your data that's actually valuable. That's why vendors prefer to use proprietary data formats--once locked in, they know you'll be at their mercy forever. And that's why there exists even a data conversion sector.

But for my search engine, I need data. The BMTC could do me a wonderful service by giving me access to their data in a machine-readable form (maybe they will, if I ask, but I haven't and won't). But for now, I had to scrap their HTML pages. And as I have found, their data sucks. There are missing routes, incorrect stop names, and inconsistent information that all stink to heaven of five-buck-an-hour typists and even cheaper database architects (normalization, anyone?).

And then I had this idea inspired by their application to make their route maps available via Google Maps (which now has street-level data for Bangalore, but not yet searchable, aargh!), but there seem to be no public-domain (or even freely-licensed) geo-referenced information available for Bangalore. The info exists--see http://traffic.mapunity.org (functionally similar to busfinder, but with the same UI problems)and http://www.janaagraha.org/jmap/, but no data is available for download. It's all locked up behind the respective applications. No APIs either, so no mash-ups possible.

Which is why I make this appeal. Free your data! Make your data available in machine-readable format with liberal licenses for use by the general public. If you're a government institution or somebody who doesn't necessarily have computer expertise---tap the internet! Release your data and see how the brilliant minds of the 'Net breath life into your data. Remember, there is always a better program. But you may have the best data.

Monday, February 12, 2007

G'bye Windows Support

With Windows Vista, it's now two windows versions that I've never seriously used. I stopped using Windows when XP was released about 5 years ago, and have never looked back. I moved to Red Hat Linux, then to Ubuntu, using Debian along the way. This has meant that I'm really out of touch with the "mainstream" computing world.

That is not so bad. Imagine the tons of support requests I'd get, which I now decline with "Sorry I don't use Windows". And I'm not lying either.

Thursday, February 08, 2007

Wirefree!

I received a Jabra BT135 Bluetooth Headset, courtesy HP, a couple of days ago. Funny thing is that they import it to a place that's ten minutes from the Institute, but I had to wait for two months for it!

My primary purpose for this new toy was to use it with Bonszai, rather than with a mobile phone. Yes, it's mono and not stereo, but going wireless with audio would be fun! Turns out Linux does support these headsets out of the box, with the snd-bt-sco driver. Essentially, this driver supports bluetooth headsets by appearing as another sound card to all applications. This page has more details.

Unfortunately, nothing ever works out of the box for me. Turns out that because I'd re-compiled ALSA separately from the rest of the kernel, the snd-bt-sco driver refused to load, citing lots of missing (and version mismatched) symbols. Either I could recompile the entire kernel or go back to the older version of ALSA (and lose the normal headphone support!). I decided instead to upgrade to kernel 2.6.20 which I knew would have the latest ALSA. The only thing that would break would be the nvidia drivers.

So there I was, snd-bt-sco loaded, btsco running, and trying to get a song to play using aplay or mpg123. Except it just wouldn't play! The headset would pair up, authenticate, send messages to the computer whenever I pressed buttons, emit a ringtone when I commanded it from the computer, doing everything short of playing a song. All the music playing apps would just freeze. Others had encountered this situation too, but nobody seemed to have found a solution to it. Just bugreport after bugreport. I struggled for a long day, before giving up.

Today, I found this bluetooth-alsa page and this thread that documented a fix to exactly the same problem. The solution was simple: use the force_scofix argument to the hci_usb module (when you load it the first time), especially if you're running a Broadcom adapter.

Voila! It worked! Sound is not that great, but it is convenient to listen to music about 5 meters wire-free away!

I hate Broadcom. What's wrong with them? First wireless adapters, now Bluetooth adapters. Sigh.

Sunday, December 31, 2006

iPod 2nd Gen with Ubuntu Dapper

There was an nice Christmas present this time, bug #66068 had a fix and nice clean instructions as well! After a bit of recompiling (the debs in the bug report are for edgy!), meanlix now works perfectly with the second generation iPod Nano. That means none of the instructions here are required any more! [Except the part about using the latest version of libgtkpod]

D-Bus and HAL rock!

Wednesday, December 27, 2006

Meanlix gets some new hardware

I put in a much overdue USB 2.0 4+1 PCI extension card into meanlix today. That means the USB proliferation (and slowness!) has been limited. Going from a single USB1.1 slot to 4 USB2.0 slots should bring a sigh of relief to my gadget-happy siblings whose appetite for cameras, mobile phones and music players rather strained that single slot. And there's still an extra slot for that another USB gadget.

Another change I made was to put in another network card into meanlix, making it so much more easier to setup bonszai to access the Internet. No more swapping cables, now the net is shared between both the PCs. Maybe I should've gone further and put in a Wifi-adapter instead. Then I'd be able to roam the house with wi-fi in every corner. Maybe ...

Meanlix now has used up nearly all of its PCI slots, just one left, which is a first for my computers (and I think for most computers).

P.S.: Anybody got good PC100 256MB/512MB SD-RAM? I'd like to buy (after testing) please.

Saturday, December 16, 2006

Technology Funland

bonszai brought some unexpected benefits into my computing life. When you know meanlix is 5 years old, you realise that I'm really at the bottom of the hardware technology curve.

Not so with bonszai. It has technologies that I've never played with: Wi-fi (802.11g), bluetooth, and Firewire (IEEE1394).

With campus Wi-fi access, I'm really not tied down anymore, and can roam with ease, atleast within most departments. Furthermore, in Ad-Hoc mode, my friends and I can form a private Wi-Fi network (MANET) that leads to interesting possibilities.

Bluetooth (and especially it's Linux implementation) also has opened up some fun possibilities. I'm looking forward to receiving a pair of bluetooth headphones (courtesy HP, hopefully they'll be sent) and am trying to increase the number of bluetooth devices I'll use, especially a planner. BTW, the Linux implementation rocks and I've never seen it so user-friendly. Want to send a file to somebody in the neighbourhood? Just right-click the file, click Send-To, and select Via Bluetooth. Voila, a list of devices in the neighbourhood is presented for your sending pleasure! I think only Mac OS X has a better implementation.

This is, of course, nothing to say of the ethernet-over-bluetooth implementation (modprobe bnep) which is ultimately cool. It means my teensy laptop can connect via four different mediums (eth, fw, bluetooth, wifi), which is the most I've seen a device ever do! It often suffices when wi-fi doesn't (due to buggy drivers). Not very great speeds though.

Firewire is another story, for "sustained" speeds and rated 400Mbps, it's an excellent industry standard for data transfer. It's only now begin showing up in desktops and laptops, and I must say it rocks too! Firewire is built for point-to-point communications and unlike USB2.0, has no problems connecting computers to each other. RFC 2734 details a IPv4-over-Firewire implementation, and the Linux module eth1394 implements it. Not very great speeds (I've got about 17MBps sustained), but again, fantastic to be trying out such technology. Windows too has this, but Microsoft has announced that "due to lack of demand", they'll be removing it in Vista.

All of this has meant that I now carry the following along with me wherever I take the laptop:
  1. One straight CAT-5 cable
  2. One cross CAT-5 cable
  3. One Firewire 4--6 pin cable
  4. One Firewire 4--4 pin cable
The shopkeeper was out of S-video to S-video cables.

Working on the Cell BE

For one of my courses (Computer Architecture), we (my partner and I), decided to port the popular ffmpeg library to the Cell Broadband engine. Yep, this is the same processor that was developed for the Playstation 3. It has got impressive computation capabilities that made us believe it would lead to significant speed-ups to video encoding. We already knew of real-time encoders written by Toshiba for H.264 (the industry's leading-edge codec), and so we decided to do the port for MPEG-4.

Our initial attempts to get hold of a Playstation 3 failed :D, and we had to settle for using the simulator to code our application.

Since we had no idea what approach would lead to a speed-up we tried many approaches, coding, benchmarking and then deciding what to do next. We got very close to both ffmpeg and Cell, but in the end, we had underestimated the task of porting a legacy application to the Cell. If you're wondering why most of your applications are not multi-core yet, you better realise it's hard. Even more, the Cell has 9 cores, 8 of which can only access their own memories (256K). Fun.

Our final results were not impressive. We could only port a single function off to the SPU (one of the 8 vector cores), and not take advantage at all of the 8 cores. Thankfully, despite the overhead, we had 0% speedup. That does mean there is scope here. Let's see, I'll be continuing on this project for some more time. Hopefully it'll lead me to some interesting research problems.

For now, I'll be content pushing the changes we made back to ffmpeg.

P.S.: Anybody tired of their PS3 and wishing to donate it, can please contact me.

Wednesday, December 13, 2006

Hardware Virtualization and KVM

One of the other reasons I went in for a AMD Turion 64 X2 was its support for "hardware virtualization". People familiar with QEMU know what virtualization is, and it is very big craze right now in the server market. While there are software based virtualizers (QEMU, MS Virtual Machine/PC, VMWare, etc.), Intel and AMD added virtualization capabilities to their recent processors. What this means is that I could run unmodified copies of that other OS under Linux, at "full" speed. Not that I want to, of course :D

Here's the relevant /proc/cpuinfo flag:
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt lm 3dnowext 3dnow up pni cx16 lahf_lm cmp_legacy svm cr8_legacy

If present, it indicates that your AMD processor supports virtualization. For Intel processors, look for the vmx flag. Unfortunately, due to concerns that a "hypervisor" rootkit could gain control over your main OS, many computers that show this enabled on their processors could have it disabled in the BIOS---often with no option to restore it. Determining your BIOS's support requires some debug voodoo at the FreeDOS prompt.

Thankfully, that's not an issue on my laptop. I was planning to install Xen sometime and check out this capability, but a new entrant to the virtualization scene made me do it quicker. kvm is the Linux virtualization module to be included in 2.6.20, but you can compile it today! It's easy. Also, it will tell you if your BIOS has disabled virtualization.

I tried out release 7 (after Debian's 5-2 failed to work for me), but was disappointed. It is slower than qemu, and has frozen my machine once in two tries. Oh well. It's still being developed, let's see how this turns out.

Wednesday, December 06, 2006

Install Report for Compaq V3133AU (V3000 Series) AMD Laptop

[This is the final version of my document]

Mostly everything works out-of-the-box on the system. Some things (graphics, sound) require some love to get working properly. Some (wireless) fail to work at all until the proper drivers are installed. Nothing has completely failed to work so far.

Note: I chose a AMD Turion for the 64-bit capabilities, as Core 2 Duos weren't available. However, based on experience installing Kubuntu Edgy on a friends V3000 series laptop with the Intel Centrino chipsets, everything seem to work completely out-of-the-box in every respect. Unless you really need 64-bit computing, I'd recommend going for Intel-chipset based laptops to make things easier.

Operating System: Ubuntu Edgy 6.10 64-bit. The laptop comes installed
with FreeDOS. GNOME 2.16.1 used on the system. Linux Kernel 2.6.17-10-generic SMP.

Processor (AMD Turion 64 X2, TL-52, 1.6Ghz)
Works. Dynamic frequency control works too, however, powernow-k8 seems to switch to only two frequencies (800/1600Mhz) despite ACPI reporting that the processor supports 8 speed steps.

Dual-core = Smooth computing.

On Board Graphics (nVIDIA GeForce Go 6150)
nv driver was not detected for the card, started up in VESA. With nv, hsync/vsync frequencies need to be specified, after which the maximum resolution of 1280x800 works. Font corruption seems to occur randomly for the nv driver.

I currently use the nvidia driver, which seems to disable 1280x768 (which works with the nv driver). Switching to a VT causes problems with the display, with lots of flickering. I'm yet to resolve this problem.

BrightView totally sucks in my opinion. Oh the glare!

S-Video: Not tested

External VGA
Works in dual-head configuration with the nvidia drivers (1.0.8776), see Appendix P (Configuring Multiple X Screens on one card) in the nVIDIA documentation for details. Note that some false alarms seem to go off, with another card supposedly being detected by X, but both the Device instances must use the same BusID.

I've not tried to get "copy out" functionality working on the external display, for now, it is a separate display.

Hotkey functionality (Fn+F4) doesn't seem to work or most likely isn't configured.

Unable to get this working with nv driver.

Expansion Card Type 3: Not tested

Integrated 10/100 Ethernet: Works.

USB2.0: Works.

Firewire (IEEE1394)
Works. Linux supports IP over Firewire! (400Mbps!!!!) See the eth1394 module. Update: I tested this out, works like a charm, but I've achieved only a peak of 17MB, with the hard disk spinning like crazy :D

SD/MMC Card Slot
Detected by the sdhci driver in 2.6.17 and above kernels, but I've been unable to get it to work with the only MMC card that I've tried. 2.6.18 supposedly has much better support, and I've heard rumours that only SD cards work. Will try this out soon. Update: SD cards work fine. It's the MMC cards that do not work.

PCMCIA
Not tested

Bluetooth
Works. Use the bnep+PAN module to get ethernet over bluetooth! This is lovely! KDE seems to have excellent BlueTooth applications, GNOME is still lacking in this area.

The command hciconfig shows you your Bluetooth devices, for which the wireless switch must be on.

Wireless (Broadcom 4312)
Works with ndiswrapper 1.28, which I had to compile for my kernel. Seems that Edgy ships with a broken ndiswrapper (Invalid argument errors). The driver is from the the SP33008A driver package
from Compaq.

The bcm43xx driver fails to extract firmware from the driver package, and does not work with my card.

Note that ndiswrapper was originally in Dapper Drake (32-bit) picking up the 64-bit driver, and obviously failing to run it.

Trackpad
Works. Use the gsynaptics (note the 's' at the end) package to get a utility to manage it.

Keyboard
Works. Including all the multimedia keys and special keys! However, some keys (like Mute) don't seem to reflect the current status (or they don't turn orange).

Audio
You'll need ALSA 1.0.13, with the disable_msi=1 parameter, to get the headphone working on the nVidia chipsets. That also seem to have stabilized things. Embedded Microphone (LCD Panel), headphones and speakers all work. Front-panel microphone not yet tested, but shows up in ALSA mixer, so should work.

DVD-Writer+CD-ROM
Works.

Power/Battery (6-cell)
Works. Displays status (charging, etc.) with charge remaining as well as time remaining.

65W AC Adaptor works.

Internal Modem
Not tested, though Edgy does show a ppp0 connection.

Suspend
Works. Edgy refused to show the Suspend button, probably because Dapper settings were imported with my home directory. Wiping out ~/.gconf/ helped restore the button (though this was done for other reasons).

The only flaw is that the trackpad comes back disabled, but a single button press gets it working again.

Hibernate
Works. However, on restore, the muted Speakers are unmuted, and headphones stop working. I must do a /etc/init.d/alsa force-reload to get everything working again.

See also: http://hpwiki.cactii.net/hpwiki/Presario_V3%2A%2A%2A for more install reports on this series of laptops.