Jeroen's Project Journals

  • DSP/DAC

  • A 4-channel USB DAC built around a pair of TI PCM5102A's with advanced DSP capabilities provided by a Teensy 4.0. Includes a 3D printed enclosure, OLED display and rotary click-encoder control

  • Gallery

Progress at last!

2026-05-22

Way back in 2023, I wrote about the major issue with this project. To recap: the Teensy Audio library does all processing in 16-bits, which means volume control in the digital domain leads to noticeable loss of sound quality. I ended with the line “I might try to modify the mono-amps to a lower gain, and I’m also looking into ways to do the DSP in 32 bits. I’ll probably needto do both, I suspect.”. This turned out to be quite prophetic, as that is exactly what I ended up doing, although that second part took until this year.

Lower amplifier gain

Modifying the gain of the mono-amps turned out to be the easy part, as all it took was removing one resistor and replacing another resistor with a different value. The soldering was slightly tricky, and the result may not be the prettiest, but it does work and this mod lowers the gain from 32 dB to 20 dB. To put this into perspective: 32 dB is equivalent to a 40x amplification of the voltage while 20 dB is a 10x amplification.

Closeup shot of the mod to reduce the gain of an amplifier

Analog volume control

While the reduction in gain was significant, a 20 dB amplification is substantial and I still needed to reduce the volume to get the sound volume at a tolerable level. Doing this digitally with the 16-bit processing of the Teensy library led to audible reduction in sound quality, and rewriting this so it could handle 32- or 24-bit seemed to me too massive a project to take on.

So as a workaround I looked into analog volume control. You can read all about that in the amplifier section. In the end I never really got this working, and at some point I gave up, shelved the project and reinstalled my crappy old SMSL mini-amplifier, with my concrete subwoofer sitting idle on my desk.

24-bit DSP

Fast-forward to 2026, and we are now in the era of LLM’s. I use LLM’s for software development at work, and am well aware of their limitations. I’m also aware of the dubious ethics of LLM training-material and the business practices employed by AI companies. Still, there’s no denying this generation of AI is, as one colleague puts it, a “force multiplier”. In this case, it let me take on a project that I dismissed as too much work just a couple of years ago. The steps I needed to take were:

  • Turn the Teensy into a 24-bit capable USB audio device
  • Create a connector from this 24-bit USB audio device into Chip Audette’s OpenAudio_ArduinoLibrary
  • Add support to OpenAudio_ArduinoLibrary for the I2S2 Teensy peripheral

This was done pretty quickly, and it actually works great. The Teensy is shown as a 24-bit device, and the entire processing path uses either int’s or float’s.