First you need to download the latest Raspberry Pi Raspbian OS from here. Get whichever version you want but I like to get the desktop version so I can VNC into it as it makes it easier.
If you have never done this connect your Raspberry Pi to a monitor, keyboard and mouse. If you are an old salt with Linux then just run headless and SSH into your Pi.
Once you download that file UNZIP IT. UNZIP IT. The file will end with an extension of .img
Do NOT try to burn the zip file to your SD card. UNZIP IT AND GET THE .IMG FILE.
Then download a program called Etcher then insert an SD card and select the card, select the img file then burn it to your SD card.
You can now boot your Pi. I strongly recommend hooking up to ethernet first or booting with a monitor keyboard and mouse to select your wifi network. Yeah you can hand code the wpa_supplicant file but this is a tutorial for beginners.
NOTE: SSH is no longer automatically enabled on Raspbian. You can either turn it on by writing a file named ssh to the boot directory or you can enable it after you boot into the GUI by passing the command:
SSH is under number 5, Interfacing Options.
To add SSH after writing the SD card (I do this from a Mac terminal)
From Raspi config you can (and should) change your password, locale, time zone, hostname and turn on VNC and SSH.
Once you boot up select your wifi or just proceed if you are hooked to the internet.
Turn WIFi on like below. Put the mouse over the up and down arrows on the toolbar. (Mine is connected to ethernet).
Once connected open terminal (the fourth icon from the left on the top toolbar that looks like a black terminal and type the following commands one at a time.
sudo apt-get update
sudo apt-get upgrade
Could take a few minutes. Once updated we’ll install LMS.
We’re going to install a music media server called Logitechmediaserver (LMS). It is available for a variety of platforms such as Windows, Linux, Mac, Raspberry Pi (ARM), and some NAS devices. My principal LMS server is installed on a Mac Mini. From there you go to mysqueezebox.com and make an account. Once you have an account you can add streaming services such as Spotify, Tidal, Pandora, TuneIn Radio, Shoutcast, among several others. Those are the ones I have used or currently use now.
Before putting LMS on the Pi add these dependencies first
sudo apt-get install libio-socket-ssl-perl libnet-libidn-perl libnet-ssleay-perl perl-openssl-defaults
You don’t HAVE to put LMS on another computer. It will run on the same Pi, it may be a little slow on a Pi Zero but it’ll run. Runs real nice on a Pi 3. So if this is going to be a stand alone LMS lets do this. If you intend to install LMS on another computer you can skip this. I have directions below for just adding a squeezelite player. To install LMS go to the nightly link above and right click on the ARM version that says “all.deb” at the end of the file name and go to your terminal and type wget followed by the link (again using the latest version as of when I wrote this).
Now type (and make sure your file names are right, cut and paste with links is weird sometimes) They change the version numbers frequently. These file names and numbers will be different in a couple days. Adjust accordingly.
cd mkdir lms cd lms wget http://downloads.slimdevices.com/nightly/7.9/sc/cf749e5/logitechmediaserver_7.9.2~1527861596_all.deb sudo dpkg -i logitechmediaserver_7.9.2~1527861596_all.deb
The last command there will install LMS on directly on your Pi and it should start automatically. The way to access it is any browser on the same network with the IP address of your Pi plus :9000 (i.e. 192.168.1.2:9000) To find the address of your Pi type
Squeezelite is the player we need to actually play the content. Adding squeezelite is remarkably simple. I do it like this. It needs some dependencies though to play common file formats.
sudo apt-get install libasound2-dev libflac-dev libmad0-dev libvorbis-dev libfaad-dev libmpg123-dev liblircclient-dev libncurses5-dev
Then lets get and install squeezelite.
cd mkdir squeezelite
Now go to this page to get the latest squeezelite. My tutorial will describe the current latest version. Simply change version number if it updates once this post gets dated a bit.
wget https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/squeezelite-22.214.171.1243-armv6hf.tar.gz tar -xzf squeezelite-126.96.36.1993-armv6hf.tar.gz sudo mv squeezelite /usr/bin/squeezelite
Okay squeezelite is now installed. Simple.
Now lets see our devices. I’m using the HDMI sound off the TV here. You could add a DAC if you wanted to.
There is quite a bit of output for a Pi Zero. The following kind of depends on what kind of Pi you have in the project. I am using a Pi zero which has really only one audio output. The HDMI. I could have chosen the one that says “sys default”, the other “hw:” device works I know. Probably some others as well. If you are using a Pi 2 or Pi 3 you also have an onboard sound output which will be your sys default. To pipe sound out via your HDMI cable you pretty much have to use the one I have circled, or the plughw one below it two items. Yes you can use the sysdefault off the 1/8th inch output on the Pi but then you need another cable. Let’s keep it simple, shall we?
I chose to use the one circled because it is the hardware (hw:) device for the HDMI. . Now here’s what we do to set up the device and make it start at boot.
NOTE: IF NOT USING HDMI THEN USE THE ONE THAT STARTS WITH sysdefault, front, or hw.
sudo nano /etc/systemd/system/squeezelite.service
It’ll be empty. Paste this in (and note this is MY system), alter accordingly. After squeezelite -o add the player you selected. The -n parameter is the name of the player. Name it anything you want. The -s is the LMS server. If you leave this out entirely it will likely find it. If you want to put -s 127.0.0.1 that will work too. The -a 80:4 is something I used on another TV that sounded terrible and choppy until I added those parameters. To be honest I didn’t remove it on this new TV and it works great. I’m leaving it in. You may not need it or you might need it. Because I have like 10 players in the house sometimes they conflict with each other. The -m setting is the MAC address of the player to keep them all straight. If this is your only player you won’t even need to add the -m part.
MAKE SURE TO GET THE DEVICE AFTER THE dash O (- o) CORRECTLY FOR YOUR INSTALLATION.[Unit]
ExecStart=/usr/bin/squeezelite -o hw:CARD=ALSA,DEV=1 -n calendar -s 192.168.20.37 -a 80:4 -m 74:da:38:41:f8:9e[Install]
Hit CTL +x and then answer Y to save the file.
Now lets start it at boot
sudo systemctl enable squeezelite.service
Now if everything went according to plan when you boot up and find your LogitechMediaServer (it is the IP address of the computer you put it on plus :9000) In my case my LMS lives on my Mac Mini of 192.168.20.37:9000
Just put that in a browser and look for your -n parameter (I named mine calendar). It should find it as a player.
You can see I circled the apps I enabled in my squeezebox.com
If you find the volume isn’t loud enough pass this command:
Select your device by following the on screen directions (usually function key + and f key) and then hold down shift and the + key on the keyboard until the volume goes up to max.
Spotify app is now called Spotty and must be added through the Settings > Plugins page.
Tidal and Spotify you must have pay premium accounts to use. Ditto with Pandora. TuneIn and Shoutcast are free.