Squeezeslave on RaspberryPi


36 posts   Page 1 of 2   1, 2
by GadgetUK » Tue May 01, 2012 5:23 pm
I've had partial success on getting squeezeslave working on RaspberryPi, but have some issues

1 - Kernel panic of the ALSA driver,

Issue logged here https://github.com/raspberrypi/firmware/issues/11

2 - Squeezeplayer appears to stop outputting audio, still running, logitechmedia server can still see the device.



However to progress, it probably needs a larger sample of people, is anyone interested in working on this ?

Posts: 42
Joined: Thu Jan 19, 2012 6:02 pm
by Argon » Sun May 06, 2012 1:48 pm
Very intrrested !

I have a Synology NAS with Squeezebox server installed on it. Im planning to use a Raspi with Squeezeslave / Squeezeplayer on it as a multi room audio system.

1 thing: i can't program... :-)
Posts: 106
Joined: Thu Aug 25, 2011 11:04 am
by renegade.angel » Sun May 06, 2012 8:06 pm
I'm also interested ! Looking for a low-cost Squeezebox Receiver alternative (as they are no longer in stock).

They guy from Squeezeplug managed to get it working on plug computers (sheevaplug etc) which I believe are also ARM-based. Maybe he can help you out ?
Posts: 1
Joined: Sun May 06, 2012 7:01 pm
by elParaguayo » Wed May 16, 2012 12:48 pm
I'd be very interested in helping too as this is exactly what I want to do with it.

Only problem: I'm still waiting to place my order... :cry:
User avatar
Posts: 421
Joined: Wed May 16, 2012 12:46 pm
Location: London, UK
by Paul Webster » Fri May 18, 2012 12:02 pm
I've had it running without incident so far.

The set of makefiles in the current source release set did not include the ARM one .. so I simply tried the pre-built ARM binary and it worked fine.

