Overcomplicated audiophool DAC design review - Page 1
Forum section: electronics / projects

author: blueskull
author_rank: Unknown
timestamp: April 16, 2015, 01:19:11 pm
content: Hi, as I said in this threadhttps://www.eevblog.com/forum/oshw/oshw-licenses/, I hereby publish my design here.Please give me some critiques and suggestions, so I can refine my design.Basically on the bottom you have a 5.5V DC->+-8.4V converter, a 5.5V DC->+3.6V converter, a +3.3/1.2V LDO, two 3.3V LDO, a parallel noise canceler and a +-8.4V to +-7.8V LDO.It generated power for FPGA, clock subsystem, DAC subsystem, analog filter subsystem and the headphone amplifier. Also, there is a 5V LDO for gain and offset control DAC.On top of it, you can find the USB3.0 interface circuitry, which consists 4.2V~5.5V to 5.5V and 1.2/3.3V converter, 5.5V to 5.5V isolated power converter, digital isolators and the most important part, the cypress FX3 USB3.0 controller with ARM9 and 512K memory, along with its serial configuration EEPROM.On the right side, you can find 1 headphone amplifier based on diamond buffer and opamp with global feedback.Moving up, we have a thermometer 3 bit dynamic element matching DAC current mode DAC, with a bunch of active and passive filters for each channel. There are totally 4 channels, for left+, left-, right+ and right-. The entire architecture is fully differential. Also, there are 8 sigma delta DAC output filters there, for gain settings and offset cancellation.On the top left corner lies the digital jitter cleaner (DFFs) and open drain output devices. In addition, there is a 8 channel sigma delta output gate (8T245) for gain and offset settings. Another important part for this section is the LMK00105 ultra low jitter clock generator and its crystal. Stated in its datasheet, it provides 230fs jitter at 25MHz, and in out case, it operates at 24.576MHz.Finally, on the top right corner, there is a FPGA that de-multiplexes 8 bit input data stream into 2*8 bit data stream, and also performs sigma delta modulation for gain and offset DAC. This FPGA is configured by FX3 every time it powers up.For further usage, I left a SHA1 device on board, in case if I want to incorporate DRM on this device.------------------------------------------------Then let's talk about software. The hardware is merely a high speed (12.288Msps) DAC. To generate audio signal, it must be fed with sigma delta modulated signal. Since the modulation requires hundreds of MFLOPS of computation power, I don't want to do it with any embedded system. On the other hand, I can do that on a PC, and for any SSE4.2 enabled PC, it consumes no more than 1% of CPU power.I am not familiar with windows kernel stream driver model, so I am working on ALSA first, and when I came up with an operable device, I will see if I want to invest more time into a proper KS driver. But for now, I will stick with Linux, sorry for those Mac and M$ fans.I will publish a FOSS ALSA driver later, with basic upsampling, sigma delta modulation and ALSA/USB interface.Also, I am planning to develop and sell a closed source driver that adds dynamic element matching and SSE4.2 support, and that is why I put an ATSHA204A on board.The hardware itself is FOSS, along with its FPGA and ARM firmware, which have not entered their coding phase.--------------------------------------------------------Any suggestions will be VERY APPRECIATED.Also, If you plan to help me on writing drivers or improving the hardware, please PM me and I can send you a free prototype hardware when I got my boards from fab.--Added 04/16 9:22 EDT: Altium project files in 7zip with par2 appended. Please change ext name to 7z in order to open it. I was not allowed to upload 7z files.--Added 04/16 9:36 EDT: For part designators, I use a combination of part type, section abbreviation and 1~Z index. For example, a capacitor used in amplifier section could be CA1 to CAZ.--Modified 04/27 2:38 EDT: New "readable" schematic of the DAC core was redrawn and posted here.--Added 04/27 2:53 EDT: GitHub repositoryhttps://github.com/blueskull/plethora.--Modified 04/27 4:33 EDT: Short circuit from DAC output to ground removed, spotted by Marco.--Modified 04/27 6:15 EDT: USB input part was redrawn.--Modified 04/27 16:56 EDT: Corrected bugs in USB section.

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: April 16, 2015, 01:22:26 pm
content: That has to be the most horrible, unreadable schematic I've ever seen.

author: Kjelt
author_rank: Super Contributor
timestamp: April 16, 2015, 01:25:27 pm
content: Quote from: blueskull on April 16, 2015, 01:19:11 pmSHA1 is not really advised for new designs. Can you change to SHA2 ?

author: Bud
author_rank: Super Contributor
timestamp: April 16, 2015, 01:33:41 pm
content: I second what Mike said. Your schematic is unreadable.

author: TiN
author_rank: Super Contributor
timestamp: April 16, 2015, 01:39:16 pm
content: Multiple above posters. Schematics is unreadable and unreviewable. Open hardware means usually not "just post your files, and everyone will work their asses to understand what is drawn there", but rather be open and present design in clear way, so 3rd party can understand what's going on there and put their suggestions, questions around it clearly.

author: TiN
author_rank: Super Contributor
timestamp: April 16, 2015, 01:48:45 pm
content: I would suggest to redraw schematics using proper symbols and in one direction, and/or split by pages.Meaning for example your inputs are at left, outputs at right, and your circuit in middle.Ports should be used only if signal going from one page to another. This will bring you much more people to discuss your design, than 10 videos of some PCB doing something.

author: doctormord
author_rank: Regular Contributor
timestamp: April 16, 2015, 01:58:37 pm
content: Quote from: Bud on April 16, 2015, 01:33:41 pmAs he said before.. " obsessive-compulsive disorder".. Thats why.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: April 16, 2015, 02:15:43 pm
content: Quote from: blueskull on April 16, 2015, 01:33:22 pmfile->new page

author: tonyarkles
author_rank: Regular Contributor
timestamp: April 17, 2015, 04:00:20 am
content: Quote from: blueskull on April 16, 2015, 01:33:22 pmThat's the trick about it... I have seen "arbitrarily drawn" schematics and they're terrible too.The ideal way to draw a schematic is to make it so that it really clearly shows the signal flow from input to output. I don't recognize the style there, I'm guessing it's KiCad. I also can't tell at all whether or not there's multiple parts of the schematic that are repeated. Ideally though, if you've got a schematic that repeats the same circuit multiple times (e.g. a 5.1 channel DAC), you'd draw a single channel as a module/block/whatever KiCad calls it, and have it duplicated.A schematic is telling the story of what is happening to a signal, from input to output. The best layout is one that tells that story really really clearly.

author: Circlotron
author_rank: Super Contributor
timestamp: April 17, 2015, 10:42:41 am
content: Quote from: tonyarkles on April 17, 2015, 04:00:20 amMy guess is Protel 99SE.

author: Dave
author_rank: Super Contributor
timestamp: April 18, 2015, 04:56:17 am
content: I don't think there is any way to sugarcoat this:If your schematic requires a half hour video to explain how everything is connected, your schematic is shit.This thing should be split onto 4-5 A4 sheets and redrawn, so the signal paths are clear and readable. Looking at a net name and trying to find the other end somewhere in that mess gives you absolutely zero clue about how the circuit works and why it's wired that way.Your "somehow OCD" is just a bullshit excuse for refusing to take criticism and learning something from it. "Arbitrarily" drawn schematics are not arbitrary at all, if the components are purposely placed so they give the reader a clear view of the signal path. Chips aligned in a grid with net names on every single one of their pins,thatis arbitrary.

author: xuio
author_rank: Contributor
timestamp: April 18, 2015, 11:04:47 am
content: If I do a complex design like this, I like do divide my schematic into logical blocks.In Altium you can do this like so:Create a main schematic document and another for each block you would like to abstractUse Ports for the signals that have to leave a sheetGo into the main sheet and do [right click] -> Sheet Actions -> Create component from sheet or HDLWire the blocks together on the main documentThat way you can create complex but clearly readable schematics.For busses or multiple I/Os you can also use harnesses, so you dont have to wire 100 signals in the main sheetThe Altium wiki has some nice explainations:Altium Techdocs: Using Signal HarnessesAltium Techdocs: Creating a Multi-channel DesignI attached some example screenshots.

author: rob77
author_rank: Super Contributor
timestamp: April 27, 2015, 06:54:18 am
content: where is the schematic diagram ? as of writing this post, there is nothing attached.

author: rob77
author_rank: Super Contributor
timestamp: April 27, 2015, 07:54:07 am
content: Quote from: blueskull on April 27, 2015, 07:01:29 amsorry but my first reaction was... WTF am i looking at ? after send and 3rd try it's still the same.1. where is the DAC ?2. are you trying to make a discrete DAC ? (the buffers and open collector drives with a shitload of resistors would suggest that).3. where is the analog part ?4. where is the USB part ?5. where is the description (at least a block diagram) of the role of the CPLD/FPGA ?we can't comment on something what's not documented properly.if you wish to hear some comments on your first steps.. then my comment is: "get back to the drawing board" and definitely choose a different route to achieve your goalbtw.. you can't simply make an audiophile grade DAC out of discrete components, and don't forget the DAC is just one part of the game. distortion and signal to noise ratio is critical for high-end audio gear.

author: Marco
author_rank: Super Contributor
timestamp: April 27, 2015, 08:18:52 am
content: Why do all your output resistors dump into ground? (I'm thinking that connection at the bottom of CAM-CAP is not supposed to be there.)

author: Marco
author_rank: Super Contributor
timestamp: April 27, 2015, 08:29:34 am
content: Quote from: blueskull on April 27, 2015, 08:20:15 amAt the moment all that amplifier is going to see is ground ... since you've connected them straight to ground.

author: Scrts
author_rank: Frequent Contributor
timestamp: April 27, 2015, 01:18:26 pm
content: Quote from: blueskull on April 27, 2015, 10:14:09 amI must admit that this is probably the worst schematic I've ever seen.You should learn schematic splitting by page, especially the power side and logic side, use global symbols for GND and VCC at least...

author: dmills
author_rank: Super Contributor
timestamp: April 27, 2015, 03:48:58 pm
content: Sorry, but I concur.Seriously, go and have a look at the schematics in AofE, Self, the ARRL Handbook, or any such publication, that is what you should be aiming for, schematics should tell a story, yours are just word salad at the moment.In fact I am fairly sure the second edition of the AofE (Not sure about the third) has a whole section of now to draw schematics so they are readable (as do other books).Altium has wonderful tools for multi page schematics and hierarchical design, use them.For me I would suggest that the USB IO & isolators belongs on one sheet, reclocking on one sheet, power on a sheet, your DAC sections scream to be a couple of hierarchy of repeated blocks (Also means you only have to lay it out once and can then use copy room to place the other instances), same with the output buffers and reconstruction filters.I would seriously question the whole approach however, current noise is going to be an issue, as is (in all probability) differential linearity and possibly monotonicity, also ferrite beads or small value resistors to slow down signal edges in the digital bit usually make this sort of thing much better behaved.Seems to me that even of you want R2R or resistor ladder (Personally I dont see much wrong with SD, but whatever) there are easier ways to skin this cat.Regards, Dan.

author: ajb
author_rank: Super Contributor
timestamp: April 28, 2015, 12:22:15 am
content: It's not necessarily the names that are a problem for the power rails so much as the fact that you've used plain net labels. Someone who isn't familiar with your naming scheme (IOW, everyone but you) can't at a glance tell if "1A2" is a signal net or a power net. Using more conventional symbols (arrows and bars) to indicate power nets would be a vast help in visually filtering out power from signals. You can even use different symbols to differentiate analog and digital power rails if you want. A somewhat more conventional naming scheme, like "1v2P" for primary would also help clear up what everything is.As far as signals, using net labels to connect things like I2C lines is more or less okay, but for analog signals that require the reader to trace their flow through the circuit, running actual wires is much preferred. It's much easier to follow a line around than to hunt around for matching net labels, especially if you've got a bajillion of them.

author: tszaboo
author_rank: Super Contributor
timestamp: April 28, 2015, 08:22:47 am
content: Quote from: blueskull on April 27, 2015, 08:43:17 pmWith this problems you experience, how can you function as an engineer (are you an engineer? How do you get access to Altium otherwise?)I mean the main function for a schematic is to explain what is going on with the circuit, and yours are frankly failing to do that. There are just so many problems with it, like pin numbers missing, you dont bundle the signals to logical groups, you use connector schematic symbols to ICs and so on and so on. I cannot tell which signal is power analog and digital. I understand that OCD is an illness, but maybe try changing your obsession to make schematic better. Like put as much information on it as possible. I dont know how it works, just trying to help.

author: tszaboo
author_rank: Super Contributor
timestamp: April 28, 2015, 08:56:05 am
content: Quote from: blueskull on April 28, 2015, 08:29:15 amYes they are. pin numbers are not there for checking, or your convience, they are essential part of the schematic. You dont need to draw the internal parts, but cmon! Having the output of a regulator on the left, input and GND on the right and the inductor on top of it is just unacceptable.Even if you custom made it, you did not made a good job. We are trying to help, because with this, even if you pass uni, you are going to be in a huge trouble even if you find a job.

author: sonicsmooth
author_rank: Newbie
timestamp: May 20, 2016, 04:18:42 pm
content: I know this post is really old.But dude, just buy a DAC. You'll get way way way better size, performance, etc., than anything you'll be able to cobble together with discrete parts. I know the audiophile fools think they can do better, but really it's not possible when you're (obviously) just starting out doing EE circuits.I designed something similar a few years ago. It used a Cypress chip with High Speed USB, some type of Xilinx FPGA to do the 5.1 decoding, a few TI/Burr-Brown 24-bit DACs, some OPA-whatever low noise opamps, a SPDIF decoder, some type of low-jitter clock thing, USB stuff, different power supplies, bla bla. I don't remember.What I *do* remember is thinking that this'll never work, and trying to do the layout to achieve 24-bit resolution was a pain -- different power domains, split power and ground planes, low noise LDOs, looking at noise specs, etc. I got the boards back, starting soldering them together, and eventually real-life and money-paying work got in the way. I'm glad I dropped it. It sounds like a fun project at first, but to get real FPGA/driver/firmware/analog-debugging working pretty much requires *full time* effort for a month or two and a decent quality o-scope with logic capabilities. I actually have a life, so I had to put that sh*t down.I appreciate the obsessive need to design and build this sort of thing, but a.1) you're never going to make money off of this by making it open-source, a.2) you're never going to make money off this. Period. Just keep it as a hobby. a.3) nobody cares about your design enough to steal it -- nothing here is new or better than anything else commonly available, b) issues with layout are going to dominate the quality of the audio, c) it's difficult to get HS USB to work without paying close attention to line impedance, d) you're wasting your time by using so many discrete components, e) having "OCD" doesn't mean anything but a lame excuse (I have some form of OCD myself, and it has nothing to do with making clear schematics), and f) you NEED to use ground symbols, global power nets, and more (yes) conventional forms of communication so you get some decent feedback about the actual design rather than critiques about the format of your schematic.So like others have said, here are my suggestions for the design:0. Use a real DAC and real power amplifiers from a real company. Don't think you can do better by doing discretes. You can't. Integrate integrate integrate!! Use multi-channel opamps, dacs, buffers, inverters, whatever. If you have an FPGA already, why are you using so much discrete logic?1. Put a block diagram on the first page, up front, showing a block for each *concept*: power supply, CPU, FPGA, DAC, etc. Then start a new page with power supplies. Then a new page with CPU. Then a new page with FPGA. Then a new page with opamps. Then a new page for high-power analog, etc.2. Use global symbols for ground and the various powers. Show signal flow left to right.3. Don't use so many inductors. They provide a false sense of "cleanliness".4. If you're using discrete logic, use the proper symbol for flip-flops, inverters, tri-state buffers, etc. Don't just make a rectangle with pin names. That's lazy.5. Add pin numbers to your symbols. For the RLC, etc., add information regarding the package, capacitor voltage rating and type. Add PPM information to the crystal.6. Annotate your schematic showing expected voltages, currents, etc. for the power supply lines.7. Annotate your schematic showing USB trace impedances.8. Don't use 4-point junctions.9. Add more space between things.10. It's okay to use large schematic size, eg 11x17" or whatever standard is common in Europe -- A-whatever.11. Show resistor values and percentages -- if you're using discrete resistors for DAC, then you probably want something really tight, like 0.1%.12. Add a page to the schematic, and a spreadsheet to the overall design, with calculations showing the linearity specs you're trying to achieve, and why you believe your particular design will work. If you have analog filters, show the order and cutoff frequency.13. For large parts with subcomponents like FPGA, place it on its own page.14. Use off-page connectors or ports.15. For multi-channel design, use Altium's hierarchical features.16. For design review, show your layout, board stackup, etc. This is *as critical* as a logically correct design.17. Make sure whatever power supplies, opamps, etc., you're using don't dominate the noise in your audio.17. No need for writing your own Linux drivers. Nobody will use them. Just make your Cypress chip follow the USB audio device class. Then it's plug-and-play on whatever system, Mac, Linux, or M"$".13. If you feel the need to put $ when referring to Microsoft, then perhaps you should stop using Altium and go to Gnu or some other crap tool.