How to stream Apple Music to a Raspberry Pi

With the recent release of Apple Music I wanted to play music through some speakers in my home that had a bit more oomph than my laptop. Unfortunately I don’t have a hi-fi system or any speakers, just an Xbox One and the TV, I do however have a spare Raspberry Pi.

Kodi (née XBMC) supports Apple’s AirPlay protocol out of the box so I just needed to get it running on the Raspberry Pi, which was a little more fiddly than I expected. I tried flashing an SD card with the images provided on the Raspberry Pi Foundation’s website, but none of them worked – this was probably more due to the very old laptop I was using to flash the card – in the end I found a much simpler solution which doesn’t require using the command line or flashing SD cards.

Instead you can use the NOOBS Lite GUI installer to setup OpenELEC on the Pi, which is an version of Kodi optimised to run on low power devices such as the Raspberry Pi.

For this method you will need: A blank SD card, a Raspberry Pi with an Ethernet port, an Ethernet cable, a HDMI cable and a USB keyboard or mouse. Note that for the initial setup you will need the Ethernet cable for a wired internet connection, after setup you can switch to WiFi.

  1. Download NOOBS Lite.
  2. Connect the SD card to your computer.
  3. Unzip the files and copy them across to the SD card.
  4. Disconnect the SD card from your computer and insert it into the Raspberry Pi.
  5. Connect the Ethernet, HDMI, USB keyboard/mouse and power supply to the Raspberry Pi.
  6. The Raspberry Pi should boot up and display a list of operating systems to install.
  7. Select ‘OpenELEC’ from the list and click ‘Install’ or press I if you only have a keyboard.
  8. Once the latest version of OpenELEC has been downloaded and installed you are almost ready to go, the Pi should automatically restart and launch Kodi.
  9. Navigate to System > Settings > Services > AirPlay, and make sure the option ‘Allow Kodi to receive AirPlay content’ has been checked.
  10. If you have a USB WiFi adapter you can now connect it to your network by going to System > OpenELEC > Connections, then select your network from the list and enter the password.

After that’s all setup you should see Kodi appear in the AirPlay list on your Mac or iOS device and you can stream everything to your Raspberry Pi. As you are using AirPlay the Pi can also receive video and images from your devices simultaneously. I was able to stream music from my iPhone whilst I browsed photos from my iPad connected at the same time, pretty nifty!

Whilst this is all a bit more fiddly than just getting an Apple TV box, it’s a lot cheaper – you can pick up a Model B+ for around £16.

→ Dreams of neural networks

Google fed their image recognition neural network images and instructed them to enhance whatever objects were recognised in the picture, resulting in some pretty weird stuff. Then they just started just inputting random noise and feeding the result back into the system over and over, ending up with some really interesting images.

Site merge and refresh

Just a quick note to let everyone know that I’ve merged my blog from nmecdesign.com to here at jwarren.co.uk. The blog archives for each are all still available and everything should redirect to the new domain, including the RSS feed.

The site has also been freshened up with a new theme, it’s quite pared back at the moment but I plan to add a few more things in the future. You’ll also notice that the site is served completely over SSL now, the site to runs through CloudFlare, which provides a number of cool things, including SSL, SPDY and IPv6 support.

Please let me know if you find anything broken – there may be a few old links that still need updating.

‘Flight rules’

I recently came across the concept of Flight rules which is summarised thus:

Flight Rules are the hard-earned body of knowledge recorded in manuals that list, step-by-step, what to do if X occurs, and why. Essentially, they are extremely detailed, scenario-specific standard operating procedures. […]

NASA has been capturing our missteps, disasters and solutions since the early 1960s, when Mercury-era ground teams first started gathering “lessons learned” into a compendium that now lists thousands of problematic situations, from engine failure to busted hatch handles to computer glitches, and their solutions.

An Astronaut’s Guide to Life – Chris Hadfield

Which brought me to a 1974 report from the Apollo program containing this little nugget:

Throughout the Apollo Program, approximately 80 percent of all problems encountered in flight, both large and small, had been analyzed previously and a course of action documented before the flight. This analysis allowed the choice of a best course of action subsequent to most failures to be essentially automatic.

Apollo Experience Report: The role of Flight Mission Rules in mission preparation and conduct – Larry W. Keyser

Well worth a read.