Getting Squeezeslave to run on the RPi is very easy - here is a revised version of the instructions that I posted on the Raspberry PI forum.
NOTE: This has been tested on Debian Squeeze (and I think it also works on Wheezy) -
Version numbers shown here were correct when this blog was written but it is possible that newer versions have been released since then ... and they might work better (or worse) so check on Sourceforge (for official release) and GoogleCode (for latest test versions).
Most of what is shown below could be copied to a script and run - but there is no error checking so it is best to run as individual commands - e.g. copy / paste into SSH session
NOTE: Some of the lines below are very long and get wrapped when presented in the blog.
I have left a blank line after those long lines to make it clearer. If you are using copy/paste to replay the commands then make sure that you take the full line and unwrap it if needed.
Start an interactive login to the Raspberry Pi then ...
mkdir squeezeslavesrc
cd squeezeslavesrc
# If on Debian (not Raspbian) then perform the next 2 commands
# If on Debian (not Raspbian) then perform the next 2 commands
wget http://sourceforge.net/projects/softsqueeze/files/squeezeslave/squeezeslave-1.2.311/squeezeslave-1.2-311-armel-lnx26.tar.gz
tar -xvf squeezeslave-1.2-311-armel-lnx26.tar.gz
# If on Raspbian (a hardfloat version of Debian) then perform the next 3 commands
wget http://squeezeslave.googlecode.com/files/squeezeslave-1.2-367-armhf-lnx31.tar.gz
tar -xvf squeezeslave-1.2-367-armhf-lnx31.tar.gz
mv squeezeslave-1.2-367 squeezeslave
mv squeezeslave-1.2-367 squeezeslave
# at this point you have the various binaries for ARM/Linux so no need to build from source
# and you now have enough to run squeezeslave
# however, by downloading some more files you can make it easier to start/stop squeezeslave
# to test what you already have - assuming you are already running LMS somewhere on the same LAN
# type
./squeezeslave -L
# if this lists audio device(s) then things will probably work for you
# if there are none then try (note - this should not be necessary on Raspbian)
sudo modprobe snd-bcm2835
# and then
./squeezeslave -L
# to run it as a player ...
./squeezeslave -D -F
# to quit from that display mode hit the "q" key
# remember - if you are doing this via SSH from a different room then
# you will only hear something if you are at the device (e.g. the speakers on your TV!)
# If it acts like it is playing something but you cannot hear it then it might be that the sound on the Raspberry PI is set too low (in ALSA).
# In that case - quit (q) Squeezeslave and run
sudo alsamixer
then boost the sound by pressing the up arrow key (and the "esc" key to exit and then try running Squeezeslave again
# assuming all was OK from above - then you can do more to automate the startup
wget http://sourceforge.net/projects/softsqueeze/files/squeezeslave/squeezeslave-1.2.311/squeezeslave-1.2-311-src.tar.bz2
# If you do not have bzip2 on your system you might need
sudo apt-get install bzip2
tar -xjvf squeezeslave-1.2-311-src.tar.bz2
sudo cp squeezeslave /usr/bin
sudo cp squeezeslave-1.2-311/config/squeezeslave.init.debian /etc/init.d/squeezeslave
sudo chmod 755 /etc/init.d/squeezeslave
sudo update-rc.d squeezeslave defaults
echo "SBSHOST=\"-F\"" > defaultsqueezeslave
# the backslashes above are needed to make the quotation marks go into the file
# if you look at the file afterwards it should look like this
# SBSHOST="-F"
# if you needed to run the modprobe to get sound working then also do this
echo "modprobe snd-bcm2835" >> defaultsqueezeslave
# then copy the file over to become the default configuration for SqueezeSlave
# Done this way because trying to use sudo to echo direct to /etc/default does not work on some builds
sudo cp defaultsqueezeslave /etc/default/squeezeslave
# then to start it ...
sudo /etc/init.d/squeezeslave start
# and to stop it (for example if something else is trying to use the audio port and sharing not working)
sudo /etc/init.d/squeezeslave stop
# it should start automatically on the next reboot of your Raspberry Pi
Here is a short video showing the result ... to be honest there is not much to see because it SqueezeSlave is running in the background. However, it does show how quickly the Raspberry Pi reboots.
I also had this synchronising with a couple of real Squeezeboxes. It needed some tweaks to the timing offsets in LMS to get it to be closely in sync.
If you plan to add more SqueezeSlave devices to your set-up then you will need to change the fake MAC address that SqueezeSlave uses. It defaults to 00:00:00:00:00:01
I will probably update the default to set the SqueezeSlave MAC address to be the real MAC address of the Raspberry Pi (which in turn is usually derived from the serial number of the device).
If you did download and unpack the source - then it is also possible to build your own copy of SqueezeSlave. I did this as well and it worked - but you have to build the "contribs" as well to get the ARM version. I might update this blog entry with how to do it if there is some interest.
Remember, though, if you are on Raspbian then start from a software release that is known to work on hard-float (armhf).

36 comments:
Hi, it works on my machine! Think you should add "snd-bcm2835" to /etc/modules, so you do not neet the sudo stuff in the startup script.
But: I get the audio through HDMI, but not on AudioOut/Headset.
Any idea?
Thanks,
Michael
Hello Michael.
Yes - I did add it to /etc/modules later - in fact I made the same suggestion to the author of the Xsqueeze plug-in
http://forum.xbmc.org/showthread.php?tid=122199&pid=1138160#pid1138160
As for why the audio is still going through HDMI ... it has priority if you have HDMI connected.
I suspect that you can run alsamixer (sudo alsamixer) to change the default to be the analogue output ... or reboot the RPi without the HDMI connected or force it with
sudo amixer cset numid=3 1
(to set it back to "auto" change the 1 at the end to 0)
Despite updating firmware, I still get breaks in the sound when playing on analogue ... which I think corresponds with long SD card activity ... so I plan to find a way to reduce that or increase sound buffer size.
shouldn't this line:
sudo echo "SBSHOST=\"-F\"" > default/squeezeslave
be like this:
sudo echo "SBSHOST=\"-F\"" > /etc/default/squeezeslave
Hello Michael,
I think that it should have been:
echo "SBSHOST=\"-F\"" > defaultsqueezeslave
There is a command a few lines further down that copies the file to \etc\defaults - and a little explanation above about why I did it that way.
Hi Paul,
I worked through the commands - which initially allowed me to run squeezeslave - however since rebooting I get the no output device found error. - I checked with OMXPlayer and the audio seems to be fine. Any thoughts ?
Cheers
Mark
Hello Mark.
Perhaps the modprobe command is not in the defaults.
What do you see when you look at the file
cat /etc/default/squeezeslave
I'm just receive my Pi and have installed Raspbian “wheezy” and have followed you instructions to install SqueezeSlave but I get a error about 'internal port audio error'.
I'm a total newbie to Linux so please be gentle with me!
Link to screen shot : [IMG]http://i47.tinypic.com/ru5ird.jpg[/IMG]
Hello Simon,
I see a suggestion elsewhere ( http://forum.xbmc.org/showthread.php?pid=1157721 ) that this might be a result of contention for the audio port.
Could there be any other sound programs running?
(eg another copy of SqueezeSlave already running in background - auto-started after a reboot)
sudo ps -ef | more
(space for next page or q to quit)
Hmm... when I try to run ./squeezeslave -L, I get:
-bash: ./squeezeslave: No such file or directory
Any ideas?
Hello sic
If you type
pwd
Does it show that you are in the squeezeslavesrc directory
(assuming that you see the error very early in the process described above)
Hello again Simon.
Just realised - you referred to Raspbian not Debian - i.e. the hardfloat version.
In that case see
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=35&t=14088
I've updated the post to include instructions for running on Raspbian.
Installed hard float version on Raspbian and it works brilliantly. Nice job!!!
I concur that hard float version on Raspbian works brilliantly following this guide to the T. Thanks.
I concur hard float version on Raspbian works brilliantly, follwoing this guide to the T. Thanks.
Hi ! And thank you...
I've got squeezeslave now working, but I had also to go through this tutorial http://elinux.org/R-Pi_Troubleshooting#Sound because I couldn't have sound through the headphones output (even when the RPi was boot without an HDMI plug in)
Thank you very much! It works perfect, on my 2012-09-18 raspbian wheezy.
OK, I allready got this working with the on board audio plug, but now I also got it working with an USB audio card. But it took me a while to figure it out.
The problem was I had to tell squeezeslave which audio device to use.
For those who are also struggling with this:
Execute this command to list the audio devices:
./squeezeslave -L
The device with the star in front is the one that is used. In my case it was the default. Which wasn't good because it should have been audio device number zero:
0: (ALSA) C-Media USB Headphone Set: USB Audio (hw:0,0) (11/46)
To tell squeezeslave to use the correct one do the following:
sudo nano /etc/init.d/squeezeslave
find this line:
SSOPTIONS=
And add "-o" In my case it was device number zero, so mine looked like:
SSOPTIONS=-o0
After restarting squeezeslave my USB sound card worked!
Followed this to the letter on Raspbian 2012-09-18. I get the following:
Stopping audio because of disconnection.
slimaudio_output_disconnect: state=7
slimaudio: audio_stop early out.
slimaudio_output_disconnect: state=7
slimaudio: audio_stop early out.
proto_thread: state=1
output_thread: PortAudio terminated
When running squeezeslave -F -D
Any ideas, it's a fresh Raspbian install.
Followed this to the letter on Raspbian 2012-09-18. I get the following:
Stopping audio because of disconnection.
slimaudio_output_disconnect: state=7
slimaudio: audio_stop early out.
slimaudio_output_disconnect: state=7
slimaudio: audio_stop early out.
proto_thread: state=1
output_thread: PortAudio terminated
When running squeezeslave -F -D
Any ideas, it's a fresh Raspbian install.
@Gerrelt
Thanks for your additional instructions for using USB audio
@Me (You)
Not sure what this could be.
Did the output from running with -L look promising?
Try
sudo alsamixer
and see if that shows an audio device
Are you using HDMI sound?
No trying to use analog 3.5mm I used your instructions fine on an older build of raspbian. I've tried twice on 18/9 build with the same issue..
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 7/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
sudo ./squeezeslave -L
PortAudio error7: No output devices found.
sudo amixer cset numid=3 1
numid=3,iface=MIXER,name='PCM Playback Route'
; type=INTEGER,access=rw------,values=1,min=0,max=2,step=0
: values=1
alsamixer shows the bcm2385
Do I need anything in /etc/asound.conf?
Sorted, I had another squeezeslave instance running via daemon. I killed the daemon and then set the MAC address to be different from another squeezeslave on the same netowrk all sorted now. Thanks
Thanks Paul. Any idea on how to get a remote LMS playing? Could I just port-forward to the local machine via ssh? Thanks...
Hello DJFake
I've not tried this but assuming that you can forward ports at your router when the LMS is running then it should be possible.
See this old post by Mark Vardy (I assume that is his name based on site URL
http://techblog.vardyfamily.co.uk/2010/01/using-squeezebox-server-remotely.html?m=1
This easy, once an ssh session with port-forwarding is open!
./squeezeslave 127.0.0.1 &
AMAZING interface!
Hi Paul - here's head to toe instructions for the RPi and Squeezeslave
http://my.opera.com/djfake/blog/2012/12/12/squeezeslave-and-the-raspberry-pi
actual command to download from sourceforge.net is
wget "http://sourceforge.net/projects/softsqueeze/files/squeezeslave/sque
ezeslave-1.2.311/squeezeslave-1.2-311-src.tar.bz2/download" -O squeezeslave-1.2-
311-src.tar.bz2
Alexey
Worked great! Using Occidentalis Distro from Adafruit with your tutorial.
3 hours of LMS=>Pandora with no hiccups.
did anyone get spotify to work? when i load a spotify track i get a message "Spotify player not supported"
For those of you finding that you don't get audio out of the Pi from a fresh cold boot, you may need to unmute the mixer.
I found that I had to start squeezeslave twice, killing the first one, then on the second start, the audio would start playing.
You can put this in the /etc/rc.local script. Be sure to put it above the last line "exit 0"
/usr/bin/amixer -q set Master 100% unmute
and it will always boot up with audio unmuted. At least it works for me. I have had to do this on my MythTv frontend since PulseAudio came along.
My weezy Pi is running squeezeslave with the help of your instruction fine.
But I want to run it 24/7 and right now the pi becomes unresponsive if I pause the playback and keep it that way over night. The next morning the pi isn’t connected anymore to the LMS.
Is there maybe something like keep alive? Or any idea how I can further analyse what’s going wrong.
Thanks
Simon
Hello Simon.
You could try leaving "top" running to see if there is a slow memory leak in one of the components that makes is slowly crawl to a halt.
Another alternative, if you don't need the basic interactive capability of SqueezeSlave, would be to run Troide's SqueezeLite instead. There is now a HF version.
Hey Simon,
I'm not experiencing this issue. I've tried to reproduce it and haven't been able to. Mine will pause for days on a local played file. I wouldn't expect this to work on a live streamed station however.
I'm using squeezeslave with this command line.
./squeezeslave --lcd -R -mac (mac address here) -o1 (ipaddress here) &
I use the -R switch to allow it to retry connecting to the LMS if it looses track of it. You might try that. It is also important if you want to run headless and just boot into squeezeslave from startup. I find that the rc.local script starts up squeezeslave before the network as finished optaining an IP address, and fails the first few times. The -R fixes that. You might try this as well.
I am using LMS version 7.7.0 which I believe is one version back from the latest. You might experiment with the -k switch which is a keepalive value. It normally isn't needed for server versions over 6.5.x and defaults to 10 I believe in that case. But is required for servers below that value.
I would also say check the system log to see if you are getting USB disconnections/resets. Run the dmesg command to see the boot and system log. I don't have a keyboard on my squeezeslave Pi now, but when I did, I saw a LOT of USB resets going on and it was due to my keyboard being a USB ver 1.1 and my external sound card being at USB ver 2.0. I had them on the same powered hub, which was connected to one of the Pi's USB ports.
I found that if I moved the keyboard to the other USB port on the Pi, the USB reset messages went away. I noticed it because it made the mouse clicks get missed in X as well.
Now I only have the external sound card directly connected to the Pi, with no other devices. Since the built-in ethernet adapter is actually connected via the USB buss in the Pi, I could see a reason to believe network disconnects could be occurring on your situation.
Just a guess of course. Let us know what you find.
Wow Thanks for your great thoughts to my problem.
I will look further into your suggestions but my guess right now is that it got be something network related because when the pi isn't connected anymore after a couple of hours to LMS I can't connect via ssh as well, but If I do try to connect a second time via ssh pi is up again and as well again connected to the LMS.
My Setup by the way is the following:
Raspberry PI:
USB Port 1 EDIMAX EW-7811UN Wireless USB Adapter,
USB Port 2 Nubert nuPro A-20 Speakers
LMS 7.7.2 running on windows 8 x64
Thanks, this worked well for me, adapted for armel RPi for spotify.
Initially it said "not compatible" or something, but it synced nicely with my squeezebox classic and spotify worked well.
Post a Comment