Author Topic: squeezelite as an alternative to squeezeslave  (Read 1317 times)

coley

  • Guru
  • ****
  • Posts: 481
    • View Profile
squeezelite as an alternative to squeezeslave
« on: July 16, 2014, 02:24:06 pm »
I wanted to swap out my squeezeslave instances with squeezelite as the former is no longer actively developed and also cannot handle Spotify streams.
Squeezelite is available on trusty but you have to build it yourself for precise.
I went digging to find out how to add it, packages+DT, "the right way" to LMCE.
From this effort I have a number of questions;

 - I found a git clone on the squeezelite site with additions to support building a deb package. Turns out Uplink did this work. How can this be used by Linuxmce?
 - To build this deb other packages are required - again not on precise, but available via another PPA, Can these be added with the package manager?
 - Can DTs be copied? or one based on another?

Thanks,
-Coley.

posde

  • Administrator
  • LinuxMCE God
  • *****
  • Posts: 3045
  • Wastes Life On LinuxMCE Since 2007
    • View Profile
    • My Home
Re: squeezelite as an alternative to squeezeslave
« Reply #1 on: July 16, 2014, 04:44:29 pm »
Should work just as nice as all the other squeezeboxes (HW or SW)

coley

  • Guru
  • ****
  • Posts: 481
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #2 on: July 16, 2014, 06:13:57 pm »
Oh, they do. I was just looking for "the right way" to add them.

-Coley.

Esperanto

  • Guru
  • ****
  • Posts: 262
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #3 on: July 18, 2014, 09:36:58 am »
Just replace the squeezeslave script and adapt the template if required for your use case. Works fine. I suggested using squeezeslave and squeezelite next to eachother some time ago but it was insisted on swapping one for the other. I get so disapointed seeing effort being lost like this when the biggest problem is the amount of development power around lmce.


coley

  • Guru
  • ****
  • Posts: 481
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #4 on: July 18, 2014, 05:03:58 pm »
I've done this by adjusting the script. But this isn't the right way to do it.
Squeezeslave could be replaced by squeezelite or I don't see a reason either why they couldn't co-exist - why did they need to be swapped? can you point me to the discussion in the forum?.

The existing template and script could be extended to run either binary - but that adds additional package dependencies that squeezeslave doesn't require.
Adding Squeezelite to trusty to coexist with squeezeslave, on the surface, looks manageable.
Adding it to precise is that bit harder with the packages not being available from linuxmce/kubuntu repos.

@phenigma - you did a lot of work with the packaging setup and addition of Raspi stuff - can you advise on my initial queries?

Thanks
-Coley.


phenigma

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1014
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #5 on: July 18, 2014, 09:36:51 pm »
There is no technical reason why they could not co-exist.  A discussion was had in irc that essentially decided there is no reason to support multiple squeezeslave binaries.  One should be chosen to maintain.  I had asked for some specifics regarding the changeover.  We can build a package for squeezelite on precise, that's not really an issue (imho).

If the squeezeslave binaries are no longer under development then we should migrate to squeezelite.

I wanted to swap out my squeezeslave instances with squeezelite as the former is no longer actively developed and also cannot handle Spotify streams.
 - I found a git clone on the squeezelite site with additions to support building a deb package. Turns out Uplink did this work. How can this be used by Linuxmce?

There are two ways, we can either build the package in house, or host it in a PPA.  I would prefer to build it in house, for precise, and use an ubuntu repo for trusty (if that exists).  We would create the package definition and point it to the lmce repo for precise and the ubuntu repos for trusty, easy enough to do.  Can you point me to the package (URL)?

- To build this deb other packages are required - again not on precise, but available via another PPA, Can these be added with the package manager?

Likely, but we would do that manually for our builders if posde is okay with that, as well as add the proper dependencies and PPA repos to the database for proper installation of package dependencies.  Again, fairly easy.

- Can DTs be copied? or one based on another?

DTs cannot easily be copied.  I would create a new DT with the existing DT open in another window and do it that way.  This is how I regurlarily create new DTs that are similar to others.

