From parts to music, a Raspberry Pi Squeezebox clone

BadassBob

Digitally rendered
What you will find in the thread below is a way to make a Raspberry Pi computer into the perfect replacement for a Squeezebox. Since the Squeezebox line was discontinued a little while ago, the prices have skyrocketed, leaving a big hole in the market for network music players. There are plenty of alternatives out there, but for the money, the Squeezebox was king. Devices offering similar functionality were often priced many times that of a Squeezebox. Now it's gone, just like that. We will miss them, they brought more audiophiles to the world of computer audio than any other product. The good news is, the Raspberry Pi more than fills the role of a Squeezebox. She sure ain't pretty, but boy can she sing!

With that out of the way, now we need parts. Some may already have them, but we are going from scratch. This thread assumes you have nothing, so we will start with the parts. The bulk of the cost will be determined in which DAC/transport you choose. Either way, a realistic minimum would be ~$100. This would include the Raspberry Pi unit, enclosure, wifi adapter, SD card, power supply, and DAC.

Here's a little parts list:

Power Supply – tablet charger, and not a cellphone charger
These make for great power supplies due to their nice and beefy 5V 2a output. The 5V 1a charger recommended for the Raspberry Pi isn't enough to power a USB DAC and a wifi dongle without a powered USB hub. My favorite is the HP Touchpad charger, which can generally be found for $10 to $15.

Raspberry Pi
These days, many online retailers carry them. If you prefer to purchase from a brick and mortar outlet, Microcenter also carries them.

SD Card
4GB or more, preferably Class 10.

Wifi dongle
The mini-sized dongles work perfectly. They don't protrude much, and can usually be found for less than $10. A quick eBay search of “raspberry pi wifi” will turn up what is needed.

Case
There are more case options than you can shake a stick at. Wood, plastic, metal, whatever. I'm more partial to heavy cases, because stiff cables will toss around a light case like a ragdoll. The case I chose is made of powdercoated steel, and has a very nice heft to it. That bad boy ain't goin' nowhere. No matter the material, a decent case will run ~$20. The cheaper ones are exactly that, cheap. The first case I bought was just small sheets of laser cut plastic, it rattled and creaked, something we are trying to avoid.

DAC
There are many units that work well with the Raspberry Pi. Some of the more popular choices are the M2Tech Hiface, Sabre-based DAC's such as the ODAC and HifimeDIY units, Schiit Modi, HRT Music Streamer II, and the Behringer UCA202. There are many options out there. If it supports Linux, chances are, it will work with the Raspberry Pi.

Now that you have a box of shiny new parts, grab yourself a copy of Raspbian Wheezy. Once it is finished downloading, unzip it, so you have a raspbian-wheezy.img file. Now, we need something to write the image to your SD card. Many here are Windows users, and the recommended software in the Windows realm is Win32 Disk Imager. Now that you have that downloaded, install it and proceed to load the raspbian-wheezy.img to the SD card. One thing I would like to stress, if you have any USB storage devices connected other than the SD card, disconnect them!. We do not want to accidentally write over your 1TB USB hard drive. Better safe than sorry. Once the image is written, remove it from your PC and insert it into your Raspberry Pi. Proceed to hook up your Raspberry Pi with a USB keyboard, wifi dongle, HDMI cable, and network cable, then power it on.

First thing, we need to expand the filesystem, so go to option 1 and hit enter. This will make the Raspbian operating system use the entire contents of the SD card.
raspi-config1_zpsab1e634f.png


Next we will want to change the user password, so head over to option 2.
raspi-config2_zps0be26a2c.png


Once you've chosen a password, hit option 3, Enable Boot to Desktop/Scratch and pick the first option, Console Text console, requiring login (default).
raspi-config3_zps442ab0ba.png


Now, we can move on to option 7, overclocking. 900MHz is no issue for the Raspberry Pi without a heatsink. I've been doing it awhile, and haven't had any stability issues.

After you get finished ramping up the speed, move on to option 8, Advanced Options. The first thing you want to do here is change the hostname, option A2. You may pick whatever you wish. It isn't necessary, but you do have the option. Once that's finished, hit option A3, Memory Split. Since we won't be using a GUI with Squeezelite, you can shrink it right down to 4MB. Next, we need remote access, so go to option A4 and enable SSH. Finally, hit the last one, A6, and update. Once it is updated, you will need to reboot it for all changes to take place. To perform a clean reboot, issue the command
Code:
sudo shutdown -hr now

Once rebooted, note the DHCP address assigned to the Raspberry Pi. We will need this for SSH access. Now that you have your Raspberry Pi's IP address, you need to download PuTTY, this give you remote command line to access your Raspberry Pi. Simply fire up PuTTY, punch in the IP address of the Raspberry Pi, enter a password, and you are in! Now, you may disconnect the keyboard and monitor, then attach your USB DAC/transport. From here on out, we will be working from a command line over SSH.

When you SSH into the Raspberry Pi, the username will be "pi", and the password whatever you chose earlier. Now that we are at a terminal, we need to remove any unnecessary software. We will need no desktop, no games, web browser, etc. Raspbian is a full-fledged desktop OS, and we are going to make it shed a lot of weight. This is a music player after all, so the bloat has to go.

First, we need to update the Raspberry Pi firmware. This firmware fixes issues with the USB bus, making for a better audio experience. It has fixed many peoples' issues with crackles and dropouts.
Code:
sudo BRANCH=next rpi-update

Now, we need to shed some weight. This is a long process due mostly to the very low power of the Raspberry Pi. It may take ½ hour or more, so you may step away for a bit while it's working. After this, all of the unnecessary software will be nothing but a dream.
Code:
sudo apt-get remove aspell desktop-base desktop-file-utils dictionaries-common dillo fonts-droid fonts-freefont-ttf fontconfig fontconfig-config galculator gnome-icon-theme gnome-themes-standard gpicview gsettings-desktop-schemas gsfonts gsfonts-x11 hicolor-icon-theme leafpad lightdm lightdm-gtk-greeter lxappearance lxde lxde-common lxde-core lxde-icon-theme lxmenu-data midori mime-support openbox omxplayer penguinspuzzle x11-common wpagui python3 python3-minimal python-pygame x11-common

Remove the python games.
Code:
sudo rm -rf python_games

Dump the rest of Python.
Code:
sudo apt-get remove `sudo dpkg --get-selections | grep -v "deinstall" | grep python | sed s/install//`

Let us remove the rest of the things we don't need.
Code:
sudo apt-get autoremove
sudo apt-get clean


Then we update.
Code:
sudo apt-get update
sudo apt-get upgrade


Now, we will enable wifi. First, you need to download wicd.
Code:
sudo apt-get install wicd-curses wicd-cli


To start wicd-curses, simply type it in the terminal.
Code:
wicd-curses


Now, you should be looking at a screen similar to this.
wicd1_zps2668091a.png



Here, wicd lists all of the available networks. Up and down arrows select the network, and right arrow takes you to the configuration menu seen here. You can use a dynamic IP and input your wifi password, or you can set a static IP. Static would be best, because then you will know your IP address for future maintenance and not have to worry about it changing.
wicd2_zps0c790e9d.png



Once the network settings are configured, highlight your network again, and press Shift + C. That will connect you to the wifi. Chances are, it will freeze your SSH terminal, but no worries. Simply refire PuTTY and have it connect to the IP you just assigned. You may now disconnect the LAN cable.

We also need to make the USB DAC the default audio device.
Code:
sudo nano /etc/modprobe.d/alsa-base.conf

We need to comment out the line that reads
Code:
options snd-usb-audio index=-2
and make it look like this.
Code:
#options snd-usb-audio index=-2
Note the #, this will tell the operating system to skip that line in the conf file, making your USB DAC the default audio device. Once the line is commented out, press Ctrl + O to write the changes, and Y to save.

Finally, we need to create our asound.conf file
Code:
sudo nano /etc/asound.conf

and add this. Once it is copied and pasted, press Ctrl + O to append, and Y to save, done!
Code:
pcm.!default {
type hw
card 0
}

ctl.!default {
type hw
card 0
}

Now that we have a lean and mean music playing machine, it needs to be able to play something. For that, we will use Squeezelite. Before we install Squeezelite, there is other software that needs to be installed. This puppy will play every audio file, but it needs the correct libraries installed first.
Code:
sudo apt-get install libasound2-dev libflac-dev libmad0-dev libvorbis-dev libfaad-dev libmpg123-dev ffmpeg
 
Last edited:
Once it's able to distinguish one file from another, we move on to Squeezelite. First, let's make a directory to put all of our Squeezelite stuff.
Code:
mkdir squeezelite
cd squeezelite


Now download Squeezelite.
Code:
wget http://squeezelite.googlecode.com/files/squeezelite-armv6hf


Move it to the usr directory, and make executable.
Code:
sudo mv squeezelite-armv6hf /usr/bin
cd /usr/bin
sudo chmod u+x squeezelite-armv6hf


When using a USB DAC, you need to tell Squeezelite to show available audio devices, since we do not want to use the Raspberry Pi's analog out.
Code:
squeezelite-armv6hf -l


Here is what I get.
squeezelite1_zps73e24981.png



Note the output device column. For my application, I chose “iec958:CARD=DAC,DEV=0”, since I want my audio to be sent through S/PDIF to my Benchmark DAC1. Choose whatever corresponds to your DAC/transport and write it down, we will need it later. It is case sensitive, so double check what you are writing.


Now, we need to make Squeezelite run as a daemon on startup. We need to download a startup script and edit it. first, we will navigate to the squeezelite folder we created earlier
Code:
cd ~/squeezelite
and download the Squeezelite startup script.
Code:
sudo wget http://www.gerrelt.nl/RaspberryPi/squeezelitehf.sh

After it’s downloaded, we need to rename and move it to the /etc/init.d folder
Code:
sudo mv squeezelitehf.sh /etc/init.d/squeezelite
and make it executable
Code:
cd /etc/init.d
sudo chmod u+x squeezelite
sudo update-rc.d squeezelite defaults

We are almost there, but we need to change a few things in the script we just added to init.d.
Code:
sudo nano /etc/init.d/squeezelite

The main parts we will want to edit are as follows. Remember that string of characters I said to write down earlier? Here, you will delete sysdefault:CARD=Set, leaving the quotation marks, and plug in what you wrote down earlier. This will tell Squeezelite to use your DAC/transport as the audio device.
Code:
# Set the soundcard
SL_SOUNDCARD="sysdefault:CARD=Set"

Next, we need to edit this line.
Code:
SL_NAME="Framboos"
Simply replace Framboos with whatever you want to call your Squeezelite device. I named mine Dungeon, since it resides in the basement.

Lastly, we need to enable the log file. Log files are very important in Linux, they tell us exactly whats wrong if things aren’t going right. Uncomment these lines:
Code:
#SL_LOGFILE=/var/log/squeezeslite.log
#SL_LOGLEVEL="all=debug"
so they look like this:
Code:
SL_LOGFILE=/var/log/squeezelite.log
SL_LOGLEVEL="all=debug"

Note the name of the log file, squeezeslite.log...rename it to squeezelite.log, just a typo from the creator of the script. Once everything is edited, press Ctrl + O to append and Y to save.

That’s it! Now we are finished. To start Squeezelite for the first time
Code:
sudo /etc/init.d/squeezelite start
Now, when you bring up your Logitech Media Server web interface, you should see your new Squeezelite machine, ready to play anything you throw at it. If you would prefer to control it from your Android or iOS device, there are many Squeezebox Remote apps available for both platforms. Being an Android user, I find the best app is Squeeze Commander, it does anything and everything. Any questions and contributions are welcome, as well as as steak dinners, lottery tickets, and cheap beer.

If your device doesn't show up, SSH into your Raspberry Pi, and type
Code:
cat /var/log/squeezelite.log
The log file will show what caused Squeezelite not to start. From there, it is easily diagnosed.

Enjoy your new Squeezelite!

Special thanks to Gerrelt on the Raspberry Pi forums, and mikelangeloz of Raspyfi, couldn’t have done it without you guys!
 
Last edited:
Awesome!!

Great write up on how to set up a RPi as a squeezebox with a non-bloated OS.

Many thanks!! :music:
 
Thanks for the kind words. I laid this guide out in a way that will make it easier for the uninitiated to have their Raspberry Pi up and running. You can copy/paste the commands above, and off you go! :yes:
 
Am I the only one that feels like a monkey sitting at a typewriter looking at this thread? I thought I knew about computers, having grown up with 8-bits like the BBC Micro, Commodore 64, and Sinclair ZX81/Spectrum. I taught myself 6502 assembly language with the Beeb, along with it's excellent Basic. I learnt Pascal and Fortran at college, and then went on to use Novell Netware, Lotus Notes, and various Windows products. I even used a bit of Unix to move files around, still do when uploading pictures to show here on AK.

But this thread makes me feel old and out of date. Can you show us the end result of what your have accomplished here? Shots of the screen you use to select music would be great, maybe even some shots of the Raspberry Pi? I thought this was a dessert at first, I started thinking about pastry...

Lee.
 
Here we go.

_MG_0202_zpsb9bb88a4.jpg


_MG_0197_zps0299c3e7.jpg


You will also need to install Logitech Media Server on the system in which your music collection resides. It can be controlled through a web browser, smartphone, or tablet with any of the Squeezebox remote apps available on the Apple App Store or Google Play.

LMS_zpsb946ec31.png


Both of my players as seen by LMS.
LMS2_zpsb623690f.png


EDIT: Here is what I use to control it, Squeeze Commander, available on Google Play.

4d4596d3-c449-49df-8afd-f5cb128d205d_zps6bd9aa6b.jpg
e34fe9fb-54a6-4ba3-abd0-3dff43c252db_zps51a29997.jpg


9845765c-6032-42bd-a8a1-8c461423529f_zpsa0bd9e69.jpg
f86f3685-a5fe-455e-9f08-6357a5cb540b_zps043c6854.jpg


255c535d-8c3a-43ad-8530-0a10181907ba_zpsfdf9a9dd.jpg
33f76a9e-a99e-4e9a-9b81-971ccdf7a614_zpscd161a47.jpg
 
Last edited:
Cool thread, should be a sticky.

That one with SPDIF interests me. I'm DAC-less at the moment. At least as far as a USB one goes. Digital out to my receiver, or a CD recorder works for me.

Just to get this straight, if I try one of these I won't need a monitor at all? I can "see" what I'm doing with an iphone or tablet?

Thanks!
 
Just to get this straight, if I try one of these I won't need a monitor at all? I can "see" what I'm doing with an iphone or tablet?

Thanks!

You would need a monitor for the initial setup. After that, it runs completely headless. Plug it in and play music :music:
 
Cool thread, should be a sticky.

That one with SPDIF interests me. I'm DAC-less at the moment. At least as far as a USB one goes. Digital out to my receiver, or a CD recorder works for me.

Just to get this straight, if I try one of these I won't need a monitor at all? I can "see" what I'm doing with an iphone or tablet?

Thanks!

+1, please sticky!
 
You would need a monitor for the initial setup. After that, it runs completely headless. Plug it in and play music :music:

Cool, I could swing that. No room for a monitor in my theater system, and I would hate firing up the projector just to use something like this. Getting it setup with a monitor and then being done is appealing.

I'm vowing to try and get on top of my computer/tablet/iphone issues this winter, and dipping my toes into streaming. One of these would compliment this I'm thinking.
 
Cool, I could swing that. No room for a monitor in my theater system, and I would hate firing up the projector just to use something like this. Getting it setup with a monitor and then being done is appealing.

I'm vowing to try and get on top of my computer/tablet/iphone issues this winter, and dipping my toes into streaming. One of these would compliment this I'm thinking.

If your computer monitor has a HDMI port, you are good. Even if its just a regular DVI port, you can get a HDMI to DVI adapter that will work just as good.
 
I'm vowing to try and get on top of my computer/tablet/iphone issues this winter, and dipping my toes into streaming. One of these would compliment this I'm thinking.

I'll do some screen shots of my phone or tablet later on so I can show you the interface used. Any of the Logitech Squeezebox remote apps on Google Play or the App Store will work with it :).
 
+1 on sticky-ness! I've been subscribed to the original R&D thread since the beginning, watching in anticipation. I will definitely be building one of these at some point down the pipe once I have a dedicated media server.

In fact the link to the new Carrier One looks like it might be adequately suited for the task of a network-only headless media server. Quad-core, PCIe or mSATA($diety, I feel old. I remember SCSI and IDE100), 10/100/1000, SPDIF, built-in WiFi-n. They mention an external DAC as optional via dedicated connector. It will be interesting to see if multiple options are available. I hope they decide to build it.
 
I almost forgot to add, this setup works great with subscription services, such as MOG and Spotify. Pandora works as well, but only paid subscriptions. As of right now, you cannot use a free Pandora account with this setup as you can on a standard Squeezebox device.
 
I will definitely be building one of these at some point down the pipe once I have a dedicated media server.

Vortexbox would be the perfect compliment to a Squeezelite device. You can rip music CDs, Bluray discs, and DVDs. It rips, converts to FLAC, mirrors to mp3, tags the files, and retrieves album art automatically. It makes for a fine media server appliance and includes Logitech Media Server for music serving duties. As a bonus, it runs well on lower powered hardware. My old Vortexbox unit was a dual-core Intel Atom setup with 2GB of RAM, worked very very good!
 
Last edited:
Back
Top Bottom