View RSS Feed


Beaglebone Black- the $45 MPD server

Rate this Entry
-or known as the ‘Summer Holiday’ project. Credit mainly goes to Richard Dale for the build instructions that I simply followed to get ‘bit-perfect’ audio playback with a USB DAC. We shared the view that embedded systems like this are adequate, even for high-end setups. Since I have no previous experience of programming or understanding Linux, I’ll admit it was a big learning curve, and without Richard’s support I would have been hopelessly lost on many occasions.

Recommended accessories:

5V/2A Power supply 5V 2A (2000mA) switching power supply - UL Listed ID: 276 - $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits
Acrylic case Adafruit Bone Box - Enclosure for Beagle Bone/Beagle Bone Black ID: 699 - $19.95 : Adafruit Industries, Unique & fun DIY electronics and kits
Or a steel case- in stock from July 15th(tip: follow them on Google+ for a 30% discount) LGX BB100 Case for BeagleBone Black SoC
Micro SD USB adapter Micro SD TF Card Reader Adapter and USB 2 0 Adapter | eBay
2 4GB Micro SD cards

Installing Debian Wheezy onto the Micro SD card:

For anyone very new to Linux, it’s helpful to follow the Beagleboard website to familiarize yourself with the board, and follow the setup guide. Try creating the most up to date Angstrom image onto one of the SD cards (instructions from the same website). I’ve been accessing the Beaglebone via shell (SSH) using the Mac Terminal.

sudo su
(enter your Mac password)

ssh root@beaglebone.local
type y/yes to register the host key. If verification fails due to a different host key i.e booting off a different SD, just edit the file with the registered host keys with the ‘nano’ command and delete the lines.
Once you can successfully boot off that image, then you can start using the following shell commands:
tar xJf debian-7.0.0-console-armhf-2013-06-14.tar.xz
unpacks the image
cd debian-7.0.0-console-armhf-2013-06-14
Now insert the SD card you want to install Debian Wheezy on the USB adapter and plug it into the Beaglebone USB port. Now type:
sh ./ --mmc /dev/sda –uboot bone_dtb
where sda is the intended card destination. Use this command if you are unsure (you still get another chance to verify):
./ --probe-mmc
Once the flashing is complete, just swap the cards and hold the boot button (make sure you hear the click sound) and power the board up. Keep holding the boot button until all the blue LED lights light up solid, then release. Debian Wheezy is now ready. I access it by shell using:
ssh debian@192.168.X.XX
where 192.168.X.XX is the network address of the Beaglebone. Password is temppwd

Installing MPD

I’ve shortened the commands to a minimum, and save the tweaks for later.
sudo apt-get install mpd
sudo apt-get install libfaad2 libfaad-dev libflac8 libflac-dev libogg0 libogg-dev \
libvorbis0a libvorbis-dev libid3tag0 libid3tag0-dev libmad0 libmad0-dev \
libcue-dev libcue1 libasound2 libasound-dev libasound2-dev \
libao-dev libwavpack-dev libwavpack1 libsamplerate0 \
libsamplerate-dev libmikmod2-dev libmikmod2 libmikmod-dev \
libshout-dev libavformat-dev libavcodec-dev libavutil-dev \
libcurl4-openssl-dev libmms-dev libmms0 \
libtwolame-dev libtwolame0 libmp3lame-dev
git clone git://
cd mpd
git checkout release-0.17.4
./ --prefix=/usr --disable-bzip2 --disable-iso9660 --disable-zzip \
--enable-id3 --disable-sqlite --enable-ffmpeg --enable-alsa \
--disable-wave-encoder --enable-pipe-output --enable-httpd-output \
--disable-recorder-output --disable-sndfile --enable-oss \
--enable-shout --disable-pulse --disable-ao \
--disable-mad --disable-inotify --disable-ipv6 --enable-curl \
--disable-mms --disable-wavpack --disable-lame-encoder \
--disable-twolame-encoder --enable-vorbis --enable-lsr \
The –-prefix=/usr can be omitted (on Richard’s advice) in case MPD is overwritten if the Debian package is updated.
If all is well, then the following should appear:
########### MPD CONFIGURATION ############
Archive support:
  (-bzip2) (-ISO9660) (-ZIP) 
