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.


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.


  1. I would ideally have liked to send you a quick email or mention you on Twitter, but I couldn't find any details, so I'm posting a comment.

    Thanks for writing this website: it's incredibly helpful. I'm currently using a new Airport Express with a digital optical cable to send audio into my DAC.

    I wanted to ask you what modifications you made to your Airport Express and why you made them. I will only ever be playing 16/44.1 files, so the limitations of the Airport are fine for me.

    One more question: Is there any benefit using a conditioned power supply for the DAC/amp/Airport Express? If so, would this one be good value / a good buy?

    Thanks again for writing such an awesome site, and thanks in advance for helping me out!

    1. Hi Chris,

      Thanks for your comments.

      My AAE modification includes:

      1. Rebuild the Power Supply. I tore down the AAE, removed the original power supply, and built another 3.3V linear power supply to power it up.

      2. SPD/IF and I2S output: The SPD/IF on AAE was driven by a TTL signal. Also, near the DAC chip, I can find the I2S signal. I built a driver circuit to drive the SPD/IF and the I2S signals, and send them to my DAC for further processing. And compare the difference between them. The smaller of the difference, which means the less jitter and noise being introduced to the SPD/IF. And at this stage, which possibly means we have achieved the best the AAE can do. If you want something better, then we might need to look into another architecture. That's why I'm currently testing the RPi + Async USB solution.

      Regarding your question about if a power cord will help? IMHO, I don't think that will help a lot, since the bottle neck might be the factory power support of AAE. It is a switched power source,
      and the performance is not as good as a simple DIY linear power supply. That's why most of the AAE modification starts from the power supply. If you can build a decent power supply, and filtered power cord might help, if the AC power source is dirty, since it will help to filter the noises source from the AC.

      For HiRES, well, I'm not a HiRES fans. Most of my media files are in 16/44.1kHz, and what I need to do is to play them in an optimized environment.

      For HiFi, I do have a tiny suggestion, spend 50% of your money on the speakers, get a good pair of speaker is extremely important. And then a decent amp, low distortion and low noise. Without them, you are not able to replay the audio, no matter how much efforts you spent in the source side like AAE or so. Put it simple, a 10000 USD CD player will only help while being played with a 10000 USD pair of speakers. And for sure, please remember, price tag is NOT always represents the quality. My 2 cents.

    2. Thanks for the reply!

      I honestly don't think that replacing the power supply will be worth the effort, time and expense. It seems as if the airport express delivers bit perfect audio, so long as the source is 16/44.1. All my music is.

      So I'll just be using a stock one. Appreciate the reply, though. Thanks again.

    3. Oh, also, I get the DT reference in your username. I'm a huge fan myself, have seen them live 5 times. :D

    4. Hi Chris,

      Exactly, I took the ID from DT, since I'm a progressive rock fan. :)

      Regarding the AAE power replacement, yes, unless you "open" the AAE, replace its own power module with a decent DIY one, you won't get much benefit. And most of my music are in 16/44.1 as well. My experience tells me, if we did "get everything right" for the system, 16/44.1 is pleasant enough.

      BTW, in DIY world, honestly, it is NEVER cost-effective. :)