Closed hansfbaier closed 3 years ago
This likely needs more work. I'll close this request and open another one if I have a working example luna device.
This does look awesome so far -- looking forward to reviewing this when you submit it. :)
@ktemkin Thanks! When running an example I still get read descriptor errors, and I have no idea whats wrong and how to go about that.
When running an example with your custom descriptors? Out of curiosity, what's the total configuration descriptor length?
If it's greater than e.g. 64B, you might be running into this: https://github.com/greatscottgadgets/luna/issues/86
@ktemkin Yes it is definitely bigger than that (172 Bytes IIRC), many thanks for the info. Will look into that issue.
@ktemkin Yes the ticket mentioned above is a blocker to USB Audio, since UAC descriptors for a minimal real world interface (2 out 1 in, no MIDI) are already quite large (over 100 bytes). I'll reopen this pull request in case you feel like taking it on. Since my ability to test the code is blocked by the mentioned issue, the code still might need amendment. (And surely I still will need to implement MIDI streaming, which is totally missing, but I want to get audio working before that).
Here is an example using the UAC2 descriptors: https://github.com/hansfbaier/luna/blob/uac2/examples/usb/usb2_audio.py
I am currently adding MIDI support.
This implements enough of USB Audio Class 2.0 for a real world audio interface. It also contains a small part of UAC3 (which I will probably not use/extend). I am not sure if the UAC3 part should be included, but I reckon it might not hurt to have it there in case someone might want to implement it and save that bit of effort. I tried to factor out common parts (shared between UAC1, 2 and 3) into its own file.