You are not logged in.

#1 2010-02-21 22:35:52

theking2
Banned
From: Romanshorn Switzerland
Registered: 2009-03-04
Posts: 372

squeezeslave - micro howto

A micro howto to get this fancy but "faceless" audio player running on your workstation

First get sound working (pulseaudio, alsa), wiki's galore to do this. Next, build the squeezeslave client according to http://wiki.slimdevices.com/index.php/S … structions and copy the resulting squeezeslave binary to /usr/bin.

Find the required output device with the conmmand

/usr/bin/squeezeslave -L

Create the settings file /etc/conf.d/squeezeslave

CMD_ARGS="--output <output-device-#> --mac <mac-address> <squeezeboxserver-host>"

Create the daemon script /etc/rc.d/squeezeslave

#!/bin/bash

. /etc/rc.conf
. /etc/rc.d/functions

NAME=squeezeslave
CMD=/usr/bin/squeezeslave
CMD_ARGS=
[ -f /etc/conf.d/${NAME} ] && . /etc/conf.d/${NAME}

PID=`pidof -o %PPID /usr/bin/squeezeslave`
case "$1" in
start)
  stat_busy "Starting squeezeslave player"
  [ -z "$PID" ] && ${CMD} ${CMD_ARGS} \
    --daemonize /var/log/${NAME} \
    --debuglog /var/log/${NAME} 
  if [ $? -gt 0 ]; then
    stat_fail
  else
    add_daemon $NAME
    stat_done
  fi
  ;;
stop)
  stat_busy "Stopping squeezeslave player"
  [ ! -z "$PID" ] && kill -15 $PID &> /dev/null
  if [ $? -gt 0 ]; then
    stat_fail
  else
    rm_daemon $NAME
    stat_done
  fi
  ;;
restart|force-reload)
  $0 stop
  sleep 3
  $0 start
  ;;
*)
  echo "usage: $0 {start|stop|restart}"
esac
exit 0

Now start the daemon with /etc/rc.d/squeezeslave start and move over to you squeezeboxserver and connect the the new device "Squeezeslave" and enjoy the music

(many thanks to mikko for the original yet briliant idea)

thinks to do: the kill not always kills succesfully.

joki

Last edited by theking2 (2010-02-21 23:18:48)


archlinux on a Gigabyte C1037UN-EU, 16GiB
a Promise  PDC40718 based ZFS set
root on a Samsung SSD PB22-J
running LogitechMediaServer(-git), Samba, MiniDLNA, TOR

Offline

Board footer

Powered by FluxBB