Internet Radio (headless)

Turn a raspberry pi model b into a streaming radio player that can be controlled by MPD apps such as the IOS app MPoD.

This is based off the Raspbian “Wheezy” image found here:

– Install the image on your SD card.

– ssh into your raspberry pi.

Username: pi

Password: raspberry

– If you have not already done so at the console, enter the initial config program

sudo raspi-config

  • Expand the file system

  • Set Hostname to piradio or whatever you want

  • Change the password if you want

  • Go to the Advanced options

    • Enable SSH

    • Update tool

    • Exit to command line

– Update and Upgrade Firmware

  •  Update all Raspbian packages.
sudo apt-get -y update
sudo apt-get -y upgrade
  • Install rpi-update

sudo apt-get install -y git-core
sudo wget -O /usr/bin/rpi-update
sudo chmod +x /usr/bin/rpi-update

  • Backup the existing firmware.

sudo cp /boot/start.elf /boot/start.elf.knowngood

  • Update to the latest firmware and activate it.

sudo rpi-update sudo shutdown -r now


– Install Audio and MPC/MPD

  • Install Audio

sudo apt-get -y install alsa-utils mpg321 lame sudo modprobe snd-bcm2835

  • Set audio output to analog (0=auto, 1=analog, 2=HDMI)# in this example the “1? is the option you would change to 2 if you wanted to use the HDMI jack

sudo amixer cset numid=3 1

  • Test Audio

aplay /usr/share/sounds/alsa/Front_Center.wav
speaker-test -t sine -f 440 -c 2 -s 1

  • Install MPD and MPC audio players

sudo apt-get install -y mpd mpc
sudo service mpd stop
sudo chmod -R g+w /var/lib/mpd
sudo chmod -R g+w /var/run/mpd

  • remove bind to address
sudo nano /etc/mpd.conf
  • Find the line that says bind_to_address “localhost”,  and put a # in front of it or remove the entire line

ctrl-x Y Enter

  • reboot

sudo shutdown -r now


– Add one or multiple radio streams and MPC Play Command

mpc add
  • Start radio when pi turns on
sudo nano /etc/rc.local
  • At the bottom add the following line
mpc play
ctrl-x Y Enter
  • Manually start the stream

MPC play

– Setup your mobile device

  • Install a free MPD app on your mobile device such as MPod on IOS or MPDroid on android. No username/password needed.
  • If it does not automatically find the device, manually add one using the above HOSTNAME or IP address. I recommend the HOSTNAME as the current setup for IP is DHCP and your IP could possibly change.

Notes: Although it is set to automatically start, sometimes it will not. The simple solution is to just open your mobile app and wait for it to say the station is available and hit play.If you want to control the player from CLI:

MPC play
MPC stop
MPC help