User avatar
Gerrelt
Posts: 294
Joined: Sat Nov 10, 2012 9:01 am

SqueezeLite up and running

Sat Nov 17, 2012 4:20 pm

Hi all,

edit: This thread describes how to install squeezelite on wheezy soft float, which is not the most common OS. The most common is Wheezy hard float, and I've now got it running on hard float to. See this tutorial for that installation: http://www.raspberrypi.org/phpBB3/viewt ... 38&t=25778.



After installing squeezeslave on my raspberry, I had a great squeezebox client which worked pretty good. See this thread: Squeezeslave up and running thread
But, I had some problems with certain internet radio streams. Squeezeslave only works with 44100 Khz streams. Some radio stations stream in other frequencies, so the sound was too slow or too fast. I tried correcting it on my logitech media server (running on my Nas), but converting the streams was too cpu intensive for my nas.

Then forum user Stoker suggested using SqueezeLite . And that was a great suggestion! SqueezeLite supports different streaming frequencies, and is also very light weight.
See more about Squeezelite: Thread: Announce: Squeezelite - a small headless squeezeplay emulator for linux (alsa only)
On page 5 there is allready somebody that had squeezelite installed on the Raspberry (see LINK).

Now, my Squeezeslave client ran on Hard-Float Raspian Wheezy, but the SqueezeLite executable is only offered for Soft-Float Debian Wheezy. Which is a bit more work to set up.

But I got it working now, and it's working brilliant, very stable and good sound.
Here are the steps I took to get it working, I did everything without a monitor using SSH.

First create a SD card with the Soft-Float Debian Wheezy image on it. Connect it to a network cable and log in using SSH (Putty is my favorite SSH client).

Run the config tool:

Code: Select all

sudo raspi-config
Enlarge the SD card, enable SSH (probably not necessary), set locale and timezone to your liking and run the update (takes a long time).

Then to get Wifi working (I have a Logilink WiFi dongle which is RTL8188CUS based), I used the excellent script from forum user MrEngman, provided in this thread: Automatic setup for RTL8188CUS based wifi adapters.
Of course, this is not necessary if you want to use the raspberry wired, then go directly to Installing Squeezelite.

These were the steps I took to get WiFi working:

Code: Select all

mkdir wifi
cd wifi
sudo wget http://dl.dropbox.com/u/80256631/install-rtl8188cus.sh
sudo chmod u+x install-rtl8188cus.sh
Then run the script, and follow the instructions. It will probably reboot and then you will run the sript again. I also ran the update at the end, I don't know if that is really necessary (it took a long time).
Run the script:

Code: Select all

sudo ./install-rtl8188cus.sh
At the end I rebooted and disconnected the network cable, and I had a wireless network connection!
The reboot command:

Code: Select all

sudo shutdown -r now
Installing Squeezelite

First create a "work" directory:

Code: Select all

mkdir squeezelite
cd squeezelite
Install some libs:

Code: Select all

sudo apt-get install libflac-dev
(answer Y to the question)

Code: Select all

sudo apt-get install libfaad2
Did this too, but it turned out it was allready installed on Debian:

Code: Select all

sudo apt-get install libmad0 
Now get squeezelite:

Code: Select all

wget http://squeezelite.googlecode.com/files/squeezelite-armv6
Move it to the usr directory, and make it executable:

Code: Select all

sudo mv squeezelite-armv6 /usr/bin
cd /usr/bin

chmod u+x squeezelite-armv6
I use a USB soundcard, so I had to tell squeezelite which sound device to use.
First list all the devices:

Code: Select all

squeezelite-armv6 -l
The result:

Code: Select all

Output devices:
  null                           - Discard all samples (playback) or generate zero samples (capture)
  default:CARD=ALSA              - bcm2835 ALSA, bcm2835 ALSA - Default Audio Device
  sysdefault:CARD=ALSA           - bcm2835 ALSA, bcm2835 ALSA - Default Audio Device
  default:CARD=Set               - C-Media USB Headphone Set, USB Audio - Default Audio Device
  sysdefault:CARD=Set            - C-Media USB Headphone Set, USB Audio - Default Audio Device
  front:CARD=Set,DEV=0           - C-Media USB Headphone Set, USB Audio - Front speakers
  surround40:CARD=Set,DEV=0      - C-Media USB Headphone Set, USB Audio - 4.0 Surround output to Front and Rear speakers
  surround41:CARD=Set,DEV=0      - C-Media USB Headphone Set, USB Audio - 4.1 Surround output to Front, Rear and Subwoofer speakers
  surround50:CARD=Set,DEV=0      - C-Media USB Headphone Set, USB Audio - 5.0 Surround output to Front, Center and Rear speakers
  surround51:CARD=Set,DEV=0      - C-Media USB Headphone Set, USB Audio - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
  surround71:CARD=Set,DEV=0      - C-Media USB Headphone Set, USB Audio - 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
  iec958:CARD=Set,DEV=0          - C-Media USB Headphone Set, USB Audio - IEC958 (S/PDIF) Digital Audio Output
I wanted to use the default audio device (Logilink USB soundcard with a C-Media chip), so I had to tell squeezelite to use " default:CARD=Set" .

Now to start Squeezelite I had to run (ip address is the address of the LMS server):

Code: Select all

./squeezelite-armv6 -o default:CARD=Set 192.168.2.4
And it worked!

Starting without the IP address for the LMS server:

Code: Select all

./squeezelite-armv6 -o default:CARD=Set
Without the IP address squeezelite uses auto discovery to determine the IP address of the LMS server.

It was working well, so now I wanted to have it started on startup. So, to automate things, I butchered the daemon start script from squeezeslave to get it to start Squeezelite.

I made the script available through my website, it's my very first Debian daemon script, so use at your own risk!
Do the next commands to automate startup:

Code: Select all

cd /home/pi/squeezelite
sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelite.sh
sudo mv squeezelite.sh /etc/init.d/squeezelite

cd /etc/init.d
chmod u+x squeezelite

sudo update-rc.d squeezelite defaults
In the script the name of the squeezelite client is set to "Framboos" which is the dutch word for Raspberry. :)
To change it, run:

Code: Select all

sudo nano squeezelite
Search for the word "Framboos" and change it to your liking, save and close.

This is how you test the script:

Code: Select all

sudo ./squeezelite start
The command prompt should return immediately. Now check if the squeezelite process is up:

Code: Select all

ps -A |grep squeeze
It should return something like this (the number will be different):

Code: Select all

2324 ?        00:00:01 squeezelite-arm
To stop squeezelite:

Code: Select all

sudo ./squeezelite stop
And that's it, if you now reboot the raspberry (sudo shutdown -r now), squeezelite should be started automatically.

I want to thank the creator of Squeezelite for creating this create squeezebox client!

Greetings,

Gerrelt.
Last edited by Gerrelt on Mon Sep 30, 2013 5:08 pm, edited 1 time in total.
my Raspberry Pi page: http://raspberry.gerrelt.nl

User avatar
Gerrelt
Posts: 294
Joined: Sat Nov 10, 2012 9:01 am

Re: SqueezeLite up and running

Sat Nov 17, 2012 6:08 pm

I just noticed the Squeezelite creator uploaded a Hard-Float version yesterday! :lol:
See: squeezelite download page
I am going to try it on Hard-Float Raspian wheezy again.
my Raspberry Pi page: http://raspberry.gerrelt.nl

peteS
Posts: 5
Joined: Fri Aug 10, 2012 10:08 am

Re: SqueezeLite up and running

Sun Dec 02, 2012 9:22 am

I've also made the move from squeezeslave to squeezelite on the hf version and found it to be rock solid - just happily sitting there serving music to my main av system via hdmi, controlled from a variety of clients such as ipeng, the squeezebox controller, or squeezebox rc on a windows phone. It just works really well and is by far the cheapest way to add a new squeezebox device. :)

User avatar
Gerrelt
Posts: 294
Joined: Sat Nov 10, 2012 9:01 am

Re: SqueezeLite up and running

Sun Dec 02, 2012 8:07 pm

Yeah, squeezelite works great!

My squeezelite player is now "back to the eighties", see topic: Radio Raspberry
my Raspberry Pi page: http://raspberry.gerrelt.nl

G_P
Posts: 2
Joined: Wed Dec 05, 2012 2:46 pm

Re: SqueezeLite up and running

Wed Dec 05, 2012 5:36 pm

Does squeezebox server transcodes say FLAC to mp3 for Squeezelite client?

I'm asking that because I can see FLAC files being transcoded to mp3 while streaming to soft clents (SqueezePlay, or just http://squeezeboxserver-ip:9000/stream.mp3 via VLC)

on Squeezebox server:

Code: Select all

121       3409     1  0 20:50 ?        00:00:00 /usr/share/squeezeboxserver/Bin/i386-linux/flac -dcs -- /media/Elements/AUDIO/Mike Oldfield ---ALBUMS---/Mike Oldfield - Voyager (FLAC)/4.Women Of Ireland.flac
121       3410     1 18 20:50 ?        00:00:03 /usr/bin/lame --silent -q 0 -v -B 320 - -


User avatar
Gerrelt
Posts: 294
Joined: Sat Nov 10, 2012 9:01 am

Re: SqueezeLite up and running

Fri Dec 07, 2012 3:22 pm

