Wednesday, January 26, 2005

WiFi radio..

It's 1:30 AM in the morning and I'm having fun. I've just setup a wireless radio station in my house. Ok, before you start to park your car outside my gate to tune in, take a deep breath and chill. Its awesome but no big deal!

All you do is install something called an icecast server, which is supposed to be better than the original Shoutcast server by the folks that brought you winAmp and then sold it to the devil (aOL) ;) Ice cast server version 2.x can stream both mp3s and ogg vorbis (better quality and patent free). A small vague run down of the steps keeping in mind this is a blog and not a howto!

First I installed icecast2 on debian
# apt-get install icecast2

You need to modify the configuration file, the main setting being setting a password and then start the server.

# /etc/init.d/icecast2 start

Next you need a client streaming application that will connect to the icecast server and stream a live feed such as from a mic / soundcard loopback or in my case using a simple play list. There are a couple of streaming clients, notably liveice and the xmms plugin for liveice seem popular for streaming mp3s, but my initial encounter with it was unsuccessful. Perhaps because it was originally written for icecast version 1, but the documentation mentions it works for version 2. So I ended up settling down with ices2 package which can stream ogg vorbis files to the server. I also installed mp32ogg package to help me convert some mp3 file to the ogg format.

# apt-get install ices2 mp32ogg

You can easily (but with patience) convert mp3 directories to ogg files by using mp32ogg. I then copied a sample xml configuration file required for ices2 from /usr/share/doc/ices2/examples/ices-playlist.xml and modified it slightly. You can then create a playlist file and launch ices2 from the command line with the xml config file as the only parameter.

~/mp3$ find . -name '*.ogg' > playlist.txt
~/mp3$ ices2 ices-playlist.xml

Thats it! I rushed over to my notebook which is connected to the streaming server over a WiFi wireless link, and launched the browser and typed the path to the streaming server as follows.

http://streamingserver_ip:8000/example1.ogg. m3u

This should launch your default media player and start playing the stream. Note that if you don't want to use the browse and would rather type the path to the stream directly on the media player then you should omit the .m3u extension. Currently I've got two notebooks in two different rooms playing the same song with a slight lag between the two. Now all I need is a couple of wireless speakers that are icecast/shoutcast compatible so I can leave one in each room, without having to sacrifice wireless notebooks for the job.

May be another day~ Happy streaming!

Wednesday, January 19, 2005

My Double date!

Ok I know the title is a bit misleading, not to mention intriguing for those who know me. Is this guy capable of such a thing? So before you start substituting my life for a sitcom, let me clear thing up by saying my double date was for two B' day parties at two very different locations.

Who's B' day party you ask? Shame on you! It was mine! If you forgot then I guess you weren't invited, so that makes us even. Anyway, I didn't really plan for two B' day parties to take place simultaneously. I invited a couple of my friends (just couples ;)) to Delimarket at WTC. Delimarket isn't my favorite place but at the time it was convenient since Kanchana and I were working late and that seemed the closest.

Anyway as the party progressed (in a very cheerful, talkative mode might I add), I got a call from home saying my uncle/aunt [aka. loku thaatha (big daddy), loki amma (guess ;))] had shown up. I guess its not a total surprise, since they usually do show up but what can I say, "I was hoping for a miracle". We've hadn't even had dinner by that time, but what else could I do but to make a false promise. So I said I'd leave in an hour.

But I guess you can't rush a good stake, so by the time I made it, my poor uncle and aunt was already on the road just pulling out to the main road. We both stopped the car and got down and chatted a little on the road, and that was that. Oh well so much for a double date. Hopefully next year I can just have the party in one place :)

Wednesday, January 05, 2005

Code for Relief

What can you do when more than 100,000 people are dead and more than a million displaced with little food, clothing or medical care at hand? Coping with a tragedy of such massive scale is not something that most of us have prepared for. I guess different people have their own way of coping. May be its by going to the affected areas and giving a helping hand. Or perhaps collecting donations and other goods and handing it over to those efforts. I can even imagine some, who might just be glued to their TV sets, switching channels to catch the latest news and programs on Tsunamis'.

So while the rest of the world was coping with this tragedy in their very own way, I got involved with a project that has helped me to somewhat cope with it as well.

It all started just about a week ago, when we met at ICTA to discuss about building an application to find missing persons. At the time Dr. Gihan Dias from the University of Moratuwa had already setup a simple system, called findthem.lk which allowed people to submit info on missing persons. Though it was very basic and simple, nevertheless did manage to collect a considerable amount of data.

My self, Anuradha and Chintana had already begun working on some database schema's as well as templates, so we had an idea of what was needed to be built. Our design was going to be based on Bugzilla, a very popular FOSS bug tracking system. Our challenge was to convince others that by treating the submission of missing and found persons as cases that can have duplicate entries as well as multiple potentially conflicting reports, will actually lead to a better robust system that fosters gathering valuable information, which is otherwise impossible using a well defined data entry process. The meeting lasted a very long four hours, but at the end we had collectively worked out a set of requirements and an action plan.

The next couple of days were mostly spent in office, cut off from rest of the world, just working on building the system. There was probably two occasions where myself and others worked for more than 24 hours straight. But the efforts didn't come alone from a couple of geeks working off their rears. A lot of companies and individuals also got involved with these efforts (list).

Besides the people search, soon other modules started to realize themselves, thus expanding the scope of the project. This is evident and somewhat humorous when you consider the name changes we went through to get to where we are now. First the project was called FindThem, after getting permission from Dr. Gihan. Then it was named to Chalana (sinhalese), to mean movement, or dynamic to reflect the expanding scope. Finally it was decided to call it Sahana (sinhalese), to mean relief.

Sunday night was a long one, spent squashing bugs and setting up a 4 processor Xeon server that IBM had generously donated temporarily until they can donate two brand new high-end servers. Ven. Mettavihari has already started to install Debian Linux on this server, which I continued with Mifan's help.

Monday morning, after working all night, myself and Anuradha along with Farhan (LFS) went to meeting that was primarily for NGOs' to demonstrate the various systems. I must say the response we got was so encouraging -- It kept us going for the rest of the day with no sleepiness whatsoever.

So all in all within a period of five days, we have collectively been able to go from nothing to relief system that's now fully online and being used. Whets more exciting is, as of yesterday, the project is being hosted at sourceforge , as a Free and Opensource software project. At the moment you can download the source code/documentation of the system we are building via cvs and contribute to our efforts. You can also drop into the UCSC and come to the LFS room on the first floor if you want to help. But please check out SourceForge before you do so.

With that final invitation, I end a long but much anticipated blog. There is actually so much more that I could write, since the last couple of days has been a real journey for me. But I shall not bore you with the *details*!

More to come later....