Today I have setup my second squeezebox emulator (squeezelite) on the new Raspberry Pi B+. The objective is to setup synchronization between the two players and second create a energy en cost efficient player. This player will mainly be used for streaming internet radio, that’s why I went for the low sound quality USB powered speakers. The recent release of the revised B+ model has received two modifications which are needed for this project. The audio circuit now incorporates a dedicated low-noise power supply, resulting in better audio output. Secondly the USB output power has increased to 1.2A, so the powered USB hub is probably not needed anymore.
- Raspberry Pi Model B+ including Multicomp casing 42,95 euro (kiwi electronics)
- Transcend 4GB Class 10 MicroSDHC 5,70 euro (kiwi electronics)
- MicroUSB Power Adapter 5.2V/2.0A – 10 Watt 10,95 euro (kiwi electronics)
- Philips SPA2201 2.0 Speaker – USB powered 20,90 euro (bol.com)
Download Raspberry Pi operating system image Raspbian from raspberry.org. I used ‘2014-06-20-wheezy-raspbian.img’. Follow the installation instructions to install the image on the MicroSD card.
I installed the Raspbian image using Macosx:
$ diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *500.1 GB disk0 1: EFI EFI 209.7 MB disk0s1 2: Apple_HFS Macintosh HD 499.2 GB disk0s2 3: Apple_Boot Recovery HD 650.0 MB disk0s3 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: FDisk_partition_scheme *4.0 GB disk1 1: DOS_FAT_32 NO NAME 4.0 GB disk1s1 $ diskutil unmountDisk /dev/disk1 Unmount of all volumes on disk1 was successful $ sudo dd bs=1m if=2014-06-20-wheezy-raspbian.img of=/dev/disk1 Password: 2825+0 records in 2825+0 records out 2962227200 bytes transferred in 1621.960044 secs (1826326 bytes/sec) $
Now assemble your Raspberry Pi and hook it up to the network and power. After a minute I saw the new Raspberry Pi appear in the arp list of my router. Connect to it using SSH (username: pi / password: raspberry) and follow the next steps.
Start the config tool:
$ sudo raspi-config
- Expand filesystem
- The timezone
- The hostname (I prefix all my raspberry’s with ‘rpi-‘)
Finish and reboot
Remove the wolfram-engine package because we’re not going to use it (it’s a large package so updating is time consuming).
$ sudo apt-get remove wolfram-engine
Check for updated packages:
$ sudo apt-get update
Install the latest patches and get some coffee (this step took 8 minutes):
$ sudo apt-get upgrade
Install squeezelite dependencies:
$ sudo apt-get install -y libflac-dev libfaad-dev
Download the squeezelite program and libsoxr dependency provided by Ralph Irving:
Extract the squeezelite program to ‘/usr/bin’:
$ sudo tar -C /usr/bin/ -zxvf squeezelite-1.6.4-439-debian7-armhf.tar.gz
Create a symlink (needed for the startup script):
$ sudo ln -s /usr/bin/squeezelite-18.104.22.1689-static /usr/bin/squeezelite-armv6hf
Extract the libxoxro package and install the package:
$ tar -xvzf libsoxr-0.1.1-1.1-debian-wheezy-armhf.tar.gz libsoxr0_0.1.1-1.1_armhf.deb libsoxr-dev_0.1.1-1.1_armhf.deb libsoxr-lsr0_0.1.1-1.1_armhf.deb $ sudo dpkg -i libsoxr0_0.1.1-1.1_armhf.deb libsoxr-dev_0.1.1-1.1_armhf.deb libsoxr-lsr0_0.1.1-1.1_armhf.deb
Update the firmware to the latest release:
$ sudo rpi-update
Reboot to effect the changes.
$ sudo /usr/bin/squeezelite-armv6hf -l Output devices: null - Discard all samples (playback) or generate zero samples (capture) default:CARD=ALSA - bcm2835 ALSA, bcm2835 ALSA - Default Audio Device sysdefault:CARD=ALSA - bcm2835 ALSA, bcm2835 ALSA - Default Audio Device $
Start the player manually:
$ sudo /usr/bin/squeezelite-armv6hf -o sysdefault:CARD=ALSA -n Bedroom -s
If you got it to work follow these last steps to make the player startup after a reboot:
$ sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelitehf.sh -P /etc/init.d/ $ sudo mv /etc/init.d/squeezelitehf.sh /etc/init.d/squeezelite $ sudo chmod 755 /etc/init.d/squeezelite $ sudo update-rc.d squeezelite defaults
Make the necessary changes to the script:
$ sudo vi /etc/init.d/squeezelite
Start the service:
$ sudo /etc/init.d/squeezelite start
Because I already had the Squeezebox server (97_SB_SERVER.pm) and player (98_SB_PLAYER.pm) module setup in FHEM the new player was automatically detected.
From here I’ll start using the Squeezebox sync function, so more to come!