Quantcast
Channel: Squeezebox : Community : Forums - 3rd Party Software
Viewing all articles
Browse latest Browse all 2050

Raspberry Pi with Squeezelite and Shairport_Sync

$
0
0
Hi all,

After trying all sorts of combinations, I finally got my Raspberry Pis up and running with both Squeezelite and Shairport_Sync working side by aside. My goal was to allow all of my Pis (I have models A, B, and v2) to run as Squeezebox players, as well as support direct streaming from mobile devices via AirPlay.

Below is the step-by-step procedure I used to setup each Pi. As you can see, I use the stock standard Raspbian image as the starting point and compile Squeezelite and Shairport_Sync from the original sources.

To allow these two audio applications to work side by side, Shairport_Sync is configured such that it shuts down Squeezelite when it starts streaming AirPlay content from your mobile device, and then starts up Squeezelite again when AirPlay streaming is stopped.

This has been working fine for quite some time.

Cheers,
Pete

Code:

1) Burn the latest Raspbian image to the SD card using Win32 Disk Imager:

  http://www.raspberrypi.org/downloads/

2) General setup

    login: pi
    password: raspberry

    sudo nano /etc/modprobe.d/alsa-base.conf
    - set the following:
        options snd-usb-audio index=-1

    sudo raspi-config
    - expand file system
    - set host name (i.e. 'Squeeze-Backyard')

    (reboot)

    sudo apt-get remove -y wolfram-engine

    sudo apt-get update

    sudo apt-get upgrade

    sudo alsamixer
    - adjust volume level

    sudo alsactl store

3) Install Squeezelite

    sudo apt-get -y install build-essential git wget patch checkinstall  libasound2-dev libmad0-dev
    sudo apt-get -y install libflac-dev  libogg-dev libvorbis-dev libfaad-dev libmpg123-dev
   
    cd ~
    git clone https://code.google.com/p/squeezelite/
    OR
    git clone https://github.com/ralph-irving/squeezelite

    cd squeezelite
    make clean
    make

    sudo cp -f ./squeezelite /usr/local/bin/squeezelite
    sudo chmod a+x /usr/local/bin/squeezelite

    sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelite_settings.sh
    sudo mv squeezelite_settings.sh /usr/local/bin
    sudo chmod a+x /usr/local/bin/squeezelite_settings.sh
 
    sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelitehf.sh
    sudo mv squeezelitehf.sh /etc/init.d/squeezelite
 
    cd /etc/init.d
    sudo chmod a+x squeezelite
    sudo update-rc.d squeezelite defaults

    sudo nano /etc/init.d/squeezelite
    - edit settings
        - change NAME=squeezelite-armv6hf to NAME=squeezelite
        - change DAEMON=/usr/bin/${NAME} to DAEMON=/usr/local/bin/${NAME}

    sudo nano /usr/local/bin/squeezelite_settings.sh
    - edit settings
        - set SL_NAME="Backyard"
        - set SL_SOUNDCARD="hw:0"
        - set SL_ALSA_PARAMS="300:::1"

    sudo nano /usr/local/bin/squeezelite_stop
    - add the following:
        #!/bin/bash
        sudo /etc/init.d/squeezelite stop

    sudo nano /usr/local/bin/squeezelite_start
    - add the following:
        #!/bin/bash
        sudo /etc/init.d/squeezelite start
 
  chmod a+x /usr/local/bin/squeezelite_*

4) Install Shairport_Sync

    cd ~
    sudo apt-get install autoconf libtool libdaemon-dev libasound2-dev libpopt-dev
    sudo apt-get install avahi-daemon libavahi-client-dev
    sudo apt-get install libssl-dev

    git clone https://github.com/mikebrady/shairport-sync.git
    cd shairport-sync
    autoreconf -i -f
    ./configure --with-alsa --with-avahi --with-ssl=openssl
    make
    sudo make install

    sudo nano /etc/init.d/shairport-sync
    - edit settings
        start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- -d -a "Backyard" -w -B "/usr/local/bin/squeezelite_stop" -E "/usr/local/bin/squeezelite_start" || return 2


Viewing all articles
Browse latest Browse all 2050

Trending Articles