DAC/ADC/Codec digital audio "beginner" kit? - Page 1
Forum section: electronics / beginners

author: paulca
author_rank: Super Contributor
timestamp: October 10, 2022, 10:14:33 am
content: I stumbled on some videos on Phil's Lab. Made me realise I'm already working with MCUs that can do CD quality DSP routines.It's something I have wanted to get into for a while, since I gave up on my DIY 1975's analogue mixer project (mostly when C&Ping PCB layouts without templates for the dozens and dozens of op amp sections, started to hurt).Normally I would go out looking for the usual trash off Ali or the bay or amazon to see what is popular, but at the moment with chip-shortages, global currency protectiism etc. etc. that market seems skewed somewhat. For example an STM32 H7 dev board is MORE expensive on Aliexpress than it is from MouserUK!DAC/ADC/Codec boards only really exist on MouserUK et. al. in the form of TI and other full on evaluation/reference implementation boards, costing $100+.The Ali haul got me a no-named 24bit 96ksps stereo ADC with i2s out, a PCM5102A DAC with I2S in. I also spend £20 on an ESP32-A1S audio toolkit board. I believe the ESP32-A1S has built in codec (probably under the can).The other option is of course to just buy some ICs, buy or fab some carrier boards for dev work, but for that I need a lot more research into what exists, what I need, how involved is the board design for mildly high quality audio. etc.Anybody around current into this area could give me a few shoves in the right directions?Hopefully the £30 haul garbage will give me something to play with. I do also have a few STM32s with USB peripherals I can possibly get some digital audio through that, depends on how much of the audio device it emulates in driver code and hardware.

author: RoGeorge
author_rank: Super Contributor
timestamp: October 10, 2022, 11:04:58 am
content: It all depends on what you want it for.If you want "ultimate" sound quality then just buy a ready made product. CODEC devboards usually have lame audio performance. They are made for learning how to program the chips, not for Hi-Fi auditions.Distinct ADC/DACs are not really used in audio nowadays. Instead, most of the time it's just an audio CODEC, with source selection, volume control, delta-sigma ADC/DACs, decimation filters and a small DSP, maybe a headset preamp, too, all on the same chip.Search for 'CODEC devboard' and see which one you like. If not, take an old PC sound card, or a defective PC motherboard with onboard sound, and try to connect its audio chip to an I2S microcontroller.If you want to learn DSP, that's a different story. Much harder than just controlling a CODEC, and you'll need a lot of math and plenty of Octave or Matlab simulations, eventually with a soundcard if you want to hear the results, but a devboard will only limit your learning with all its quirks particularities.Either one, learning CODEC configuration/control from a MCU, or learning DSP, is not beginners level. For anything other than loading and running a demo, it will be way more complicated than the general Arduino stuff, will assume the basics of MCU, programming, EE, etc. are known already. Will require a lot of CODEC datasheet readings, too.

author: paulca
author_rank: Super Contributor
timestamp: October 10, 2022, 12:09:34 pm
content: Thanks.On purpose. Say a software mixer. "Personal audio quality", non AudioPhool level. To give you an idea, I run my own DIY OPA551 headphone amp. My current output master is a beringher 4 output headphone amp! So I'm not precious about it. I just want an extensible way to mix multiple inputs and direct/route them to multiple outputs. As mentioned before I found this started to become exceedingly tedious with opamps. Not least when I considered a basic 3 band semi parametric eq on each channel.I don't know, yet, the horse power required to process multiple I2S buses for basic "down mix" and route them to multiple I2S output buses. Maybe a few EQ filters. No special effects, no need for temporal filters.If at it's output it produces something resembling a basic 16bit/44.1k PC sound card I'd be happy.I'm up for the challenge on the interfacing with codecs. I'm not that new to MCUs now and certainly not afraid of bit banging registers and low level c.On the DSP and more "pure mathematical" aspects. I'm only starting into this because I feel there are enough community examples of "basic stuff" already. So I'm not going to be studying multi-pole IIR filter abstractions in MATHLAB. I'm going to get a library of open source ones and see if I can run what I need with the horsepower I can afford. Which is an interesting point, because for a one-off DIY project, hardware and horsepower are "cheap", so I can be somewhat lazy in performance coding and just buy a bigger MCU. Can't do that in product land, the BOM bean counters will hang you unless you market is very high end.

author: RoGeorge
author_rank: Super Contributor
timestamp: October 10, 2022, 01:22:03 pm
content: Mixing in digital domain is not trivial, especially when sources are coming from different codecs. Keeping them in sync and at low latency is a chore. If you want to add different filters to each source, that's yet another bag of problems. Unless the codec itself has tone control filters, you may probably need a DSP capable MCU (with hardware DSP blocks).I've fiddled once with a DSP board from TI. Their solution was a small DSP MCU (TMS320C5535- now obsolete) and a dedicated CODEC that is still in use (TLV320AIC3204), on the same devboard. Even so, the USB was capable of only 8kHz recording and 16/44k of 2 channels playback. The devboard was namedezDSP, and that was a lie, it wasn't exactly easy. Its name tricked me into buying the board thinking it will be easy.Same as you, I was only wanted to step into DSP, after working for a while with microcontrollers.It was not easy at all. Digital signal processing is way more difficult than microcontrollers. Though, it was a very interesting learning journey. Even after learning the basics, I'm still a newcomer when it comes to DSP. My point is, if you want to learn digital processing, then yes, go ahead with the digital route, but if you only want to make an audio mixer, then use analog electronics. Digital is so much more complicated, both to learn it, then to implement what you learn in a product. And you will be dependent of somebody else's software and libraries. For example, the board I was using is now obsolete, and a few years later there is no software toolchain for it any more, while analog electronics will still be around for many years from now on.If you buy a devboard, look for something that has plenty of tutorials and examples of how to do the most usual audio tasks. Pick something that has good software libraries and code examples, or else you'll write software for a year and still not have all you need to make a mixer.For learning filters you can use Octave, which is the same as Matlab but free.Maybe start with learning filters and DSP first, that will tell you what to expect from the rest of the mixer project, and what hardware you'll need to implement it.Overall, it will take many months to learn DSP and make a functional mixer.With opamps, mixing and tone correction would be much easier in practice.

author: paulca
author_rank: Super Contributor
timestamp: October 10, 2022, 02:33:42 pm
content: It took me months to learn how to create a merge 2 basic stereo mixer channels with op amps, properly. Just a pre-amp, a mix amp for each of 3 stereo pairs and a bus master amp and BOM was already into dozens of op amps and as I said, KiCAD, which I was using provided no way to "modularize" the PCB layout, so while you could group, section off and reuse schematic sections, you couldn't create net/placement templates in the layout editor. There was a hack where you used python to generate the layout blocks at various positions, but it just became untenable.It was when I laid out a PCB for a single semi parametric filter and considered having to make 2 or 3 copies per channel, with 3 stereo inputs, nope!The thread is still on here and quite a few people were pointing out it would be so much easier to do it in a DSP! Ironically.

author: Marco
author_rank: Super Contributor
timestamp: October 10, 2022, 03:30:02 pm
content: Never used it, but Teensy has a 16 bit audio library and someone madea floating point version(you will really want a Cortex M7 for that).

author: paulca
author_rank: Super Contributor
timestamp: October 10, 2022, 05:32:23 pm
content: There is at least this:And... this:https://www.st.com/en/embedded-software/stm32-audio100a.html#documentationAlso there is Phil's lab stuff on STM32 F4 DSP filters.

author: RoGeorge
author_rank: Super Contributor
timestamp: October 10, 2022, 05:44:57 pm
content: Quote from: paulca on October 10, 2022, 02:33:42 pmDepends on the mixer. Maybe it is indeed easier with a DSP (if you already know DSP).Learning DSP for the first time is the hardest part, then once you know how, learning the DSP libraries from the chip manufacturer and using them for your own project will also be a challenge, and very time consuming. Or at least that's how it was for me.But anyway, a digital mixer is a great project to enter the DSP world, so go for it!About your project, an audio mixer can be many ways, from the very simple to the very full featured used in sound production. No idea about what complexity you plan for your mixer, or about the former analog project. A link to the former project would help showing your expectations.