Author Topic: SqueezeCenter for squeezebox  (Read 17085 times)

felpouse

  • Veteran
  • ***
  • Posts: 99
    • View Profile
SqueezeCenter for squeezebox
« on: August 29, 2008, 07:11:26 pm »
Dear all,

I would like to know if it's possible to compile (howto to do it) or create a new .deb package of the squeezecenter and next install on LinuxMCE.

The actual release is the 6.5.4 but the new one is growing quickly. Because at today we have the new 7.2 release.

Anyone is knowing if there are problems in doing that or not? If it's possible could someone tell me the possible procedure to generate the new package. Because I saw that the other package related to slimserver have dependencises with the 6.5.4 .deb package.

Few months ago I'll try to do it, using the tgz package and modifing the script (in the past from 6.2.2 to 6.5.4 worked well) but without success.

Best regards

Luke

P.S. : if are necessary more explanation don't esitate to send me back question about that .

jspeckman

  • Regular Poster
  • **
  • Posts: 25
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #1 on: September 02, 2008, 09:22:11 pm »
While not a procedure for generating a package, You can take a look at the howto I wrote for upgrading SlimServer.

http://wiki.linuxmce.org/index.php/Upgrading_SlimServer

May or may not be useful to you.

Jason

felpouse

  • Veteran
  • ***
  • Posts: 99
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #2 on: September 03, 2008, 04:10:08 pm »
Hi Jason,

I've checked your procedure. This similar to one that I've used with the old linuxmce 0704 release for upgrading the slimserver from 6.2.2 to 6.5.4.

But the actual 6.5.4 deb package is structured in different mode. And could be necessary to change many scripts files for the starting and stopping processes.

The possibility to create a new .deb package would be a great solution, also for the dependences for these packages pluto-slim-server-streamer and pluto-slimserver-plugin that have the dependences from this one: slimserver (6.5.4 release).

Thanks for your support.

Best regards,

Luke

felpouse

  • Veteran
  • ***
  • Posts: 99
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #3 on: September 08, 2008, 11:29:29 am »
Dear all,

actually I was able to do it, but not in a perfect way.

First of all I've downloaded the .tgz package with the last release and scompacted into the /home directoy.
Then I've created a simlink to it ( ln -s squeezecenter -> squeezecenter-7.2 ).

I've cancelled the /etc/init.d/slimserver script and do an " update-rc.d slimserver remove " .

And do this :

                          chown -R slimserver:nogroup squeezecenter-7.2


Then I've create a new script /etc/init.d/squeezecenter and added to the /etc/rc.local script.

The script is like that:

------------------------------------------------------------------------------------------------------
#!/bin/bash

PORT="${1:-7890}"
#
SQUEEZE_SERVER_HOME=/home/squeezecenter;
#
PARAMS="--audiodir /home/public/data/audio --cachedir /home/squeezecenter --daemon --user slimserver --cliport $PORT --cliaddr 127.0.0.1 --prefsdir /etc/slimserver --noupnp"
#
exec `which perl` $SQUEEZE_SERVER_HOME/slimserver.pl $PARAMS;
------------------------------------------------------------------------------------------------------

I've modified also this script:

more /usr/pluto/bin/LaunchSlimServer.sh
------------------------------------------------------------------------------------------------------
#!/bin/bash

PORT="${1:-7890}"
PARAMS="--cliport $PORT --audiodir /home/public/data/audio"

sed -ri "s,SLIMOPTIONS=.*,SLIMOPTIONS=\"$PARAMS\",g" /etc/default/slimserver

####### invoke-rc.d slimserver restart
invoke-rc.d rc.local start
------------------------------------------------------------------------------------------------------

Then I've tested it doing a complete shutdown of the system and then powered on. Actually I've the new release working well.
But I need some suggestion to create a best script in the /etc/init.d/ directory. The script would be able to do a start, stop, restart and conrestart. Similar to all the other script.
If someone is able to give some soggestion on do it, it would be a great solution.

Best regards,

Luke

P.S.: the integration in LinuxMCE at the moment is working perfectly!!!   ;)

