Steve's blog
   


Steve About
Steve's blog,
The Words of the Sledge
steve@einval.com

Subscribe
Subscribe to the RSS feed.

Links

  • Home
  • Debian
  • PlanetDebian
  • Search PlanetDebian
  • Friends

  • Matthew Garrett
  • Jonathan McDowell
  • Jo McIntyre
  • Martin Michlmayr
  • Andrew Mobbs
  • Mike Pitt
  • Daniel Silverstone
  • Andy Simpkins
  • Neil Williams

  •        

    Wednesday, 02 February 2005

    Ogg support on my WMA11B

    Noodles kindly passed on the Linksys WMA11B Wireless Media Adapter that he'd promised me. This is a little ARM-based Linux box with wired and wireless network inputs and TV and audio outputs. With the software that comes with the little media box, you can play Windows media and MP3 audio and display a variety of image formats.

    There's just one problem with this software - it claims to work only on Windows, needing a .Net runtime to serve both software and media files to the box. We don't have any Windows machines in the house any more, so that clearly wasn't going to wash!

    Various Free Software hackers have acquired these boxes and played with them, and there's now a complete set of Free tools available (to play audio, at least):

    • Andy Wild has written wmaloader, a replacement program to download software to the WMA11B. I've packaged this for Debian.
    • James Pitts has written wmamp, an iTunes client that runs on the WMA11B. Simply replace the "squishguava" software image from the WMA11B CD with wmamp.img.
    • Alexander Oberdörster has written a free iTunes-compatible server called daapd that runs on Linux, serving up MP3 files. This is packaged in Debian too.

    With this selection of excellent programs, I managed to get my WMA11B up and running a couple of weeks back without once using the supplied Windows software. I could play MP3 music through my new hi-fi, spooling the files directly off the network. Yay! Well, almost. The problem is that almost all the music I have is now in Ogg Vorbis format. :-(

    I didn't want to re-rip and re-encode all of my CDs into an inferior, encumbered format, so I decided to extend the toolchain to support Ogg Vorbis. This turned out to be really quite easy, and after just a few hours of hacking at the weekend I have it working now.

    There were a few issues and bugs to solve along the way:

    • daapd didn't know anything about Ogg at all. That was easily solved - add code to use libogg and libvorbis to extract header info from Ogg files.
    • daapd always sent music files as Content-Type: text/html, which seemed a little silly. I've fixed this so that it will now use audio/mpeg and application/ogg as appropriate.
    • Setting up an arm cross compiler. In the past I've spent many many hours doing this, so I was really impressed by the Debian toolchain-source package. It Just Worked first time.
    • wmamp would only play MP3 files; I've now extended it to recognise the Content-Type header and use either the original MP3 code or the new Ogg code as appropriate.
    • My first attempt to use libvorbis in wmamp almost worked, but playback was very jerky. The little Arm processor in the WMA11B doesn't have hardware floating-point support, and the normal libvorbis uses floating point for decoding. Noodles pointed me at Tremor, the simplified fixed-point Vorbis decoder. A few minutes more hacking and I was done.

    My very first attempt to play Ogg files worked, just slowly. My first attempt at playback with the Tremor library worked perfectly. Monitoring the system using top, I can see it uses about 20-25% CPU when playing back Ogg files, leaving enough spare cycles to do other stuff.

    To do:

    • At the moment I only have rudimentary Ogg playback working. I want to make all the remote control functions work (e.g. pausing playback).
    • Ogg Flac support should be quite easy to add too.
    • The MP3 decoder currently drives a visualiser - a simple spectrum analyser. The Ogg code should be able to do the same at least. In fact, I'd like to add more visualisation options, maybe using xmms-style plugins if I can.
    • I need to check that the changes I've made to daapd haven't broken support for existing iTunes clients.
    • Last, but not least: I need to push the changes I've made upstream!

    Longer term, I'm thinking of hacking apart wmamp and essentially rewriting it. I've got several ideas on how I'd like it to look and behave. It's been a while since I've worked on GUI code, but I'll muddle through somehow.

    I've had a great time so far hacking on the WMA11B. Plugging together the fruits of multiple projects has proven to me again just how powerful Free Software can be. I have a neat new toy to play with, and as I have source to all the main components I can customise and improve them as I see fit. How cool is that? :-)

    01:26 :: # :: /wma :: 10 comments

    Comments

    Cleaned up wmamp sources at MyTinker
    Geert wrote on Mon, 13 Feb 2006 02:39

    I have rigorously cleaned up the wmamp source and fixes lots of bugs and leaks and streamlined the whole thing.

    http://groups.yahoo.com/group/mytinker/


    Reply

    Your Comment

     
    Name:
    URL/Email: [http://... or mailto:you@wherever] (optional)
    Title: (optional)
    Comment:
    Anti-spam:Select the seventh of the following words and enter it in the "Human" box
    newer notions nuncio nicety neighing nostrils ninety nippiest notation nauseous
    Human:
    Save my Name and URL/Email for next time