Wednesday, June 28, 2006

Mind Meld Part III: the Return of the Ogg

(Okay, that is the last of my lame attempts at clever titles.)

Yet another milestone has been reached: I was able to build a downloadable image containing the copy of wmamp 0.6 that I compiled myself and the darn thing ran. So at the very least I know I can build something that works.

Adding (or rather, re-adding) ogg Vorbis support is quite another story. James Pitts originally wrote wmamp (thank you, James!), and then Steve comes along and adds support for ogg vorbis files. According to Steve's blog, he pushed his ogg patches back to the maintainers of wmamp (whoever they were at the time, maybe James, or maybe these guys) and daapd. The funny thing is that none of the later versions of daapd or wmamp have this work, but the reasons are probably lost in the mists of last year. The work on daapd is moot for me since I have mt-daapd running, and it already has support for sending ogg files (if you explicitly enable it with --enable-oggvorbis, which I had not, so I had to rebuild it again last night). The changes to wmamp are still very relevant to me though, and so I figured I'd take a stab at merging them forward. Steve's patch applies cleanly to the wmamp-0.4 sources, so I created two versions: wmaamp-0.4-canon (canonical) and wmamp-0.4-ogg (with Steve's patch applied). Then I created two versions of wmamp-0.6 with the same names. Then comes the really hairy part: compare the differences between the two 0.4 source files (should only be the ogg changes) and try to make the same changes to the wmamp-0.6-ogg sources. I had to do it this way because the source for 0.6 has changed significantly from 0.4. There has been a lot of restructuring of the code, and most of the chunks of Steve's patch would not apply at all to 0.6 (some of the files are no longer there).

Oh yeah, I had to cross-compile Tremor too, but thankfully the xiph people had everything already set up so this was completely uneventful.

In an effort to make sure I was on the right path, I built an image using vorbis-0.4-ogg and downloaded it to the WMA11b, but it would segfault after selecting a DAAP server. I wasn't ready to give up yet though, so I got wmamp-0.6-ogg to compile and built an image with that. It does better then the 0.4 version - it dies only when I try to start playing a song. So that kinda blows, but it's still better then 0.4, and I have some idea of what is wrong. It probably didn't help that it was rather late in the evening when I was doing my merges and such, and so I expect that I made more than a couple of mistakes.

I can't believe all that I've been able to do in a couple of evenings. This is exactly why I love programming. More precisely, it's why I love programming with Free Software (or Open Source, if you prefer). I am starting to make this device my own. One day soon, I will grok the fullness of it.

Labels: