Squeezeberry : Arch Linux based

After my first version of squeezeberry, I found it a little bit long to boot (40 seconds) with the raspian distribution. So I wanted a system able to boot faster. I tried Arch Linux, and it was not very easy to setup. Here we go ...

Download arch linux iso for raspberry pi here

Copy it on your SDCard. Here my SDCard is on /dev/sdb and my arch linux iso is on /
sudo dd bs=1M if=/archlinux-hf-2013-05-14.img of=/dev/sdb

If like me you don’t have display, you can use the console port.
For that you need to modify de cmdline.txt file in your boot partition :
Add at the end of the file :
loglevel=5
and modify the speed from 115200 to 38400
console=ttyAMA0,38400 kgdboc=ttyAMA0,38400

Here is my full cmdline.txt :

selinux=0 plymouth.enable=0 smsc95xx.turbo_mode=N dwc_otg.lpm_enable=0 console=ttyAMA0,38400 kgdboc=ttyAMA0,38400 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=noop rootwait loglevel=5

For the wifi connexion, be sure to have plugged your usb wifi token. And start the wifi wizard :
wifi-menu
Once your connexion is ok, we have to make it autostart.
Normally the configuration file is in /etc/netctl
So you have to enable this profile with netctl :
netctl enable wlan0-mywifinetwork

add the sound library :
pacman -yS alsa-utils alsa-firmware alsa-lib alsa-plugins flac libmad faad2

list your mixer controls :

amixer controls
numid=3,iface=MIXER,name='PCM Playback Route'
numid=2,iface=MIXER,name='PCM Playback Switch'
numid=1,iface=MIXER,name='PCM Playback Volume'

setup the volume to 100% :
amixer cset numid=1 100%

add python, gcc, unzip and git :
pacman -S python2 python2-distribute gcc unzip git

add squeezeberry user interface
wget https://github.com/emmaanuel/squeezeberry/raw/master/squeezeberry.py

add needed python librairies
easy_install-2.7 simplejson
easy_install-2.7 RPi.GPIO

Gaugette library compilation :

wget https://github.com/guyc/py-gaugette/archive/master.zip
unzip master.zip
cd py-gaugette-master/
python2 setup.py install
cd ..

add WiringPi-Python library compilation :

git clone https://github.com/WiringPi/WiringPi-Python.git
cd WiringPi-Python
git submodule update --init
cp WiringPi/wiringPi/*.h /usr/include/
python2 setup.py install
cd ..

add squeezelite :

wget http://squeezelite.googlecode.com/files/squeezelite-armv6
chmod u+x squeezelite-armv6
./squeezelite-armv6 -l

You should see something like this :

[root@alarmpi ~]# ./squeezelite-armv6 -l
Output devices:
 null                           - Discard all samples (playback) or generate zero samples (capture)
 pulse                          - PulseAudio Sound Server
 default:CARD=ALSA              - bcm2835 ALSA, bcm2835 ALSA - Default Audio Device
 sysdefault:CARD=ALSA           - bcm2835 ALSA, bcm2835 ALSA - Default Audio Device

Now, launch squeezelite, replacing 192.168.0.10 by your squeezebox server private IP adress :
./squeezelite-armv6 -o sysdefault:CARD=ALSA -a 5000:4 192.168.0.10&

launch squeezeberry UI :
python2 squeezeberry.py

If everything where fine, You should see "radio" on the lcd screen.

After that we would like to start the radio on raspberry startup.
For that you need to add a service to systemd.

create and edit a file : /usr/lib/systemd/system/squeezeberry.service with

[Unit]
Description=Squeezeberry startup
After=network.target

[Service]
ExecStart=/root/startup.sh
Type=simple

[Install]
WantedBy=multi-user.target

Then enable the service :

systemctl enable squeezeberry
systemctl status squeezeberry

Now you can restart your Squeezeberry. In my case it took 20s to be ready.