Sunday, December 23, 2012

AirTunes with Raspberry Pi

Computer Audio System

I'm always interested in the computer based HiFi audio solution, the only reason is that I'm a lazy guy. I'll prefer to store all my audio files on a NAS instead of building a huge CD shelf, save the time from swapping CDs from the CD player, and enjoy the music on the sofa.

One of the solution is to set up a dedicate PC or Mac, connect it to a DAC with USB input. With this kind of approach, you might need to rebuild the power supply system for the PC/Mac, such as a linear power supply, since the factory power of a PC/Mac is usually switching based. The problem is, to provide sufficient power to the PC/Mac from a linear power supply, you'll need a large transformer, regulator block and maybe a pool of capacitors or some decent designs on noise filtering. Except for the power, since USB is usually the output of audio (digital), you'll then need to spend some time to make or find a decent USB DAC for your CAS system. 

Or you can do something similar to me, by modifying an Apple Airport Express, power it up with a relatively smaller power supply, connect the AAE SPDIF output to a DAC, and enjoy the AirTunes (AirPlay with music only) feature on iTunes.

Asynchronous USB Sound Card

Most of the CAS fans are looking for the Async USB Sound Card solution, so that they can send the audio data to the Async USB Sound Card device, and the processor on the Async USB device will regenerate the clock on board independently from the clock generate from the source PC/Mac.

PureAudio DDC 192 is one example of such kind of solution. Its design is based on the XMOS chip, following the USB Audio Class 2.0, which is supported natively on Mac OSX and Linux today. (For Windows, you will need to install the drivers)

By connecting the PC/Mac to the Async USB Sound Card device, we are good to go.

Raspberry Pi

However, I really don't like the overkill solution for using a PC/Mac as the CAS solution. So I stayed with the AAE solution for awhile. But there's a problem for the AAE solution, I always have some concerns regarding the WiFi - Radio Frequency (Although I kept it off in the AAE setting), since it may possibly introduce more noises to the AAE. Now, there might be a potential solution for me -  Raspberry Pi .

RPi is a cheap educational embedded Linux solution at cost less than 26 pounds. It has built-in Ethernet  port, open source Linux support, low power consumption. Such architecture is very similar the AAE, but RPi's WiFi interface is  "optional".

RPi is powered by a 5V/700 mA DC power supply, and for an audiophile, to build a decent power supply for it shouldn't be a difficult problem. and the good thing is, I can modify anything I want on the Linux OS.


AirTunes/AirPlay

The other good news is: since RPi is based on Linux, which means I can compile the "Shairport" (An open source AirTunes implementation ) on it, so that I don't have to move from my existing iTunes audio database to another solution.
 
My plan is to connect the RPi to the Async USB Sound Card, send the audio stream from iTunes to RPi via Shairport, and redirect the audio output from Shairport to the Async USB Audio, and then to my DAC.

After a few trial & error, I found that it is quite easy. And I can successfully "airplay" the music from my iTunes to it.



AAE vs. Raspberry Pi + Async USB

I had a simple listening comparison, even with just a switching power supply, RPi + Async USB solution has slightly better low end (I believe that is contributed by PureAudio DDC 192) and very similar resolution than my current AAE solution (with modified linear power and digital signal processing). Although the difference is small, but note that I haven't touched anything on the power for RPi.

I think the RPi will be a neat and potential solution for me as a replacement for AAE. The next step will be power the RPi up by a linear power supply, and see how much difference can I get.