I am sending the sound out via the HDMI link.
I used -F to auto-find my SqueezeServer (or whatever it is called nowadays) and it was fine.
Running it from an interactive session with -D (to get the simple old Squeezebox-like display also worked fine (then controlled it with cursor keys and Enter).
Note - there is no built-in Exit command (that I found) so running it in foreground on your only console session is not a great idea.

Simple instructions (from memory).
#NOTE: this is a quick hack way of doing it so others can try it
#NOTE: it really needs to be tidied up and started with a init script etc etc
sudo mkdir /opt/squeezeslave
cd /opt/squeezeslave
sudo wget h t t p ://sourceforge.net/projects/softsqueeze/files/squeezeslave/squeezeslave-1.2.311/squeezeslave-1.2-311-armel-lnx26.tar.gz
sudo tar -xvf squeezeslave-1.2-311-armel-lnx26.tar.gz
./squeezeslave -F --daemonize /tmp/squeezeslave.log

Then you can control it from various Squeezebox controllers.
#to kill it later ... find it using "ps -ef | grep squeezeslave" and then "kill" it.
Something like this
pi@raspberrypi:/opt/squeezeslave$ ps -ef | grep squeezeslave
pi 1246 1 0 12:50 ? 00:00:00 ./squeezeslave -F --daemonize /tmp/squeezeslave.log
pi 1282 1048 0 12:54 pts/1 00:00:00 grep squeezeslave
pi@raspberrypi:/opt/squeezeslave$ kill -5 1246

Take the spaces out of the "h t t p" above - I did that to make it display without using a link in the forum.

-F from above makes it Find your SqueezeCenter
--daemonize runs it as a daemon (background process) and sends the log data to the specified location (I put it in /tmp/squeezeslave.log) - but in that case do not use -D (can't have a local display on your terminal session when it is running as a daemon).

If it appears to be running (you can see "Squeezeslave" from your SqueezeCenter controller) but you hear no sound - then you probably need to run
sudo modprobe snd-bcm2835
before you start Squeezeslave
Last edited by Paul Webster on Fri May 18, 2012 12:12 pm, edited 1 time in total.
User avatar
Posts: 413
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by GadgetUK » Fri May 18, 2012 12:12 pm
Thats interesting Paul, I had compiled from source, but I'll give the pre-compile a go.

One difference I was using the audio out rather than HDMI.
Posts: 42
Joined: Thu Jan 19, 2012 6:02 pm
by Paul Webster » Fri May 18, 2012 12:13 pm
Where did you find the makefile for the ARM build?
User avatar
Posts: 413
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by GadgetUK » Fri May 18, 2012 12:23 pm
If you pull the code from SVN, there is a makefile as follows

makefile.linux26-armel-alsa-display
Posts: 42
Joined: Thu Jan 19, 2012 6:02 pm
by Paul Webster » Fri May 18, 2012 12:45 pm
That is how I started (the SVN from GoogleCode).
I see a lot of makefiles in the root - but not that one.
I didn't search lower directories at the time - but I do now see it in ./contrib
User avatar
Posts: 413
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by Paul Webster » Fri May 18, 2012 2:45 pm
Also - I see that there is a debian init script somewhere in the distribution.
So - treat my installation location and start-up mechanism as just temporary to prove that it works.
User avatar
Posts: 413
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by GadgetUK » Fri May 18, 2012 3:45 pm
Wonder if the makefile in contrib has some more refined options.

So far the prebuilt seems to be working.
Posts: 42
Joined: Thu Jan 19, 2012 6:02 pm
by Paul Webster » Fri May 18, 2012 5:10 pm
Once it is working ... then it is fairly easy to get it started on system boot if you have downloaded and unpacked the full source code set.

The paths below might not be quite right - so check carefully (I've assumed that you have moved to the directory containing the unpacked source - and that you have put the binaries in the same place - which will, I presume not be correct if you have managed to do a full build yourself)

Code: Select all
sudo cp squeezeslave /usr/bin
sudo cp config/squeezeslave.init.debian /etc/init.d/squeezeslave
sudo chmod 755 /etc/init.d/squeezeslave
sudo update-rc.d squeezeslave defaults
sudo echo "SBSHOST=\"-F\"" > /etc/default/squeezeslave

Note: backslash before each of the embedded quotes above. They are just to get them to work through the echo command. The /etc/default/squeezeslave will, correctly, not have those backslashes in.

Then to test it ...
Code: Select all
sudo /etc/init.d/squeezeslave start


If you have more than one Squeezeslave (e.g. other RPis) then you will probably have to edit the /etc/default/squeezeslave to specify a different (fake) MAC address for each using SSMAC field (see the top of the start-up script for an example).

Also - this script does not do the RPi specific modprobe call to get the audio working ... so you need to have that done earlier in the boot process.

If others find that this process works - then it looks like a candidate to put into the wiki (and improve it).

to stop it ...
Code: Select all
sudo /etc/init.d/squeezeslave stop

which I guess will be necessary if something else needs the audio output.
User avatar
Posts: 413
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by Paul Webster » Fri May 18, 2012 5:49 pm
Here is how I hacked getting the sound to be up on boot.
I simply stuck the modprobe command into the /etc/default/squeezeslave file

So now - my RPi boots up and continues playing from where it left off ....
Easy way to do this (assuming above instructions were followed)

sudo echo "modprobe snd-bcm2835" >> /etc/default/squeezeslave
It does not seem to matter if the modprobe call is made more than once.

Note: I am sending the sound via HDMI - this might need changing for sound via other route.
User avatar
Posts: 413
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by GadgetUK » Sun May 20, 2012 8:56 pm
Ok.

Still seems a little flaky on occasions.

More tests required.
Posts: 42
Joined: Thu Jan 19, 2012 6:02 pm
by Paul Webster » Sun May 20, 2012 9:13 pm
I rebuilt it in the end - with the resulting executable the same size as the one that I had downloaded direct from the GoogleCode site (I realise that this does not mean that they are 100% the same).
I have had one kernel panic - but 4 hours non-stop use including an hour or so with it synced up with 2 real Squeezeboxes.
User avatar
Posts: 413
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by sdsnyr94 » Tue May 22, 2012 8:29 pm
Glad to hear that people have gotten squeezeslave to work on the Pi... still waiting for mine (middle of June, so they say).

Squeezeslave can output some basic information (such as the title of the track playing) out to a USB display. Anyone try this yet?

I was thinking of something along these lines: http://www.mini-box.com/picoLCD-20x2-OEM .... would help make a nice little squeezebox clone.
Posts: 1
Joined: Tue May 22, 2012 8:20 pm
by yumbrad » Thu May 24, 2012 3:20 am
Awesome work! I do embedded audio development & I may jump in and help (if it's even needed!) Does Squeezeslave on the Pi maintain close sync with real squeeze hardware? I tried softsqueeze a looong time ago on linux, and it tended to drift with respect to my squeezeboxes.
Posts: 1
Joined: Thu May 24, 2012 3:17 am
by Paul Webster » Thu May 24, 2012 7:19 am
I made adjustments to the timing offsets via the LMS device settings to get it in sync and it stayed there for the hour that I left it playing.
User avatar
Posts: 413
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by Argon » Thu May 24, 2012 2:38 pm
I expect my RasPi in 3 weeks and love to install Squeezeslave on it! Is it hard to install for a Linux Noob?

Once installed, can you control it from an Android device with for example Squeeze Commander?
Posts: 106
Joined: Thu Aug 25, 2011 11:04 am
by Paul Webster » Thu May 24, 2012 5:35 pm
It is a bit fiddly but nothing too hard - and it can be controlled by other things.
User avatar
Posts: 413
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by GadgetUK » Fri May 25, 2012 7:16 am
If anyone is interested I'd be willing to look at a putting together an SD card with all the required software setup and ready to go.
You'd just need to add a RaspberryPi and squeezeserver.
Posts: 42
Joined: Thu Jan 19, 2012 6:02 pm
by Argon » Fri May 25, 2012 7:19 am
interested ! ;-)
Posts: 106
Joined: Thu Aug 25, 2011 11:04 am
by truehl » Fri May 25, 2012 8:21 pm
Hi,
I've got LMS working on RPI. I ran a lot of stability tests and now LMS is running very stable since over 24 hours. I've had some massive problems with some installations with the stability. Sometimes the RPi was totally freezed and sometimes the squeeze clients loosed there connections to the server every seconds. In other words the connection flickered.

As I sayed before, now it's working very stable and performant. The next days I'll try to get my whole Squeezeplug project running on RPi. Squeezeslave will also be included. Take a look at http://www.squeezeplug.de.

My problem right now is that I don't know why some of my installations works fine and others not. I do not find the reason for the flickering connection to LMS. Did someone of you see a similar problem? Does someone like to share my project and get LMS working on RPI? I can provide my working image for you if you are interested.

If you are interested give my a hint, I would be very pleased.

Greetings,
Thomas
truehl
http://www.squeezeplug.de
User avatar
Posts: 619
Joined: Sun Mar 04, 2012 6:47 pm
by Paul Webster » Sat May 26, 2012 3:39 pm
I have just written up my notes on how I installed SqueezeSlave and set it to start automatically.
In essence it is as a wrote in this thread a while ago - but I have now included some more background.

Note - in the simplest form it is just one wget command.

http://dabdig.blogspot.co.uk/2012/05/running-squeezeslave-on-raspberry-pi.html
there is a simple video to go along with it - but there is not much to see because SqueezeSlave is running in the background - but you can see how quickly the RPi reboots and the player autostarts.

http://www.youtube.com/watch?v=IfH8W0k3qkQ
User avatar
Posts: 413
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
by tawalker » Sat May 26, 2012 4:09 pm
Good news for Arch/ARM Pi-oneers (ooh, I should copyright that ;) ): squeezeslave is in the AUR, which should mean it's possible to build an Arch package from there. (I've already built a few on the Pi itself, so the ARM side of things doesn't seem to be a problem.)
---
Raspberry Pi Model B ("ryo-ohki") - Arch Linux/ARM (hard float)
Visit Eee 701 Planetoid (http://eee701planetoid.wordpress.com/) for continuing adventures with an Eee 701SD and Raspberry Pi...
---
Posts: 180
Joined: Tue Jan 17, 2012 9:02 am