USB audio codec for a microphone - Page 1
Forum section: electronics / beginners

author: werediver
author_rank: Contributor
timestamp: March 25, 2021, 03:25:07 pm
content: I'm thinking about building a microphone with a (semi-) decent ECM cartridge (maybeAOM-5024L-HD-R) and a preamp-compressor (probablySSM2166orSSM2167) for use with a computer (a laptop).Both the ECM and the preamp require power, and I'm not sure a typical computer TRRS socket is designed to supply enough current (the mentioned ECM operates at about 500 uA, while SSM2166 declares 7.5 mA [2.3 mA for SSM2167] consumption). A USB socket must be somewhere nearby, but using it for power only would yield an ugly device.At this point I'm looking for a simple to use USB audio ADC / codec and virtually the only thing I found so far isTI PCM29xxfamily of products, most of which are 2 in / 2 out devices, which feels like an overkill.My main question is:Could you recommend a more minimalistic IC I can use for a single channel microphone?I'm also a bit concerned about whether SSM2166/SSM2167 will output good quality sound. If you don't think it will and can recommend a better preamp-limiter IC or circuit, I'd appreciate that too.Thank you for your time.

author: HB9EVI
author_rank: Frequent Contributor
timestamp: March 25, 2021, 05:19:08 pm
content: more minimalistic than a PCM2912A is barely possible. It requires nearly no external components and offers reasonable good audio qualityp.s. the SSM2166/67 offer acceptable sound quality; I'm using them in both, hamradio and guitar circuits as compressor/limiter; as simple dynamic range reduction for a mic, I'd use the SSM2167 only

author: werediver
author_rank: Contributor
timestamp: March 25, 2021, 06:30:55 pm
content: Quote from: HB9EVI on March 25, 2021, 05:19:08 pmSure, I just thought maybe there are chips with only the CO- part of a CODEC(coder, audio input without audio output), but I haven't found such and your reply suggests I probably won't

author: ve7xen
author_rank: Super Contributor
timestamp: March 25, 2021, 08:01:45 pm
content: The problem with PCM2912A is that the USB descriptors are fixed. So even if you don't connect the DACs to anything, it will present it to the bus, and the PC might try to use it for audio output. Other than that, it's about as simple as you'll get for this.You may consider CM6327A which is just a mono USB ADC, exactly what you seek. Or CM118B (or one of their other chips, they have a bunch), which allows to put it into 'microphone mode' where it will only present the input channel to the PC. Audio performance of these ADCs is similar to the TI part (which is acceptable but not great). You might have a hard time getting your hands on them, though.

author: werediver
author_rank: Contributor
timestamp: March 26, 2021, 09:26:14 am
content: Quote from: ve7xen on March 25, 2021, 08:01:45 pmThis is nasty. I hoped audio output can be turned off on that chip. Thank you for mentioning this.Quote from: ve7xen on March 25, 2021, 08:01:45 pmA mono USB ADC is indeed what I seek. CM6327A doesn't show up where I usually buy parts, but I can find it on AliExpress. I suppose, it's acceptable in my case.CM6327A datasheet doesn't say a lot about the typical application (in terms of circuitry around the chip) and I can only find some photos of commercial product PCBs on the Internet. It seems, thought, that CM6327A can be used without uC control and even without EEPROM (with the default product string, PID, VID [sounds fine to me, also not planning to use more than one mic on the same machine]), and judging by those photos, the circuitry around the chip is not too complicated.Would be nice to take a look at some example design around CM6327A, though. Have you seen any out there?

author: tszaboo
author_rank: Super Contributor
timestamp: March 26, 2021, 09:56:45 am
content: PCM2902-12 is preatty much as barebones as it gets. They are on the market for more than a decade, and while there isn't anything exceptional about them, you don't actually need all that much for a basic audio device. USB 1.1 had this limitation. UAC2 never really happened, and nowadays everyone wants bluetooth and other interfaces.There are better products but most of them will require some sort of programming or connecting more than one IC together.

author: voltsandjolts
author_rank: Unknown
timestamp: March 26, 2021, 10:35:57 am
content: @OPJust in case you are considering going "full custom" route with a microcontroller, this is quite a nicely documented example:https://andybrown.me.uk/2021/03/13/usb-microphone/

author: werediver
author_rank: Contributor
timestamp: March 26, 2021, 10:48:03 am
content: Quote from: voltsandjolts on March 26, 2021, 10:35:57 amHey, it's a very interesting and pretty detailed article! Thank you for mentioning it.The hardware design isn't even that complicated, but clearly it pushes some complexity towards software (firmware). I have nothing bad to say about this approach, and the project is cool, but I'd prefer a more analog design. Well, maybe because I have enough software development during work hours

author: ve7xen
author_rank: Super Contributor
timestamp: March 26, 2021, 06:56:30 pm
content: Quote from: werediver on March 26, 2021, 09:26:14 amThey seem mostly interested in low-cost, high-volume consumer product manufacturers, so there's not great public documentation, especially for such a niche chip. We're lucky they publish datasheets. The critical thing missing here seems to be the default EEPROM settings, it's possible it just boots up muted and without an EEPROM. How to use the GPIO is also missing, and some PWRSEL pins are referenced but not defined. You could try e-mailing them, can't hurt. On the bright side, these chips are designed for absolute lowest cost in a typical application, which means a minimum of external components is likely required, so the EEPROM is almost certainly optional for a typical design.I haven't seen any designs well documented; my own interest is on the high end side, so I've spent some time trawling CMedia for useful chips, but only actually used the CM6631A (USB UAC2 -> I2S) (and then just on a devboard, I decided to implement this function myself in the end since this requires 'firmware' that is not trivial).QuoteWith a digital mic, there's practically no analog at all! Intermediate option might be using a separate I2S ADC and a similar software design, but you're unpacking the microphone part more than the microcontroller part which would be largely the same.The 'struggle' here so to speak is that low end, value solutions will be completely integrated with a fixed configuration (as you are finding that you generally get either just a DAC or a DAC+ADC, but not often just an ADC) like the CM6327A, but once you move away from that, there's too much configuration required for a fixed solution, and if you're going to need a micro anyway, you may as well implement the USB there too. There are still a couple products out there that bridge that gap (handle USB<->I2S but require an external micro for configuration), but not many. See CP2615/CP2114 (now NRND), or maybe SA9227 that is even less well documented than CM6327A.You will find USB UAC1 app notes for most USB microcontrollers that contain an I2S peripheral, though.I've done a fair bit of digging around this area, and if you don't want to use a firmware-based implementation, you don't have many options. Most integrated chips include DACs as well, and most USB-I2S bridges, which are few and far between anyway, aren't configurable enough for this.

author: werediver
author_rank: Contributor
timestamp: March 27, 2021, 04:23:14 pm
content: At this point I'm starting to digress towards the idea of using a µC to implement the USB audio interface. The trade-offs of the integrated solutions discussed above just make me sad; you know, it's a hobby project and I want it to beright(or, well, as close as possible to what I imagine). Having unused audio outputs (with PCM29xx) or lacking documentation (CM6327A) seems justwrong.I'd be happy to try out the SAMD21 board (XIAO) I already have, but there seem to be so much more information about USB audio on STM32—even the above mentionedAndy Brown's USB mic project—that I may just go straight for STM32 to shorten the route.I still want an analog mic+preamp-compressor part (as an exercise for myself, if nothing else), hence a dedicated ADC (16-bit at least).

author: voltsandjolts
author_rank: Unknown
timestamp: January 01, 2022, 03:35:29 pm
content: Just adding something to this sleeping beauty...Spotted another interesting USB microphone setup using an I2S microphone and RP2040 microcontroller running TinyUSB:https://electronut.in/mico/https://github.com/mkvenkit/mico

author: werediver
author_rank: Contributor
timestamp: January 22, 2022, 03:39:37 pm
content: QuoteA couple of boards that may be suitable / interesting for a similar uptake:-Seeeduino XIAO RP2040(tiny; would need an equally tiny daughter-board with a mic)-Seeeduino XIAO BLE Sense(nRF52840 withMSM261D3526H1CPMmic)The latter one is, basically, only lacking a firmware to become a USB microphone.