Tuesday, July 04, 2006

Usability. Meh.

"My Sharona" by The Kinks was just playing, and now it's Echo and the Bunnymen's cover of "People are Strange", and it's wmamp that's playing them. This shouldn't be a big deal, but it wasn't something that could be done before. I can only assume that the original interface for music selection was some sort of proof-of-concept or something, because I can't imagine using it myself on a day-to-day basis. Music selection in wmamp has apparently been very simple right from day one: pick a DAAP server, select an artist, select an album, then select a song to start playing. If the song screen lists more than one song it will play all songs from the one selected to the end.

I have only a small selection of songs on my linux server (remember, only 4GB of space on the hard drives), and so I have at most a handful of songs from any one artist, and those are likely from a couple of different albums. Until now this has meant that any time I want to do some testing I end up listening to a handful of songs over and over. Since I'd finally had some luck tuning uClibc and busybox (more on this later) I decided to keep the hacking light for the evening (ha!).

My idea to improve the interface was to provide two methods of selection at the server and artist level: method 1 selects all songs available at that level and method 2 follows the original scheme. The concept is simple, but the execution not so much. The code for making DAAP requests was tied fairly tightly to the original selection mechanism. I also learned something else: whenever wmamp makes a request for a list of songs it receives the entire song list from the server and extracts the ones it wants. I don't know if this is an artifact of the way that the requests are constructed or a limit of DAAP, but it sure would be nice if a specific query could be sent to the server and it returned only matching results. This may actually be possible - I haven't looked at DAAP that closely yet but it looks like I may have to. Anyway, wmamp has a routine that reads in the song descriptions and keeps only those that match the artist and album requested (remember, this is the original code I'm talking about here). This was where the bulk of my work was done - certain search parameters might not be available (or any, if you played all the songs on the server), and it would discard valid songs as non-matches. That wasn't too hard to fix but it was only half the job. All my ogg files have Song Title, Artist and Album Name information, but a lot of the mp3s contain only the name in the id3tag. I've even seen mp3s with no meta-data - only the filename of the mp3 told you what it was. Some songs were being thrown out because of missing album or artist information, and so I had to code up something to deal with crappy mp3 encoders.

There was other work too, but that was the heavy lifting. No point in boring people with all the minutia.

The other thing I managed to do today was pare down the size of busybox and uClibc. Neither got a lot smaller, especially since I'm statically linking busybox, but even so, the image I'm downloading is around 1.1MB whereas the original 0.6 image weighs in at 1.6MB. If I didn't have to deal with the original uClibc it would be even smaller. I really need to replace the disk image that's flashed into the WMA11b itself. If I could get some reasonably modern code in there I'd have a lot more RAM to work with. I'm going to need it unless I can start making smarter DAAP requests.

Labels: