I've been talking about the BeagleBone Black on the recent 'Raspberry Pi. Yum' thread, and I thought I should summarize my experiences so far and give some instructions for building an MPD server customized to talk directly to ALSA, rather than via Pulse Audio like the Debian packaged version.
WHAT TO BUY
You can get a BeagleBone Black from Farnell UK for 30.99 UKP:
http://uk.farnell.com/circuitco/bb-bblk-000/beaglebone-black-cortex-a8-dev/dp/2291620
Farnell sell a suitable linear power supply for 10.60 UKP:
http://cpc.farnell.com/1/1/84869-ac-dc-linear-psu-5v-1a-universal-s2226st-stontronics.html
I bought my linear power supply from Item Audio for 19 UKP:
http://www.itemaudio.com/index.php/power-supplies/linear-psus/detail/28-linear-psus/flypage/1080-5v--1a-linear-psu.html?sef=hcfp
It may be the same model as the Farnell one, I'm not sure.
I bought my case from Tigal for 29 euros + VAT:
http://www.tigal.com/product/3458
Logic Supply do another type of metal case:
http://www.logicsupply.com/blog/2013/05/23/beaglebone/
Both Tigal and Logic Supply sell BeagleBone Blacks, although I don't think they sell any suitable linear PSUs.
INSTALLATION
Initially I used the Angstrom Linux distribution that comes with the BeagleBone. I found a few annoying things with it though. If you added an NFS mount to /etc/fstab it wasn't mounted on startup. Getting the ntp time server working took about half an hour of fiddling around whereas once you install it on Debian it just works. I was getting quite frequent dropouts at the end of tracks with ALSA errors in the log. Another advantage of using Debian Wheezy is that it is the same Linux distribution as Raspian on the Raspberry Pi, and so any software setup tips and howtos will be much the same.
These notes are adapted from the RaspyFi instructions here:
http://www.raspyfi.com/raspyfi-rc2-how-its-made-and-list-of-all-the-optimizations/
Follow the instructions here on how to install Debian Wheezy onto an SD card:
http://avedo.net/653/flashing-ubuntu-13-04-or-debian-wheezy-to-the-beaglebone-black-emmc/
You will need a Linux computer with an SD card reader/writer to setup the BeagleBone's SD card. If you haven't got one,
you will need to buy a USB SD card reader/writer and attach it to the BeagleBone and follow the instructions with Angstrom
Linux running off the flash card.
You could install Wheezy on the internal 2Gb flash memory, but I prefer to keep that as standard Angstrom Linux as provided with the BeagleBone.
# Set up the locale.
# I use American en_US.UTF-8 as I'm not bothered about British English
sudo apt-get install locales
sudo dpkg-reconfigure locales
# Tweak ALSA to buffer more packets for USB (that's what I think this does)
sudo apt-get install alsa-utils
sudo nano /etc/modprobe.d/alsa-base.configure
# Add this line at the end:
options snd-usb-audio nrpacks=1
# Install mpd and the mpc command line utility.
# We are going to build our own MPD, but it is easier to use an existing
# configuration and just change the mpd binary to a custom one.
sudo apt-get install mpd mpc
# Install the dependencies for building 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
# Get the mpd sources from git:
cd /home/debian
git clone git://git.musicpd.org/master/mpd.git
cd mpd
# The most recent release is 0.17.4, and so check out that version
git checkout release-0.17.4
# Configure mpd, it will be installed in /usr/local:
./autogen.sh --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
When the configuration has finished, you should see something like this:
########### 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)
##########################################
# Build and install:
make
sudo make install
# Change the mpd config to pick up the mpd program from /usr/local/bin/mpd:
/etc/init.d/mpd stop
echo DAEMON=/usr/local/bin/mpd >>/etc/default/mpd
/etc/init.d/mpd start
# Remove apache as it isn't needed:
sudo apt-get remove apache2
sudo apt-get remove apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common
# Install lighttpd instead for serving cover art:
sudo apt-get install lighttpd
# Edit /etc/lighttpd/lighttpd.conf
server.document-root = "/var/lib/mpd/music"
# Install NFS client software in order to NFS mount a disk with music tracks
sudo apt-get install nfs-common
# Edit /etc/fstab and add a line similar to this to NFS mount a disk at startup
192.168.1.104:/mnt/Music04 /mnt/Music04 nfs soft,intr,ro,rsize=32768 0 0
# Create mount point:
sudo mkdir /mnt/Music04
# I use a large read buffer with 'rsize=32768' as we are reading large music
# file sequentially
Comment out these lines in /etc/inittab to stop the 7 getty processes
being started:
# 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
# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3
# Change the CPU frequency governor from 'ondemand' to 'performance'
sudo nano /etc/default/cpufrequtils
# Add this line:
GOVERNOR="performance"
# Create symbolic links in /var/lib/mpd/music to your NFS mounted music disk:
cd /var/lib/mpd/music
sudo ln -s /mnt/Music04/Music/Music Music
# Find out the name of your USB device with the 'aplay -l' command.
# This is what I get for my V-Link:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Black [TI BeagleBone Black], device 0: HDMI nxp-hdmi-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: VLink [Musical Fidelity V-Link], device 0: USB Audio [uSB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
# Edit /etc/mpd.conf and change the output section for your DAC or other USB device
# Here is the entry I use for my V-Link:
audio_output {
type "alsa"
name "Musical Fidelity V-Link"
device "hw:VLink" # optional
# format "44100:16:2" # optional
# mixer_device "hw:MM1" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
mixer_type "none"
}
Restart with 'sudo reboot', and debug anything which goes wrong.
SOUND
The sound once everything is set up is really good. I was using an old MacBook with Decibel and BitPerfect before, and I think the BeagleBone has clearer, higher resolution treble.
NEXT STEPS
I'm looking an RFI/EMI shielding sheets to use in the BeagleBone case. There may be a version of the Voyager Linux music distribution available soon which would simplify setting up an MPD server. I may switch to that, but I'm pretty pleased with my set up as is.
WHAT TO BUY
You can get a BeagleBone Black from Farnell UK for 30.99 UKP:
http://uk.farnell.com/circuitco/bb-bblk-000/beaglebone-black-cortex-a8-dev/dp/2291620
Farnell sell a suitable linear power supply for 10.60 UKP:
http://cpc.farnell.com/1/1/84869-ac-dc-linear-psu-5v-1a-universal-s2226st-stontronics.html
I bought my linear power supply from Item Audio for 19 UKP:
http://www.itemaudio.com/index.php/power-supplies/linear-psus/detail/28-linear-psus/flypage/1080-5v--1a-linear-psu.html?sef=hcfp
It may be the same model as the Farnell one, I'm not sure.
I bought my case from Tigal for 29 euros + VAT:
http://www.tigal.com/product/3458
Logic Supply do another type of metal case:
http://www.logicsupply.com/blog/2013/05/23/beaglebone/
Both Tigal and Logic Supply sell BeagleBone Blacks, although I don't think they sell any suitable linear PSUs.
INSTALLATION
Initially I used the Angstrom Linux distribution that comes with the BeagleBone. I found a few annoying things with it though. If you added an NFS mount to /etc/fstab it wasn't mounted on startup. Getting the ntp time server working took about half an hour of fiddling around whereas once you install it on Debian it just works. I was getting quite frequent dropouts at the end of tracks with ALSA errors in the log. Another advantage of using Debian Wheezy is that it is the same Linux distribution as Raspian on the Raspberry Pi, and so any software setup tips and howtos will be much the same.
These notes are adapted from the RaspyFi instructions here:
http://www.raspyfi.com/raspyfi-rc2-how-its-made-and-list-of-all-the-optimizations/
Follow the instructions here on how to install Debian Wheezy onto an SD card:
http://avedo.net/653/flashing-ubuntu-13-04-or-debian-wheezy-to-the-beaglebone-black-emmc/
You will need a Linux computer with an SD card reader/writer to setup the BeagleBone's SD card. If you haven't got one,
you will need to buy a USB SD card reader/writer and attach it to the BeagleBone and follow the instructions with Angstrom
Linux running off the flash card.
You could install Wheezy on the internal 2Gb flash memory, but I prefer to keep that as standard Angstrom Linux as provided with the BeagleBone.
# Set up the locale.
# I use American en_US.UTF-8 as I'm not bothered about British English
sudo apt-get install locales
sudo dpkg-reconfigure locales
# Tweak ALSA to buffer more packets for USB (that's what I think this does)
sudo apt-get install alsa-utils
sudo nano /etc/modprobe.d/alsa-base.configure
# Add this line at the end:
options snd-usb-audio nrpacks=1
# Install mpd and the mpc command line utility.
# We are going to build our own MPD, but it is easier to use an existing
# configuration and just change the mpd binary to a custom one.
sudo apt-get install mpd mpc
# Install the dependencies for building 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
# Get the mpd sources from git:
cd /home/debian
git clone git://git.musicpd.org/master/mpd.git
cd mpd
# The most recent release is 0.17.4, and so check out that version
git checkout release-0.17.4
# Configure mpd, it will be installed in /usr/local:
./autogen.sh --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
When the configuration has finished, you should see something like this:
########### 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)
##########################################
# Build and install:
make
sudo make install
# Change the mpd config to pick up the mpd program from /usr/local/bin/mpd:
/etc/init.d/mpd stop
echo DAEMON=/usr/local/bin/mpd >>/etc/default/mpd
/etc/init.d/mpd start
# Remove apache as it isn't needed:
sudo apt-get remove apache2
sudo apt-get remove apache2-mpm-worker apache2-utils apache2.2-bin apache2.2-common
# Install lighttpd instead for serving cover art:
sudo apt-get install lighttpd
# Edit /etc/lighttpd/lighttpd.conf
server.document-root = "/var/lib/mpd/music"
# Install NFS client software in order to NFS mount a disk with music tracks
sudo apt-get install nfs-common
# Edit /etc/fstab and add a line similar to this to NFS mount a disk at startup
192.168.1.104:/mnt/Music04 /mnt/Music04 nfs soft,intr,ro,rsize=32768 0 0
# Create mount point:
sudo mkdir /mnt/Music04
# I use a large read buffer with 'rsize=32768' as we are reading large music
# file sequentially
Comment out these lines in /etc/inittab to stop the 7 getty processes
being started:
# 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
# Example how to put a getty on a serial line (for a terminal)
#
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
# Example how to put a getty on a modem line.
#
#T3:23:respawn:/sbin/mgetty -x0 -s 57600 ttyS3
# Change the CPU frequency governor from 'ondemand' to 'performance'
sudo nano /etc/default/cpufrequtils
# Add this line:
GOVERNOR="performance"
# Create symbolic links in /var/lib/mpd/music to your NFS mounted music disk:
cd /var/lib/mpd/music
sudo ln -s /mnt/Music04/Music/Music Music
# Find out the name of your USB device with the 'aplay -l' command.
# This is what I get for my V-Link:
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Black [TI BeagleBone Black], device 0: HDMI nxp-hdmi-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: VLink [Musical Fidelity V-Link], device 0: USB Audio [uSB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0
# Edit /etc/mpd.conf and change the output section for your DAC or other USB device
# Here is the entry I use for my V-Link:
audio_output {
type "alsa"
name "Musical Fidelity V-Link"
device "hw:VLink" # optional
# format "44100:16:2" # optional
# mixer_device "hw:MM1" # optional
# mixer_control "PCM" # optional
# mixer_index "0" # optional
mixer_type "none"
}
Restart with 'sudo reboot', and debug anything which goes wrong.
SOUND
The sound once everything is set up is really good. I was using an old MacBook with Decibel and BitPerfect before, and I think the BeagleBone has clearer, higher resolution treble.
NEXT STEPS
I'm looking an RFI/EMI shielding sheets to use in the BeagleBone case. There may be a version of the Voyager Linux music distribution available soon which would simplify setting up an MPD server. I may switch to that, but I'm pretty pleased with my set up as is.