Beaglebone Black- the $45 MPD server
-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
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 [email protected]
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:
wget http://rcn-ee.net/deb/rootfs/wheezy/debian-7.0.0-console-armhf-2013-06-14.tar.xz
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 ./setup_sdcard.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):
./setup_sdcard.sh --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 [email protected]
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://git.musicpd.org/master/mpd.git
cd mpd
git checkout release-0.17.4
./autogen.sh --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 \ --with-zeroconf=auto
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: (+ID3) 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:
make
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
Type:
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:
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.
10 Comments
Recommended Comments