Client support:
  (-IPv6) (+TCP) (+UNIX Domain Sockets) 
File format support:
  (+AAC) (-C64 SID) (+FFMPEG) (+FLAC) (-FluidSynth) (-GME) (-libsndfile) 
  (-MikMod) (-MODPLUG) (-MAD) (-MPG123) (-MP4) (-Musepack) 
  (-OggTremor) (+OggVorbis) (-WAVE) (-WavPack) (-WildMidi) 
Other features:
  (+libsamplerate) (-inotify) (-SQLite) 
Metadata support:
Playback support:
  (+ALSA) (-FFADO) (+FIFO) (-File Recorder) (+HTTP Daemon) (-JACK) 
  (-libao) (-Media MVP) (+OSS) (-OpenAL) (-OS X) (+Pipeline) 
  (-PulseAudio) (-ROAR) (+SHOUTcast) (-Solaris) (-WinMM) 
Streaming encoder support:
  (+FLAC) (-LAME) (+Ogg Vorbis) (-TwoLAME) (-WAVE) 
Streaming support:
  (-CDIO_PARANOIA) (+CURL) (-Despotify) (-Last.FM) (-Soundcloud) 
  (-MMS) (-SOUP) 
Now type:
sudo make install
I’ve avoided installing mpc (client) to the build, because I favour using MPoD app on the iPhone (free), or MPaD on iPad (nominal cost).

Configuring MPD to recognize USB DAC

sudo nano /etc/mpd.conf
And edit a few entries; they should be fairly simple to locate:
group should be “audio”
bind_to_address should be “any”
Now locate # An example of an ALSA output and change starting with “the audio_output {“ to the following:
audio_output {
        type            "alsa"
        name            "USB"
        device          "hw:1,0"        # optional
#       format          "44100:16:2"    # optional
Commenting out the format line ensures bit perfect output.

Setting up NFS

On the NAS side:
I use a Synology Diskstation and found a thread on XBMC to be useful: - NFS_sharing_from_commercial_NAS_systems_such_as_Sy nology_or_QNAP
It would be best to familiarize yourself with editing using vi – quite different to nano editing.

On the Beaglebone side:
To install NFS client software type:
sudo apt-get install nfs-common
then type:
sudo nano /etc/fstab
then add the line for the NFS to mount at startup:
192.168.X.XX:/volume/music /mnt/music nfs soft,intr,ro 0 0
where 192.168.X.XX is the NAS network address and volume/music is the path directory where your music is stored.
Exit and save, then to create the mount point:
sudo mkdir /mnt/music
we then need to create symbolic links (for the client to recognize music files out of the mpd library):
cd /var/lib/mpd/music
sudo ln –s /mnt/music music
Setting up MPoD

Remember to set the Wi-Fi mode to ON on the iPhone settings to the same network.
Press the Dartboard symbol on the top and ‘Add player manually’
Name is your choice. Server is your network address (if you don’t know, try ‘arm’ or ‘arm.local’ then press save. The Wi-Fi symbol should darken indicating successful connection.
Now click on the cog button and ‘Update database’ (it will take a while) and then ‘Refresh local cache’. Now you can browse by Artist, Album, or Song. I’ll leave out cover art option for now.
Enjoy! Next write up will be about the hardware and software tweaks.
Tags: beaglebone, linux, mpd


  1. Jud's Avatar
    Very helpful and thorough step-by-step. Thanks to both you and Richard.
  2. Richard Dale's Avatar
    Nice write up Kelvin! I hope this encourages a few people to try out the excellent and cheap BeagleBone.

    "The –-prefix=/usr can be omitted (on Richard’s advice) in case MPD is overwritten if the Debian package is updated."

    One minor addition to this. If you install the mpd binary in /usr/local/bin/mpd, you need to make a change to the mpd configuration so that it gets picked up from there:

    /etc/init.d/mpd stop
    echo DAEMON=/usr/local/bin/mpd >>/etc/default/mpd
    /etc/init.d/mpd start
  3. The Computer Audiophile's Avatar
    The BBB is a great board. Thanks for taking the time to write up these instructions!
  4. The Computer Audiophile's Avatar
    Hi Guys - I'm running Debian (Wheezy) directly from the eMMC on the board rather than an SD card. It's nice to reduce possible components and issues. However, all my audio going into a USB DAC is choppy. Sample rate doesn't matter. I have a nearly identical setup on a CuBox Pro without a single issue. Anyone experience this choppy audio on the bbb or have any ideas for me?
  5. k-man's Avatar
    Hi Chris,

    This is a list of various commands to reduce the background processes running:

    sudo apt-get remove apache2
    sudo apt-get remove apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common
    sudo nano /etc/modprobe.d/alsa-base.conf
    Add a line at the end:
    options snd-usb-audio nrpacks=1
    Removing getty processes:

    [CODE]sudo nano /etc/inittab[/CODE]

    Comment out these lines with the hash key i.e.
    # 1:2345:respawn:/sbin/getty 38400 tty1
    # 2:23:respawn:/sbin/getty 38400 tty2
    # 3:23:respawn:/sbin/getty 38400 tty3
    # 4:23:respawn:/sbin/getty 38400 tty4
    # 5:23:respawn:/sbin/getty 38400 tty5
    # 6:23:respawn:/sbin/getty 38400 tty6
    Changing the CPU frequency governor:

    sudo nano /etc/default/cpufrequtils
    Add this line in:
    Note it's a blank page to begin with

    If you are using NFS sharing try editing NFS settings:

    sudo nano /etc/fstab/
    Amend the entry:
    192.168.x.xx:/mnt/Music /mnt/Music nfs soft,intr,ro,rsize=32768 0 0
  6. The Computer Audiophile's Avatar
    Terrific K-Man! Works like a gem now. Thanks!
  7. k-man's Avatar
    Did you get your Wheezy image from the same source?

    Index of /deb/rootfs/wheezy

    I still get the occasional pop when using my Debussy and I've narrowed it down to it being an ethernet issue. This is because I transferred some files to the MPD library i.e. /var/lib/mpd/music and I get flawless playback (playing a 24/192 file).

    There are some LAN tuning guides on the web, but if they don't help, the root cause maybe the ethernet driver (credit to Miska for that response).
  8. The Computer Audiophile's Avatar
    By the way, I used these instructions to download the image file, write it to an SD card, then boot form that card which flashes the eMMC automatically. Worked awesome.

    BeagleBoardDebian -
  9. k-man's Avatar
    Thanks for posting that very informative link. I've had to refer to the site a few times to build fresh images ;-)

    Another cool Robert Nelson script is the 'beaglebone black copy microSD to eMMC' script. This allow anyone who has finished the blog instructions to transfer it all to eMMC, rather than doing it twice:

    chmod +x
    sudo ./
    Unplug the power to the board, remove microSD card, and plug power to the board. It maybe necessary to re-edit /etc/fstab for NFS mounts.

    I only recommend doing this if you are happy all the optimizations are finalized. I also highly recommend creating back up of built images before tweaks are applied, certainly for anyone doing this the first time:

    Take the microSD card and place it in the microSD-USB adaptor and attach to a computer. Example using the Mac Terminal:

    sudo su
    diskutil list
    This determines the disk number of the SD card. Now use the copy command:
    dd if=/dev/disk1 of=/Users/XYZ/Folder/Wheezy1.img bs=1m
    Where 'XYZ' is the Mac Administrator Name and 'Folder' is your destination folder. If in doubt of the intended destination, just drag the destination folder to the shell window after "of=" Again it is important to select and type the correct disk number. The back up image will be the same size as the SD card capacity so I recommend compressing it with a utility.

    To copy an image to a blank card (FAT formatted) reverse the 'dd' destinations i.e.
    dd if=/Users/XYZ/Folder/Wheezy1.img of=/dev/disk1 ​bs=1m
    Choosing the wrong disk number can possibly lead to a computer permanently corrupted so be very careful by running the 'diskutil list' command just to be extra sure. If the above command doesn't work, go to Disk Utility Application to 'Unmount' one of the SD cards partition (NOT Eject) and run the command again.
    Updated 07-13-2013 at 07:17 AM by k-man
  10. The Computer Audiophile's Avatar
    Hi Guys - I just published a little article on the BBB. Your tips, tricks, and tweaks are always appreciated.

    Computer Audiophile - Geek Speak: How To Build A BeagleBone Black MPD Music Server