Tuesday, May 01, 2007

The sound of music..

Am not a music enthusiast, but when I got to listen to it, I need the song. Although I do have an MP3 player, I am fond of internet radio.. live365, pandora, raaga.com, dishant.com et al. Most of them work flawlessly on Linux.. but some Indian Bollywood radios seem to fail pathetically. I always thought that it would be some compatibility issue since they seem to work fine on Windows. Incidentally, few days back I started firefox from the terminal(well.. i generally click on the icon) and wistfully tried playing a song from raaga.com. (Firefox on wine is really frustrating). Of course.. nothing happened, but I found a SEGFAULT reported to the terminal... this was the beginning of a big adventure :)

I googled out the issue and found that someone had found the issue and interestingly enough posted the solution on bugzilla long ago. I downloaded the latest tar ball and saw that the errors were not yet fixed! Big deal I thought.. lemme compile the code myself. There were no INSTALL or READMEs in the directory.. but there was a Makefile... I didn't care to look into the makefile and just called make. That didn't work.. I found that Makefile called individual makefiles in hundreds of subdirectories and those makefiles were not there in the subdirectories!! This is where the "real" fun began.

I have to give you a brief idea of the helix project on Linux(Real's backend) before I can proceed further.
  • Its a mixture if highly convoluted C and C++ code. The building process is handled by a python script called Umake (which is used for cross platform compilation).
  • The same blob can be compiled into helix server, helix client, real player.. etc etc. There are 32 different project into which you can compile the source code into.
  • There are 634 build targets!!
  • This whole setup reads another configuration parameter to know the destination build system.. including most almost all versions of Windows, Unix and linux.
  • I'd leave the maths up to you.
It makes sense now that a static Makefile was not supplied with the release tarball. But I was pretty adamant on getting RealPlayer to work with my firefox installation. This manual will tell you that how freaking hard it is to get the damned thing compile.

I had to become a Helix community member, set up CVS access to the repository, accept all the BEULA craphola(I am not allowed to fix bugs and let people have it even though its free), spend countless hours debugging the substandard code and build it. The whole code base has tell tale signs of cut paste code, unnecessary optimization and non standard C++. I was messing up with the latest stable release when one of the Real developers informed me that the branch was dead!! I got one of those nightly builds that had fixed few, but not all, of the issues. I then quickly made the changes and got the thing to build. The most stupid errors were the ones where the variables were used without definition inside a #ifdef clause, casting a boolean into integer etc.

To cut the long story short, Raaga.com now works with firefox on Linux!!! and no unfortunately I cant give you the binary, you have to build it yourself.. RealPlayer's license needs another entry. It is clearly an example of __evil__ open source (The good one being GPL of course). I cant check in the code cuz I was not authorized to modify them at the first place.

Anyhoo.. the songs sound so much more melodious now :)...

PS: A developer asked me to submit a patch. If all goes well, then the whole Linux desi community would soon be thanking me :P

PPS: My patch is accepted. You can download the nightly build by tomorrow.. or wait for the next release. It will be a part of the next release... Yay!!

PPPS: Download the latest binaries here.

11 comments:

  1. u have all the time in the world to waste huhh ...:D

    ReplyDelete
  2. @Shantanu: hmm.. better than your stupid video games :P.. plus I get the bragging rights.

    ReplyDelete
  3. nice work dude..
    I apprecite it.

    I'll try to build one. I hope you can help in the process of building if i face any issues.

    ReplyDelete
  4. crazy stuff.. u would go way beyond to get your things to work.. hmmm..i have seen so many blogs of yours.. they are way too over my head!!! keep it up.. good to read your achievements!!!

    ReplyDelete
  5. @Vinay : Thanks for the compliments. Its not only the compensation to get the thing working but also the fact that fixing a trivial bug can help about a million users to listen to radio.. plus all these ppl will have the code written by me on their machines.. even the ones on windows cuz the code base is the same.. The realization that all the real player users will have my code on their machine gives a big kick.

    ReplyDelete
  6. quite an achievement ...

    ReplyDelete
  7. @nishesh: fixing typo is not an achievement :P

    ReplyDelete
  8. Ya, Still fixing typos are the biggest headache for computer professionals... And its surprising to see so many flaws just because of a casual coding typos/flaw somewhere in the software.

    ReplyDelete
  9. gud work, sridhar.. :)
    i tested the nightly build (20/05) with raaga and it worked great..
    i then tried dishant.com which is similar to raaga, but for some reason, that did not work..

    any clues?

    ReplyDelete
  10. @Sambit: Works fine on mine.. Try posting the error message on helix-client-dev@helixcommunity.org.. a console output would help.

    ReplyDelete
  11. @Sridhar
    I sent a mail to helix-client-dev@helixcommunity.org with the console messages that are seen when I try to play a song from dishant.com

    The mail is waiting for an approval by the moderator. I have not subscribed to the helix-client-dev list.

    ReplyDelete