I hope that helps, I am happy to do some of the integration work but I don't have a lot of time to test right now.  I'm around next week then off on vacation for 2 weeks.  Let me know if you have other questions!

J.

Esperanto

  • Guru
  • ****
  • Posts: 262
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #6 on: July 19, 2014, 01:06:17 pm »
I would use the existing DT otherwise you will have to change code since lmce needs to know that it is usable for playing audio. Thom pointed me to it and I made the changes but probably did something wrong cause it did not work and I ended up using the existing DT. Since phenigma wants to replace squeezeslave I see even less need to use another DT since otherwise you end up removing the same code afterwards ;-).

If possible please add a optional configuration to be able to specify pulseaudio sinks. Has no influence on the way it works for normal usage and might be useful later on (I use it myself since I run on pulseaudio).

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4508
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: squeezelite as an alternative to squeezeslave
« Reply #7 on: August 13, 2014, 06:27:46 pm »
I would use the existing DT otherwise you will have to change code since lmce needs to know that it is usable for playing audio. Thom pointed me to it and I made the changes but probably did something wrong cause it did not work and I ended up using the existing DT. Since phenigma wants to replace squeezeslave I see even less need to use another DT since otherwise you end up removing the same code afterwards ;-).

If possible please add a optional configuration to be able to specify pulseaudio sinks. Has no influence on the way it works for normal usage and might be useful later on (I use it myself since I run on pulseaudio).

We use a separate DT in Dianemo for SqueezeLite as we need to keep existing installations working with Squeezslaves.

Andy
Andy Herron,
Convergent Home Technologies Ltd

My Blog; http://ellipticalcurve.com

Get RaspSqueeze-CEC or Raspbmc-CEC Wifi enabled for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

For Smart Home consulting advice;
@herron on Twitter, inquiries@ellipticalcurve.com via email or PM me here.

Get a Dianemo License: http://forum.linuxmce.org/index.php?topic=8880.msg100221#msg100221
Follow us on Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

coley

  • Guru
  • ****
  • Posts: 481
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #8 on: August 14, 2014, 05:43:50 pm »
That is my plan too - don't break existing when adding new.

-Coley.

Esperanto

  • Guru
  • ****
  • Posts: 262
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #9 on: August 17, 2014, 12:11:32 pm »
Code: [Select]
/usr/pluto/bin# cat LaunchSqueezelite.sh
#!/bin/bash
. /usr/pluto/bin/Config_Ops.sh
. /usr/pluto/bin/pluto.func
. /usr/pluto/bin/LockUtils.sh
. /usr/pluto/bin/SQL_Ops.sh
. /usr/pluto/bin/Utils.sh

DEVICEDATA_Alsa_Output_Device=74
DEVICEDATA_PULSE_SINK=88
DEVICEDATA_PARAMETERS=139

SQUEEZELITE=squeezelite-i386
SQUEEZELITEDIR=/usr/bin
SERVER=dcerouter
DEVICE=0

if [ ! -f $SQUEEZELITEDIR/$SQUEEZELITE ]; then
  echo "squeezelite binary not found. Downloading it."
  wget --directory-prefix=$SQUEEZELITEDIR http://squeezelite.googlecode.com/files/squeezelite-i386
fi
if [ ! -x $SQUEEZELITEDIR/$SQUEEZELITE ]; then
  echo "squeezelite binary not executable. running chmod u+x"
  chmod u+x $SQUEEZELITEDIR/$SQUEEZELITE
fi
if [ ! -x $SQUEEZELITEDIR/$SQUEEZELITE ]; then
  echo "error: $SQUEEZELITEDIR/$SQUEEZELITE does not exist or is not executable"
  echo "sleeping 10"
  sleep 10
  exit 1
fi

while getopts ":d:r:" optname
  do
    case "$optname" in
      "d")
        DEVICE=$OPTARG
        ;;
      "r")
        SERVER=$OPTARG
        ;;
      *)
        ;;
    esac
  done

