Hi.cypress
使用CyUSB3014+WM8960(音频Codec),来实现USB声卡的功能,通过修改的USB设备描述符, 变成两路音频,发现windows不识别。之前的1路是没问题。(见附件one channel and two channels)
thanks
flance fang
已解决! 转到解答。
Hi Flance,
把第二路的这一项改一下就可以了
0x03, /* Audio Streaming interface 1 belongs to this AudioControl Interface */
Regards,
Eddie
#ifdef UAC_INTERFACE
#if defined(USB_HID_INTERFACE)
#define CY_FX_UAC_CTRL_INTERFACE (uint8_t)(3) /* UAC Control Interface */
#define CY_FX_UAC_STREAM_INTERFACE (uint8_t)(4) /* UAC Streaming Interface : Alternate setting 1 */
#else // !USB_HID_INTERFACE
#define CY_FX_UAC_CTRL_INTERFACE (uint8_t)(2) /* UAC Control Interface */
#define CY_FX_UAC_STREAM_INTERFACE (uint8_t)(3) /* UAC Streaming Interface : Alternate setting 1 */
#endif // !USB_HID_INTERFACE
#endif
#ifdef UAC_2_INTERFACE
#if defined(USB_HID_INTERFACE)
#define CY_FX_UAC_2_CTRL_INTERFACE (uint8_t)(5) /* UAC Control Interface */
#define CY_FX_UAC_2_STREAM_INTERFACE (uint8_t)(6) /* UAC Streaming Interface : Alternate setting 1 */
#else // !USB_HID_INTERFACE
#define CY_FX_UAC_2_CTRL_INTERFACE (uint8_t)(4) /* UAC Control Interface */
#define CY_FX_UAC_2_STREAM_INTERFACE (uint8_t)(5) /* UAC Streaming Interface : Alternate setting 1 */
#endif // !USB_HID_INTERFACE
#endif
Hi Flance,
我通过客户的这种方式,修改描述符为:
Windows是可以识别的。请问客户的设备不识别,window是显示描述符错误吗? 我目前看不出客户的描述符文件有什么问题。
/* Standard super speed configuration descriptor */
const uint8_t CyFxUsbSSConfigDscr[] __attribute__ ((aligned (32))) =
{
/* Configuration descriptor */
0x09, /* Descriptor size */
CY_U3P_USB_CONFIG_DESCR, /* Configuration descriptor type */
// 0x6A,0x00, /* Length of this descriptor and all sub descriptors */
0xDB,0x00,
0x04, /* Number of interfaces */
0x01, /* Configuration number */
0x00, /* Configuration string index */
0x80, /* Config characteristics - Bus powered */
0x32, /* Max power consumption of device (in 8mA unit) : 400mA */
/* Interface association descriptor */
0x08, /* Descriptor size */
0x0B, /* Interface association descr type */
0x00, /* Number of first interface */
0x02, /* Number of video streaming i/f */
0x01, /* Interface class: Audio Interface Class */
0x02, /* Interface sub class: Audio Streaming Interface SubClass */
0x00, /* Interface protocol code */
0x07, /* String desc index for interface */
/* Standard Audio Control Interface Descriptor */
0x09, /* Descriptor Size */
0x04, /* Interface Descriptor Type */
0x00, /* Interface number */
0x00, /* Alternate setting */
0x00, /* Number of endpoints - 0 endpoints */
0x01, /* Interface Class - Audio */
0x01, /* Interface SubClass - Audio Control */
0x00, /* Interface Protocol - Unused */
0x00, /* Interface string index */
/* Class Specific Audio Control Interface Descriptor */
0x09, /* Descriptor Size */
0x24, /* Descriptor Type - CS_INTERFACE */
0x01, /* Descriptor SubType - Header */
0x00, 0x01, /* Revision of class specification - 1.0 */
0x1E, 0x00, /* Total size of class specific descriptors */
0x01, /* Number of streaming Interfaces - 1 */
0x03, /* Audio Streaming interface 1 belongs to this AudioControl Interface */
/* Input terminal descriptor */
0x0C, /* Descriptor size in bytes */
0x24, /* CS Interface Descriptor */
0x02, /* Input Terminal Descriptor subtype */
0x01, /* ID Of the input terminal */
0x01, 0x02, /* Microphone - terminal type */
0x00, /* Association terminal - None */
0x02, /* Number of channels - 2 */
0x03, 0x00, /* spatial location of the logical channels - Front Left and Front Right */
0x00, /* Channel names - Unused */
0x00, /* String index for this descriptor - None */
/* Output terminal descriptor */
0x09, /* Descriptor size */
0x24, /* Class specific interface desc type */
0x03, /* Output terminal descriptor type */
0x02, /* ID of this terminal */
0x01, 0x01, /* Output terminal type: USB Streaming */
0x00, /* Association terminal - Unused */
0x01, /* Id of the terminal/unit to which this is connected - Input terminal id */
0x00, /* String desc index : Not used */
/* Standard Audio Streaming Interface Descriptor (Alternate setting 0) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x01, /* Interface number */
0x00, /* Alternate setting number */
0x00, /* Number of end points : zero bandwidth */
0x01, /* Interface class : Audio */
0x02, /* Interface sub class : Audio Streaming */
0x00, /* Interface protocol code : Unused */
0x00, /* Interface descriptor string index */
/* Standard Audio Streaming Interface descriptor (Alternate setting 1) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x01, /* Interface number */
0x01, /* Alternate setting number */
0x01, /* Number of end points : 1 ISO EP */
0x01, /* Interface Audio class */
0x02, /* Interface Audio sub class - Audio Streaming */
0x00, /* Interface protocol code : Unused */
0x00, /* Interface descriptor string index */
/* Class-specific Audio Streaming General Interface descriptor */
0x07, /* Descriptor size */
0x24, /* Class-specific AS i/f Type */
0x01, /* Descriptotor subtype : AS General */
0x02, /* Terminal Link - Output terminal id */
0x01, /* Interface delay */
0x01, 0x00, /* Audio data format - PCM */
/* Class specific AS Format descriptor - Type I Format Descriptor */
0x0B, /* Descriptor size */
0x24, /* Class-specific Interface Descriptor Type */
0x02, /* Format Type Descriptor subtype */
0x01, /* PCM FORMAT_TYPE_I */
0x02, /* Number of channels - 2 */
0x02, /* Subframe size - 2 bytes per audio subframe */
0x10, /* Bit resolution - 16 bits */
0x01, /* Number of samping frequencies - 1 */
0x80, 0xBB, 0x00, /* Sampling frequency - 48000 Hz */
/* Endpoint descriptor for ISO streaming Audio data */
0x09, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
CY_FX_EP_ISO_AUDIO, /* Endpoint address and description */
0x05, /* ISO End point : Async */
0x60, 0x00, /* Transaction size - 96 bytes */
0x03, /* Servicing interval for data transfers */
0x00, /* bRefresh */
0x00, /* bSynchAddress */
/* Super speed endpoint companion descriptor */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
0x00, /* Max no. of packets in a burst : 1 */
0x00, /* Mult.: Max number of packets : 1 */
0x60, 0x00, /* Bytes per interval : 1024 */
/* Class Specific AS Isochronous Audio Data Endpoint Descriptor */
0x07, /* Descriptor size in bytes */
0x25, /* CS_ENDPOINT descriptor type */
0x01, /* EP_GENERAL sub-descriptor type */
0x00, /* bmAttributes - None */
0x00, /* bLockDelayUnits - Unused */
0x00, 0x00 /* wLockDelay - unused */
,
/* Interface association descriptor */
0x08, /* Descriptor size */
0x0B, /* Interface association descr type */
0x02, /* Number of first interface */
0x02, /* Number of video streaming i/f */
0x01, /* Interface class: Audio Interface Class */
0x02, /* Interface sub class: Audio Streaming Interface SubClass */
0x00, /* Interface protocol code */
0x07, /* String desc index for interface */
/* Standard Audio Control Interface Descriptor */
0x09, /* Descriptor Size */
0x04, /* Interface Descriptor Type */
0x02, /* Interface number */
0x00, /* Alternate setting */
0x00, /* Number of endpoints - 0 endpoints */
0x01, /* Interface Class - Audio */
0x01, /* Interface SubClass - Audio Control */
0x00, /* Interface Protocol - Unused */
0x00, /* Interface string index */
/* Class Specific Audio Control Interface Descriptor */
0x09, /* Descriptor Size */
0x24, /* Descriptor Type - CS_INTERFACE */
0x01, /* Descriptor SubType - Header */
0x00, 0x01, /* Revision of class specification - 1.0 */
0x1E, 0x00, /* Total size of class specific descriptors */
0x01, /* Number of streaming Interfaces - 1 */
0x01, /* Audio Streaming interface 1 belongs to this AudioControl Interface */
/* Input terminal descriptor */
0x0C, /* Descriptor size in bytes */
0x24, /* CS Interface Descriptor */
0x02, /* Input Terminal Descriptor subtype */
0x01, /* ID Of the input terminal */
0x01, 0x02, /* Microphone - terminal type */
0x00, /* Association terminal - None */
0x02, /* Number of channels - 2 */
0x03, 0x00, /* spatial location of the logical channels - Front Left and Front Right */
0x00, /* Channel names - Unused */
0x00, /* String index for this descriptor - None */
/* Output terminal descriptor */
0x09, /* Descriptor size */
0x24, /* Class specific interface desc type */
0x03, /* Output terminal descriptor type */
0x02, /* ID of this terminal */
0x01, 0x01, /* Output terminal type: USB Streaming */
0x00, /* Association terminal - Unused */
0x01, /* Id of the terminal/unit to which this is connected - Input terminal id */
0x00, /* String desc index : Not used */
/* Standard Audio Streaming Interface Descriptor (Alternate setting 0) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x03, /* Interface number */
0x00, /* Alternate setting number */
0x00, /* Number of end points : zero bandwidth */
0x01, /* Interface class : Audio */
0x02, /* Interface sub class : Audio Streaming */
0x00, /* Interface protocol code : Unused */
0x00, /* Interface descriptor string index */
/* Standard Audio Streaming Interface descriptor (Alternate setting 1) */
0x09, /* Descriptor size */
CY_U3P_USB_INTRFC_DESCR, /* Interface descriptor type */
0x03, /* Interface number */
0x01, /* Alternate setting number */
0x01, /* Number of end points : 1 ISO EP */
0x01, /* Interface Audio class */
0x02, /* Interface Audio sub class - Audio Streaming */
0x00, /* Interface protocol code : Unused */
0x00, /* Interface descriptor string index */
/* Class-specific Audio Streaming General Interface descriptor */
0x07, /* Descriptor size */
0x24, /* Class-specific AS i/f Type */
0x01, /* Descriptotor subtype : AS General */
0x02, /* Terminal Link - Output terminal id */
0x01, /* Interface delay */
0x01, 0x00, /* Audio data format - PCM */
/* Class specific AS Format descriptor - Type I Format Descriptor */
0x0B, /* Descriptor size */
0x24, /* Class-specific Interface Descriptor Type */
0x02, /* Format Type Descriptor subtype */
0x01, /* PCM FORMAT_TYPE_I */
0x02, /* Number of channels - 2 */
0x02, /* Subframe size - 2 bytes per audio subframe */
0x10, /* Bit resolution - 16 bits */
0x01, /* Number of samping frequencies - 1 */
0x80, 0xBB, 0x00, /* Sampling frequency - 48000 Hz */
/* Endpoint descriptor for ISO streaming Audio data */
0x09, /* Descriptor size */
CY_U3P_USB_ENDPNT_DESCR, /* Endpoint descriptor type */
CY_FX_EP_ISO_AUDIO, /* Endpoint address and description */
0x05, /* ISO End point : Async */
0x60, 0x00, /* Transaction size - 96 bytes */
0x03, /* Servicing interval for data transfers */
0x00, /* bRefresh */
0x00, /* bSynchAddress */
/* Super speed endpoint companion descriptor */
0x06, /* Descriptor size */
CY_U3P_SS_EP_COMPN_DESCR, /* SS endpoint companion descriptor type */
0x00, /* Max no. of packets in a burst : 1 */
0x00, /* Mult.: Max number of packets : 1 */
0x60, 0x00, /* Bytes per interval : 1024 */
/* Class Specific AS Isochronous Audio Data Endpoint Descriptor */
0x07, /* Descriptor size in bytes */
0x25, /* CS_ENDPOINT descriptor type */
0x01, /* EP_GENERAL sub-descriptor type */
0x00, /* bmAttributes - None */
0x00, /* bLockDelayUnits - Unused */
0x00, 0x00 /* wLockDelay - unused */
};
Regards,
Eddie
Hi.Eddie
客户在win7系统下试验2台电脑,一台是在笔记本上试,第二路音频驱动没有加载成功;在台式电脑上,一个驱动都没加载出来。显示情况是:台式机没有发现任何新设备 , 笔记本可以驱动成为1路视频和1路音频, 新加的一路音频显示的感叹号。
Hi Flance,
把第二路的这一项改一下就可以了
0x03, /* Audio Streaming interface 1 belongs to this AudioControl Interface */
Regards,
Eddie