-
|
Hi all, I have a USB 2.0 Audio 2.0 device, implemented with STM32F0 custom board. The current firmware version (if you're interested) is available in https://github.com/anttikes/usb-fm-radio/tree/main/Firmware My device is otherwise working ok but I have a rather peculiar problem. When I enable the audio device from the Sound applet in Windows, I get the SET INTERFACE call to choose the alternative setting 1. Right after that, I get an "unknown type 7f" packet in Wireshark with the "URB transfer type" set to "Unknown (0xff)" directed at the control endpoint 0x00. TinyUSB probably answers this by stalling the control endpoint and the operating system driver then reports USBD_STATUS_NOT_SUPPORTED. After this occurs, the operating system then chooses the "muted" interface (alternative 0), obtains the sampling frequency, and then chooses alternative 1 again before starting the streaming. I've come to understand that this is kind of a "soft reset" in response to TinyUSB stalling the unknown request. What I want to do is trap this "Unknown type 7f" and handle it properly so as to prevent the "soft reset". The reason for wanting this is that I want to start the stream in the firmware (enable I2S and issue a sampling rate command) when I receive the "alternative setting 1", and conversely stop it when "alternative setting 0" arrives. I know I could use a timer in the STM32F0 to solve this but I'd rather handle the request that the host is sending me. Although not visible in the repository above, I have tried enabling the "vendor" class driver ("CFG_TUD_VENDOR 1") and implementing the "tud_vendor_control_xfer_cb" function but this function is not called in this case. I have looked at the other examples implementing this function but they all have the Microsoft OS 2.0 descriptor and BOS, among other things. I'd rather avoid those, if possible. Any ideas or pointers on what I should do? Is there some special callback function in TinyUSB that I just don't know about?
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
|
I think you mean AUDIO 2.0 device, UAC1 support it's still pending in #3270.
Although I can't recognized the 0x7f request from poor Wireshark capture, the interface switching sequence is totally normal, there is no "soft reset" thing. |
Beta Was this translation helpful? Give feedback.
-
|
It took me quite a long while to get this test done but it seems the UAC 1.0 version is working much more logically. There's just one "SET INTERFACE" to start it, and one "SET INTERFACE" to stop it. Works like a charm. |
Beta Was this translation helpful? Give feedback.
-
|
One note I made during the migration. The "audio10_feature_unit_control_bitmap_t" seems to be missing a "AUDIO10_FU_CONTROL_BM_NONE" for scenarios where an audio device does not allow individual control for a channel. I'm not sure if this was intentional or not. I can always set that to "0x00", of course. An example from a two-channel feature unit with my suggestion: |
Beta Was this translation helpful? Give feedback.





It took me quite a long while to get this test done but it seems the UAC 1.0 version is working much more logically. There's just one "SET INTERFACE" to start it, and one "SET INTERFACE" to stop it.
Works like a charm.