Saturday, May 29, 2010

GSoC Week 2: Experimenting with Collections

Another week is already gone, and although it didn't see much progress feature wise, I've been working a lot on the project. Three days were spent on a nasty little hard to produce bug, one that would only occur 4 levels deep into the Content Directory, and not always in that case either. Finally with a lot of debug statements, many hours talking to Tuomo Penttinen of HUpnp we fixed a little bug in his library.

The reason the bug was present - MediaTomb was disconnecting my slave for connecting multiple times very very quickly. When it rejected the request, two slots were fired in the HUpnp code which caused multiple access's to certain data which should be modified only once... I'll spare the details.

Once that was fixed, I spent half a day getting the DLNA recommended meta-data being reported by the slave using custom UDSEntry fields. That was pretty easy.

That pretty much finishes the slave's Browse() API, since fetching file's is delegated to the HTTP slave. The next step is Search().

But I took a little break and started experimenting with Amarok's Collection code, which is HUMONGOUS and complicated. I still haven't figured it out completely. Like why Collection::queryMaker() has too return a new instance of a QueryMaker sub class everytime, or how the Capabilities system works, but I'll get there in the end. The result for today is manually inserting a track into the collection. Ah, I do like seeing progress:

Friday, May 21, 2010

GSoC Week 1: Kioslave is shaping up

(This post was published on Friday, but I put in a wrong tag and I didn't get aggregated, so, republished)

Although I've been hacking on my GSoC project for quite a while, doing little experiments and getting my mind around various factors involved, this week was my first official coding period, since that was what I had in my timeline.

The first piece to implement is the kioslave to browse UPnP MediaServers. This involves writing a parser for the DIDL-Lite XML format used to describe directory structures. The parser I developed this week can now parse containers and items and their titles and pass them on to the slave. Meta-data and extra tag handling isn't done yet, but I have time :) The slave scheme is upnp-ms and right now you have to pass the UUID. But once the network:// slave is modified, it should be seamless for normal users

Their are a few issues I have to take care of in the slave. UPnP identifies all objects merely by a numeric ID. Now it wouldn't be fun to have the user deal with IDs. So the kioslave uses names just like normal file browsing. This involves reconversion back to the ID whenever I have to talk to the server. If the user manually types a URL to jump to some other point, I have no information about the IDs leading up to that location. So I've to implement some resolving. This is what I did this week. It is still a bit buggy, but I haven't figured out if the bug is in my code or HUpnp ( most likely my code ).

Tuesday, May 11, 2010

This semester was... LEGEN-wait for it-DARY

It's been a week since the summer holidays, and that means another semester is behind me. Reflecting on the past two years of engineering, I would say that this semester has been the best 6 months of my life ever. I have changed (read: improved) in a hell of a lot of ways. I also dumped some of my inclination to always plan out the day and introduced some spontaniety. Just before the sem there was December, which meant and the rural internship. Both thrust me into the public all alone, resulting in an eye-opening experience. was a collection of geeks where for the first time I could talk to other people all day about technology and computers and meet lots of coders from around the country. From a wi-fi enabled, air-conditioned environment to a laid-back village in the middle of nowhere in 3 days. That was the beginning of my rural internship. Those 4 days in the village were quite boring, yet it also opened my eyes to what India was. It doesn't mean I am going to go and use ICT in a socially responsible manner -- It isn't as much fun as programming.

Next up was Synapse. For the first time any piece of my code was being interacted with by hundreds of people, as my backend powered the registration and site navigation for the fest. I knew my code was very good ( definitely better than some code I had to look at for some events with specific websites ), and it felt good when the amount of junk IDs were a very small percentage of the total number of registrations.

Then just a day before Synapse was to begin, we had a 'Bazinga!' moment. The server room air conditioner caught fire, rendering the entire DA-IICT network infrastructure down for about a week. No Synapse website, no updates to do in the dead of the night, which meant I had 3 days off to enjoy :-). This also meant I finally had time to give my laptop for repairs.

Enjoy I did. This Synapse was and will remain a very memorable one. We had a blast decorating the SAC for D-lounge. This involved hanging flags on the awnings by climbing a shaky ladder up to the first floor, then leaving both hands to unravel and hook up the flag. Next up was putting up a installation in the middle of the lotus pond. This required calling in a special-ops team as the pond was full of water. Which reminds me, someone has photos of the entire drama. That same rickety ladder was placed flat and one person sat on the end to keep it from toppling into the water. Then about five of us walked across to the first stage of the pond. Then the ladder was pulled across to the next level. Then me and tanmay passed over. After that the ladder was pulled back, and the artwork was passed over. Time for the final jump. The ladder was brought up all the way to the centre, and we literally pushed the canvas across it, hoping it wouldn't end up tearing or going in the water. Then we repeated the entire sequence to get back out. Fortunately, no one fell in, although two poor souls had to stand barefoot in the dirty water all this while.


Finally at 3am the task was done, or so we thought.

Synapse Day 1 - 10:30pm I had just finished the last lecture of the day, and wanted to go to Ahmedabad and get my laptop back. But a gust of wind had caused the installation to collapse. Which meant going back in again, this time much more easily and confidently, and sticking it into the ground using bamboos and nails.

Of course this isn't a post about Synapse, so I am going to jump ahead to day 2, which was all about Indian Ocean.
There is a secret to getting the best view at the Pro Nites in Synapse. Get into security, and know a lot of people. The concert was just a treat, well worth all the effort put into Synapse. It was mindblowing and perhaps only the video can capture most of it. They played some never before played songs which are to be released in movies soon. Yet Ma Rewa and Kandisa stole the show as usual. But the most important part is at the end. Once the concert was done we formed a cordon to let the guys get to their room. Now we weren't allowed in, but in an act of spontaneity I took of my Synapse T-shirt (right there!) and threw it in to the coordinator so he could get it signed. And then I *ran*, to the nearest bathroom which was still some 100 metres away :o Well it definitely paid of. In my closet is now a T-shirt signed by Amit Kilam from Indian Ocean. Finally there was the D-Lounge treasure hunt and the late night pool-playing. Ah... those were the days.

Ok, enough about Synapse. The other thing I do in DA-IICT is play football. This year has been a record in terms of the number of tournaments we've played. In the 3rd semester we went to Patan and had our very own Concours. Then we won the IPTG Petro Cup. And in March we went to BITS Pilani, Goa. I've been in top form ( if I should say so myself ) and improved tremendously in ball control and dribbling this semester. Although we lost in the first round, I was happy to hold my ground and not make any mistakes.

And finally there was of course the Google Summer of Code result. I hadn't got in last year. But this time I had put in a *lot* of effort and would have been really disappointed if I didn't make it. But fortunately I did

Now I just got my results, and I got an 8 out of 10 SPI, my lowest yet :-( All thanks to CT and EL, although it was my fault... Well you can't have everything.