Skip to content

usb_audio USBSpeaker class & enabled on nordic#11062

Open
FoamyGuy wants to merge 6 commits into
adafruit:mainfrom
FoamyGuy:usb_audio_output_speaker
Open

usb_audio USBSpeaker class & enabled on nordic#11062
FoamyGuy wants to merge 6 commits into
adafruit:mainfrom
FoamyGuy:usb_audio_output_speaker

Conversation

@FoamyGuy

Copy link
Copy Markdown
Collaborator

Added USBSpeaker implementation that can take audio from a computer over USB and integrate with existing audio APIs. You can apply effects with audiospeed and similar modules, and ultimately pipe it to an output source like I2SOut

I also tested USBMicrophone on RP2350, nrf52840, and samd51 successfully. Right now this PR enables usb_audio for 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.

@FoamyGuy

Copy link
Copy Markdown
Collaborator Author

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?

@FoamyGuy

Copy link
Copy Markdown
Collaborator Author

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 dhalbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants