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

Re: [Tutorial] Squeezelite up and running on Raspbian

Tue May 06, 2014 8:24 pm

A few people asked me about how to get two or more squeezelite players running on one Raspberry Pi.

So, I made page about it: Two Players one Pi

I don't use it myself, but a few people have done it this way. So it should work.
my Raspberry Pi page: http://raspberry.gerrelt.nl

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Sat May 10, 2014 4:13 pm

Raspberry Forum user foxpi, told me recently how to switch off the Squeezelite player on shutdown.
He used netcat for this. With netcat one can write to a TCP connection.

Using netcat he wrote a command to the Squeezebox server command line interface.
The command told the squeezebox server that this squeezelite player is switched off.
See: http://www.raspberrypi.org/forums/viewt ... at#p517424
This was very smart!

I have now implemented this power-off in the squeezelite startup script.
BUT, this only works if you have entered the Squeezebox server IP address in the SB_SERVER_IP variable. The command needs an IP address, otherwise, it doesn't know where to send it.

While playing with this, I've thought of another use:
Some people want to have Squeezelite to automatically start playing when it's started (on Raspberry Pi power-up).
I've added some shell scripting that first waits till the squeezelite player is connected to the Squeezebox server, and then tells it to start playing.
It can be activated with the SL_AUTO_PLAY variable. BUT, this also only works if you have entered the Squeezebox server IP address in the SB_SERVER_IP variable.

If you want to make squeezelite to automatically start playing on startup, follow these next steps:

First download and install the new script:

Code: Select all

cd /home/pi/squeezelite
sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelitehf.sh
sudo cp /etc/init.d/squeezelite /etc/init.d/squeezelite.old
sudo mv /home/pi/squeezelite/squeezelitehf.sh /etc/init.d/squeezelite
sudo chmod a+x /etc/init.d/squeezelite
Now set the auto-play:
Open the script with:

Code: Select all

sudo nano /etc/init.d/squeezelite
Change the same settings as in the old (saved to squeezelite.old) script.
Now also uncomment these variables: SL_AUTO_PLAY, SB_SERVER_IP
And change the IP address to the IP address of your Squeezebox server.

After a reboot, Squeezelite should automatically start playing.

Thank you foxpi, for pointing this out!! 8-)
my Raspberry Pi page: http://raspberry.gerrelt.nl

thepigletbank
Posts: 2
Joined: Mon Jan 14, 2013 9:54 am

Re: [Tutorial] Squeezelite up and running on Raspbian

Sun May 25, 2014 10:02 am

Hey, I'm wondering if I can do this without the usb sound card and just put my audio cable into the input that the pi already has?

Thank You

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Sun May 25, 2014 10:22 am

Yes, you can. But the sound quality is less.

The startup script is set default to the onboard audio output.
my Raspberry Pi page: http://raspberry.gerrelt.nl

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Wed Jun 04, 2014 7:43 pm

Every morning I switch on the kitchen raspberry to our favorite morning radio station. Which is easy, just open squeezer and press play. But something you do repeatedly is a candidate for automatic scheduling.
Now, there is an alarm function in the Squeezebox server, go to the management page, and choose: settings -> Player Tab -> choose player with the first drop down box -> choose "alarm clock" in the second.

But, where is the fun in using something pre-made? :D

I have added some commands to the squeezelite script, that allow you to set volume, start playing (at a certain volume), start playing a favorite (at a certain volume) or stop playing .

This is how to use them:

Code: Select all

sudo /etc/init.d/squeezelite set_volume <volume>

sudo /etc/init.d/squeezelite play [volume]

sudo /etc/init.d/squeezelite play_fav <part of favorite name> [volume]

sudo /etc/init.d/squeezelite stop_playing
The " [ ] " means it is optional, the " < > " means it is mandotory.

I find the play_fav command the most usefull. This command will start playing one of the entries in your favorites. When this command is called with a part of the favorite's name, it will set the player to that radio station or song and start playing it.
The play_fav command is not entirely bullit proof, it is best to use a piece of the favorite name that is quite unique. Otherwise it might just start playing the first favorite it finds with that word in it's name.

One important thing to note: These commands only work if you have set the ip address of your Squeezebox server in the SB_SERVER_IP variable.
The commands need the IP address so they can send their commands to the Squeezebox server.

Example
I have added two cronjobs that starts a certain radio station at 7:15 and stops it at 8:15, and only on workdays.
The crontab looks like this:

Code: Select all

0 7 * * 1-5 sudo /etc/init.d/squeezelite play_fav "Q-music" 40
15 8 * * 1-5 sudo /etc/init.d/squeezelite stop_playing
This works great for me, now the kitchen raspberry is on at the right volume on the right radio station every morning. 8-)

That is not the only use for these commands. You could also use this if you want to create buttons on your Squeezebox Raspberry to change the volume or change the radio station...


If you want to use the new version of the script, follow these next steps:

First download and install the new script:

Code: Select all

cd /home/pi/squeezelite
sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelitehf.sh
sudo cp /etc/init.d/squeezelite /etc/init.d/squeezelite.old
sudo mv /home/pi/squeezelite/squeezelitehf.sh /etc/init.d/squeezelite
sudo chmod a+x /etc/init.d/squeezelite
Change the same settings as in the old (saved to squeezelite.old) script.

Now also uncomment this variable: SB_SERVER_IP
And change the IP address to the IP address of your Squeezebox server.
my Raspberry Pi page: http://raspberry.gerrelt.nl

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Sat Jun 28, 2014 4:18 pm

The download location of squeezelite has changed. The old download location is still active, but only offers version 1.5.
The new download location offers version 1.6.3 .
I have changed the download URL in my Tutorial, and in the startup script.

The startup script uses the URL for the update function. If you want to use the update function, either download the script again and redo your settings, or correct the URL in the script with these steps:

Open the squeezelite script:

Code: Select all

sudo nano /etc/init.d/squeezelite
And search for the old URL: "http://squeezelite.googlecode.com/files ... te-armv6hf"
You should find it on line 207.

Change only the URL to: "http://squeezelite-downloads.googlecode ... te-armv6hf"

The function should now look like this:

Code: Select all

#
# Function that updates squeezelite
#
do_update()
{
    wget -P /tmp http://squeezelite-downloads.googlecode.com/git/squeezelite-armv6hf
    sudo cp /usr/bin/squeezelite-armv6hf /tmp/squeezelite-armv6hf.old
    sudo mv /tmp/squeezelite-armv6hf /usr/bin
    sudo chmod u+x /usr/bin/squeezelite-armv6hf
    # get the new version
    SL_VERSION=$(sudo $DAEMON -t | grep "Squeezelite v" | tr -s ' ' | cut -d ',' -f1 | cut -d ' ' -f2)
}
Save the file and, if you want to upgrade squeezelite, execute this (it will stop and start squeezelite automatically):

Code: Select all

 sudo /etc/init.d/squeezelite update
And now, you should have version 1.6.3.
my Raspberry Pi page: http://raspberry.gerrelt.nl

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Sun Jun 29, 2014 1:04 pm

Is anybody using squeezelite on RaspBMC? I am suddenly experiencing crackles in the sound after the latest RaspBMC update, it was fine before.
Does anybody have a solution?
my Raspberry Pi page: http://raspberry.gerrelt.nl

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Wed Jul 02, 2014 11:19 am

Gerrelt wrote:Is anybody using squeezelite on RaspBMC? I am suddenly experiencing crackles in the sound after the latest RaspBMC update, it was fine before.
Does anybody have a solution?
FWIW: I "solved" it by adding this:

Code: Select all

dwc_otg.speed=1
to /boot/cmdline.txt

A bit strange that this is suddenly needed, but the Raspbmc team now know about this problem. They will investigate.
my Raspberry Pi page: http://raspberry.gerrelt.nl

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Mon Jul 14, 2014 8:44 pm

I've been looking at the new B+ model. It looks really promising. It probably does not need a seperate USB hub or USB soundcard anymore. Which means you would only need a B+ model and a good power supply.
If anybody is going to try the B+ model with Squeezelite, I am curious if the sound quality actually did improve and if the USB ports are powerfull enough to power a WiFidongle.
my Raspberry Pi page: http://raspberry.gerrelt.nl

User avatar
hannesie
Posts: 8
Joined: Mon Oct 15, 2012 10:40 am
Location: Netherlands Dordrecht

Re: [Tutorial] Squeezelite up and running on Raspbian

Mon Jul 14, 2014 9:24 pm

If you like to hear a Raspberry with Squeezelite, I live in your neighborhood, Dordrecht.
I play also DSD files with DoP file via a High End System and a Raspberry via USB. :mrgreen:
A USB Amanero interface can deliver the signals to the ESS9016 DAC.
Last edited by hannesie on Wed Jul 16, 2014 10:44 pm, edited 1 time in total.

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Tue Jul 15, 2014 7:13 pm

Hi Dordrechtenaar! :)

Thank you for the offer, but I was curious how the standard output sounds like on the new Raspberry Pi model B+.
See:
http://www.raspberrypi.org/blog/#introd ... del-b-plus

As it is just released, I don't think you allready got one?
I allready own a couple of "old" :D model B's. There is even one model B with only 256 mb memory.

Groeten!

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

User avatar
hannesie
Posts: 8
Joined: Mon Oct 15, 2012 10:40 am
Location: Netherlands Dordrecht

Re: [Tutorial] Squeezelite up and running on Raspbian

Tue Jul 15, 2014 9:59 pm

I had announced it on my forum today.
http://forum.zelfbouwaudio.nl/viewtopic ... 9#p1695519

I think that the sound is not different from the old one. :mrgreen:
The difference in sound is on the DAC. :D

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Wed Jul 16, 2014 5:43 pm

Gerrelt wrote:Hi Dordrechtenaar! :)

Thank you for the offer, but I was curious how the standard output sounds like on the new Raspberry Pi model B+.
See:
http://www.raspberrypi.org/blog/#introd ... del-b-plus

As it is just released, I don't think you allready got one?
I allready own a couple of "old" :D model B's. There is even one model B with only 256 mb memory.

Groeten!

Gerrelt.
Hi Gerrelt.
I*ve got my Model B+ today. I can't get a good sound out of the internal audio connector with SqueezeLite. Did you try it?

Thomas
truehl
http://www.squeezeplug.de

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Wed Jul 16, 2014 6:34 pm

Hi Thomas,

I don't own a B+, and haven't ordered one yet either. I have no use for an extra Raspberry Pi right now.

What are you experiencing? Crackles?

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

rgthorpe
Posts: 2
Joined: Mon Jul 21, 2014 1:52 pm

Re: [Tutorial] Squeezelite up and running on Raspbian

Mon Jul 21, 2014 2:02 pm

I just purchased my first pi, the new B+ model, and thanks to your tutorial and script have squeezelite up and running successfully -- almost -- with a Fiio E17 and Belkin N150 dongle (fyi, no issues with running both from the built in usb ports with only a standard phone microusb power supply to the pi itself). The "almost" issue is that flac files at 96 / 24 are being played by the E17 at 48 / 16. The E17 plays these at 96 / 24 using my Mac and squeezelite for mac os x so long as I give it the "-a :0" option to disable resampling within OS X. Is there a comparable option to be added within your script to do the same thing for the Raspian variant? After looking at the options for the binary itself, I tried adding "-R -u E" after the "80" in the ALSA option in your script, to no effect.

rgthorpe
Posts: 2
Joined: Mon Jul 21, 2014 1:52 pm

Re: [Tutorial] Squeezelite up and running on Raspbian

Mon Jul 21, 2014 11:44 pm

Please disregard -- I seemed to have solved my problem by fixing the device line -- I had been using default:CARD=DACE17, and what I needed was the front speaker variant front:CARD=DACE17,DEV=0. The full command generated by the script that is now successfully giving me 96 / 24 output is: /usr/bin/squeezelite-armv6hf -o front:CARD=DACE17,DEV=0 -n <devicename> -m <address> -a 80 -R -u E

squiregeek
Posts: 24
Joined: Mon Jan 14, 2013 3:44 pm

Squeezelite stopping

Wed Jul 23, 2014 9:43 pm

I have been trying to get reliable operation from my Raspi systems, but having no luck. Today I provisioned three Pi's to stream from a fourth Pi running LMS. All are Squeezeplug 7.09. After several hours, all three players stopped, though at different times.

Running 'service squeezelite status' showed 'running.' 'service squeezelite restart' restored audio output. I am at a loss to find a solution. This has occurred with Raspi and Odroid-U3. My internet streamers (Logitech Squeezebox Booms) run reliably and do not have a problem with the Squeezeplug server running on a Raspi B.

Any thoughts?

BTW -- The new raspberry Pi B-Plus will not boot from a Squeezeplug SD. At least it didn't with multiple attempts with several SD cards. It did boot from the June Wheezy distro.

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Thu Jul 24, 2014 11:21 am

@rgthorpe: great that you found the solution! And thank you for your info on the 96 / 24 playback .

@squiregeek: This is not the thread about squeezeplug, but about installing squeezelite on a Raspbian image by yourself.
Nevertheless, maybe "we" can help:
Are you using the standard audio output on the Raspberry? If so, that one is not very reliable. I've had it turn into white noise after several hours too.
I would advise to use a USB soundcard, even a cheap one will do. I use the “LogiLink USB Soundcard”, model number: UA0053.
my Raspberry Pi page: http://raspberry.gerrelt.nl

squiregeek
Posts: 24
Joined: Mon Jan 14, 2013 3:44 pm

Re: [Tutorial] Squeezelite up and running on Raspbian

Thu Jul 24, 2014 12:45 pm

Thanks for the help Gerrelt. I may try Squeezlite by myself if I can't make the 'plug' version stable. I have Odroids and Cubox-i's yet to try.

I've used Wolfson, Behringer, Odroid, Startech and ADSTech modules with success, at least until Squeezelite goes offline. I'm still trying to get HDMI to work into an audio-only converter.

I'll find a squeezeplug forum and look for further advice. Sorry for the inconvenience.

User avatar
Paul Webster
Posts: 842
Joined: Sat Jul 30, 2011 4:49 am
Location: London, UK
Contact: Twitter

Re: [Tutorial] Squeezelite up and running on Raspbian

Thu Jul 24, 2014 1:39 pm

@squiregeek you could use the -d and -f parameters to squeezelite to generate logs to try to capture a reported problem.
Be careful about setting (and leaving) a very high log level for a long time because of space.

squiregeek
Posts: 24
Joined: Mon Jan 14, 2013 3:44 pm

Re: [Tutorial] Squeezelite up and running on Raspbian

Thu Jul 24, 2014 2:52 pm

Thanks, Paul. That's a great idea.

I've installed Squeezelite on a Raspi B+ using gerrelt's indispensable tutorial. I'll see how long it works.

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Thu Jul 24, 2014 5:08 pm

squiregeek wrote:Thanks, Paul. That's a great idea.

I've installed Squeezelite on a Raspi B+ using gerrelt's indispensable tutorial. I'll see how long it works.
Did you try the internal sound output, or only with soundcard or DAC?
truehl
http://www.squeezeplug.de

squiregeek
Posts: 24
Joined: Mon Jan 14, 2013 3:44 pm

Re: [Tutorial] Squeezelite up and running on Raspbian

Thu Jul 24, 2014 5:38 pm

Hi Herr Truehl,

(I'm a donor!)

No, I've only used outboard DACs, given the complaints about the sound quality. I use optical interfaces to keep hum down as well, but tried the Behringer's line out for testing.

So many users are getting reliable results that I'm sure that I'm doing something wrong. But I've followed the video instructions to the letter (you have a great 'radio' voice). I hope this helps.

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

Re: [Tutorial] Squeezelite up and running on Raspbian

Fri Jul 25, 2014 12:07 pm

Are you using a wifi dongle?
my Raspberry Pi page: http://raspberry.gerrelt.nl

squiregeek
Posts: 24
Joined: Mon Jan 14, 2013 3:44 pm

Re: [Tutorial] Squeezelite up and running on Raspbian

Fri Jul 25, 2014 12:18 pm

gerrelt,

No, I'm hardwired on all devices.

My current experiment involves four R-Pis. One is running LMS via Squeezeplug 7.09, and the other three are provisioned with squeezelite per your tutorial. Two of them are streaming Internet audio and one is playing music from the local library. Since they went live at 1600 yesterday, all are stable and functioning.

The players include two B's and one B+. Two output via Behringer UCA222 and the B+ is using a Startech USB DAC, which I like because it gives SPDIF (toslink) and earphone simultaneously; nice for troubleshooting.

I have long suspected that my problem is network related, but having changed out the switches and the cabling, I've run out of tricks.

Thanks for your attention.

Return to “Graphics, sound and multimedia”