LinuxMCE Forums

General => Developers => Topic started by: coley on July 16, 2014, 02:24:06 pm

Title: squeezelite as an alternative to squeezeslave
Post by: coley 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.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: Marie.O on July 16, 2014, 04:44:29 pm
Should work just as nice as all the other squeezeboxes (HW or SW)
Title: Re: squeezelite as an alternative to squeezeslave
Post by: coley on July 16, 2014, 06:13:57 pm
Oh, they do. I was just looking for "the right way" to add them.

-Coley.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: Esperanto 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.

Title: Re: squeezelite as an alternative to squeezeslave
Post by: coley 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.

Title: Re: squeezelite as an alternative to squeezeslave
Post by: phenigma 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.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: Esperanto 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).
Title: Re: squeezelite as an alternative to squeezeslave
Post by: totallymaxed 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
Title: Re: squeezelite as an alternative to squeezeslave
Post by: coley on August 14, 2014, 05:43:50 pm
That is my plan too - don't break existing when adding new.

-Coley.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: Esperanto 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}"
Title: Re: squeezelite as an alternative to squeezeslave
Post by: coley 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.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: phenigma 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.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: coley 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.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: phenigma 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.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: coley 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.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: phenigma on September 18, 2014, 06:24:35 pm
Actually it's all working quite well, I just need to deal with a postinst issue to prevent squeezelite from launching its' own daemon and it'll be a drop in replacement.

J.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: phenigma on October 05, 2014, 07:57:18 pm
This has been folded into 1204 now for anyone that would like to test and report back on results.  Thanks!

J.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: Esperanto on October 13, 2014, 03:33:08 pm
Seems to work!

I still think it be nice if you add a proper description to the devices (maybe even the room). And an optional pulsesink selection. I did both in the code I posted previously (not the room though)
Title: Re: squeezelite as an alternative to squeezeslave
Post by: phenigma on October 14, 2014, 05:14:52 am
I still think it be nice if you add a proper description to the devices (maybe even the room).

Um?  No.  You can edit the device and describe it any way you would like, just like every other device in the system.

And an optional pulsesink selection. I did both in the code I posted previously (not the room though)

Heh.  Ok.  I don't see any code or feature patches to support pulseaudio anywhere in the system in trac anywhere.  And since we don't support pulseaudio I will not add specific pulseaudio code until the system supports it.  That being said: Have you even tried it?  Have you put your pulse:sink name in as the output device?  I don't think you've even tried it and from the squeezelite documentation it appears that it should work as is.

Look, I'm getting really frustrated that you that certain people continually complain about things without actually trying to do much of anything about it.  I work *really* hard here *for free* to try and support all kinds of things for people, including things that I don't use like the damn squeezeslave/squeezelite players.   So thanks for testing, I'm glad you're complaining that it doesn't slice and dice and make damn Julien fries at the same freakin' time.  I'm really happy that it's 'working' but not 'properly' becuase it doesn't describe the device to your satisfaction and that it doesn't support an audio subsystem that we don't support at all.

Despite my rant: Please let me know if the existing functionality, as intended, is working or if there are any issues with it because I want it to work properly within the existing system.  If you want it to do something it doesn't do then *please* open a feature request in trac.  Then feel free to provide proper svn patches to provide those features.  If you are unsure how to do that then *please* ask in #linuxmce-devel on freenode irc for specific assistance.

J.
Title: Re: squeezelite as an alternative to squeezeslave
Post by: Esperanto on October 15, 2014, 07:54:15 pm
It's not really code just shell script I referred to:
http://forum.linuxmce.org/index.php?topic=13714.msg99923#msg99923

Um?  No.  You can edit the device and describe it any way you would like, just like every other device in the system.
I mean the name squeezelite promotes itself with to the slimserver. That can be the description or whatever. It just a minor change which might help people when debugging.

Heh.  Ok.  I don't see any code or feature patches to support pulseaudio anywhere in the system in trac anywhere.  And since we don't support pulseaudio I will not add specific pulseaudio code until the system supports it.  That being said: Have you even tried it?  Have you put your pulse:sink name in as the output device?  I don't think you've even tried it and from the squeezelite documentation it appears that it should work as is.

I tried that when I created the squeezelite template and launchscript. The only option that is there beside the alsa options is pulse in general:
Code: [Select]
dcerouter_1039929:~# squeezelite -l
Output devices:
  default                        - Playback/recording through the PulseAudio sound server
You can however specify the sink as an environment variable as I did in my launchscript.


Look, I'm getting really frustrated that you that certain people continually complain about things without actually trying to do much of anything about it.  I work *really* hard here *for free* to try and support all kinds of things for people, including things that I don't use like the damn squeezeslave/squeezelite players.   So thanks for testing, I'm glad you're complaining that it doesn't slice and dice and make damn Julien fries at the same freakin' time.  I'm really happy that it's 'working' but not 'properly' becuase it doesn't describe the device to your satisfaction and that it doesn't support an audio subsystem that we don't support at all.

I feel your frustration. I spend just a fraction like you do and all my efforts towards most linuxmce things (like squeezelite) are wasted time since they are not used anyway. Back then I tried to create a separate device for squeezelite but could not get Linuxmce to recognize it as media playable device and stopped trying just because I felt it would end up as not being used anyway.

Since pulseaudio is on the list of wishes of some devs I thought that something small as supporting a pulsesink would not be a problem since it does not influence normal behavior although I understand it has zero priority.

But heeee J.... all your efforts are very much appreciated! We all love ya.  :-*
Title: Re: squeezelite as an alternative to squeezeslave
Post by: phenigma on October 16, 2014, 06:34:17 pm
Please feel free to add to the existing launch script and submit svn diff patches to trac.  I don't plan on doing any pulse support directly until the backend of the system supports it.  That being said, if you want it for this device provide patches to trac to add that functionality without breaking anything existing.

Is everything else working as expected with the squeezelite players?

J.