Q="
        SELECT MACaddress
        FROM Device
        WHERE PK_Device='$DEVICE'
"
MAC=$(RunSQL "$Q")

Q="
        SELECT Description
        FROM Device
        WHERE PK_Device='$DEVICE'
"
DESCRIPTION=$(RunSQL "$Q")

AUDIO_DEVICE=$(GetDeviceData "$DEVICE" "$DEVICEDATA_Alsa_Output_Device")
PULSE_SINK=$(GetDeviceData "$DEVICE" "$DEVICEDATA_PULSE_SINK")
PARAMS=$(GetDeviceData "$DEVICE" "$DEVICEDATA_PARAMETERS")


PARAMS="";
if [ -n "$AUDIO_DEVICE" ]; then
    PARAMS="$PARAMS -o $AUDIO_DEVICE"
fi
if [ -n "$MAC" ]; then
    PARAMS="$PARAMS -m $MAC"
fi
if [ -n "$SERVER" ]; then
    PARAMS="$PARAMS -s $SERVER"
fi
ENV="";
if [ -n "$PULSE_SINK" ]; then
    ENV="$ENV PULSE_SINK=\"$PULSE_SINK\""
fi
if [ $AUDIO_DEVICE = "pulse" ]; then
    ENV="$ENV PULSE_PROP_OVERRIDE=\"application.name='squeezelite $DEVICE $DESCRIPTION'\""
fi
echo "Starting squeezelite: $ENV $SQUEEZELITEDIR/$SQUEEZELITE $PARAMS -n \"$DEVICE $DESCRIPTION\""
PULSE_SINK="$PULSE_SINK" PULSE_PROP_OVERRIDE="application.name='squeezelite ${DEVICE} ${DESCRIPTION}'" $SQUEEZELITEDIR/$SQUEEZELITE $PARAMS -n "${DEVICE} ${DESCRIPTION}"

coley

  • Guru
  • ****
  • Posts: 481
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #10 on: September 05, 2014, 04:34:12 pm »
Apologies for the delay in getting to reply to this.
There are two ways, we can either build the package in house, or host it in a PPA.  I would prefer to build it in house, for precise, and use an ubuntu repo for trusty (if that exists).  We would create the package definition and point it to the lmce repo for precise and the ubuntu repos for trusty, easy enough to do.  Can you point me to the package (URL)?

https://code.google.com/r/raducx-squeezelite-ubuntu-deb/source/browse

Likely, but we would do that manually for our builders if posde is okay with that, as well as add the proper dependencies and PPA repos to the database for proper installation of package dependencies.  Again, fairly easy.

libsoxr needed for building - I used this ppa
deb http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu precise main
deb-src http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu precise main


-Coley.

phenigma

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1014
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #11 on: September 05, 2014, 06:42:38 pm »
:) No problem.  The package definition has been created.  The packages are built and available on raspbian wheezy (lmce repo) and on ubuntu trusty (ubuntu repo), I will be added them into ubuntu precise (lmce repo) sometime next week.

J.

coley

  • Guru
  • ****
  • Posts: 481
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #12 on: September 08, 2014, 01:33:47 pm »
:) No problem.  The package definition has been created.  The packages are built and available on raspbian wheezy (lmce repo) and on ubuntu trusty (ubuntu repo), I will be added them into ubuntu precise (lmce repo) sometime next week.

J.
Great Thanks

-Coley.

phenigma

  • NEEDS to work for LinuxMCE
  • ***
  • Posts: 1014
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #13 on: September 12, 2014, 11:19:55 pm »
no problem.  I need to do a little bit more testing to ensure the new boot script works properly in all cases and then the switch will happen.  I'll post here when it does with any requirements.

J.

coley

  • Guru
  • ****
  • Posts: 481
    • View Profile
Re: squeezelite as an alternative to squeezeslave
« Reply #14 on: September 16, 2014, 05:27:47 pm »
If you need me to do any testing I'll help.
I've been hopeless recently at getting time on lmce :(

-Coley.