Squeezelite

From LinuxMCE
Revision as of 15:18, 20 March 2014 by Esperanto (Talk | contribs) (Added upstart and log scripts)

Jump to: navigation, search

An alternative for squeezeslave.

Downloadable executables and source at:

http://code.google.com/p/squeezelite/


Squeezelite upstart (/etc/init/squeezelite.conf). This is run after pulseaudio is started up and uses the pulseaudio sink 'kitchen'.

# squeezelite service

description     "squeezelite"

start on start pulseaudio
stop on starting shutdown

respawn

env EXEC="/root/squeezelite-i386"
env ARGS="-a 180 -o pulse"
env LOGGING="-d all=info"
env MAC="00:00:00:00:00:04"
env LOGFILE="/var/log/squeezelite.log"
env PIDFILE="/var/run/squeezelite.pid"
env NAME="kitchen"
env PULSE_SINK="kitchen"
env PULSE_PROP_OVERRIDE="application.name='squeezelite kitchen'"
env SERVER="192.168.80.1"

exec start-stop-daemon  -m --pidfile $PIDFILE --exec $EXEC --start -- -s $SERVER $ARGS $LOGGING -m $MAC -f $LOGFILE -n $NAME

Take care of the logfile

/var/log/squeezelite.log {
       daily
       rotate 7
       delaycompress
       compress
       missingok
       postrotate 
        [ ! -f /var/run/squeezelite.pid ] || kill -HUP `cat /var/run/squeezelite.pid`
       endscript
}

Since pulseaudio is started via /etc/init.d/ instead of upstart I changed /etc/init.d/pulseaudio and added to end of the pulseaudio_start () section:

        if [ ${status} -eq 0 ]; then
                initctl emit started JOB=pulseaudio
        fi
        log_end_msg ${status}