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.

63 thoughts on “Building A ‘high-end’ USB Audio DAC

  1. 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.

    1. 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. :-)

      1. 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.

        1. 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.

          1. 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?

          2. @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.

          3. For the record, Gen0 is completely wrong. Sampled audio above 10 kHz can be completely out of phase, or completely in phase, or anything in between. Phase is not quantized.

      2. 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. 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.

    1. 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.

        1. 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.

          1. 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.

          2. 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.

        2. 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.

    2. 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!

      1. 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.

    3. 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.

    4. 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.

    5. 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.

    6. 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.

  3. 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!

    1. 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.

    1. 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!

    2. 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.

    3. 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.

      1. 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.

        1. > 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.

    1. 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

    2. 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.

      1. I have most of the top level dacs – that record producers use to when they master records.
        And I prefer NOS TDA1543 and TDA1541. Not because they can produce perfect square wave,
        but because they have the best sound.

  4. 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.

    1. 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.

    1. 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.

  5. 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.

  6. 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)

  7. 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.

  8. I have built this circuit twice now with two different layouts, and am having the same problem. Using the OPA2134 I am finding that with identical negative feedback resistors 820R in this case, on both circuits I am getting a 0.4V difference between the two outputs A & B. I am inputting a sine wave through audacity tone generator (440Hz 0.8 amplitude default setting) over USB. Because of this I have had to adjust the gain resistor to enable the output voltages to match. To get the same output voltages on my first circuit I have ended up using 1K1 on op-amp A and 1K62 & 10K in parallel = 1.394K on op-amp B as the negative feedback resistors. The issue is the same on my second circuit, but different layout.
    Has anyone else experienced this? Is this simply a resistor tolerance problem which has happened by coincidence twice? Or a op-amp chip issue? Or other? Any ideas?

  9. Is there any possibility to get this DAC to run at 192khz? Maybe change the PCM2707 to something else? Maybe there is a different chip for the I2S conversation available which has the same footprint as the PCM2707…?

  10. Could someone give me a link(s) where I can learn more about DACs? I’d love to build this one, but I don’t understand all the things. I don’t know if I can use this particular DAC with my speakers (which are active) or headphones (a budget Senheiser model). Could you help me, please?

  11. There are more uses than your listening pleasure for USB soundcards that do NOT use sigma/delta .

    One being Software Defined Radios ….. Flex sufferes from Tx noise out to several Khz because of the sigma/delta from using 16bit and lower.

    Image rejection for Tx of SDR’s need better bit depth to get a better (deeper) null of the image AND lower Tx trash coming from the soundcard.

  12. Hello. I am looking at a similar project but I also need a microphone input to the codec. In doing research I contacted TI and learned something I was not expecting. The tech support guy is telling me that the PCM2707C can only output 16bit audio on the I2S. They have acknowledged that I2S standard is not limited to 16bit for a 12MHz clock but they claim that 16bit is still all that this part will do. Did you actually confirm that you were seeing 24bit data coming off of the PCM2707C? Sorry if I rained on your parade.

  13. The higher the digital sampling rate of the original analog source, then the more accurate the waveform will be, and thus the DAC will be, (assuming a high quality DAC is also implemented).
    There’s a good reason why DVD-Audio, and Blu-Ray’s all use 96/24 audio (stereo, and/or multichannel) signals, with Blu-Rays also having 192/24 audio.
    The redbook Audio CD (44/16) was/is a poor quality medium, They should have waited a couple more years and developed the 96/24 Audio CD as the (minimum) defacto audio standard.
    Also, (due to the incredible sizes of very small/portable mass-storage today), lossy, bandwidth-limited, patent-encumbered audio codecs, like mp3’s, … should all be outlawed, and instead, lossless/HQ FLAC made king of the free/opensource audio codecs.

    …and that way we wouldn’t be having this conversation today.

  14. Amazing piece of work, especially with a hand made board!
    I guess I would have cheated and purchased the board, LoL.
    Boy, this post sure brought out the audio nuts. They just run around in circles reading each others posts and building on partial truths and nonsense. At the end of the day, it sounded better and that’s what counts.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.