Wednesday, November 30, 2016

Easily install Logitech Media Server (Squeezebox Server) and Squeezelite on your Pi with Armbian Jessie

Do you have any spare Pi?
I am talking about the Raspberry Pi, Orange Pi, Banana Pi, Cubieboard, pcDuino, Odroid, NanoPi and the likes...

Why not transform it into a Sonos-like multimedia server and player?
It's soooo easy!

All we need is two nice pieces of software: the Logitech Media Server (aka Squeezebox server) and a player to connect to it, which is going to be Squeezelite.

First of all, download the right image of Armbian for your board HERE
Please choose "Jessie server" image, if available. This is the version for server usage, with no desktop environments.
Follow the instructions and setup the operating system (we have faith you can manage this on your own, since you have a spare development board...)

How to install the Logitech Media Server / Squeezebox Server

Now, we have to install the Logitech Media Server, but we have to download it first. From the command line give the following command:
wget http://downloads.slimdevices.com/nightly/7.9/sc/ffd0b97/logitechmediaserver_7.9.0~1480398011_arm.deb -O lms.deb
(Please notice that from http...to..._arm.deb there are no spaces)
And let's wait for the file to be downloaded.  If you get a file not found error, you'll have to visit this website with a browser:
http://downloads.slimdevices.com/nightly/?ver=7.9
Find the most recent version of the _arm.deb version available, right click on it to copy it's link, and substitute this link in the above command.

Once the Logitech Media Server installation package has been downloaded, proceed with its installation:
sudo dpkg -i lms.deb
That's it! The Logitech Media Server is now installed, and you can go to:
http://ip-address-of-the-board:9000
 from any browser to set it up.

How to install the Squeezelite player

To actually play/stream your music collection or listen to online radios, you'll also need a player. This can be installed on the same board as the Logitech Media Server (so you will have a Server and a Player on the same machine), or on different boards which will work as players that connect to the Server (you can have as many players as you want!)

So, let's install Squeezelite, the Player "side" of this combo.
First we need to refresh the packages list of our installation:
sudo apt-get update
 Then we can install squeezelite:
sudo apt-get install squeezelite
That's basically it! Squeezelite will be installed and will automatically be launched at startup.

If you are using an external usb soundcard you might need to tweak with the squeezelite configuration file, which is /etc/default/squeezelite

First you will need to find out the name of the soundcard, and to do this you have to issue the following command:
sudo /usr/bin/squeezelite -l
Check the output and identify the name of your sound card. Copy it, then open the configuration file:
sudo nano /etc/default/squeezelite
Find the following line:
SL_SOUNDCARD="sysdefault:CARD=ALSA"
and substitute sysdefault:CARD=ALSA with the name of the card you have copied before.

If you want to give your player a different name than your hostname, just edit this line:
SL_NAME="$(hostname -s)"
and change the string within the quotes to the name you want to give this player.

The other options usually don't need to be touched.
That was easy, wasn't it?

Enjoy your music on your Pi!