a Rasperry Pi-based appliance that broadcasts video or audio via DILC servers. Below is the audio broadcaster part.
A. Audio Streaming
* Raspberry Pi (Model B)
* USB Sound Card
* Audio Computer Microphone
* USB Micro Cable with Power Brick (5 Volts, 2 Amperes)
* Ethernet Cable
B. For Programming
A. Installing and Running the Rasbian Wheezy OS (Operating System)
- Use Win32 Disk Imager to write a boot image to your SD Card.
- Download the Wheezy zip file and extract the file.
- Insert the SD Card into your Raspberry Pi and write the disk image file using the installed win32 Disk Imager.
B. Setting Static IP
- Check first the set-up by
then the line iface eth0 inet dhcp implies that the IP address is via DHCP which is dynamically registered by the router. This is what we want to change, if necessary.
- Get Information
with these you will get the different information that we will use later such as:
inet address (Pi's Current IP Address)
Bcast (The Broadcast IP Range)
Mask (Subnet Mask Address)
netstat -nr or route n
(note that these commands will give you the same information)
Get also the
- Editing Network Configuration
open the file /etc/network/interfaces by:
sudo nano /etc/network/interfaces
change the line
iface eth0 inet dhcp
iface eth0 inet static
after this line, directly type the information that we gathered a while ago and save and exit by Ctrl+o and Ctrl+X
next is to reboot..
will reveal the changes or try to ping it with your IP Address by
ping (your IP Address) -c 5
C.Programming for the Audio Streaming
After installing and running the OS of your Raspberry Pi, you are now ready to program the audio streaming.
Open the LX Terminal,
- Install PulseAudio and these preference GUI with the command
sudo apt-get install pulseaudio
sudo apt-get paprefs
- After the system being rebooted, next thing to do is to edit and add the following lines in the file /etc/pulse/daemon.conf by these command
sudo nano /etc/pulse/daemon.conf
resample-method = ffmpeg
default-sample-rate = 44100
alternate-sample-rate = 44100
after these save and exit by Ctrl+o and Ctrl+x
- To make the Raspberry Pi audio server appearing automatically in your "Sound Setting" on every client (PC) and the server (raspberry Pi).
sudo sed -i 's/AVAHI_DAEMON_DETECT_LOCAL=1/AVAHI_DAEMON_DETECT_LOCAL=0/g' /etc/default/avahi-daemon
- Activate the network feature of PulseAudio on both client and server.
For the server mark the following boxes
Network Server -Enable network access to local sound devices
Network Server -Allow other machines on the LAN to discover local sound devices
Network Server -Don't require authentication
For the client you want to stream from the server (Raspberry Pi)
Network Access -Make discoverable PulseAudio network sound devices available locally
- Reboot the both server and the client by:
After the system reboots, the Sound Setting should appear like these:
D. Connecting the Pulseaudio to the Icecast2 server using the Darkice
- Compile and Install Darkice
$ sudo sh -c "echo 'deb-src http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi' >> /etc/apt/sources.list"
$ sudo apt-get update
Install some additional packages
sudo apt-get --no-install-recommends install build-essential devscripts autotools-dev fakeroot dpkg-dev debhelper autotools-dev dh-make quilt ccache libsamplerate0-dev libpulse-dev libaudio-dev lame libjack-jackd2-dev libasound-dev libtwolame-dev libfaad-dev libflac-dev libshout3-dev libmp3lame-dev
Create a working directory
$ mkdir src && cd src/
Get a source package of darkice
$ apt-get source darkice
change the compile configuration to match the Raspbian environment
$ cd darkice-1.0/
$ vi debian/rules
change the contents to:
Esc + : + q + ~ to save and exit
Change the version of the package to reflect mp3 support.
$ debchange -v 1.0-999~mp3+1
- To check if the streaming is working plug in the Computer Audio Microphone in the USB Sound card and start to talk. Note that there will be a delay of 1000ms-2000ms.
- Catherine Bagotsay (developer)
- Dawn Benigno (consultant)
- Dan Villareal (consultant)
- Peter Sy (consultant)