3 ms·
> USB Audio device class and a USB stack. That's a hell of a lot of code. Its actually not that much for the bare minimum needed, though the USB docs are prett
by ranma42 6y ago
> USB Audio device class and a USB stack. That's a hell of a lot of code.
Its actually not that much for the bare minimum needed, though the USB docs are pretty daunting.
If you go with USB1, you basically just need enough to answer the descriptor and set interface queries and set up the endpoints (in particular the isochronous endpoint for audio is a bit more complex). If you stick to exactly one supported format and sample rate and don't include any control units, you can basically skip all the audio class control messages.
For USB1, in a pinch, you can use a cheap generic 24MHz usb logic analyzer and pulseview to decode the raw usb protocol for debugging (though with 24MHz you get some corruption in the capture from clock drift, you need at least 48MHz for more reliable signal sampling).
I'd guess you can make do with ~1k LOC in this case.