Saturday, July 17, 2010

UPnP Searching

I’ve been pretty quite about GSoC progress. But I had a great time at aKademy and forgot all about blog posts. So the current status is thus. If programming was just about getting things done, I am done! But its not, which means although everything I was supposed to do is done in a big picture way, the next few weeks will see bug fixes, optimization and ensuring that certain things can be done faster, more accurately or in a more user-friendly manner. I also have to port the code over to use Solid, now that fellow GSoCer Paulo Romulo has improved UPnP support in it.

Last time I gave a glimpse of the Browse based collection. UPnP MediaServers have two methods of accessing their content. Browse() is similar to going through your hard-disk directory by directory. As you can see, this can be quite inefficient for a Collection since it has to keep track of a large number of tracks. The other method is Search(), wherein users can query the MediaServer to give tracks/media matching certain criteria, such as belonging to a specific artist, or containing a certain pattern in the name. This is much more efficient because all the work is done by the server and we just need to handle the results.

That has been the crux of my work this past month. Due to the restricted format of the UPnP search standard, it required a bit of work to handle more complex queries. In addition, due to the way the Amarok Collection and QueryMaker code works, I have to always ask the server for tracks rather than telling it to return on Artists or Albums. It took quite a bit of experimenting to understand these two things. But two days ago the collection started working with actual searching for simple patterns.

Here is the Search based collection with no search.

Here it is with a search term.

I should point out that the code is intelligent. It will contact the server and ask it if it supports Searching, or only Browsing and use the appropriate collection.

Other than that there are several bug fixes in the slave and in Amarok and support for reference IDs to prevent duplicate items ( every FOSS software server I tried still doesn’t support refID properly though ).

By the way, I passed mid-term evaluations. Yay!

Posted via email from nikhil's posterous


  1. this is really a killer feature i am really missing in amarok...

  2. I can not even understand why there is so much noise about UPnP when it is not widely used and it is difficult to configure. And using it in KDE SC (or any other) is hard because the devices and clear easy settings.

    I think biggest reason what cause this is from release of Windows XP when even FBI developed a application programg for XP users to disable the UPnP because security problems. Since then device manufacturers and software developers have been lousy and afraid to actually implent anything with it.

    I have not seen any working UPnP environment with anyone.

  3. Fri13, UPnP may not be very widely available, but the UPnP AV protocol used by MediaServers and so on is very widely available. Virtually all Network Attached Storage devices support it, there are several software implementations, many devices support it too, including the PS3. You might know it better under the DLNA label. DLNA is basically a subset of UPnP. In fact UPnP support has been requested in Amarok since 2007 and I've had people come up and ask me in person when this would be merged into Amarok.