streaming to Airtunes (Airport Express) with PulseAudio

So, being back in Australia, the sun is shining, I'm sat on my sofa and I can't help but feel like I'm on summer holidays. So I want to crank some Uh Huh Her on the stereo.

We have an Airport Express, but using would normally require using Steph's computer, or the computer downstairs. So instead I thought I'd give the support in PulseAudio a go.

It's pretty easy to set up. Install the (Debian/Ubuntu) packages paprefs pavucontrol pulseaudio-module-raop pulseaudio-module-zeroconf (Fedora packages might have different names). Run paprefs and tick the option to discover Airtunes devices.

paprefs
Then using pavucontrol you can set the output device for an application.

pavucontrol
It's not perfect yet, it can sometimes get stuck skipping, and you have to move the stream to your local computer and back to the Airport (apparently the buffering is just implemented using windowing, but maybe needs to be smarter?), but it's working pretty good. Still, it's insanely neat, and because it's in PulseAudio, you can redirect any stream you like (not just from your music player).

It's not just Airtunes either. You can stream to other PulseAudio servers (discovered over mDNS) as well as UPnP media renderers.

Upgrading to Ubuntu Karmic

Upgraded to Ubuntu Karmic pre-release today on my Thinkpad X200s. Had two issues:

  1. machine wouldn't prompt for the key to unencrypt the hard disk so it didn't boot. This seems to be Launchpad bug 446591. I followed this fix.
  2. forgot that I had downgraded my Intel graphics driver to v2.4, causing my consoles to break, suspend to RAM to break and only support a broken version of EXA. apt-get install xserver-xorg-video-intel fixed this.

Things seem much better now than the mess I had this morning.

improving your code by fixing warnings

I don't know why, but there is a class of software programmer who seem to believe that compiler and runtime warnings are somehow optional, or something that can be cleaned up at a later date. This class of programmer is very common in the commercial software world.

I've never really been sure why people think these warnings can be ignored. Compilers are pretty smart these days, and if a the compiler says you have a type-mismatch for your pointer assignment… there's a good chance you did something silly.

Library developers don't just add all of those pesky assertions to their methods for fun. If your code is outputting critical warnings, you probably shouldn't be surprised that it's crashing shortly afterwards. Something clearly went wrong.

So what can you do? Compiling your code with warnings-as-errors when developing it is a very good step (-Werror in gcc). For runtime warnings, you can probably set an environment variable to make the program abort when reached (e.g. for GLib you can export G_DEBUG=fatal-warnings or fatal-criticals) — this allows you to attach a debugger when the warning is reached.

Simple steps for much better code.

key maintenance

For those who care about things like GPG keys, I generated a new GPG key today. My old key wasn't compromised, but it's been around for a long time and is full of lots of old subkeys and my old name and stuff. I've signed my new key with my old key and set the expiry for my old key to tomorrow (I've not revoked it — should I?).

Update: it turns out that everyone in Debian is now generating 4096 RSA+RSA keys (Debian instructions). May as well be future proof, so I've revoked the key from this afternoon and generated another one. Thanks to Sjoerd for the tip.

I've pushed the keys to the keyserver, but for reference:

pub   4096R/4EE4E30F 2009-09-22 [expires: 2011-09-22]
      Key fingerprint = 5ED7 A3C0 F83A D937 300B  DA54 82EC F846 4EE4 E30F

uid                  Danielle Madeley <danielle@madeley.id.au>
uid                  Danielle Madeley <danielle.madeley@collabora.co.uk>

-----BEGIN PGP PUBLIC KEY BLOCK-----
Version: GnuPG v1.4.9 (GNU/Linux)

mQINBEq4fAgBEACvK97bvlOs1ONSiMnEyw5FfHNTO6B4cJ+ASsGwOFeeLQ1VNbtZ
fklCHVDRk79R6Hrg1PU1YgDgpVp60zPp7D59XP8GOFYhsDHOQitc+I0VMbXXpycF
dK6+kL5e59pnDfYrV6p3a4WblIE4SGcVtDwY8kmXQMFBP0Cul8zIA+AMlbeW2Pl6
TASxHHW5P2TtndncedBSE2h9Rwcr0krWnHQqeCMna7JFw/zx+iFtvG9lVvbsjz3W
3R1kEWcz16G+guYPBkepK7m4oveZmYaWJbHlNIleTcjAVx1aX/6qUqr8vI+9HX2n
66XyjoFLHEtbl8GMdW7qeEgbA9+aVGRrE9t77VXOUSTKG9mSh8MmAseZhtzdAmyR
KZq+5Ifv4tOJrQ47+pMZVoYziiNaqWCd55iHIFCppOFnpBbHbJslY5O19UBACUaw
0MdhStm/j16xhh0rCdiduP2o0mPRnIi1z7c7S5Qbbt44I2uuDLN27O0TY0yBQ+ni
7MW8lpXdWyG6yYluOmQa9lnACGOcSJ3SoONvPej8MJYMV3FAzXbQHKi2194Af3ZF
9bD2L9XHbpOMvJtpRohPAiT4bQW5fjvhF8QBi5L2SqUw2ydGoJGqP4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FvE6O7wx28FJjsn08cH7urdHcu/G7lJ6+w
I07uaR9LbAhyczJBS4TKHr0qMg6x07L4K+GwfMY34YUZkXMYNzt0BWprUYrb6AMv
kqqVodwzkg2JDbfbf12tH1jfB/VY3T1NNo7omi08BH5T6Z/OmTZOmyXuoSBJ0UCV
Ej6kbsI2F3irV8Q5pPkeMxiOdjq39wL3+i+hr9WRacqc
=Nihe
-----END PGP PUBLIC KEY BLOCK-----

Please don't sign a key from someone you aren't sure is the real person, yadda yadda.

Creative Commons Attribution-ShareAlike 2.5 Australia
This work by Danielle Madeley is licensed under a Creative Commons Attribution-ShareAlike 2.5 Australia.