Monday, June 26, 2006

Mind Meld Part II - The Clienting

Woo hoo! wmamp builds! This is no small accomplishment. wmamp requires FreeType2, libhttpd, libid3tag, libmad, libopendaap and zlib just for starters, and they have to be cross-compiled for ARM. Oh yeah, about cross-compiling - there's this great Debian sub-project called emDebian that
has an apt repository with pre-built cross-compilers and a few libraries (like libc) to link against. Very handy indeed.

Luckily most of the aforementioned libraries cross-compile pretty easily, with the exception of freetype - it creates a program (apinames) to run that extracts data from the .o files, but apinames also gets cross-compiled and so it won't run and the build fails. Thankfully apinames is only a single source file, so it was a simple matter to compile it manually (and natively), copy the binary where it was needed and then run "make" again.

wmamp needs one more library - mDNSResponder from Apple. wmamp was built against version 58.8, but good luck finding it. The original author of wmamp - James Pitts - has archived a version here. What I don't understand yet is why this is necessary - libopendaap builds and uses another multicast-DNS library mdnsd, and so it seems that wmamp, if it needs direct access to an mdns API should be able to use that instead. I'm sure there's some duplication of functionality here that could be trimmed. mDNSResponder, BTW, cross-compiles just fine.

With all these libraries built and installed, it's time to build wmamp itself, and that's when things go wrong yet again - emDebian installed kernel headers for 2.6, but the WMA11b runs a 2.4 kernel, and at least one header file - fb.h - has changed in a way that is incompatible with wmamp. The solution is to unpack all the stuff Linksys provides here (warning, zipped tarball of truly unholy size), install it and create a local symlink to the kernel headers Linksys provides. All of this might not be strictly necessary, but until I know just how many changes were made to the standard 2.4.17 kernel for the WMA11b this was the safest and most expedient route to a successful compile.

And that's that. I still have to build a disk image with my wmamp to be sure what I've compiled runs, but a clean build is 90% of the work, IMHO.

In my first WMA11b post I neglected to mention a couple of things. First, turthalion was the guy who put me on to the WMA11b in the first place when he got one back in January, and when I told him about my weekend he kindly linked back to me, and then proceeded to (rightly) berate me for not providing the explicit commands to start and stop the Windows(TM) services that I had mentioned. I don't know why, but a lot of sites tell you to stop and then restart these services "and if you don't know how, then just reboot". No one seems to want to reveal the dark secrets of the "net" command for whatever reason. Well screw that. If you want to stop the services, use these commands:

net stop XWPCHostService
net stop XWPCApplicationLoaderService

To start them up again, use:

net start XWPCApplicationLoaderService
net start XWPCHostService

Stay tuned for Part III - adding ogg vorbis support (well, that and creating an image I can actually load onto the WMA11b).

Labels: