Thursday, 22 January 2015

Phase 2 - Cutting the cost of Raspberry Pi Multi-room Audio

Introduction

So, in the previous blog ( Phase 1 ) I set up a Raspberry Pi streaming audio player using piCoreAudio to play music streamed from Logitech Media Server on my Synology NAS - capable of delivering multi-room audio.

I cobbled the system together from stuff I had lying around, but now I want to start sourcing the component parts to build the entire player for £60 or less.

At the moment I am accepting the Raspberry Pi as an immovable cost (though will review that decision later) - the current model is the Raspberry Pi model B+ which costs £27.99. Ordered one from modmypi.com.

That leaves me with £32 to buy the DAC, amp and speakers capable of delivering decent HiFi sound - no mean feat.

The Digital to Analogue Converter (DAC)

As mentioned previously, the 3.5mm audio line-out jack on the Raspberry Pi is pretty ropey, so not worthy of feeding into an amp if you're interested in HiFi sound.

The HiFiBerry DAC in the existing setup did a great job, but cost about £27 (€29.99 + VAT) - too expensive for this penny-pinching project.

After some hunting around, I found the following listing on Ebay:


"PCM2704 USB DAC to S/PDIF Sound Card Decoder Board 3.5mm Analog Output" for £4.99, including delivery - all the way from Hong Kong. What could go wrong?

When it arrived (about three weeks after ordering it) I plugged the DAC into one of the USB ports on the newly acquired Raspberry Pi Model B+, the little (and very bright) blue LED burst into life.

After selecting the DAC and changing some settings in the piCorePlayer web interface (I'll explain all shortly), the quality of the audio output was on a par with the HiFiBerry DAC (to my untrained, non-audiophile ears).

To select the USB DAC and configure in the piCorePlayer settings, do the following:
  1. Log onto the web interface for the piCorePlayer
  2. Go to the "Squeezelite Settings" page
  3. Under the "Choose Audio Output" heading, select "USB Audio" from the dropdown list
  4. In the Output Settings field, paste in the following text: iec958:CARD=DAC,DEV=0 
  5. Press the "Submit" button at the bottom of the screen
  6. Go to the "Main Page" and hit the "Restart" button
This DAC has comfortably met my price/quality compromise combo - it's a keeper.

The Amplifier

After sweating Google for a while and speaking to friends, I started investigating Class T amplifiers based on a range of Tripath chips. There are a variety of manufacturers (mostly Chinese, I think) such as Lepai, Lvpin, Topping, Indeed HiFi, Muse, et al, building some really cheap, and pretty well respected mini amplifiers.

You can also buy amp boards based on the Tripath chips for less than £5, but I was nervous of going in too cheap (I know) - I needed something to act as a reference for any future, cheaper models.

After reading a whole load of reviews and the opinions of audiophiles/audiophools, I plumped for the dubiously named Indeed HiFi Lab TA2020s Mini Amplifier, listed on Ebay as:
"Indeed Hi Fi Lab Class T Amp TA2020 Mini Cute Amplifier 20WX2 Tripath Digital X"


This amp cost a whopping £29 including delivery - so far over budget, it's untrue. The seller promised it would be delivered in about three or four weeks - it turned up about three days after ordering it.

Pot luck or not, this amplifier is gorgeous; the build quality is superb. It has a lovely solid feel, and the sound quality is breathtaking.

The Speakers

I am not expecting (and I'm clearly not going to achieve for this budget) stadium filling sound, but I don't want that nasty gutless sound that you can get from really cheap speakers (though cheap is my new friend).

My intention is to have speakers that relatively discreetly blend into a room, rather than being a feature, so I started looking out for a pair of good quality bookshelf speakers.

The Wharfedale Diamond 9 speakers have become a bit of a legend, and deliver surprisingly good sound for very little money - I picked up a pair for £49.99 from Richer Sounds.



Although these immediately blew the budget, I wanted to use them as a benchmark against which I would measure any other, cheaper speakers.

On advice from a friend I looked at the Tibo EDGE MINIs - the reviews are too good to be true, and they cost an unbeatable £19.99, again from Richer Sounds. Yes, I went out and picked up a pair.


...they are brilliant - the build quality is fantastic and they sound incredible for the price - in fact they sound incredible for three times the price; they're not quite as good as the Wharfedales, but they're not that far adrift.

These Tibo EDGE MINIs are now the speakers of choice for the project.

Phase 2 Summary

So, to round up the pricing so far:

Raspberry Pi Model B+: £27.99
PCM2704 DAC: £4.99
Indeed HiFi Class T Amp: £29.00
Tibo EDGE MINI speakers: £19.99

TOTAL Spend: £81.97 (£21.97 over budget!)

I can only see an opportunity to squeeze cost out of the amp, and possibly the Raspberry Pi. Time for Phase 3...

Phase 1 - Raspberry Pi Multi-room Audio

Low Cost Multi-room Audio

Introduction

So, I wanted to setup a multi-room audio system at home to compete with Sonos, but on a tight budget.

The entry level Sonos device is the PLAY:1 which costs £169 for a very high quality mono solution. You can't argue with the quality, but you're looking at over £300 for stereo sound.

I want to put something together for £60 for a stereo solution with HiFi quality sound that can be repeated to create true multi-room audio throughout a house. Yes, I know!

I have a Synology NAS (the best technology investment ever) that I use for storing and serving all my media files (photos, videos and music):


...which I want to use as the source of the music (which would have been the case with a Sonos setup), as well as playing radio stations and other music streaming services, such as Spotify and Deezer.

It just so happens that the Sonology NAS devices come with a whole bag of really useful apps, including the brilliant (and free) Logitech Media Server (LMS) - formerly "SlimServer", "SqueezeCenter" and "Squeezebox Server".

I'm also just a little bit hooked on trying to use the RaspberryPi as a platform for all sorts of low-cost, low-power applications, so I'll be using a Raspberry Pi as the platform to create the client/player device on.

Step A - Set up LMS on the Synology NAS

You can run LMS on any Windows PC, Apple OS computer or Linux platform and immediately start streaming your music to software and hardware receivers (such as Logitech's Squeezebox devices), as well as other media players capable of playing MP3 streams.

For the sake of my project, I'm going to use LMS on my Synology NAS to do the job.

Setting up LMS on the Synology NAS is really easy.

  1. Logon to DSM (the web interface for the NAS)
  2. Click on "Package Centre"
  3. Select the "Multimedia" heading in the left hand navigation
  4. Click the "Install" button on the Logitech Media Server tile
  5. Once it has finished installing, click on Open to launch the web interface for LMS
There's not a lot more you can do until you've set up a device to receive the music stream from LMS.

You do need to have some music files in the "music" shared directory on the NAS.

Step B - Build a receiver for the LMS music streams

This is the bit that is going to take some tweaking and refining over time, so I've approached this in phases:

Phase 1

This isn't going to be the cheapest spec setup, because I'll be using kit lying around the house to get it going - I'll squeeze out the cost in later phases.

I am going to use a Raspberry Pi as the client/player, so need to find a decent Squeezebox client.

After about 10 seconds of Googling, I came across piCorePlayer - this looks perfect.

I have an old Audiolab 8000A amplifier:


...and a pair of B&W DM301 speakers:

...in the loft, so I'll dust them off and use them to test the output, once the Raspberry Pi has been configured as a piCorePlayer device.

For this initial setup I'm using a Raspberry Pi model B board that I've already got here - cost about £25 a year or so ago:

It turns out that the 3.5mm audio line-out jack (note: not a headphone jack, so don't expect to plug your headphones in) has shocking sound quality - sounds like someone's left a gas tap on while you're trying to listen to your music. This calls for a Digital to Analogue Converter (DAC). There are a couple of DAC's targeted at the Raspberry Pi that I stumbled across:
  1. HiFiBerry DAC
  2. IQaudIO Pi-DAC+ HAT
I plumped for the HiFiBerry DAC, it cost €29.90:


With the Raspberry Pi Model B version of the HiFiBerry DAC there is a little bit of soldering to do on the Pi board, but in the version for the Raspberry Pi Model B+ it just plugs straight on the GPIO connector.

After installing the DAC, the quality of audio from the Raspberry Pi is fantastic.

Step C - Install 

So, first to set up the Raspberry Pi as a piCorePlayer device:

  1. Download a copy of the piCorePlayer software here
  2. Burn the image to an SD Card using Win 32 Disk Imager for Win PC, or ApplePi-Baker for Mac
  3. Insert the SD Card into your Raspberry Pi
  4. Connect the Raspberry Pi to your network
  5. Apply power to the Raspberry Pi using a 5v micro USB power supply
To make any configuration/settings changes to piCorePlayer, log onto the web interface for the device:
  1. Identify the IP address of the Raspberry Pi (check your router to find it, or use a free app for scanning your LAN for devices - I use LanScan for the Mac)
  2. Using a web browser, enter the IP address identified in step 1, e.g. http://192.168.0.8
  3. If you are using a DAC, then, as a minimum you will need to select it as the Audio Output in the Squeezelite Settings page (otherwise you won't hear any music!).
  4. You might like to rename the piCorePlayer to be something more meaningful, such as "Living Room"
  5. After making any changes, then hit the Restart button on the "Main Page"
I then connected the RCA output from the HiFiBerry DAC to the amp, and the amp to the speakers.

Step D - Now to Test That it Works


You can control the music being streamed to the piCorePlayer via the LMS web interface (see below), or one of the many free and paid apps for Android and iOS devices - I use iPeng8 for iPhone and iPad, which costs about £5, but works really well.

When installed on a Synology NAS, the IP address for the LMS web interface is the same as the NAS, but uses port 9002, so in my case http://192.168.0.250:9002

As soon as you login, you will be able to select your piCorePlayer and choose some music to start streaming to it. That's it.

Now to work on stripping out the cost from the solution...