Streaming Audio on Raspberry Pi

First off, you’re not the only one trying to do this, there are many of us and most of us have left a comment or question on the interwebs, so look it up if you run into trouble. You’ll have to look harder than normal…

First off, follow my tutorial on getting audio up and running on one pi before you start with two. In this example I will get streaming audio from one pi to another.

Step 1:

Install a few packages…

sudo apt-get install pulseaudio
sudo apt-get install paprefs
sudo apt-get install mplayer

Step 2:

Set your settings in paprefs, there’s a great example here: http://dp.nonoo.hu/forwarding-sound-on-lan/

Step 3:

Get both pi’s set up for success, make sure they know eachother’s IP. You can use this command to find your IP address:

ifconfig

Once you’ve got the IP’s set Pi A’s IP to Pi B’s and vice versa:

# on Pi A
export PULSE_SERVER=<ip of Pi B>

# on Pi B
export PULSE_SERVER=<ip of Pi A>

Step 4:

Make sure your shit works. Download an mp3 and test.

wget http://www.freespecialeffects.co.uk/soundfx/household/bubbling_water_1.mp3
mplayer -ao pulse bubbling_water_1.mp3

Make sure the setting are correct and pulse audio should be outputting audio from one pi to the other!

Troubleshooting:

If alsa recognizes your webcam but wont play audio, check this link out: http://forums.debian.net/viewtopic.php?f=6&t=57022

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.