usb_audio USBSpeaker class & enabled on nordic#11062
Conversation
|
Is the best way to handle the ones that overflowed from nordic port to add the config disabling them individually to their mpconfigboard.mk files? Or is there some higher level switch that exists already or we could create that would allow turning off the swath of them at once? |
|
The latest commit limits this to only nrf52840 and boards with external flash. That looks to have resolved all of the overflowing ones. Thanks for the tip @dhalbert. |
dhalbert
left a comment
There was a problem hiding this comment.
Now that you've added USBSpeaker, I'm wondering about the API. If you look at usb_midi, you see that usb_midi.enable() is just on/off. The PortIn and PortOut objects are not constructable, but are just available as pre-created singletons.
In the current usb_audio API, what would happen if you tried to create more than one USBSpeaker or USBMicrophone? I would think it would or should fail.
I'm thinking maybe USBSpeaker and USBMicrophone should also be fetchable singletons (or Null) as in usb_midi, and not actually constructable.
The usb_audio.enable() call is somewhat confusing because the direction parameter doesn't relate directly to speakr or microphone. Suppose instead it were something like usb_audio.enable(speaker=True/False, microcphone=True/False, ... <other current optional params)?
Added
USBSpeakerimplementation that can take audio from a computer over USB and integrate with existing audio APIs. You can apply effects withaudiospeedand similar modules, and ultimately pipe it to an output source like I2SOutI also tested USBMicrophone on RP2350, nrf52840, and samd51 successfully. Right now this PR enables
usb_audiofor the nordic port which required a few changes to handle the way isosyncronous endpoints are handled under nordic. I've left it disabled on atmel port for now, I had to disable some other things to make room for it and I think there will be a fair number of boards that will overflow.