From 61af44e07bc86484e814a183ad91671bd71b3b10 Mon Sep 17 00:00:00 2001 From: imi415 Date: Thu, 10 Feb 2022 21:45:13 +0800 Subject: [PATCH] Added misc files, more descriptor trials. --- .clang-format | 2 +- CMakeLists.txt | 1 + Core/Inc/usbd_descriptors.h | 56 +++++++--- Core/Inc/usbd_uac_process.h | 11 ++ Core/Src/main.c | 13 ++- Core/Src/usbd_uac_process.c | 80 ++++++++++++++ misc/nxp.lsusb | 162 +++++++++++++++++++++++++++++ misc/self.lsusb | 201 ++++++++++++++++++++++++++++++++++++ misc/up4.lsusb | 172 ++++++++++++++++++++++++++++++ 9 files changed, 678 insertions(+), 20 deletions(-) create mode 100644 Core/Inc/usbd_uac_process.h create mode 100644 Core/Src/usbd_uac_process.c create mode 100644 misc/nxp.lsusb create mode 100644 misc/self.lsusb create mode 100644 misc/up4.lsusb diff --git a/.clang-format b/.clang-format index 3003f59..7427375 100644 --- a/.clang-format +++ b/.clang-format @@ -2,7 +2,7 @@ BasedOnStyle: Google IndentWidth: 4 AlignConsecutiveMacros: AcrossEmptyLines AlignConsecutiveDeclarations: true -AlignConsecutiveAssignments: AcrossEmptyLinesAndComments +AlignConsecutiveAssignments: true BreakBeforeBraces: Custom BraceWrapping: AfterEnum: false diff --git a/CMakeLists.txt b/CMakeLists.txt index e59d118..21c97e7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,6 +37,7 @@ set(TARGET_C_SOURCES "Core/Src/stm32h7xx_hal_msp.c" "Core/Src/stm32h7xx_hal_timebase_tim.c" "Core/Src/system_stm32h7xx.c" + "Core/Src/usbd_uac_process.c" "Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal.c" "Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_cortex.c" "Drivers/STM32H7xx_HAL_Driver/Src/stm32h7xx_hal_dma.c" diff --git a/Core/Inc/usbd_descriptors.h b/Core/Inc/usbd_descriptors.h index 8a023c8..409418b 100644 --- a/Core/Inc/usbd_descriptors.h +++ b/Core/Inc/usbd_descriptors.h @@ -18,10 +18,21 @@ UCHAR device_framework_fs[] = { 0x03, // iSerialNumber 0x01, // bNumConfigurations + /* Device Qualifier descriptor */ + 0x0A, // bLength + 0x06, // bDescriptorType + 0x00, 0x02, // bcdUSB + 0xEF, // bDeviceClass !! DESCRIBED IN IAD + 0x02, // bDeviceSubClass !! -^ + 0x01, // bDeviceProtocol !! -^ + 0x08, // bMaxPacketSize0 + 0x01, // bNumConfigurations + 0x00, // bReserved + /* Configuration descriptor size=9 */ 0x09, // bLength 0x02, // bDescriptorType - 0xA4, 0x00, // wTotalLength !! 9 + 8 + 9 + 85 + 9 + 16 + 6 + 8 + 7 + 7 ... + 0xB1, 0x00, // wTotalLength !! 9 + 8 + 9 + 89 + 9 + 9 + 16 + 6 + 8 + 7 + 7 ... 0x02, // bNumInterfaces 0x01, // bConfigurationValue 0x00, // iConfiguration @@ -55,7 +66,7 @@ UCHAR device_framework_fs[] = { 0x01, // bDescriptorSubType 0x00, 0x02, // bcdADC !! 2.00 0x08, // bCategory - 0x55, 0x00, // wTotalLength !! 9 + 8 + 8 + 8 + 9 + 14 + 17 + 12 + ... + 0x59, 0x00, // wTotalLength !! 9 + 8 + 8 + 8 + 9 + 18 + 17 + 12 + ... 0x00, // bmControls /* Audio Control Clock Source descriptor CID=0x10 size=8 */ @@ -99,14 +110,15 @@ UCHAR device_framework_fs[] = { 0x03, // bmControls !! Windows UAC 2.0 driver does not support SET_CUR. 0x00, // iClockSelector - /* Audio Control Feature Unit descriptor UID=0 size=14 */ - 0x0E, // bLength !! + /* Audio Control Feature Unit descriptor UID=0 size=18 */ + 0x12, // bLength !! 0x24, // bDescriptorType 0x06, // bDescriptorSubType 0x30, // bUnitID !! 0x20, // bSourceID !! From Input Terminal TID=0x20 0x0F, 0x00, 0x00, 0x00, // bmaControls(0) !! - 0x0F, 0x00, 0x00, 0x00, // bmaControls(1) !! + 0x00, 0x00, 0x00, 0x00, // bmaControls(1) !! + 0x00, 0x00, 0x00, 0x00, // bmaControls(2) 0x00, // iFeature /* Audio Control Input Terminal descriptor TID=0x20 size=17 */ @@ -118,7 +130,7 @@ UCHAR device_framework_fs[] = { 0x00, // bAssocTerminal !! 0x12, // bCSourceID !! From Clock Selector CID=0x12 0x02, // bNrChannels - 0x00, 0x00, 0x00, 0x00, // bmChannelConfig + 0x03, 0x00, 0x00, 0x00, // bmChannelConfig 0x00, // iChannelNames 0x00, 0x00, // bmControls 0x00, // iTerminal @@ -140,6 +152,17 @@ UCHAR device_framework_fs[] = { 0x04, // bDescriptorType 0x01, // bInterfaceNumber 0x00, // bAlternateSetting + 0x00, // bNumEndpoints + 0x01, // bInterfaceClass + 0x02, // bInterfaceSubClass + 0x20, // bInterfaceProtocol + 0x00, // iInterface + + /* Audio Streaming Interface descriptor size=9 */ + 0x09, // bLength + 0x04, // bDescriptorType + 0x01, // bInterfaceNumber + 0x01, // bAlternateSetting 0x02, // bNumEndpoints 0x01, // bInterfaceClass 0x02, // bInterfaceSubClass @@ -155,7 +178,7 @@ UCHAR device_framework_fs[] = { 0x01, // bFormatType 0x01, 0x00, 0x00, 0x00, // bmFormats 0x02, // bNrChannels - 0x00, 0x00, 0x00, 0x00, // bmChannelConfig + 0x03, 0x00, 0x00, 0x00, // bmChannelConfig 0x00, // iChannelNames /* Audio Streaming Format Type descriptor size=6 */ @@ -163,7 +186,7 @@ UCHAR device_framework_fs[] = { 0x24, // bDescriptorType 0x02, // bDescriptorSubType 0x01, // bFormatType - 0x02, // bSubslotSize + 0x02, // bSubslotSize !! 0x10, // bBitResolution !! - 16bits /* Audio Streaming Class Specific Data Endpoint descriptor size=8 */ @@ -181,15 +204,15 @@ UCHAR device_framework_fs[] = { 0x01, // bEndpointAddress 0x05, // bmAttributes 0x00, 0x01, // wMaxPacketSize - 0x04, // bInterval + 0x01, // bInterval /* Endpoint descriptor size=7 */ 0x07, // bLength 0x05, // bDescriptorType 0x81, // bEndpointAddress 0x11, // bmAttributes - 0x00, 0x01, // wMaxPacketSize - 0x04, // bInterval + 0x04, 0x00, // wMaxPacketSize + 0x01, // bInterval }; UCHAR device_framework_hs[] = { @@ -288,10 +311,13 @@ UCHAR device_framework_string[] = { /* Serial Number string descriptor : Index 3 */ 0x09, - 0x04, // wLANGID - 0x03, // bIndex - 0x04, // bLength - 0x30, 0x30, 0x30, 0x31, // "0001" + 0x04, // wLANGID + 0x03, // bIndex + 0x10, // bLength + '0', '1', '2', '3', // ..DATA + '4', '5', '6', '7', // -^ + '8', '9', 'A', 'B', // -^ + 'C', 'D', 'E', 'F', // -^ }; UCHAR device_framework_lang_id[] = { diff --git a/Core/Inc/usbd_uac_process.h b/Core/Inc/usbd_uac_process.h new file mode 100644 index 0000000..f4dcaa9 --- /dev/null +++ b/Core/Inc/usbd_uac_process.h @@ -0,0 +1,11 @@ +#ifndef USBD_UAC_PROCESS_H +#define USBD_UAC_PROCESS_H + +#include "ux_api.h" +#include "ux_device_class_audio.h" +#include "ux_device_class_audio20.h" +#include "ux_device_stack.h" + +UINT usbd_uac_class_register(void); + +#endif \ No newline at end of file diff --git a/Core/Src/main.c b/Core/Src/main.c index 78ac038..bd45f47 100644 --- a/Core/Src/main.c +++ b/Core/Src/main.c @@ -36,6 +36,8 @@ #include "ux_device_class_audio20.h" #include "ux_device_stack.h" +#include "usbd_uac_process.h" + /* USER CODE END Includes */ /* Private typedef -----------------------------------------------------------*/ @@ -98,11 +100,11 @@ static uint8_t tx_block_memory[65536]; TX_THREAD led_thread; -UX_DEVICE_CLASS_AUDIO_PARAMETER audio_param; - #include "usbd_descriptors.h" static void usb_init(void) { + _ux_dcd_stm32_initialize(0, (ULONG)&hpcd_USB_OTG_FS); + HAL_PCDEx_SetRxFiFo(&hpcd_USB_OTG_FS, 0x120); HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 0, 0x80); HAL_PCDEx_SetTxFiFo(&hpcd_USB_OTG_FS, 1, 0x174); @@ -112,7 +114,6 @@ static void usb_init(void) { } static void led_thread_entry(ULONG thread_input) { - _ux_dcd_stm32_initialize(0, (ULONG)&hpcd_USB_OTG_FS); usb_init(); while(1) { @@ -139,7 +140,11 @@ void tx_application_define(void *first_unused_memory) { UX_NULL); - //_ux_device_stack_class_register(_ux_system_slave_class_audio_name, _ux_device_class_audio_entry, 1, 0, UX_NULL); + if(usbd_uac_class_register() != UX_SUCCESS) { + for(;;) { + // + } + } tx_thread_create(&led_thread, "LED Thread", led_thread_entry, 0, memory_ptr, 2048, 3, 3, TX_NO_TIME_SLICE, TX_AUTO_START); } diff --git a/Core/Src/usbd_uac_process.c b/Core/Src/usbd_uac_process.c new file mode 100644 index 0000000..adae98a --- /dev/null +++ b/Core/Src/usbd_uac_process.c @@ -0,0 +1,80 @@ +#include "usbd_uac_process.h" + +UX_DEVICE_CLASS_AUDIO_PARAMETER audio_param; +UX_DEVICE_CLASS_AUDIO_STREAM_PARAMETER audio_stream_param[1]; +UX_DEVICE_CLASS_AUDIO20_CONTROL audio_control[1]; + +static UINT usbd_uac_request_process(UX_DEVICE_CLASS_AUDIO *audio, UX_SLAVE_TRANSFER *transfer); +static VOID usbd_uac_activate(VOID *args); +static VOID usbd_uac_deactivate(VOID *args); + +static VOID usbd_uac_stream_change(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG alt_setting); +static VOID usbd_uac_frame_done(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG actual_len); + +UINT usbd_uac_class_register(void) { + audio_control[0].ux_device_class_audio20_control_cs_id = 0x10; + audio_control[0].ux_device_class_audio20_control_sampling_frequency = 48000; + audio_control[0].ux_device_class_audio20_control_fu_id = 0x30; + audio_control[0].ux_device_class_audio20_control_mute[0] = 0; + audio_control[0].ux_device_class_audio20_control_volume_min[0] = 0; + audio_control[0].ux_device_class_audio20_control_volume_max[0] = 100; + audio_control[0].ux_device_class_audio20_control_volume_res[0] = 1; + audio_control[0].ux_device_class_audio20_control_volume[0] = 100; + + audio_stream_param[0].ux_device_class_audio_stream_parameter_callbacks.ux_device_class_audio_stream_change = + usbd_uac_stream_change; + audio_stream_param[0].ux_device_class_audio_stream_parameter_callbacks.ux_device_class_audio_stream_frame_done = + usbd_uac_frame_done; + audio_stream_param[0].ux_device_class_audio_stream_parameter_max_frame_buffer_nb = 2; + audio_stream_param[0].ux_device_class_audio_stream_parameter_max_frame_buffer_size = 256; + audio_stream_param[0].ux_device_class_audio_stream_parameter_thread_entry = ux_device_class_audio_read_thread_entry; + + audio_param.ux_device_class_audio_parameter_streams_nb = 1; + audio_param.ux_device_class_audio_parameter_streams = audio_stream_param; + audio_param.ux_device_class_audio_parameter_callbacks.ux_slave_class_audio_instance_activate = usbd_uac_activate; + audio_param.ux_device_class_audio_parameter_callbacks.ux_slave_class_audio_instance_deactivate = + usbd_uac_deactivate; + audio_param.ux_device_class_audio_parameter_callbacks.ux_device_class_audio_control_process = + usbd_uac_request_process; + + return ux_device_stack_class_register(_ux_system_slave_class_audio_name, ux_device_class_audio_entry, 1, 0, + &audio_param); +} + +UINT usbd_uac_request_process(UX_DEVICE_CLASS_AUDIO *audio, UX_SLAVE_TRANSFER *transfer) { + UINT status; + UX_DEVICE_CLASS_AUDIO20_CONTROL_GROUP group = {1, audio_control}; + + // + status = ux_device_class_audio20_control_process(audio, transfer, &group); + if (status != UX_SUCCESS) { + return status; + } + + switch (audio_control[0].ux_device_class_audio20_control_changed) { + case UX_DEVICE_CLASS_AUDIO20_CONTROL_MUTE_CHANGED: + break; + case UX_DEVICE_CLASS_AUDIO20_CONTROL_VOLUME_CHANGED: + break; + default: + break; + } + + return UX_SUCCESS; +} + +static VOID usbd_uac_activate(VOID *args) { + // +} + +static VOID usbd_uac_deactivate(VOID *args) { + // +} + +static VOID usbd_uac_stream_change(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG alt_setting) { + // +} + +static VOID usbd_uac_frame_done(UX_DEVICE_CLASS_AUDIO_STREAM *stream, ULONG actual_len) { + // +} \ No newline at end of file diff --git a/misc/nxp.lsusb b/misc/nxp.lsusb new file mode 100644 index 0000000..c3da0a4 --- /dev/null +++ b/misc/nxp.lsusb @@ -0,0 +1,162 @@ +Device Descriptor: + bLength 18 + bDescriptorType 1 + bcdUSB 2.00 + bDeviceClass 0 + bDeviceSubClass 0 + bDeviceProtocol 0 + bMaxPacketSize0 64 + idVendor 0x1fc9 NXP Semiconductors + idProduct 0x0098 + bcdDevice 1.01 + iManufacturer 1 NXP SEMICONDUCTORS + iProduct 2 USB AUDIO DEMO + iSerial 0 + bNumConfigurations 1 + Configuration Descriptor: + bLength 9 + bDescriptorType 2 + wTotalLength 0x0091 + bNumInterfaces 2 + bConfigurationValue 1 + iConfiguration 0 + bmAttributes 0xc0 + Self Powered + MaxPower 500mA + Interface Association: + bLength 8 + bDescriptorType 11 + bFirstInterface 0 + bInterfaceCount 2 + bFunctionClass 1 Audio + bFunctionSubClass 0 + bFunctionProtocol 32 + iFunction 0 + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 0 + bAlternateSetting 0 + bNumEndpoints 0 + bInterfaceClass 1 Audio + bInterfaceSubClass 1 Control Device + bInterfaceProtocol 32 + iInterface 2 USB AUDIO DEMO + AudioControl Interface Descriptor: + bLength 9 + bDescriptorType 36 + bDescriptorSubtype 1 (HEADER) + bcdADC 2.00 + bCategory 1 + wTotalLength 0x0040 + bmControls 0x00 + AudioControl Interface Descriptor: + bLength 8 + bDescriptorType 36 + bDescriptorSubtype 10 (CLOCK_SOURCE) + bClockID 16 + bmAttributes 1 Internal fixed clock + bmControls 0x07 + Clock Frequency Control (read/write) + Clock Validity Control (read-only) + bAssocTerminal 0 + iClockSource 2 USB AUDIO DEMO + AudioControl Interface Descriptor: + bLength 17 + bDescriptorType 36 + bDescriptorSubtype 2 (INPUT_TERMINAL) + bTerminalID 32 + wTerminalType 0x0101 USB Streaming + bAssocTerminal 0 + bCSourceID 16 + bNrChannels 2 + bmChannelConfig 0x00000003 + Front Left (FL) + Front Right (FR) + iChannelNames 0 + bmControls 0x0000 + iTerminal 2 USB AUDIO DEMO + AudioControl Interface Descriptor: + bLength 18 + bDescriptorType 36 + bDescriptorSubtype 6 (FEATURE_UNIT) + bUnitID 48 + bSourceID 32 + bmaControls(0) 0x0000000f + Mute Control (read/write) + Volume Control (read/write) + bmaControls(1) 0x00000000 + bmaControls(2) 0x00000000 + iFeature 0 + AudioControl Interface Descriptor: + bLength 12 + bDescriptorType 36 + bDescriptorSubtype 3 (OUTPUT_TERMINAL) + bTerminalID 64 + wTerminalType 0x0301 Speaker + bAssocTerminal 0 + bSourceID 48 + bCSourceID 16 + bmControls 0x0000 + iTerminal 0 + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 1 + bAlternateSetting 0 + bNumEndpoints 0 + bInterfaceClass 1 Audio + bInterfaceSubClass 2 Streaming + bInterfaceProtocol 32 + iInterface 2 USB AUDIO DEMO + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 1 + bAlternateSetting 1 + bNumEndpoints 1 + bInterfaceClass 1 Audio + bInterfaceSubClass 2 Streaming + bInterfaceProtocol 32 + iInterface 2 USB AUDIO DEMO + AudioStreaming Interface Descriptor: + bLength 16 + bDescriptorType 36 + bDescriptorSubtype 1 (AS_GENERAL) + bTerminalLink 32 + bmControls 0x00 + bFormatType 1 + bmFormats 0x00000001 + PCM + bNrChannels 2 + bmChannelConfig 0x00000003 + Front Left (FL) + Front Right (FR) + iChannelNames 0 + AudioStreaming Interface Descriptor: + bLength 6 + bDescriptorType 36 + bDescriptorSubtype 2 (FORMAT_TYPE) + bFormatType 1 (FORMAT_TYPE_I) + bSubslotSize 2 + bBitResolution 16 + Endpoint Descriptor: + bLength 7 + bDescriptorType 5 + bEndpointAddress 0x02 EP 2 OUT + bmAttributes 13 + Transfer Type Isochronous + Synch Type Synchronous + Usage Type Data + wMaxPacketSize 0x00c0 1x 192 bytes + bInterval 1 + AudioStreaming Endpoint Descriptor: + bLength 8 + bDescriptorType 37 + bDescriptorSubtype 1 (EP_GENERAL) + bmAttributes 0x00 + bmControls 0x00 + bLockDelayUnits 0 Undefined + wLockDelay 0x0000 +Device Status: 0x0001 + Self Powered diff --git a/misc/self.lsusb b/misc/self.lsusb new file mode 100644 index 0000000..0cdeead --- /dev/null +++ b/misc/self.lsusb @@ -0,0 +1,201 @@ +Device Descriptor: + bLength 18 + bDescriptorType 1 + bcdUSB 2.00 + bDeviceClass 239 Miscellaneous Device + bDeviceSubClass 2 + bDeviceProtocol 1 Interface Association + bMaxPacketSize0 8 + idVendor 0x0483 STMicroelectronics + idProduct 0x5730 Audio Speaker + bcdDevice 0.00 + iManufacturer 1 STMacroelectronics + iProduct 2 Lo-Res DAC + iSerial 3 0001 + bNumConfigurations 1 + Configuration Descriptor: + bLength 9 + bDescriptorType 2 + wTotalLength 0x00ad + bNumInterfaces 2 + bConfigurationValue 1 + iConfiguration 0 + bmAttributes 0x80 + (Bus Powered) + MaxPower 114mA + Interface Association: + bLength 8 + bDescriptorType 11 + bFirstInterface 0 + bInterfaceCount 1 + bFunctionClass 1 Audio + bFunctionSubClass 0 + bFunctionProtocol 32 + iFunction 0 + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 0 + bAlternateSetting 0 + bNumEndpoints 0 + bInterfaceClass 1 Audio + bInterfaceSubClass 1 Control Device + bInterfaceProtocol 32 + iInterface 0 + AudioControl Interface Descriptor: + bLength 9 + bDescriptorType 36 + bDescriptorSubtype 1 (HEADER) + bcdADC 2.00 + bCategory 8 + wTotalLength 0x0055 + bmControls 0x00 + AudioControl Interface Descriptor: + bLength 8 + bDescriptorType 36 + bDescriptorSubtype 10 (CLOCK_SOURCE) + bClockID 16 + bmAttributes 1 Internal fixed clock + bmControls 0x01 + Clock Frequency Control (read-only) + bAssocTerminal 0 + iClockSource 0 + AudioControl Interface Descriptor: + bLength 8 + bDescriptorType 36 + bDescriptorSubtype 10 (CLOCK_SOURCE) + bClockID 17 + bmAttributes 1 Internal fixed clock + bmControls 0x01 + Clock Frequency Control (read-only) + bAssocTerminal 0 + iClockSource 0 + AudioControl Interface Descriptor: + bLength 8 + bDescriptorType 36 + bDescriptorSubtype 10 (CLOCK_SOURCE) + bClockID 17 + bmAttributes 5 Internal fixed clock (synchronized to SOF) + bmControls 0x01 + Clock Frequency Control (read-only) + bAssocTerminal 0 + iClockSource 0 + AudioControl Interface Descriptor: + bLength 9 + bDescriptorType 36 + bDescriptorSubtype 11 (CLOCK_SELECTOR) + bClockID 24 + bNrInPins 2 + baCSourceID(0) 16 + baCSourceID(1) 17 + bmControls 0x03 + Clock Selector Control (read/write) + iClockSelector 0 + AudioControl Interface Descriptor: + bLength 14 + bDescriptorType 36 + bDescriptorSubtype 6 (FEATURE_UNIT) + bUnitID 48 + bSourceID 32 + bmaControls(0) 0x0000000f + Mute Control (read/write) + Volume Control (read/write) + bmaControls(1) 0x00000000 + iFeature 0 + AudioControl Interface Descriptor: + bLength 17 + bDescriptorType 36 + bDescriptorSubtype 2 (INPUT_TERMINAL) + bTerminalID 32 + wTerminalType 0x0101 USB Streaming + bAssocTerminal 0 + bCSourceID 18 + bNrChannels 2 + bmChannelConfig 0x00000003 + Front Left (FL) + Front Right (FR) + iChannelNames 0 + bmControls 0x0000 + iTerminal 0 + AudioControl Interface Descriptor: + bLength 12 + bDescriptorType 36 + bDescriptorSubtype 3 (OUTPUT_TERMINAL) + bTerminalID 33 + wTerminalType 0x0302 Headphones + bAssocTerminal 0 + bSourceID 48 + bCSourceID 24 + bmControls 0x0000 + iTerminal 0 + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 1 + bAlternateSetting 0 + bNumEndpoints 0 + bInterfaceClass 1 Audio + bInterfaceSubClass 2 Streaming + bInterfaceProtocol 32 + iInterface 0 + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 1 + bAlternateSetting 1 + bNumEndpoints 2 + bInterfaceClass 1 Audio + bInterfaceSubClass 2 Streaming + bInterfaceProtocol 32 + iInterface 0 + AudioStreaming Interface Descriptor: + bLength 16 + bDescriptorType 36 + bDescriptorSubtype 1 (AS_GENERAL) + bTerminalLink 32 + bmControls 0x00 + bFormatType 1 + bmFormats 0x00000001 + PCM + bNrChannels 2 + bmChannelConfig 0x00000003 + Front Left (FL) + Front Right (FR) + iChannelNames 0 + AudioStreaming Interface Descriptor: + bLength 6 + bDescriptorType 36 + bDescriptorSubtype 2 (FORMAT_TYPE) + bFormatType 1 (FORMAT_TYPE_I) + bSubslotSize 2 + bBitResolution 16 + Endpoint Descriptor: + bLength 7 + bDescriptorType 5 + bEndpointAddress 0x01 EP 1 OUT + bmAttributes 5 + Transfer Type Isochronous + Synch Type Asynchronous + Usage Type Data + wMaxPacketSize 0x0100 1x 256 bytes + bInterval 4 + Endpoint Descriptor: + bLength 7 + bDescriptorType 5 + bEndpointAddress 0x81 EP 1 IN + bmAttributes 17 + Transfer Type Isochronous + Synch Type None + Usage Type Feedback + wMaxPacketSize 0x0100 1x 256 bytes + bInterval 4 + AudioStreaming Endpoint Descriptor: + bLength 8 + bDescriptorType 37 + bDescriptorSubtype 1 (EP_GENERAL) + bmAttributes 0x00 + bmControls 0x00 + bLockDelayUnits 0 Undefined + wLockDelay 0x0000 +Device Status: 0x0000 + (Bus Powered) diff --git a/misc/up4.lsusb b/misc/up4.lsusb new file mode 100644 index 0000000..07e3579 --- /dev/null +++ b/misc/up4.lsusb @@ -0,0 +1,172 @@ + +Bus 003 Device 002: ID 0a12:1244 Cambridge Silicon Radio, Ltd Shanling UP4 +Device Descriptor: + bLength 18 + bDescriptorType 1 + bcdUSB 2.00 + bDeviceClass 0 + bDeviceSubClass 0 + bDeviceProtocol 0 + bMaxPacketSize0 64 + idVendor 0x0a12 Cambridge Silicon Radio, Ltd + idProduct 0x1244 + bcdDevice 36.05 + iManufacturer 1 Shanling Digital Technology Development Co., Ltd. + iProduct 2 Shanling UP4 + iSerial 3 ABCDEF0123456789 + bNumConfigurations 1 + Configuration Descriptor: + bLength 9 + bDescriptorType 2 + wTotalLength 0x008d + bNumInterfaces 3 + bConfigurationValue 1 + iConfiguration 0 + bmAttributes 0x80 + (Bus Powered) + MaxPower 500mA + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 0 + bAlternateSetting 0 + bNumEndpoints 0 + bInterfaceClass 1 Audio + bInterfaceSubClass 1 Control Device + bInterfaceProtocol 0 + iInterface 0 + AudioControl Interface Descriptor: + bLength 9 + bDescriptorType 36 + bDescriptorSubtype 1 (HEADER) + bcdADC 1.00 + wTotalLength 0x002b + bInCollection 1 + baInterfaceNr(0) 1 + AudioControl Interface Descriptor: + bLength 12 + bDescriptorType 36 + bDescriptorSubtype 2 (INPUT_TERMINAL) + bTerminalID 1 + wTerminalType 0x0101 USB Streaming + bAssocTerminal 0 + bNrChannels 2 + wChannelConfig 0x0003 + Left Front (L) + Right Front (R) + iChannelNames 0 + iTerminal 0 + AudioControl Interface Descriptor: + bLength 13 + bDescriptorType 36 + bDescriptorSubtype 6 (FEATURE_UNIT) + bUnitID 2 + bSourceID 1 + bControlSize 2 + bmaControls(0) 0x0001 + Mute Control + bmaControls(1) 0x0002 + Volume Control + bmaControls(2) 0x0002 + Volume Control + iFeature 0 + AudioControl Interface Descriptor: + bLength 9 + bDescriptorType 36 + bDescriptorSubtype 3 (OUTPUT_TERMINAL) + bTerminalID 3 + wTerminalType 0x0301 Speaker + bAssocTerminal 0 + bSourceID 2 + iTerminal 0 + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 1 + bAlternateSetting 0 + bNumEndpoints 0 + bInterfaceClass 1 Audio + bInterfaceSubClass 2 Streaming + bInterfaceProtocol 0 + iInterface 0 + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 1 + bAlternateSetting 1 + bNumEndpoints 1 + bInterfaceClass 1 Audio + bInterfaceSubClass 2 Streaming + bInterfaceProtocol 0 + iInterface 0 + AudioStreaming Interface Descriptor: + bLength 7 + bDescriptorType 36 + bDescriptorSubtype 1 (AS_GENERAL) + bTerminalLink 1 + bDelay 0 frames + wFormatTag 0x0001 PCM + AudioStreaming Interface Descriptor: + bLength 14 + bDescriptorType 36 + bDescriptorSubtype 2 (FORMAT_TYPE) + bFormatType 1 (FORMAT_TYPE_I) + bNrChannels 2 + bSubframeSize 2 + bBitResolution 16 + bSamFreqType 2 Discrete + tSamFreq[ 0] 48000 + tSamFreq[ 1] 44100 + AudioStreaming Endpoint Descriptor: + bLength 7 + bDescriptorType 37 + bDescriptorSubtype 1 (EP_GENERAL) + bmAttributes 0x81 + Sampling Frequency + MaxPacketsOnly + bLockDelayUnits 2 Decoded PCM samples + wLockDelay 0x0000 + Endpoint Descriptor: + bLength 9 + bDescriptorType 5 + bEndpointAddress 0x03 EP 3 OUT + bmAttributes 1 + Transfer Type Isochronous + Synch Type None + Usage Type Data + wMaxPacketSize 0x00c0 1x 192 bytes + bInterval 1 + bRefresh 0 + bSynchAddress 0 + Interface Descriptor: + bLength 9 + bDescriptorType 4 + bInterfaceNumber 2 + bAlternateSetting 0 + bNumEndpoints 1 + bInterfaceClass 3 Human Interface Device + bInterfaceSubClass 0 + bInterfaceProtocol 0 + iInterface 0 + HID Device Descriptor: + bLength 9 + bDescriptorType 33 + bcdHID 1.11 + bCountryCode 0 Not supported + bNumDescriptors 1 + bDescriptorType 34 Report + wDescriptorLength 69 + Report Descriptors: + ** UNAVAILABLE ** + Endpoint Descriptor: + bLength 7 + bDescriptorType 5 + bEndpointAddress 0x81 EP 1 IN + bmAttributes 3 + Transfer Type Interrupt + Synch Type None + Usage Type Data + wMaxPacketSize 0x0010 1x 16 bytes + bInterval 8 +Device Status: 0x0000 + (Bus Powered)