Raspberry Airplay

A Raspberry Pi 3 with a decent quality Digital-to-Analog Converter makes a surprisingly good stereo component for streaming music.

My next Raspberry Pi project was to stream music to my stereo system. Since I’m all Apple at home, I decided I need something that uses Apple’s Airplay and the Raspberry Pi seemed the natural choice.

After some research, I learned (unsurprisingly) that the earphone jack on the RPi would be insufficient. It just doesn’t have a high enough bit rate DAC (Digital/Analog Converter) driving it. The first option I explored was to use an external USB DAC. There are some fine ones but they are expensive and bulky. I have to admit though, some of the tube-based DACs look pretty good and I’m sure the sound is impressive but they are cost prohibitive. What to do?

I found HifiBerry. They have a few choices of DACs that plug right into the GPIO (general purpose I/O) port on the Pi. They also sell cases that hold the Pi and DAC very nicely. I found the HifiBerry DAC I wanted on Amazon, added the case and Pi 3 B to my cart but found that ordering a bundle straight from HifiBerry was about $20 cheaper. I already owned a spare MicroSD card an power cord so the project cost me around $100.

I decided on the DAC+ Standard. I didn’t need the DAC+ Pro with its gold plated RCA connectors because I don’t think they make a difference. But some real audiophiles will disagree.

Ordering a bundle from HifiBerry was a bit confusing. What comes with the bundles and what do I need to add? Turns out you need to pick your package and customize everything. For me, I selected the DAC+ Bundle and added the DAC+ Standard, the HifiBerry Universal case, and the Raspberry Pi 3B. If you need a power supply you might find one cheaper elsewhere. If you don’t have an adapter to plug the SD card into your computer, you will need one and HifiBerry’s seems a reasonable price.

If you buy from HifiBerry, the order ships from Switzerland so expect some delay. Shipping information from Switzerland to JFK was provided but once it hit JFK, shipping info disappeared. Since I didn’t get a notification that it was stuck in customs I decided to wait. Ten days later it showed up via USPS. So if time is important, you might pay more and get it from Amazon.

Instructions below the fold…

You need to assemble your kit. I did it two or three times because I did it backwards. You want to put the nylon screws in the bottom of the Pi facing up and then screw on the risers so their threaded ends are pointing up (see photo to the right, click to enlarge). Now drop the DAC over them and onto the GPIO and put on the bolts (photo below). If you do it the other way round, the Pi won’t sit in the case.

Slide the Pi into the case and snap it in. It is more snug than you’d imagine.

Hifiberry link to a Max2Play image for the SD card. What it is is Max2Play’s baked version of Raspian with their software pre-installed. If you’ve installed Raspian from NOOBS in the past, this is going to look different.

If you don’t already have it installed, I really recommend installing ApplePi-Baker on your Mac. This puts all of the tools you’ll need to get the SD card set up. 1For Windows users, these tools are mostly native to your operating system. Instructions here.

  1. Download the HifiBerry image from Max2Play. This will take a few minutes so you can do the rest of the steps while you’re waiting.
  2. Plug the SD card into a reader and plug that into a USB slot and launch ApplePi-Baker.
  3. Select the right card from the Pi-Crust section.
  4. Use Prep for NOOBS from Pi-Ingredients. This merely formats the SD card. It doesn’t install NOOBS.
  5. Once the Max2Play image has finished downloading, unzip it.
  6. In Pi-Ingredients, click Restore Backup and navigate to the image file you unzipped and select it. This will take a while to copy the image.

The SD card is now ready to go. Slide the SD card in and you’re almost ready to power it up. DON’T power it up yet. You’ll need a keyboard, mouse, and monitor with an HDMI port. I used my TV.

If you’re using a RPi 3 it has WiFi built in and we’ll need to get that connected. This part is different than with Raspbian and the instructions were buried in the Max2Play website documentation.

Before you boot the Pi, hit the WPA button on your router. Now boot the Pi and it should connect to WiFi itself.

If that worked, you can skip this part.

I’m not positive how this looks from a clean install because I tried to enable WiFi from the command line. Hopefully, you won’t need to but here’s what I did first to try to connect WiFi. The following didn’t work till I used WPA but I did this first:

  1. On the Pi, open a terminal window.
  2. sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
  3. Go to the bottom of the file and add the following, obviously, insert your network SSID and password:
network={
 ssid="Your_SSID"
 psk="Your_wifi_password"
}
  1. Ctrl O to write the file and Ctrl X to quit nano.

  2. Reboot the RPi.

One way or another, you should be connected to Wifi at this point.

The directions on both the HifiBerry and the Max2Play site say that you can open a browser on a computer on the same network and navigate to http://max2play/ and you’ll get the webpage interface for the Pi. I have never been able to do that. It keeps navigating me to the Max2Play website. I had to navigate to the IP address of the Raspberry Pi in a web browser and then I got the interface.

After this, the instructions here mostly work. One heads up though, the web interface on the Raspberry Pi will say that it isn’t activated. What that means is that you haven’t purchased a license for Max2Play’s premium features. If you don’t want to use them, you’re fine.

Once that was all finished, I plugged it into the aux port on my stereo and cranked it. The sound quality is excellent. Airplay, however, can be a bit finicky on the Macbook. I’ve been looking around for fixes and the best answer is to turn off Bluetooth while you’re using it. I haven’t had any problems with it on the iPhone yet.

Update 5/25/2018
I’ve added another RPi music system for my backyard. This may be a pathology. Anyway, I love the functionality of Max2Play but the interface leaves something to be desired. Especially since I added a USB drive with a bunch of music on it to my first Pi. To use it with Max2Play, you have to set up the Logitech SqueezeBox player which has a HORRIBLE and practically unusable on a mobile device.

So I thought I’d give JustBoom a try. The important things I was looking for was AirPlay capability and a nice interface. Got it in spades. Also, setup is dead easy, just follow the instructions on line.

As a plus, instead of that horrible Logitech SqueezeBox interface, JustBoom scanned my drive and is much easier to navigate. Once I set up a samba share for that drive, I now have my other RPi reading that same drive. The oh my gosh I can’t believe it moment for me came when I was messing around in JustBoom player’s plugins. There is a Radio Paradise plug in. I swoon. Radio Paradise is the station I listen to most often. Even more than my Apple Music or Amazon Prime Music accounts. I used to have to stream it from my iPhone via AirPlay and that eats up battery. Now I can just have my AirPlay speakers play it for me.

Okay, not all good news but the bad news is very minor. I would love to have an equalizer for my outdoor RPi because I’d like to punch up the bass on those speakers. So far, I haven’t been able to get the equalizer plugin to work. Not a deal breaker but bummer.

And just to prove that this is becoming a pathology, I have a set of Realistic bookshelf speakers that I want to get set up in my office. I’m planning on using a RPi Zero and the JustBoom Amp Zero pHAT for the Raspberry Pi Zero to drive them. Now, I have to come up with some money…
End of Update

1 For Windows users, these tools are mostly native to your operating system. Instructions here.
Print This Post Print This Post

Be the first to leave a comment. Don’t be shy.

Join the Discussion

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>