Difference between revisions of "Squeezelite"
From LinuxMCE
(squeezeslave alternative) |
(Added upstart and log scripts) |
||
Line 4: | Line 4: | ||
http://code.google.com/p/squeezelite/ | 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'. | ||
+ | <nowiki> | ||
+ | # 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 | ||
+ | </nowiki> | ||
+ | |||
+ | Take care of the logfile | ||
+ | <nowiki> | ||
+ | /var/log/squeezelite.log { | ||
+ | daily | ||
+ | rotate 7 | ||
+ | delaycompress | ||
+ | compress | ||
+ | missingok | ||
+ | postrotate | ||
+ | [ ! -f /var/run/squeezelite.pid ] || kill -HUP `cat /var/run/squeezelite.pid` | ||
+ | endscript | ||
+ | } | ||
+ | </nowiki> | ||
+ | |||
+ | 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: | ||
+ | <nowiki> | ||
+ | if [ ${status} -eq 0 ]; then | ||
+ | initctl emit started JOB=pulseaudio | ||
+ | fi | ||
+ | log_end_msg ${status} | ||
+ | </nowiki> |
Revision as of 15:18, 20 March 2014
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}