The fun I had with this one!
The goal: to get Airplay working on my Raspberry Pi.
The rationale: turns out that my HP Microserver (N40L) doesn’t support the hardware extensions needed to pass-through a USB sound-card to VMWare ESXi 5.5, in order for it, in turn, to pass that to the VMs. So, my goal of having a Windows VM running iTunes, Spotify etc. and playing that through a long (15m) 3.5mm cable in a #8 fencing wire approach to extending my media upstairs has come up short. Ha, ha.
So, my backup plan? I have a Raspberry Pi sitting right beside the Microserver (with a very long HDMI cable for extending same said video media upstairs). Maybe I could use that, I thought.
The plan: the Raspberry Pi is running RaspBMC (an awesome distro), and I thought it worthwhile to use a USB soundcard (specifically, a Creative Sound Blaster USB stick) to improve on the not-so-flash audio that comes out of the native 3.5mm jack.
Enter Shairport – a port of Airplay that can run on a Pi.
This site has most of the instructions needed to download and compile the Shairport source, including the additional instructions when using Raspbmc as a base.
From there, the gotchas I uncovered:
- The SoundBlaster seemed to have dramas with rubbish sound when the analog input (default) was selected, but no problems when what ALSA identifies as the S/PDIF input. So, to use that, I had to create a
/etc/asound.conffile that contains the line
pcm.!default front:U0x41e0x30d3and nothing else. The U0x… is the identifier of the SoundBlaster that I got from using the
aplay -Lcommand, along with the iec958 which is the identifier of the S/PDIF input.
- I found I didn’t need to have the
options snd-usb-audio nrpacks=1line in the
/etc/modprobe.d/alsa-base.conffile, so that’s good.
- Still some noise coming through the soundcard, so I used
alsactl store 0to mute and save the changes to the Mic input.
- The final key to getting rid of the noise as best I could was to add the line
/boot/cmdline.txtfile which, I think, slows down the USB ports to cut back noise.
What a drama! But now I have it (mostly) sorted and stable, and receiving pretty good sound from a VM with a hi-fi virtual audio cable and AirFoil.
Not too bad.