hathach / tinyusb

An open source cross-platform USB stack for embedded system
https://www.tinyusb.org
MIT License
4.85k stars 1.03k forks source link

Interrupt-endpoint for audio class #1697

Closed battlesnake closed 3 days ago

battlesnake commented 1 year ago

Related area

Audio class UAC2

Hardware specification

STM32H7 (probably not relevant)

Is your feature request related to a problem?

UAC2 supports an interrupt endpoint to provide notifications to the host about control changes (e.g. mute button pressed on the device).

I see that there is some code for this, but it seems incomplete. I see audio_device.c never assigns a value to audio->ep_int_ctr. Compare to feedback endpoint (which I have working), which assigns and clears audio->ep_fb as needed.

Describe the solution you'd like

Support for the interrupt endpoint in Audio Class devices.

I can implement this myself, but any advice/guidance beforehand would be appreciated!

I have checked existing issues, dicussion and documentation

battlesnake commented 1 year ago

Working, but possibly ugly implementation: https://github.com/hathach/tinyusb/pull/1702

Gadgetoid commented 6 months ago

I came across the linked PR while searching for a means to synchronise device control changes (volume and mute in particular) to the host. I'd like to register my interest in this feature.

battlesnake commented 6 months ago

Sure. My fork of tinyusb has a few extra features implemented for audio class, but didn't get merged as I don't have the boards used by the mainline project for testing. If you don't need any newer features than my fork (or official support from the project), you could potentially use my fork.

Gadgetoid commented 5 months ago

If you don't need any newer features than my fork (or official support from the project), you could potentially use my fork.

Unfortunately I think I need both, I'd hoped I could get away with cherry-picking some bits from your fork but so far it's mostly lead to eclectic bugs and crashes.

Thanks for blazing this trail, anyway, there are surely others out there like me who think using media keys to have the host control the volume is barbaric 😆