Hello all, I'm working on putting an unusual combination of features together into a project, and I'd much appreciate some advice in terms of what hardware is most suitable for it!
The general idea is to have a keyboard-like device for selecting music based on some characteristics for the purposes of providing ambiance for tabletop roleplaying games. So it takes power in (probably over usb-c), and based on user interaction with the buttons, send audio out, along with some UX in the form of per-button lighting and a small display.
I am planning on using AMB Labs' Gamma1.5 DAC/Amp
https://www.amb.org/audio/gamma1.5/ for all things analog on this project, largely since I have one built already. This device has two boards-- the top one implements UAC1/2 in isochronous-asynchronous mode, outputting i2s to the bottom board, which does the DAC and analog output. I'm aware that this device is probably overkill, but hey, I already have one around.
Here is a list of the functions I'd like the main board to handle, in order of descending importance:
1. Reading .mp3 files off of a microSD card (SPI?) to send over USB UAC1. For the most part, lossless or uncompressed versions of these files don't exist. UAC1.0 should be enough in this case.
2. USB audio output to the AMB Gamma1.5. This should probably be UAC1 given the files. UAC2 would be nice to implement later, but seems much more difficult and not really necessary?
3. Scanning a ~35-key matrix and implementing some more advanced keyboard-style functions (function layers, long key presses, modifier key)
4. Driving a 128x64 monochrome OLED display over SPI for simple text/progress bar rendering
5. Sending data to ~35 WS2812B-style RGB LEDs
On Raspberry Pi this was all pretty trivial to get working, but I'm much less skilled with C and lower-level code. I will eagerly use any existing drivers and libraries I can get my hands on, particularly for UAC2 and things like the display driver. I am also fine with using additional ICs which may make this list of functions more achievable. The plan is to build a custom PCB supporting all of these functions (resembling a keyboard PCB with some extra headers).
My initial rationale was that this is something like a keyboard that plays audio, so I started looking at the boards supported by QMK Firmware (
https://github.com/qmk/qmk_firmware), but ultimately I think it's more like an audio player that also has keyboard functionality! That said, the STM32s seemed like a good starting point. I've looked at ChibiOS as a starting point since that's what QMK uses, but it seems there are some issues with the UAC2 stack, so I have also just learned of the EZ-USB FX2 and the XMOS X-CORE (and of course there is the AVR audio-widget project upon which the top half of the AMB Gamma1.5 is based). The main thing I'm struggling with in terms of finding examples is that almost nobody ever wants to do USB audio OUT, they typically want to go the other way and have their MCU either do ADC from a mic, or do DAC as a sound card.
Any advice on implementation? Seems easy enough to find drivers for any given purpose, but identifying implementations that all work on the same platform together is where I start to lose the plot. I am new to all this, so I also assume I have made some naive assumptions or overlooked some obvious facts along the way.
I think my first goal on some STM32-Discovery board (or similar) is to make a device that will deliver audio data to the AMB Gamma1.5 over UAC1.0, likely from a short .mp3 stuffed into the firmware.
Thank you for reading!