Here's a quick guide to set up a RPI as a PulseAudio network sink. It's based on the Debian image.
1. Upgrade to the latest kernel version using rpi-update.
There are a couple of important fixes to the alsa driver. https://github.com/Hexxeh/rpi-update/
2. Load the sound driver on boot
#sudo nano /etc/modules
Add this line:
snd_bcm2835
3. Install PulseAudio and avahi
#sudo apt-get install pulseaudio pulseaudio-module-zeroconf avahi-daemon
4. Make PulseAudio start on boot
#sudo nano /etc/default/pulseaudio
Change PULSEAUDIO_SYSTEM_START to 1
5. Configure PulseAudio to work over network.
#sudo nano /etc/pulse/system.pa
Add these lines. Change to suite your network if needed.
load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;192.168.0.0/16
load-module module-zeroconf-publish
6. Reboot you Pi.
Your Pi should now appear as an Output Device in the sound settings on your Linux Desktop. On my own system I only want the sound from Spotify to be routed to the Pi. To do this you can write a small script to set up PULSE_SINK and PULSE_SOURCE before starting Spotify. This will work with any application.
Code: Select all
#!/bin/bash
export PULSE_SINK=tunnel.raspberrypi.local.alsa_output.0.analog-stereo
export PULSE_SOURCE=tunnel.raspberrypi.local.alsa_output.0.analog-stereo.monitor
/usr/bin/spotify