Building a ‘high-end’ USB audio DAC

As [Jan-Erik] had already built a simple USB connected Digital-to-Analog Converter (DAC), he decided to make the high-end version of it.

The prototype you see in the picture above is based on:

  • the PCM2707C from Texas Instruments which takes care of the USB communication and outputs I2S audio data
  • the PCM1794A, a 132dB SNR 24-bit 192kHz DAC which receives I2S protocol
  • the OPA4134, a high performance audio operational amplifier

The on-board +3.3V and -5V voltages are generated by inductor-less power supplies. As [Jan-Erik] mentions in his write-up, the ‘high-end’ was put between single quotes because the PCB is single sided and uses through hole passive components. The board was designed using Kicad, etched by himself and put in a machined enclosure. All the production files can be downloaded from his website so you may produce it within a day.

Comments

  1. Nawak says:

    In a comment of a recent Hackaday article ( http://hackaday.com/2013/08/25/the-difference-between-bitcrushers-and-sample-rate-reducers/ ), I found a very interesting site about digital media (xiph.org).
    I recommend reading it, and why not start with a blog post that explains why 24bits/192kHz audio is useless, even harmful: http://people.xiph.org/~xiphmont/demo/neil-young.html
    Of course, the 24bits/192kHz DAC is not the only thing that makes this USB box “High-End”, so it is still a worthy project.

    • Rob says:

      That xiph study is flawed. Doesn’t properly take into account several factors of the nature of sound. It’s not so much an issue of how they do their math, but that science has not yet accounted for a perfect understanding of sound and hearing (it’s science, so it’s progressing towards lesser degrees of imperfection but it can’t ever actually be a perfect understanding, per se) and how humans decode the sound that they hear. To imply that they know everything that they need to know is arrogant, and yet that’s the position they write from. Of course, trying to argue that with them is pointless because “they know”, but then the same goes for many audiophiles.

      All that to say, some folks can hear a difference and some folks can’t. And then there’s those of us that can hear the difference but can’t afford the necessary hardware to be able to enjoy it on a regular basis… Projects like this give me hope that the high end audio industry is still approachable by those of us that like to tinker and build. :-)

      • hat says:

        Your comment would be more convincing if you actually said what you think they missed, instead of just repetitively stating that the Xiph articles are wrong. For what it’s worth, Bell Labs did very extensive and careful studies of human hearing in the first half of the last century, and human hearing doesn’t evolve over only 80 years. The Xiph article is based partly on those studies and partly on well-proven signal-processing math.

        As for “some folks can hear a difference and some folks can’t,” well the folks who can have a curiously hard time hearing the difference when the tests become double-blind.

        • Dax says:

          The main objection against the site’s argument is that it offers an incomplete view on how digital sampling works. It’s not the whole story because of sampling errors that happen below the Nyquist frequency that limit the actual distortion free frequency range to approximately 16-17 KHz for 44.1 kHz CD audio.

          http://www.kostic.niu.edu/NIWEEK99.htm

          Put simply, when you sample a signal that is close to but below the Nyquist limit of your sampling frequency, you get a beat frequency in your sample as a result of the interference between the sampled signal and the sampling rate. The beat amplitude diminishes the further away from the limit you go, and becomes virtually unnoticeable at around 0.7-0.8 times the Nyquist frequency.

          Some algorithms exist to trade off this beat error into phase errors if you have an original sample with a higher sampling rate so the error can be known, basically shifting the timing of the peaks to minimize the effect on the downsampled version, but there’s no universal way of getting rid of these errors completely, and there’s no reconstruction algorithm that could take the result and produce the original signal back, because it can’t know whether the beating should be there or not.

          Because of that you actually have to lowpass-filter your audio a lot lower than 20 kHz to get rid of all possible errors, so if you want to have a truly high fidelity recording up to 20 kHz, you’d need a sampling rate at least 58 kHz to make sure you don’t get these errors in the high frequency range. Much more than that would be pointless, though.

          • Nawak says:

            Contrary to what your argumentation implies, Xiph blog post actually acknowledges the usefulness of using 24 bits / 192 kHz in sound recording / mixing! The blog post targets specifically the use of 24 bits / 192 kHz in *sound playback*! The USB box featured here is for playback, not recording.
            Is there any argument really in favor of using 24 bits / 192 kHz for playback?

          • @Nawak

            If DAC is just ADC in reverse, any problems going in also apply going out.

            To put it simply, if you downsample 192 ITB to 44.1 you recreate the quantization issues that you had when recording at 44.1. Think about it. You need 2 samples to make a 20khz ‘sine’ at 44.1khz one for up and one for down (actually looks more like a saw, but there’s no possible harmonics in the digital copy). That means you can actually fit two 20khz tone cycles in the same space of one 10khz tone at one of 2 phases: Synced and half a cycle behind, meaning stereo sound above 10khz can only be completely out of phase, or completely in phase, no in between, and anything more accurate cannot be expressed due to the limitations of the sample rate. This is still a problem down to around 4k in terms of hearing a difference with a trained ear.

            THIS is why higher sample rates are better for playback. Not because of higher frequency sound, but because of much more accurate imaging.

      • Alfie Noakes says:

        Sounds like you are deep into Audiophool Woo.

      • Eric says:

        While they’re “24/192 doesn’t matter” reasoning is flawed, I agree with their conclusion that it doesn’t make sense for end-user distribution. Higher depth and frequency for sampling is useful due to alignment, phase, noise floor, and overshoot concerns.

  2. Dave M says:

    Good article! Simple, functional, schematics and everything. Love it.

  3. bobthetree says:

    Anyone got an idea of the total cost of this?

  4. Tom the Brat says:

    Not in an Altoids tin?

  5. peter says:

    From his website, “I was surprised by the improvement in sound quality over the motherboard sound output.”

    I like the project, the build and the fact he shared all the files. Having said that, I wonder about the perceptible difference in sound quality. Granted, I have not heard the two outputs side by side, but I have a healthy dose of skepticism regarding most things audio, eg people claiming to hear the difference $2 cables and $500 gold clad, nitrogen infused, hand soldered by elves, dragon blood soaked super cables.

    Once again, nice build.

    • Max Siegieda says:

      Depends on the quality of your onboard sound I guess, plug a pair of sensitive earphones into the output, on every board I’ve ever used you can clearly hear the hiss of background noise and if you’re unlucky you can hear the noise change as the GPU if you have one renders frames. That noise might go away when you listen to music, but that’s because humans are pretty good at picking signals out of noise, it’s still there. I switched to an off the shelf DAC (Fiio E17 because I wanted spdif and USB) and the hiss is gone, though you can introduce it again by increasing the gain on the headphone amp stage, that says it all really. As for other things like increased bass or changing the sound I can’t really comment, but signal to noise ratios are a clearly audible reason to get external DACs.

      • matt says:

        Is that hiss present on the optical output of a motherboards sound card too?

        • Angus says:

          The optical output is digital, so unless something goes seriously wrong with the hardware or software it will transmit the correct sequence of bits. It’s then the responsibility of the hardware on the other end to read those bits and convert them into a sound without hiss in it.

          • Greenaum says:

            I suppose that’s the only true way of getting rid of interference, or at least the only intrinsically-noiseless way. USB has lots of high-frequency blips in it, ironically a balanced signal when the audio circuits aren’t.

            But if you want to be clear of interference I’d say optical is the way to go. Into a DAC box like this, powered from batteries. Should be economical enough to run off batteries, or use rechargeables. Then the electrical noise only starts from the output of the DAC.

          • Max Siegieda says:

            SPDIF does get rid of hiss, but from my experience it has its own problems. This is all subjective and totally untested but I *think* I’ve heard differences between spdif outputs (optical from laptop, laptop to monitor to optical). Supposedly there are some differences because both ends of a SPDIF link have to have accurate timing hardware and not all do.

          • John says:

            High frequency interference is very easy to get rid of, you just use a 20k low pass filter.

        • gabe says:

          It is silly to compare headphone jacks (a powered speaker output) to a digital link (digital sound only).

          unless you could plug your headphone passively on the light… which i doubt. You will feed that digital audio signal to a digital to analog, which is, guess… an amplifier! or a Sound card for all practical aspects that we are comparing here! so when you use the TOS link, you are pretty much ignoring all the cheap electronics in your motherboard AC’97 budget implementation.

    • Rob says:

      A big part about hearing a difference is the source material you’re listening to. If you’re listening to iTunes, WMAs, or MP3s, the difference between the onboard soundcard and a high-end external will be slight (mostly just some hiss as [Max Siegieda] described above). If you’re listening to a hi-resolution sound file or a non-compressed movie, the difference will become large. The internal soundcard will round off the bit level, split up the sampling, incorporate noise, etc… it will sound smeared and muffled. An external soundcard, otoh, will sound crisp, clean, and clear with snappy dynamics and high contrast.

      Your output device (speakers, headphones, etc…) will also matter, but only in proportion to how clean the rest of the signal chain is.

      It’s a matter of what you listen to and how much you care. One size certainly doesn’t fit all, and some folks won’t hear a difference and would never need to. Other folks will hear a world of difference and refuse to settle for less once they’ve heard that difference. Sound is anything but simple and YMMV!

      • Erik Johansson says:

        I only listen to 128kbit mp3:s there is no feel and love in these new high bit rate formats.

        Seriously though, just pluging the cheap 4 dollar USB sound card it into my externally power USB hub instead of my computer helped my audio quality.

    • Joey Bloggs says:

      Admittedly, the “high end audiophile” world has garnered some reputation for being easily fooled by snakeoil/overly enthusiastic subjective reviews.

      On the other hand, mainboard audio outputs are top of my list of sucky, crappy sound outputs, so improving these is easy and likely.

    • hat says:

      Eh, I can believe it.

      There’s tons of electrical noise inside your PC case. Sigma-delta DACs don’t have great power supply rejection, and you usually need an amp after the DAC anyway (so there’s always some analog componentry which is susceptible to noise pick-up if you don’t design things right). Most people don’t choose a motherboard based on the quality of sound it produces, so there isn’t much incentive for motherboard makers to engineer a really good audio subsystem, and, well… the result is motherboard with mediocre sound quality and background noise that varies depending on CPU/GPU load.

      That said, I’d be surprised if he could discern a big difference between his homebrew rig (which is pretty awesome, by the way) and, say, a $50 internal or external sound card with real engineering.

    • Nova says:

      Chiming in with what the others have said, I own a laptop that makes audible noise on it’s audio output port when using a specific USB port. Sound quality is the least of just about any motherboard manufacturers worries when they have GHz range signals to tend to.

      In the end just about any USB Audio DAC will outperform what’s on the motherboard, it’s much easier to isolate noise where there is just one digital-bus going near your audio-DAC. Also given that it’s sole purpose is audio, it’s hard to screw up unless it’s some no-name manufacturer.

    • Jan-Erik says:

      Yeah, I might add the this sophisticated version maybe does not add very much over the simple PCM270x DAC. But compared to a normal motherboard sound chip I now which I prefer.

  6. Rob says:

    I’d love to build one myself, if just to see how it tests out as far as true bitrate, noise, thd, etc… sadly, I’d have to get my hands on a measuring device too, and the folks at Audio Precision aren’t exactly giving them away.

    Regardless, building my own DAC is something I’ve thought about on and off for several years now, and reading this gives me confidence that I can actually do it (once I clear the jungle off the top of my workbench). Awesome article/feature! Thanks, HAD!

    • Max Siegieda says:

      I hear that, unfortunately when I was looking into DACs the only thing I found in a hurry was a mate who at the time was building a SPDIF mixer and VU meter with an FPGA so I got a bit scared off, forgot all the processing chips do exist as off the shelf items. Might be time to have another look at a multi input multi output mixer I guess.

  7. Pinky's Brain says:

    Using an unregulated output from a switching power supply for the DAC and opamps doesn’t seem very high end either.

    • Rob says:

      Some projects are never intended to be finished. Once you’ve been bitten by the audio bug, you’re always looking for more aspects of the project to add to your fix-it/to-be-improved list…

      If you’re interested the Millet MiniMax group project (I might have mangled the name) resolved an onboard power supply to ridiculously low levels of noise… wouldn’t be tough to incorporate those same ideas here, I’d think.

      All in good time… There’s listening to be done in the meantime!

    • AnarKIT says:

      Nothing wrong with a stiff unregulated power supply to opamps, they’re beasts at rejecting power supply fluctuations.

      It looks reasonably filtered, you don’t need huge filters and regulators all over the place when your loads are small and your source power is fairly well behaved.

      The PCB layout could use a better ground layout, there’s no star point and there doesn’t look like there’s any separation between the digital ground reference and the analog.

      That being said, kudos for gettin this designed and built, and if it meets their needs, then it’s successful, another step in the learning process!

      I’d like to do something like this in an integrated amplifier for my office, I’ll get to it eventually I’m sure.

    • heh says:

      Yes, there’s some shortcomings with the circuit and the board design. It kinda defeats the point of using super high end parts in the first place, like that $6 opamp, whereas a 40 cents NE5534 definitely wouldn’t be the “bottleneck” in the first place. Same for the overkill $8 DAC.

      There’s just so much more to it than picking ICs. Like part placement, signal routing, grounding (digital ground plane, separating analog/digital grounds with a star grounding for the analog section, digital signals over ground, etc), better placement of all decoupling caps (using ground plane too) because the traces are too long (besides needing better power regulation) and picking the values based on the noise frequencies (perhaps even adding inductors and/or ferrite), separate power planes, moving to SMT parts which are smaller so things can be tighter laid out where needed, and then of course controlling EMI, harmonics, capacitive coupling, proper filtering and such throughout the whole design. There’s just tons more to it, that’s BARELY scratching the surface! If you’re not gonna use the reference design, you gotta know what you’re doing as good as the engineers who made it.

      I’m sure it was fun to make, a learning experience, that it sounds better than cheapo onboard but the 132dB SNR here is a pipe dream, it definitely doesn’t hit 100dB. A much improved design with far cheaper parts would give a MUCH improved result, but that requires a LOT of hard work and knowledge. Unfortunately, spending an extra $20 on high end parts doesn’t fix that, sorry.

      • Garbz says:

        I think you’ll be hard pressed finding people who can hear a difference between 100dB and 132dB SNR. Sure the design has room for improvement but then you need to wonder just how much improvement will make an audible difference. He’s not selling some $10000 wanky design here either. Cheap DAC chips often can be a serious bottleneck, especially the all in one jobs on a typical motherboard.

        • heh says:

          > I think you’ll be hard pressed finding people who can hear a difference between 100dB and 132dB SNR
          If not only you’re not getting anywhere near the performance of the expensive chips can get you (pointless waste of money) but that you can’t even hear such a difference in the first place, then it’s just even more pointless.

          > Cheap DAC chips often can be a serious bottleneck, especially the all in one jobs on a typical motherboard.
          Not at all! Typical DACs on motherboards can do > 100dB SNR. For example, the cheapo Realtek ALC889 on my motherboard from 2007 has a 108dB SNR, and the newer ALC898 has 110dB. The problem which makes them suck is the design around the chip, not the chip itself — exactly like this DIY design. If anything, he should have understood that the design around the chip is key.

          Improve the design until the chips become the bottleneck, THEN use high end chips to improve it if necessary. Using high end chips on a poor design gives poor results regardless (it merely increases the price of the BOM, nothing more). Motherboards are a prime example of that.

  8. Rochey says:

    Cool Stuff! Any performance plots? I’m interested to see the impact of the charge pump.

  9. F says:
    • Max Siegieda says:

      No idea, but it’s almost academic since the value in this project is in the building. You can throw £1000 at the problem and easily get a better solution if you really felt like it, we don’t even have a price for this project so value for money isn’t a consideration

    • Garbz says:

      Depends entirely if you buy into that Non-oversampling DAC = better bullshit. Given how OS was a great solution to imaging problems that plagued digital audio of the late 80s I’m inclined to say that this probably sounds better. But if you’re the type of person who thinks a cheap poorly made tube amp can sound better than a well designed transistor amplifier because OMG TUBES! then a nasty TDA1543 DAC is probably the answer for you, despite what all measurements would say.

  10. Lupin says:

    The schematic has too many wires crossing, could use some labels. Nice build, but it seems more like a non-hifi, non-high-end approach. But that’s okay if it still gives reasonable sound quality.

    Can the buffered outputs drive headphones? Maybe the charge pump won’t deliver enough power? But besides that it should work?

    Would be nice to hook that USB->I2S converter up to an FPGA and start designing your own DAC (N-th order sigma delta with high oversampling ratio). Would be interesting to see what kind of results one could get.

    • Jan-Erik says:

      Yep, it is not easy on a single-sided board. But I have no facility for producing a double-sided board.
      It is not intended to drive headphones (I don’t use them), but the LM2662 should deliver 200 mA. There are however 100R resistors on the outputs here.

  11. No. 1089 says:

    Would this work on the Raspberry Pi?

  12. Aron says:

    Is there an 8 audio channel output version of something like this?

    • Rob says:

      Commercially, yes. Companies such as Apogee (first one that comes to mind, though there are a number of companies) have multichannel hi-res DACS. From the amateur side, I don’t know. Wouldn’t be too tough… would just need a new board to do the multi-track decoding into sets of 2 channel data and then multiples of this board to handle however many 2 channel sets you have. The design considerations mentioned by [AnarKIT] and [heh] would really need to be dealt with before doing any scaling though… first things first.

    • Garbz says:

      There are plenty of integrated 8 channel audio DACs. The hard part is finding an 8 channel USB -> I2S interface.

  13. Dodo says:

    My on board sound is really bad. There is a high pitched squeal over the output. It is so loud that even with music set to max volume it can still be heard. There is also some noise, but this is masked by a music signal.

  14. This seems to have a major flaw, from datasheets the PCM2707 samples at 48 khz, 16 bit. I dont know if it passes through i2s at a higher sampling rate but it seems like a waste to then run it through a more expensive PCM1794 for Digital analog conversion (this chip is made for up to 192khz 24 bit DAC) so why not just use the PCM2707 as the DAC (it has built in digital analog conversion)

  15. daniel says:

    I have made a headphone amp that is powered off my computer’s 12v rail. It uses a 5v headphone amp IC and a 5v linear reg decoupled on the input and output with ceramic and electros. As someone remarked above about the power supply rejection of opamps, I too thought that this headphone amp would sound fine when running off my computer’s power supply.

    Of course it sounded horrible with all the associated electrical noise of hard drive and fan motors injected into the sound. I fixed it by inserting a 60 ohm resistor in series with the 12v supply, and sinking the supply current though the audio jack from the motherboard. it was only 10mA, and didin’t blow it up. You can use all the decoupling you want, but the fact of the matter is that the onboard sound has its own analog ground plane with supply rails generated from a linear reg. Since this is single ended audio, ripple in the ground potential has just as much as an effect as ripple on the signal. The result is that when using 32 ohm headphones it amplifies the background hiss of the motherboard DAC to a point where it is audible. I have in turn fitted a potentiometer to the output is that is left to attenuate the gain produced by the amplifier most of the time. I can turn it back up again when I want to jam out.

  16. Hey man, how’s the sound quality?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s