tschak909

  • LinuxMCE God
  • ****
  • Posts: 5549
  • DOES work for LinuxMCE.
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #4 on: September 08, 2008, 01:37:17 pm »
Dude, You're awesome! :)

Let's try to get this tested with more people, and then if it works okay, let's try to merge it in.

-Thom

felpouse

  • Veteran
  • ***
  • Posts: 99
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #5 on: September 10, 2008, 08:11:55 pm »
Hi Thom and all other people,

thanks for your comment. This evening thanks to this great wiki page on internet:

http://wiki.debian.org/SlimServerHowto

I created a little bit better init script. This one is also able to start, stop and restart all the services related to the new squeezecenter release. I think could be possible to reuse it also for the next close future releases I mean.

I'll attach the new script and following the modification that were necessary for the porpouse:

-----------------------------------------------------------------
more /etc/rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# /etc/init.d/squeezecenter

exit 0
-----------------------------------------------------------------

more /usr/pluto/bin/LaunchSlimServer.sh
#!/bin/bash

PORT="${1:-7890}"
PARAMS="--cliport $PORT --audiodir /home/public/data/audio"

sed -ri "s,SLIMOPTIONS=.*,SLIMOPTIONS=\"$PARAMS\",g" /etc/default/slimserver

####### invoke-rc.d slimserver restart
invoke-rc.d squeezecenter restart
####### invoke-rc.d rc.local start
-----------------------------------------------------------------

I've tested it both doing a complete shutdown and a complete reboot of the core/MD system. At the moment all the services seems to be working well.
If someone else would like to test it, would be great. And also if someone would like to send me some suggestion for correction or modification, I'm here.

Best regards,

Luke

P.S. : here the squeezecenter script  ----------- >

-----------------------------------------------------------------------------------------------------

#!/bin/sh

# slimserver init script for Debian Linux
#
# This script expects slimserver to be installed in
# /home/squeezecenter
#

DAEMON=/home/squeezecenter/slimserver.pl
PIDFILE=/var/cache/slimserver/squeezecenter.pid
MYSQLPIDFILE=/home/squeezecenter/squeezecenter-mysql.pid
LOGFILE=/var/log/slimserver/squeezecenter.log
CACHEDIR=/var/cache/slimserver
PORT="${1:-7890}"
DIRECTORY="squeezecenter"
USER=slimserver
UIDUSER="116"
PREFSDIR=/etc/slimserver
PREFSFILE="${PREFSDIR}/slimserver.pref"
AUDIODIR=/home/public/data/audio
CLIADDR="127.0.0.1"
mDNS=/home/squeezecenter/Bin/i386-linux/mDNSResponderPosix
SLIMSERVER_OPTS=""

test -x ${DAEMON} || exit 0

case "$1" in
   start) echo -n "Starting SqueezeCenter: "
   HOME=/home/$DIRECTORY   
   start-stop-daemon --start --quiet --exec $DAEMON -- --daemon \
   --cachedir=${CACHEDIR} --audiodir=${AUDIODIR} --prefsdir=${PREFSDIR} --user=${USER} \
   --cliport={$PORT} --cliaddr={$CLIADDR} --prefsfile=${PREFSFILE} --pidfile=${PIDFILE} \
   --logfile=${LOGFILE} --cachedir={CACHEDIR} --noupnp ${SLIMSERVER_OPTS}   
   echo "Done"
   ;;
            
   stop) echo -n "Stopping SqueezeCenter: "   
   start-stop-daemon --stop --quiet --user ${UIDUSER} --pidfile ${PIDFILE} --retry 5
   start-stop-daemon --stop --quiet --user ${UIDUSER} --pidfile ${MYSQLPIDFILE} --retry 5
   start-stop-daemon --stop --quiet --user ${UIDUSER} --exec ${mDNS} --retry 5
   rm $PIDFILE
   echo "Done"
   ;;
            
   force-reload|restart) $0 stop
   $0 start
   ;;
            
   *) echo "Usage: $0 {start|stop|restart|force-reload}"
   exit 1;
               
   ;;
esac

exit 0

niz23

  • Guru
  • ****
  • Posts: 361
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #6 on: September 10, 2008, 10:16:55 pm »
Great work felpouse.

Will try with squeezeslave when I have my new core running everything I need.

/niz23

PeteK

  • Guru
  • ****
  • Posts: 408
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #7 on: September 10, 2008, 11:51:45 pm »
You can also get squeezecenter using apt-get install squeezecenter.  This will uninstall the pluto-slimserver-streamer package, so you will have to re-install it with dpkg.

I had talked with Daniel about removing the CLI port reassignment from the lmce script and using the default port.  This is a little bit clearer.  I'll try to get that checked in in the next couple of days.


felpouse

  • Veteran
  • ***
  • Posts: 99
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #8 on: September 11, 2008, 12:16:25 am »
Hi Petek,

thanks for your suggestion. But few months ago I'll try it, but it happened that from a reboot or from a possible shutdown for maintenance, the system reinstall the old one that belongs to the linuxmce version. At that period I didn't make more investigation about that.
From that strange behavior I started to try to make some changes on the scripting for use the new one release.

For the moment, who wants to try the script, this is the new one. I made some mistakes with the variables environment:
------------------------------------------------------------------------------------------------------
#!/bin/sh

# slimserver init script for Debian Linux
#
# This script expects slimserver to be installed in
# /home/squeezecenter
#

DAEMON=/home/squeezecenter/slimserver.pl
PIDFILE=/var/cache/slimserver/squeezecenter.pid
MYSQLPIDFILE=/home/squeezecenter/squeezecenter-mysql.pid
LOGFILE=/var/log/slimserver/squeezecenter.log
CACHEDIR=/var/cache/slimserver
PORT='7890'
DIRECTORY="squeezecenter"
USER=slimserver
UIDUSER="116"
PREFSDIR=/etc/slimserver
PREFSFILE="${PREFSDIR}/slimserver.pref"
AUDIODIR=/home/public/data/audio
CLIADDR='127.0.0.1'
mDNS=/home/squeezecenter/Bin/i386-linux/mDNSResponderPosix
SLIMSERVER_OPTS=""

test -x ${DAEMON} || exit 0

case "$1" in
      start) echo -n "Starting SqueezeCenter: "
              HOME=/home/$DIRECTORY   
              start-stop-daemon --start --quiet --exec $DAEMON -- --daemon \
             --cachedir=${CACHEDIR} --audiodir=${AUDIODIR} --prefsdir=${PREFSDIR} --user=${USER} \
             --cliport=${PORT} --cliaddr=${CLIADDR} --prefsfile=${PREFSFILE} --pidfile=${PIDFILE} \
             --logfile=${LOGFILE} --cachedir=${CACHEDIR} --noupnp ${SLIMSERVER_OPTS}   
             echo "Done"
         ;;
            
      stop) echo -n "Stopping SqueezeCenter: "   
             start-stop-daemon --stop --quiet --user ${UIDUSER} --pidfile ${PIDFILE} --retry 5
             start-stop-daemon --stop --quiet --user ${UIDUSER} --pidfile ${MYSQLPIDFILE} --retry 5
             start-stop-daemon --stop --quiet --user ${UIDUSER} --exec ${mDNS} --retry 5
             rm $PIDFILE
            echo "Done"
            ;;
            
      force-reload|restart) $0 stop
             $0 start
            ;;
            
      *) echo "Usage: $0 {start|stop|restart|force-reload}"
             exit 1;
               
            ;;
esac

exit 0
------------------------------------------------------------------------------------------------------

Sometimes the stopping procedure at the moment is not working well.  :(
I hope to make it working asap .......

Best regards,

Luke

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #9 on: November 24, 2008, 04:56:19 am »
I am struggling to get my Squeezebox Boom working in LMCE. Initially it recognised it and added it to the system. I updated the firmware, but the SqueezeBox is saying that SqueezeCenter needs to be updated. From the web site this needs 7.2.1 to support the Boom. Either way I need to update from Slimserver to SqueezeCenter...

In this thread it isn't clear to me whether the rc.local pieces of the discussion are still needed. By the final felpouse post it looked like he was just working with init.d scripts so that is what I focused on. I have downloaded the tgz file and expanded it into /home/squeezecenter-7.2.1 and created the symlink to squeezecenter in the same directory.

I then copied and pasted the last version of the slimserver init.d script in the previous post into /etc/init.d/slimserver (after backing up the old version). chmod to be the same as all the other scripts.

Now when I try to /etc/init.d/slimserver start ... i get:

Starting SqueezeCenter: Use of uninitialized value in join or string at /usr/share/perl/5.8/File/Spec/Unix.pm line 37.
Use of uninitialized value in pattern match (m//) at /home/squeezecenter-7.2.1/Slim/Utils/Prefs.pm line 275.
/etc/init.d/slimserver: line 32: --prefsdir=/etc/slimserver: No such file or directory
/etc/init.d/slimserver: line 35: --pidfile=/var/cache/slimserver/squeezecenter.pid: No such file or directory
Done

I have no idea why! /etc/slimserver does exist but /var/cache/slimserver/squeezecenter.pid does not - I assumed this would only get created once the process had started...

Can anyone please help on this?

felpouse

  • Veteran
  • ***
  • Posts: 99
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #10 on: November 24, 2008, 10:29:33 am »
Hi colin,

I know that my procedure could be a little confused. I would like to try to make a summary for the procedure that I followed.

First of all, but could be or not, I've deleted the slimserver script from the /etc/init.d and put the new one with the name squeecenter (added in the init.d process and deleted the old one from it). The content of the script is the last one in the post.

Then I've dowloaded the .tgz into the /home dir and unzipped there. Than created the simlink with squeezecenter, like this:

lrwxrwxrwx  1 root       root          19 2008-10-23 21:08 squeezecenter -> squeezecenter-7.2.1/
drwxrwxr-x 17 slimserver nogroup     4096 2008-09-10 23:46 squeezecenter-7.2/
drwxrwxr-x 14 slimserver nogroup     4096 2008-11-12 20:32 squeezecenter-7.2.1/

You have to check that all the directories, subdir and the files had the chown like this (all with slimserver:nogroup) .

Also the /etc/slimserver/  :

ls -alF /etc/slimserver/
total 76
drwxr-xr-x   3 slimserver nogroup  4096 2008-11-24 10:08 ./
drwxr-xr-x 126 root       root    12288 2008-11-24 10:22 ../
-rw-r--r--   1 slimserver nogroup  5839 2008-09-29 00:37 convert.conf
-rw-r--r--   1 slimserver nogroup  4706 2008-09-07 18:05 log.conf
drwxr-xr-x   2 slimserver nogroup  4096 2008-10-23 21:17 plugin/
-rw-r--r--   1 slimserver nogroup 19429 2008-11-24 10:08 server.prefs
-rw-r--r--   1 slimserver nogroup  5936 2008-09-07 16:40 slimserver.pref
-rw-r--r--   1 slimserver nogroup  5856 2008-09-07 17:43 squeezecenter.pref
-rw-r--r--   1 slimserver nogroup  4032 2008-09-29 00:37 types.conf

Also too the /var/cache/slimserver  :

drwxr-xr-x  6 slimserver nogroup    4096 2008-11-22 23:15 ./
drwxr-xr-x 21 root       root       4096 2008-09-07 14:55 ../
drwxr-xr-x 18 slimserver nogroup    4096 2008-09-17 21:03 Artwork/
-rw-r--r--  1 slimserver nogroup     320 2008-11-23 23:15 cookies.dat
-rw-r--r--  1 slimserver nogroup     995 2008-11-09 20:50 favorites.opml
-rw-r--r--  1 slimserver nogroup    1209 2008-10-25 17:46 favorites.opml.backup
drwxr-xr-x 18 slimserver nogroup    4096 2008-09-17 21:03 FileCache/
-rw-r--r--  1 slimserver nogroup  110086 2008-10-23 21:09 fontcache
-rw-r--r--  1 slimserver nogroup     731 2008-10-23 21:09 infobrowser.opml
-rw-r--r--  1 slimserver nogroup     165 2008-09-10 23:47 infobrowser.opml.backup
-rw-r--r--  1 slimserver nogroup 9642842 2008-09-10 23:47 jive_7.2_r2873.bin
-rw-r--r--  1 slimserver nogroup      61 2008-09-17 15:50 jive.version
-rw-r--r--  1 slimserver nogroup      74 2008-11-22 23:15 mDNS.conf
-rw-r--r--  1 slimserver nogroup    1092 2008-11-22 23:15 my.cnf
-rw-r--r--  1 slimserver nogroup     170 2008-09-17 21:15 myradio.opml
-rw-r--r--  1 slimserver nogroup     208 2008-09-17 21:15 myradio.opml.backup
drwxr-xr-x  4 slimserver nogroup    4096 2008-11-22 23:15 MySQL/
-rw-rw----  1 slimserver nogroup   19070 2008-11-22 23:15 mysql-error-log.txt
-rw-r--r--  1 slimserver nogroup   20020 2008-11-22 23:15 plugin-data.yaml
-rw-rw----  1 slimserver nogroup       5 2008-11-22 23:15 squeezecenter-mysql.pid
srwxrwxrwx  1 slimserver nogroup       0 2008-11-22 23:15 squeezecenter-mysql.sock=
-rw-r--r--  1 root       root          4 2008-11-22 23:15 squeezecenter.pid
-rw-r--r--  1 slimserver nogroup  139190 2008-10-23 21:08 stringcache
drwxr-xr-x  3 slimserver nogroup    4096 2008-11-12 20:33 templates/

Thats it. If you try to start it it's possible that you receive some errors. Check the /home/squeezecenter subdirectory, because the first time you start it the process create subdirectory with chown not correted, like Logs/ , if I remember .

Please let me know if my new explanation help you or not.

Best regards,

Luke

caiman

  • Veteran
  • ***
  • Posts: 119
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #11 on: November 24, 2008, 11:26:51 am »
so last night I just added the following line to /etc/apt/sources.list :

Code: [Select]
deb http://debian.slimdevices.com stable main
and installed squeezecenter via apt
Code: [Select]
apt-get update
apt-get install squeezecenter
then I changed the CLI port and music directories in the squeezecenter web GUI as explained on the wiki. Rebooted, and both my the squeezebox and my boom seem to work fine.

Anything wrong with that ?

Oh yes, I did not re-install yet the pluto-slimserver-streamer package as I didn't have the .deb at hand. Do I need it ?

Caiman


felpouse

  • Veteran
  • ***
  • Posts: 99
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #12 on: November 24, 2008, 11:47:35 am »
Hi Caiman,

I think that you need it, if you would like to use with LinuxMCE.

And also the other package, the plugin. Here the list of the packages :

dcerouter_89303:~# dpkg -l | grep slim

ii  pluto-slim-server-streamer                 2.0.0.44.0804112200                 
ii  pluto-slimserver-plugin                      2.0.0.44.0804112200     

And if I remember, one or both of them have dependencies related to the slimserver package 6.5.4 when you try to install it.

Luke

P.S.: if you reinstall the old slimserver package, the new one will be deinstalled.                                       

caiman

  • Veteran
  • ***
  • Posts: 119
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #13 on: November 24, 2008, 05:41:39 pm »
Thanks Luke.

Let me paste here the commands I have put in to install the streamer for the benefit of others
Code: [Select]
dpkg -i --ignore-depends=slimserver /usr/pluto/deb-cache/pluto-slim-serverstreamer_2.0.0.44.0804112200_i386.deb

Now I have all three packages installed:
Code: [Select]
dcerouter_73xxx:~# dpkg -l | grep slim
ii  pluto-slim-server-streamer                 2.0.0.44.0804112200                  <insert up to 60 chars description>
ii  pluto-slimserver-plugin                    2.0.0.44.0804112200                  <insert up to 60 chars description>
rc  slimserver                                 6.5.4                                Streaming Audio Server
dcerouter_73943:~# dpkg -l | grep squeeze
ii  squeezecenter                              7.2.1                                Streaming Audio Server

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: SqueezeCenter for squeezebox
« Reply #14 on: November 24, 2008, 08:36:52 pm »
Thanks guys! I tried doing what Caiman suggested and it worked just fine! Testing now to make sure all is ok... thanks for both your help!