Ultimate 4 channel audio recorder

Portable, 2 channel, balanced input, 24 bit 96khz recording

Similar projects worth following
Using knowledge gained from the ultimate vlogging mic & knowledge of its mane use patterns, the plan for replacing the venerable Zoom took shape. Basically, merge the microphone preamp of 7 years with the AK4524 circuit. Make it permanently phantom powered, with XLR inputs. The AK4524 can be used as a differential ADC by combining its 2 channels & it's not a huge drop from the PCM4222.

Based on the use pattern, it also needs a way to monitor 2 channel audio from another digital source without recording it. Maybe this audio could be injected from WIFI. Another circuit will record TOSLINK output from the computer, at a different samplerate than the microphone audio. This should allow it to be used for the ultimate narration of screen captures, as well as ASMR audio & rocket launches.

It's been a long time coming, with many questions.  Switchable phantom power & input jacks?  Just buy a better Zoom?  The Zoom was never used to record stereo from electret condensers since bootlegging, 8 years ago.  The gootube has eliminated any need for bootlegging & any concerts worth it are better shot with the DSLR.  Its only line output recordings were from tape.  The tape deck needs to be restored, to do that again.  There's a lot more information about restoring tape decks than 8 years ago & the need to do it.  Perhaps switchable input modes are important.  The connector style & phantom power would be changed with molex connectors & jumpers.

The PCM4222 is sort of a pain because it requires an antialiasing filter outside the chip & an external DAC for monitoring. Not sure the guys building ultimate recorders out of them are getting any better results from them, because the noise from the slightest analog chain knocks it down below 14 bits.  They never ever show a waveform of a biased DC offset captured by them.

Beyond a certain point, it's easier just to invest in a better Zoom.  The H2 from 8 years ago was always a piece of junk.  There are better Zooms, for a price, but for the limited applications, it's not worth the price.  

Reviewers are loath to ever stress test their gear because they can forget about ever selling it, but in here

there was a brief segment where he turned the gain to 0 & recorded the self noise of his Zoom H6. Tried an unscientific comparison with the homemade audio recorder also at gain 0. In both cases, there's enough gain at 0 to barely hear a voice. The homemade gain 0 could be much lower than the Zoom gain 0, but the voice is equally unintelligible in both. Wouldn't expect much from the Zoom H6 because it's a prosumer product.


Normalized outdoor recording. It was originally -43db. Microphone noise, computer noise & pops abound. It might have had a buffer overrun. Now you see how hard it is to get perfect & consistent results from home made audio gear & why hobbyists focus on a specific technology like tubes instead of trying to achieve perfect metrics.

flac - 31.74 MB - 01/28/2018 at 06:29



The 1st files it recorded before it crashed, with no compression. Aux/I2S2 output

Waveform Audio File Format (WAV) - 560.00 kB - 01/14/2018 at 07:16



The 1st files it recorded before it crashed, with no compression. Mane/I2S3 output

Waveform Audio File Format (WAV) - 560.00 kB - 01/14/2018 at 07:16


  • Having what past lions wanted

    lion mclionhead06/19/2018 at 07:31 0 comments

    This gadget hasn't gotten the use hoped for.  The teenage lion of many decades ago dreamed of having an open reel tape teck & sounding like Van Cliburn.   The closest he ever got was the mighty Technics RS-BR465, but that Yamaha C3 still sounded terrible.  The biggest leap toward the Van Cliburn sound came from getting better piano teachers, years of practice, better instruments, & digital editing.

    Now the lion kingdom made better gear than anything that existed decades ago.  Given what this circuit revealed about the noise introduced by just millimeters of wire & any single ended analog signal, any tape head or stylus is a gigantic radio receiver.  There's no way any open reel tape deck or record player could ever compete with even a 16 bit digital system at 48khz.  They can only color the sound & introduce a musical form of noise.

  • Dave explains noise

    lion mclionhead05/20/2018 at 00:13 0 comments

    A good explanation of the noise encountered in this circuit.  Noise in very low frequencies grows because of 1/f noise rather than the nV/root Hz rating.  1/f noise is the reason you need blocking caps.  The nV/root HZ rating of an op amp is actually for a very small bandwidth.  It actually compounds as the bandwidth increases.  His explanation of RMS noise is a bit easier than TI's.

  • Differential output monitoring

    lion mclionhead01/27/2018 at 23:31 1 comment

    After upgrading the preamp, decided to make the VU meters show differential output instead of single ended levels.  Single ended  noise was too high for the meters to be any use, but

    The differential output was in the weeds with the preamp off.

    Maximum preamp gain with no microphone was still around -79db.  The gain is only 12x.

    The aux channel has pops.

    Single ended preamp with maximum gain was a bit noisier.  For each mixdown mode, the VU meters have the relevant titles & the relevant number of meters.

    The room noise with the microphones connected & maximum gain, so obsessing over -79db or -60db is about as pointless as any game.  

    When lions 1st saw digital audio on a computer 25 years ago, -40db was the lowest useful level for any VU meter.  All the consumer gear stopped at -40db, even after minidiscs came out.   -90db was a ludicrous option on DAWs for many years.  Who knew it would be necessary for testing home made gear.

  • Vs the Zoom H2

    lion mclionhead01/18/2018 at 01:09 0 comments

    Plotted some waveforms comparing the noise of various configurations in differential mode.  All were magnified to 1/262144 per Y pixel.  With all the junk beyond what was connected to the Zoom, it still outperformed the Zoom.  The Zoom doesn't have a gain control or phantom power, but does have some passives, so it's like the AK4524 with no preamp.

  • Noise notes

    lion mclionhead01/17/2018 at 06:59 0 comments

    Disconnected successively more components, starting with the microphones & ending with just the op-amps to isolate the noise sources.  

    The noise is over the air, not over the power rails.

    There is 60Hz line noise from the bench & 10Hz wifi noise from the pi.

    In differential mode, turning off wifi offers no improvement beyond using txpower 5.  In single ended mode, turning it off knocks out significant noise.

    Powering off a battery, LM317, 78L05, RC filter made no difference.  

    Unplugging the phantom power circuit from the op-amp causes the largest reduction in noise.  

    Moving the PI farther away from the preamp, reducing txpower to 5, & using differential mode are going to be the standard use case & the keys to acceptable noise levels.  This gives the following waveforms at 1/262144 per Y:

    With these measures, the system is at least as good as the Zoom was in its best days.  It's important to remember no other audio interface in the world uses wifi.  Though the noise is horrendous in single ended mode, it's acceptable because the preamp is the only subject of concern, it's the same circuit that was used with the Zoom, & it's never going to be used in single ended mode.

    Would only complain that it's nowhere close to the ASMR videos of others & the headroom is reduced when combining the differential signals digitally.  You wouldn't notice the headroom except when listening to fully saturated levels.  The next steps would involve a new phantom power circuit, shrinking the wires in the preamp, using digital pots, disabling wifi, moving the entire ADC chain inside the microphone, optical outputs, adding pilot lights to the JFETs.

  • Tupperware preamp rides again

    lion mclionhead01/16/2018 at 07:45 0 comments

    Kept what was there from 7 years ago.  Made the amplifier section output differential signals.  Of course, there are sections where the pairs aren't close together & this is where the RF gets in.  At least it worked as designed.  Considering the preamp, a Zoom H6 would be smaller & easier to use.

    A few more software bug fixes & it finally captured microphones with the monitoring working perfectly in both channels.  Another change made the MANE volume control all the mane/I2S3 levels & the AUX volume control all the aux/I2S2 levels.  It now requires both faders to adjust a stereo volume, but it's more intuitive.  Also, the 2 channel mode using ADCs as differential pairs (L+/-  R+/-) now has to write a separate file for each channel.  A bit more effort could make every mode write a single file, but it's hardly ever going to be used.

    Like the Zoom H2, the ADC board has no input protection.  To protect it from 48V pops, the preamp has spudger diodes.  The TLV320AIC32 in the Zoom simply blew up when plugged into phantom power.

    The output of the ADC is a bit quieter than it was on the Zoom, because of the larger voltage range.  The preamp already does 100x.  The ADC can provide additional gain, but it has to be a GUI option.  

    The real problems show up in the L/L  R/R mode.  Here, the differential pairs subtract away the microphone signal & sum the RF.  The RF is highly suppressed in the +/- modes, but still there.  The RF getting into the preamp is awful.  It's probably why others put thousands of parts into their preamps & pilot lights in their JFETs.

  • The GUI

    lion mclionhead01/15/2018 at 07:37 0 comments

    The mane feature of the GUI is the setting for mixing the 4 ADC's.  Mixing down before writing was deemed necessary, since the storage goes from 10 hours for a single channel to 2 hours for 4 channels & multiple files with differential pairs are a pain.  The mixing for storage is a completely different set of equations from the mixing for monitoring.  

    The VU meters still show the independent levels of the 4 ADCs.  The top 2 are the AUX I2S & the bottom 2 are the mane I2S.  The board layout led to the mane I2S always being the higher number on every list.

    The 2 monitoring volumes are applied differently, depending on the mixing formula.  The easiest way to figure out how they're mixed is by listening & tweeking the faders.

    The mane trend is the use of the ADCs in the AK4524 as either a differential pair, an averaged pair, or 2 discrete channels.  It should be obvious from the GUI.  Each I2S needs to write to its own file because of synchronization problems.  The Zoom H2 had the same problem.

    After a heroic programming session, the file writer was upgraded to a 16 second buffer which writes as soon as it has data instead of in 1 second chunks.  The SPI buffer was increased to 1/18 second, which was the maximum the STM32 could easily fit.  More draconian measures could get it to 1/11.  Unfortunately, its core coupled memory isn't accessible to DMA, which would have doubled the SPI buffer. 

    With all that going for it, it still overran once when recording 4 channels for 40 minutes.  Don't expect to ever record 4 channels, except for testing the other modes.  The next step would be recording to USB storage or moving the whole PI to a faster SD card.

    It still only does 48khz & only uses the AK4524 as the source for I2S2.  Have never ever used 96khz, despite it being on the Zoom H2.  The biggest value was 24 bits.  The problem is moving the ultimate stereo amplifier to a commercial 96khz DAC would give up the external tap for I2S.  It would be a matter of swapping the TOSLINK between 1 board purely for capturing it & a board for listening to it or somehow splitting the TOSLINK.  A USB soundcard would be the hardest to sniff.

    The next matter is the preamp.  

    The thought occurred of dumping 48V phantom power & replacing the microphone electronics with op-amps boosting directly to line level.  These mics are virtually free, have been replaced by USB versions & it would reduce the noise.  It would require exposing some kind of gain adjustment, but the metal enclosure is absolutely required to stop interference.  It's not for stopping singers from accessing the bass rolloff switch.  A preamp conversion would be a lot of work splitting mane hairs for a truly meaningless difference.

  • 1st recording

    lion mclionhead01/14/2018 at 07:18 0 comments

    Capturing PC audio in software sounds like a good idea until you have to monitor the PC audio in the phones.  That would require a mixing board & a bunch of wires.  The easiest way is capturing TOSLINK on the same board as the microphone & mixing it in software.  Sometimes, the best way to do more in software is more custom hardware.

    The trick is the AUX I2S clock is going to drift away from the mane I2S or be at a totally different sample rate.  The only solution is to record different files for each I2S & take nearest neighbor samples for the monitoring.

    Otherwise, rediscovered the raspberry pi's largest SPI buffer is 4096 bytes.  You need to add spidev.bufsiz=32768 to /boot/cmdline.txt to expand it.  

    The 1st audio file recorded open circuits & showed -86.6, -87.6, -87.4, -88.08 dB for the maximums & -99.4, -99.8, -99.8, -100 dB for the RMS.  They strangely got quieter as they went down the board, but were all good enough.

    4 channels magnified to 1/262144 per Y.

    When recording different files for the 2 I2S streams, it overruns all the time, even at 48khz.  CPU usage is 5%.  In typical ext4 fashion, it frequently locks up while doing an extended write.  Mutex locking the 2 file writers doesn't help.  The maximum SPI buffer size which can fit in the ARM is 12296 bytes.  It needs some minimal mixing instead of writing the full ADC output & a more optimized buffer algorithm.  Partitioning the flash into a raw area might be required.

    The 1st files it recorded before it crashed:

  • I2S & DAC testing

    lion mclionhead01/12/2018 at 08:38 0 comments

    In testing the DAC, the single ended output voltage is roughly 1.1 - 3.9 with the center at 2.5.  The DAC is 20 bits, so you need to write -0x80000 to 0x7ffff.  The ARM was configured with I2S_Standard = I2S_Standard_MSB, I2S_DataFormat = I2S_DataFormat_32b, I2S_CPOL = I2S_CPOL_Low.  The AK4524 was configured with I2S mode 1.  The I2S->DR register is written as well as read with most significant 16 bits 1st.  The ADC spits out the sample left justified & the DAC takes it in right justified.  In 96khz mode, the AK4524 drives I2S at twice the bit clock as 48khz mode but the format is the same.

    Unfortunately, to minimize noise on the 5V rail, the headphone amplifier is powered by the 3.3V rail & it's DC coupled to the DAC. At least for the 440Hz test tone, the AD8604 dumps loads of current & 100% volume is far too loud.   50% volume is required to get below 3.3V & that is also quite loud.  May just risk using the 5V rail rather than make an AC coupled headphone amplifier.  Other ideas are shifting the midpoint in software to 2.2V, giving roughly 75% volume.  The output does seem to be DC coupled to the DAC.  It also has an intermittent problem of not initializing the left DAC after an ARM reboot until being power cycled.

    Didn't notice any noise with the 3.3V power.  Differential output definitely isn't necessary for a simple headphone monitor.

  • Board bringup & full duplex I2S

    lion mclionhead01/11/2018 at 09:27 0 comments

    Once the usual GPIO snafus were fixed, attention turned to using the AK4524's built in DAC for monitoring.  Banging on this discontinued chip isn't so bad when you consider guys are going around building computers out of 6502's.

    C11 didn't work as I2S3ext_SD.  Only B4 did.  The datasheet had a buried nugget about aux function GPIO_AF_I2S3ext having to be selected for C11 while the aux function was GPIO_AF_SPI3 for B4.  No amount of register banging could send data out of C11.  What did help was printing the contents of SPI3->I2SCFGR & I2S3ext->I2SCFGR to verify the key registers were being set correctly.  Also review the I2S_FullDuplexConfig, I2S_Init functions.  Once full duplex is enabled, you have to use I2S3ext registers to send or receive data using the ext_SD pin & the I2S3 registers to access the SD pin.  Both pins can be inputs or outputs.  

    The timing of when to send what 16 bits to the DR register to reconstruct 2 channel 24 bit samples is a bit tricky.  Similar to a state machine which uses the channel side bit & a counter to sort the 16 bit reads from the DR register, another state machine must use the same bits to sort 16 bit writes.  Not sure how people do it with DMA, but it definitely must be done with polling to downmix the 4 input channels & monitor audio without latency.  

View all 13 project logs

Enjoy this project?



Louis Parkerson wrote 01/10/2019 at 17:02 point

Hey, the project I am currently working on, Pi Portable Recorder, is very similar to yours and it would be very interesting to see your schematics and code (mainly schematics). Is there anywhere I can find these? Thanks, Louis

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates