Wait, what ? Again ? sigh yeah, again.
Loose implementation of excellent ST appnote AN5142,
using so-called Black Pill
boards.
So, USB audio on STM32. Usually this involves USB-I2S bridge, some DAC, and maybe power stage on cheap D-class chip. Boring. Let's do it in software (and hey, check that paper above, really).
(back ? good)
Audio data flow:
As one can see, while overall scheme remains the same, some (let's call it) improvements exists:
- S16/S24/S32/FLOAT@44.1/48kHz and S16/S24@88.2/96kHz as input;
- optional subwoofer channel with crossover at 120 Hz;
- 8x/16x upsampler with 24/48-tap FIR interpolator;
- 4th order noise shaper;
- 7bit/384kHz PWM as output;
From USB poit of view, things are pretty straightforward:
- arm-none-eabi toolchain, i.e. from here
- octave with
- octave-signal extension.
git clone --recurse-submodules
make
Precompiled binaries are in bin/ directory
Resulting PWM outputs are GPIOA8/GPIOA9 for left/right channels, with complementary GPIOB13*/GPIOB14*. Sample schematics for headphones:
Another one, sort of 'desktop speakers':
Oh, and you can attach OLED display. Or two. And encoder. And proper power stage. Anyway, here's latest:
Maybe i should consider title change.