It could very well be that the squeezebox transcodes for it's clients.
I am not a squeezebox server expert, maybe you should ask your question on this forum: Squeezebox forum

I played around with transcoding trying to work around the 44.1 khz limitation squeezeslave has. I got some information from this thread: Link
My NAS couldn't handle the transcoding, so I switched to squeezelite when I was told about it.
my Raspberry Pi page: http://raspberry.gerrelt.nl

djfake
Posts: 7
Joined: Fri May 25, 2012 2:44 pm

Re: SqueezeLite up and running

Mon Dec 10, 2012 3:43 pm

Any idea on how to get Squeezelite to connect to a remote LMS? I'd love to be able to listen at work to my home LMS, which I can do by portforwarding via ssh. But would be nice to do this "headless".

thanks

User avatar
Gerrelt
Posts: 294
Joined: Sat Nov 10, 2012 9:01 am

Re: SqueezeLite up and running

Mon Dec 10, 2012 5:50 pm

If you add an IP address to the start command of squeezelite, it will connect to that IP address instead of doing auto discovery.

If you are using my script do:

Code: Select all

cd /etc/init.d
sudo nano squeezelite
and change this

Code: Select all

SLOPTIONS="-o sysdefault:CARD=Set -n Framboos"
to:

Code: Select all

SLOPTIONS="-o sysdefault:CARD=Set -n Framboos 127.0.0.1"  
I used localhost 127.0.0.1 as an example IP address, so change it to your IP address.

I just found this page for making your LMS server accessable through the internet, might be interesting too: Slimdevices Wiki page
my Raspberry Pi page: http://raspberry.gerrelt.nl

djfake
Posts: 7
Joined: Fri May 25, 2012 2:44 pm

Re: SqueezeLite up and running

Tue Dec 11, 2012 3:03 am

Yes, that's it... thank you!

Code: Select all

ssh -L 9000:<lan ip>:9000 -L 3483:<lan ip>:3483 <user>@<wan address>
sudo squeezelite-armv6hf -o sysdefault:CARD=ALSA -n Framboos 127.0.0.1
Music plays!

djfake
Posts: 7
Joined: Fri May 25, 2012 2:44 pm

Re: SqueezeLite up and running

Tue Dec 11, 2012 3:28 pm

I notice that FLAC decoding is very choppy compared to MP3. Anyway to mitigate this?

User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm

Re: SqueezeLite up and running

Tue Dec 11, 2012 3:49 pm

djfake wrote:I notice that FLAC decoding is very choppy compared to MP3. Anyway to mitigate this?
I never had any problems playing FLAC with Squeezelite! It simply runs great!
truehl
http://www.squeezeplug.de

djfake
Posts: 7
Joined: Fri May 25, 2012 2:44 pm

Re: SqueezeLite up and running

Tue Dec 11, 2012 4:04 pm

But this is remotely playing, over the internet, not inside a subnet.

To fix, I can go into the player settings for "Framboos" and change the Bitrate Limiting from "unlimited", which resolves the issue.

bricolodu13
Posts: 44
Joined: Tue Aug 07, 2012 2:05 pm

Re: SqueezeLite up and running

Tue Dec 11, 2012 10:53 pm

Hello Gerrelt,

I've successfully made squeezelite-armV6hf running thanls to your nice "How To".

However, trying to have it started on startup with your script i get a permission error with the prompt :
chmod u+x squeezelite

any idea ?

Best regards,
Jean

eklem
Posts: 2
Joined: Wed Dec 12, 2012 9:04 am

Re: SqueezeLite up and running

Wed Dec 12, 2012 9:05 am

Would I be able to play music from my Spotify-account with SqueezeLite and Debian Softfloat?

User avatar
Gerrelt
Posts: 294
Joined: Sat Nov 10, 2012 9:01 am

Re: SqueezeLite up and running

Wed Dec 12, 2012 12:38 pm

bricolodu13 wrote:I've successfully made squeezelite-armV6hf running thanls to your nice "How To".

However, trying to have it started on startup with your script i get a permission error with the prompt :
chmod u+x squeezelite

any idea ?

Hi Jean,

Yes, there seems to be an error in my how-to... :oops:

It should be prefixed with "sudo", like this:

Code: Select all

sudo chmod u+x squeezelite
The Pi user is not allowed to change the script to an executable in the init.d directory, I think. So it should be done under "sudo" rights.

Greetings,
Gerrelt.
my Raspberry Pi page: http://raspberry.gerrelt.nl

User avatar
Gerrelt
Posts: 294
Joined: Sat Nov 10, 2012 9:01 am

Re: SqueezeLite up and running

Wed Dec 12, 2012 1:23 pm

eklem wrote:Would I be able to play music from my Spotify-account with SqueezeLite and Debian Softfloat?
I don't really know, I don't use Spotify. But according to the Squeezelite thread, it should work. See: Post 1 of Squeezelite thread.
my Raspberry Pi page: http://raspberry.gerrelt.nl

bricolodu13
Posts: 44
Joined: Tue Aug 07, 2012 2:05 pm

Re: SqueezeLite up and running

Wed Dec 12, 2012 7:02 pm

Hi Gerrelt,
Yes, there seems to be an error in my how-to... :oops:

It should be prefixed with "sudo", like this:
Ok Thank you, I'll try that.
But in the meantime I've edited your Script with nano and need to modify it at least as I'm using the hard float version of squeezelite.

Looks like I can't save it as I don't have the permission.

Sorry but I'm absolutely newbie with linux.
Yesterday night was my very first steps... :oops:

Best regards,
Jean

User avatar
Gerrelt
Posts: 294
Joined: Sat Nov 10, 2012 9:01 am

Re: SqueezeLite up and running

Wed Dec 12, 2012 8:38 pm

Hi Jason,

No problem, we all started somewhere.

To modify the script, also add "sudo", like this:

Code: Select all

cd /etc/init.d
sudo nano squeezelite
Sudo is a bit like "Run as administrator" on Windows.

To save in text editor nano, press Control + X, answer "Y" and then press the Enter key.

But I didn't have to modify the script for Wheezy Raspbian hardfloat, which I am running now.
I am planning a how-to for squeezelite on Hardfloat too, I just have to find the time..

Greetings,

Gerrelt.
my Raspberry Pi page: http://raspberry.gerrelt.nl

bricolodu13
Posts: 44
Joined: Tue Aug 07, 2012 2:05 pm

Re: SqueezeLite up and running

Thu Dec 13, 2012 10:46 am

Ok, Gerrelt,

I succeeded in modding your script for hf
and the script is running on start up as I can see from the LMS web browser the Squeezelite name "Framboise" (I'm French, sorry :D )

However I have no sound although I also changed the ouput to "-o pulse" as it was the one working for me.

Any idea ????

Best regards,
Jean

bricolodu13
Posts: 44
Joined: Tue Aug 07, 2012 2:05 pm

Re: SqueezeLite up and running

Thu Dec 13, 2012 11:27 am

Hi Gerrelt,

Just for info, when I do after login :
ps -A |grep squeeze

I get

1719 ? 00:00:01 squeezelite-arm

So beside no sound (which is sad) it works.
But I would like to understand why i get no sound.
By the way the Squeezelite "Framboise" from the LMS browser is somewhat eratic

best regards,
Jean

User avatar
Gerrelt
Posts: 294
Joined: Sat Nov 10, 2012 9:01 am

Re: SqueezeLite up and running

Thu Dec 13, 2012 11:53 am

Hi Jean,

What's the output of this command?:

Code: Select all

./squeezelite-armv6 -l
Or, if you are using the correct squeezelite for HF, it's:

Code: Select all

./squeezelite-armv6hf -l
Greetings,

Gerrelt.
my Raspberry Pi page: http://raspberry.gerrelt.nl

bricolodu13
Posts: 44
Joined: Tue Aug 07, 2012 2:05 pm

Re: SqueezeLite up and running

Thu Dec 13, 2012 3:28 pm

Hi Gerrelt,

Thanks a lot for helping.

Here is a screen copy :
Output devices:
null - Discard all ....
pulse - Playback/recording through the PulseAudio spund server
sysdefault:CAED=ALSA -bcm2835 ALSA, bcm2835 ALSA -Default Audio Device

Best regards,
Jean

bricolodu13
Posts: 44
Joined: Tue Aug 07, 2012 2:05 pm

Re: SqueezeLite up and running

Thu Dec 13, 2012 3:37 pm

OK Gerrelt,

I Changed the ouput option to ALSA and it is working :D

Thank you
Jean

User avatar
truehl
Posts: 642
Joined: Sun Mar 04, 2012 6:47 pm

Re: SqueezeLite up and running

Sun Dec 23, 2012 7:52 pm

I have some massive problems with the Squeezelite init-script running under the updated Raspbian version. Squeezelite works on start, but only with a very strange sound. Killing Squeezelite and start by hand (without any options) runs great!

Did someone also saw this?
truehl
http://www.squeezeplug.de

User avatar
Gerrelt
Posts: 294
Joined: Sat Nov 10, 2012 9:01 am

Re: SqueezeLite up and running

Sun Dec 23, 2012 8:09 pm

Are you using the Raspbian hard float executable? This thread is for Debian Soft Float.
For hard float issues, please use this thread.

The hard float version of the executable ends with "hf".
my Raspberry Pi page: http://raspberry.gerrelt.nl

Return to “Graphics, sound and multimedia”