I recently had to retire my Squeezebox Classic (v3) that was rebooting consistently after playing a couple of tracks. I needed a network player solution and as I searched for options came across solutions built on the Raspberry Pi. I am up for some DIY and it seemed like a fun project.
I set up my Pi this past week and I thought I would share my experience. My intent is not to promote myself as the authority on this topic, but in my trials I found numerous forum posts and websites as resources. I thought it would be helpful to compile my findings into a single place to help other vagabonds on this generally geeky journey to digital audio bliss.
I’m new to the Raspberry Pi, but not new to computers. I have a general working knowledge of Linux (Ubuntu), which means I sort of know where some things are, and what they do. However, I don’t have deep knowledge of what each option, flag, or tool does.
In my research I discovered Raspyfi and explored enough of the situation to believe it would work. I read extensively about the USB problems (pops and skips) that occurred up through May 2013 when that pesky USB bug was fixed. It seemed clear that after that date folks were fairly happy with Raspyfi audio quality. It was a go.
Obviously when visiting Raspyfi you will see the pop-up for the volumio project. I figured it was the way to go considering it is the future of the platform. I assume volumio is taking things learned from Raspyfi and evolving it in a good direction.
As I haven’t used or tested Raspyfi I can’t speak to its capabilities or lack there-of. My efforts have been to get volumio going.
Raspberry Pi, Model B
CY Raspberry Pi Case (blue)
EDIMAX EW7811Un - USB Wifi
USB Power supply (5V, 1500mA)
Rotel RA-1570 Integrated Amplifier w/ USB 2.0 DAC
- General consensus is to use external power, don’t use USB bus power for something like this.
- Wifi: I don’t have ethernet cable running to my stereo area, so wifi was the ideal. While researching the USB issue (fixed May 2013, see mention above) there was info that the ground on the Ethernet port is connected to the ground of the Pi’s internal USB hub. This could cause interference, or potentially skipping/pops/crackling noise to your USB DAC. Wifi seemed to eliminate this issue where mentioned. (Sorry, no refs, just synthesizing my findings.) I needed Wifi anyway, and it seemed to eliminate a class of problems Ethernet was causing.
- Model B: This was the latest device available. I wanted the RAM in the event I wanted to use the Pi for something else, should the network player project not work.
- The case - it was the best looking case I found (that wasn’t expensive), and general reviews were that the Pi fit nicely and it was well built. The external lights are great for seeing activity. The case won’t work for me if I decide to add an external device like the HifiBerry Digi or other device. I’ll deal with that issue if I go that direction.
- HifiBerry Digi - I would like to explore SPDIF/digital connectivity vs. USB. I was definitely interested in the digi as an alternative to USB in the event I have pops/skipping/etc. due to USB issues on the Pi. (Fortunately, I don’t). So far, I like the quality of the sound coming out of the Pi via USB, but the digi may just be something I try for fun.
Software & Configuration
- volumio (1.1Beta, 12/24/2013) via torrent (much faster than straight d/l).
- Followed steps under OSX to image my SD card.
- Used straight volumio image (haven’t added any external packages, etc.)
- I don’t have HDMI capability. I considered an HDMI->DVI adapter, but saved the few dollars by assuming I could figure this out headless via SSH.
- I followed volumio instructions (plug in all devices such as wifi and DAC, then do initial boot).
- I also connected ethernet cable. This is because my wifi is secured with WPA2 and I obviously knew the Pi would not auto-discover that.
- Once boot-up, I visited the volumio web interface. Looks nice, awesome!
- I went to Network where wlan was showing not connected. I configured the wireless settings, to no avail. I put in my SSID, etc., rebooted, and no wifi.
The Unbroadcasted/Private SSID Situation & How The EDIMAX Hates 5Ghz
I wasn’t sure why the wifi didn’t work. It was actually quite baffling. That stupid blue-light on the EDIMAX ignorantly blinked at me with its searching pattern. Like Pink Floyd asking if anybody is out there. With no response. This is 2014, wifi has evolved, and even skipped letters of the alphabet - A, B, G, N! Come on!
I finally came across information that states the Raspberry Pi doesn’t like connecting to unbroadcasted SSID/wifi networks. Ad nauseum comments about how hiding your SSID doesn’t really make anything more or less secure. The simple fix: broadcast your SSID.
Also, the EDIMAX won’t work with 5Ghz spectrum. Make sure you are connecting to your 2.4Ghz network. If you’re like me and you have an Airport Extreme I just made sure that my channels were on “Auto” and the full set of a/b/g/n options were enabled. I did have an explicit channel set on my 2.4Ghz network due to interference but it seemed to finally work only when channel was “Auto”.
Here’s how to connect your Pi to an unbroadcasted 2.4Ghz, Auto-Channel SSID. (see blog post linked below these steps. I am summarizing steps from the blog post here.)
WPA Supplicant seemed to be installed based on other things I read, so I didn’t bother installing that, contrary to the blog instructions.
Generate the WPA2 pass hash, because ultimately you need to tell your “interfaces” file about your wifi network.
$ wpa_passphrase “” “”
Replace the text between the < > brackets with your info. I used double-quotes even though I didn’t have whitespace in my names. There are comments that if you have symbol characters in your passphrase, that could be a problem, YMMV.
A generated code will show on your screen, be ready to copy/paste it in a second.
- Edit your “interfaces” file and tell it about your Wifi setup.
$ sudo nano /etc/network/interfaces
Here are the contents of my file:
iface lo inet loopback
iface wlan0 inet dhcp
wpa-proto RSN WPA
wpa-pairwise CCMP TKIP
wpa-group CCMP TKIP
I believe the double-quotes are needed here!
iface eth0 inet dhcp
end of the file
Save the changes.
$ sudo shutdown
Once the Pi is down, unplug the Ethernet cable, and restart the device.
Your Pi should now join your Wifi network.
The default host name is “volumio”. But, if you have an Airport Extreme, your LAN DNS behaves a bit funny. All names are suffxed with “.local”, so you’ll actually want to talk to volumio via volumio.local
You should now be able to access the volumio web app where you can begin the setup as found on the volumio site and forums.
How to setup a Raspberry Pi with a hidden network using a Edimax EW-7811Un - Palmtree Initiative Blog
dafinga.net/2013/01/how-to-s … idden.html
Setting up NFS mounts to a Synology NAS
First, I’m no super expert on NFS, so I can tell you what my setup is, but if it doesn’t work you’ll likely need to Google for assistance. I cobbled this together from the depths of the Googles.
Not to say it may not work “out of the box” per se, but I reviewed various NFS settings/options via Synology forums, etc. and so on.
NFS on the Synology
All my music is presented through a share called “Music” on the Synology. I decided to create a single NAS mount (in volumio) to my “Music” root. This is in lieu of setting up named mounts for sub-folders off my main share, which it appears volumio lets you do. It’s up to you. It doesn’t appear to help MPD out any if you have a large library, as it indexes everything in a single file - not per mount.
First, configure your Synology to share the Music folder for NFS. I already used NFS for my OSX workstation to connect to my Synology but I decided I wanted to create a brand new user for volumio just to keep things organized.
I do not use NFS 4, so I don’t have that checked on my Synology, but you’ll need to make sure the NFS service is enabled.
- Enable NFS service.
- Create a new user in DSM for volumio, I just called it “volumio”.
- Give it a password. Check the box so that the user can’t change it.
- Give it Read/Write to the “Music” share.
- On “Applications” tab I didn’t give it any app rights.
- Go to “Shares” in Control Panel, select “Music”, right-click, select “Privileges” and select “NFS Privileges”.
- Create an entry:
- Hostname/IP: volumio (or volumio.local for Airport wifi people)
- You can also put in your whole network if you’re down with that.
- such as: 192.168.1.0/24
- This will allow all hosts on the 192.168.1.* network to use NFS (as long as they have user account access. This is a network level constraint if you want to limit the hosts that can connect.)
- Privilege: Read/Write
- Root Squash: Map to guest
- Enable: Asynchronous
Now that NFS is setup on the Synology/NAS, let’s connect from volumio as a client.
Mount the NAS from volumio
- Open the “Library” page in volumio.
- Under “NAS Mounts” section click “Add New Mount”
- Configure a new network mount.
- Source name: Music (give your mount a name)
- Fileshare/protocol: select “NFS” from the picklist
- IP address: Enter the IP/name of your Synology/NAS.
- Remote Directory: volume1/Music
- remember on the Synology this is a full path rather than a relative path as you’re typically used to for an SMB/AFP share. i.e. nfs://mySynology/volume1/Music (you don’t typically have to mess with the “volume1” junk)
- It’s case sensitive.
- Username: volumio (or whatever you setup on your synology/nas)
- Password: ***
- click “Show Advanced Options”
- Charset: UTF8 (default)
- Rsize: 32768
- This is the max-size for NFS 3 protocol.
- Wsize: 16384
- volumio will never write, but I gave it some buffer. I set this “proactively” to avoid issues out of the box. This could probably be dialed back without a problem. Especially because of what we’ll specify next.
- Mount flags: nfsvers=3,ro,noatime,intr
- nfsvers=3 - This explicitly tells us we’re going to talk V3
- ro - Read-only. This is why wsize likely has no effect. volumio/MPD will have no rights to write data to your NAS, only read data.
- noatime - Don’t update “Last Access” timestamp when accessing files. I guess I don’t know if this matters with “ro”, but saw it on forum/blog talking about NFS performance. This keeps your storage from having to update stuff as MPD scans/browse, etc.
- intr - Allows the NFS client to be interrupted in the event the storage server is going down. I have this in OSX and I saw it on various forums/blogs, so it must make sense. I don’t know what behavior would result if you took this out.
- Save your mount.
Ok, be prepared for what’s next. volumio will tell MPD to start scanning the mount you setup. MPD will start chewing on your files and building out the tag index that will become your track database.
It will take a long time if your collection is large. I don’t know what constitutes “large”, but for reference, my collection of ~22,800 songs, I let index overnight. I haven’t dug into determining actual index time.
My mistake: I thought it was done at one point and tried to start doing stuff and I think I screwed MPD up. This resulted in me rebooting and forcing an update of the mount in volumio. MPD seems to get stuck on some files and will chew on them a long time, or retry them, or whatever. The best bet is to monitor the log file for MPD or the tag index and then you’ll know its really done (if you see no data is being written to them). If you have a small collection, this probably doesn’t matter as much.
/var/lib/mpd/tag_cache - This is the file that holds the index of all your music for MPD. When this file stops growing, it’s done.
/var/log/mpd/mpd.log - This records what MPD is doing, and as it builds the DB it will tell you all about it here. It will also tell you if it has problems here as well.
Once MPD is done scanning:
You should now be able to browse your collection from within volumio, and play it!
I don’t believe my experience to be utterly, horribly bad. It seems par for the course with a couple of gotchas that I had to maneuver around.
Overall, I highly enjoy volumio and it’s already provided hours of listening enjoyment to myself and my family.
The audio quality is fantastic. I’ve played poor quality MP3’s all the way to studio-quality 24/48 FLAC.
I notice a pop sometimes when switching tracks, but I rarely have pops/noise during actual playback. This only occurred during the initial build of the MPD database, and I was anxious to listen, so I started listening to indexed music. I experienced some slight glitchy/pops every now and then. Once the heavy network scanning was done, I haven’t noticed pop/cracks/drops.
Every now and then I may experience a light degradation, like dropping bits, but it’s like once an hour, during straight listening. It likely has to do with Pi deciding it needs to do something in the background and steals some resources. I don’t know. It’s certainly not a show-stopper.
The Wifi works well. I haven’t noticed any issues once it was online. I don’t notice my overall wifi suffering while streaming. My old Squeezebox Classic was wifi as well and I never experienced network issues on my wifi while playing music.
The volumio web interface seems to work. It’s design is clean and simple. I hope it’s just the start of more to come. It’s simplicity is welcoming, but of course once you start using it in-depth there are various features that come to mind. I’ve made a couple requests via the forums and I’d suggest you do the same.
The overall experience with getting volumio going is pretty slick and streamlined. Most of the issues I experienced weren’t volumio directly.
Restarting MPD from the web interface doesn’t work (correctly). It all “looks” like its working, but the web interface becomes unresponsive while it waits for MPD to restart. MPD never ultimately restarts correctly for me. Not sure why. My resolution is, after making a config change, reboot entire device. The management of MPD by volumio seems to need some work or tweaking.
Powering off my DAC causes MPD/volumio to lose track of the DAC. The Pi appears to pick up the USB DAC coming back online, but MPD/volumio doesn’t recalibrate and see it. As just mentioned, forcing an MPD restart from web doesn’t fix. Full reboot required.
- Post in the volumio help forum here that discusses this issue: how-can-turning-dac-off-without-rebooting-volumio-t692.html
Airplay works via Shairport, however, as noted here (shairport-and-mpd-won-get-along-t332.html) there is trouble once you’re done with Airplay. It’s almost like the Shairport scenario is like the powering-off of my DAC scenario - MPD just loses itself. So I can Airplay, but I can’t go back to direct NAS->volumio playback without rebooting.
Backups: As I’m new to the Pi and it all lives on the SD card, I haven’t thought through what I should do with backups. In the event I ever had to re-image the card it’d be nice to have a back-up of common settings, the tag_cache from MPD, etc. to avoid the full re-scan of the NAS mount, etc.
I’d like to consider a HifiBerry Digi and see if SPDIF into my Rotel enhances the audio quality at all, and/or reduces any potential pops, data-loss, etc. that the USB may be incurring. (as I mentioned, very occasional pops/bit loss)
Web interface/usability improvements: saving playlists, adding search results to playlist, cover-art on display in volumio app
Raspyfi - Might it be worth imaging a different card with Raspyfi and giving it a try? Is volumio still a bit too new? Is Raspyfi more tried and true? What would I give up going to Raspyfi?
I hope this recounting of my Raspberry Pi/volumio experience is helpful to others. The knowledge about all this is spread across forums and blogs, of which the usability/searchability is often poor. This single article will hopefully assist you in some way or another.
Hopefully, you’re sitting back and enjoying your music collection at this point.