Prerequisites
Sound tests
List sound devices:
$ aplay -L
Play a sound on default RPI output:
$ aplay /usr/share/scratch/Media/Sounds/Vocals/Singer2.wav
Install a DAC
I bought this USB DAC but it is cheaper without the enclosure.
Play on USB DAC:
$ aplay -D default:CARD=DAC /usr/share/scratch/Media/Sounds/Vocals/Singer2.wav
Set USB DAC as default output:
$ sudo emacs /etc/modprobe.d/alsa-base.conf
Comment that line:
options snd-usb-audio index=-2
Add that line:
options snd-usb-audio nrpacks=1
Restart daemon:
$ sudo /etc/init.d/alsasound restart
Install squeezelite
I already have a Logitec Media Server installed on my NAS for my [Squeezebox Radio](http://en.wikipedia.org/wiki/Squeezebox(networkmusic_player). So let's install SqueezeLite client on the raspberry pi.
Install dependencies:
$ sudo apt-get install libflac-dev
$ sudo apt-get install libfaad2
$ sudo apt-get install libmad0
Install squeezelite:
$ mkdir squeezelite
$ cd squeezelite
$ wget http://squeezelite.googlecode.com/files/squeezelite-armv6hf
$ sudo mv squeezelite-armv6hf /usr/bin
$ chmod u+x /usr/bin/squeezelite-armv6hf
Test with:
$ squeezelite-armv6hf -l
$ squeezelite-armv6hf -o default:CARD=ALSA -a 200
$ squeezelite-armv6hf -n "PI-NAME" -a 200
Install daemon:
$ sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelitehf.sh
$ sudo mv squeezelitehf.sh /etc/init.d/squeezelite
$ sudo chmod a+x /etc/init.d/squeezelite
Fix daemon script:
$ sudo emacs /etc/init.d/squeezelite
Remove 'SLMAC' stuff and set:
SLOPTIONS="-a 200 -n PI-NAME"
Start daemon:
$ sudo update-rc.d squeezelite defaults
$ sudo service squeezelite start
External References:
Install AirPlay
Now I want to stream the music stored on my NAS to the raspberry pi through Audio Station, controlling it with DS Audio.
Thanks to ShairPort that's easy.
Install dependencies:
$ sudo apt-get install git libao-dev libssl-dev libcrypt-openssl-rsa-perl libio-socket-inet6-perl libwww-perl avahi-utils
$ sudo cpan install Net::SDP
Install ShairPort:
$ git clone https://github.com/abrasive/shairport.git shairport
$ cd shairport
$ ./configure
$ make
$ sudo make install
Test:
$ shairport.pl -a ShairPort
Install daemon:
$ sudo cp ./shairport.init.sample /etc/init.d/shairport
$ sudo chmod a+x /etc/init.d/shairport
Fix daemon:
$ emacs /etc/init.d/shairport
Change name: NAME=ShairPort
Start daemon:
$ sudo update-rc.d shairport defaults
$ sudo service shairport start
External References: