打印
[USB驱动]

USB audio 如何把16位传输的描述符改成24位传输,很急!!

[复制链接]
1832|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
xuqingli123|  楼主 | 2018-7-12 10:15 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 xuqingli123 于 2019-3-5 13:38 编辑

        /* USB Microphone Audio Type I Format Type Descriptor */
        0x0B+9,                               /* bLength */
        0x24,      /* bDescriptorType */
        0x02,          /* bDescriptorSubtype */
        0x01,                  /* bFormatType */
        0x01,                                 /* bNrChannels */
        0x02,                                 /* bSubFrameSize : 2 Bytes per audio subframe */
        0x10,                                 /* bBitResolution : 16 bits per sample */
        0x04,                                 /* bSamFreqType */
        //B3VAL(USBD_AUDIO_FREQ),               /* tSamFreq : Audio sampling frequency coded on 3 bytes */
        B3VAL(48000),
        B3VAL(32000),
        B3VAL(16000),
        B3VAL(8000),
改成
        /* USB Microphone Audio Type I Format Type Descriptor */
        0x0B+9,                               /* bLength */
        0x24,      /* bDescriptorType */
        0x02,          /* bDescriptorSubtype */
        0x01,                  /* bFormatType */
        0x01,                                 /* bNrChannels */
        0x03,                                 /* bSubFrameSize : 2 Bytes per audio subframe */
        0x18,                                 /* bBitResolution : 16 bits per sample */
        0x04,                                 /* bSamFreqType */
        //B3VAL(USBD_AUDIO_FREQ),               /* tSamFreq : Audio sampling frequency coded on 3 bytes */
        B3VAL(48000),
        B3VAL(32000),
        B3VAL(16000),
        B3VAL(8000),
除了在这个地方修改之外,还需要修改什么吗?16位的电脑能正常枚举出来,这样修改之后24位枚举出错,什么原因,求各位大佬帮帮忙,很急

相关帖子

沙发
xuqingli123|  楼主 | 2018-7-12 10:17 | 只看该作者

使用特权

评论回复
板凳
xuqingli123|  楼主 | 2018-7-12 10:50 | 只看该作者
自己顶一下

使用特权

评论回复
地板
xuqingli123|  楼主 | 2018-7-12 15:32 | 只看该作者
.....

使用特权

评论回复
5
xuqingli123|  楼主 | 2018-7-13 09:33 | 只看该作者
全部描述符
__ALIGN_BEGIN static uint8_t usbd_audio_CfgDesc[AUDIO_CONFIG_DESC_SIZE] __ALIGN_END =
{
        /* USB Microphone Configuration Descriptor */
        0x09,                                 /* bLength */
        0x02,    /* bDescriptorType */
        LOBYTE(117),       /* wTotalLength */
        HIBYTE(117),
        0x02,                                 /* bNumInterfaces */
        0x01,                                 /* bConfigurationValue */
        0x00,                                 /* iConfiguration */
        0xC0,                                 /* bmAttributes : Self Powered */
        0x32,                                 /* bMaxPower = 100 mA*/
        /* 09 byte*/
/* ---------------------------------------------------------------------------*/
        /* ------------------ AudioControl Interface ------------------ */
        /* USB Microphone Standard AC Interface Descriptor */
        0x09,            /* bLength */
        0x04,        /* bDescriptorType */
        0x00,                                 /* bInterfaceNumber */
        0x00,                                 /* bAlternateSetting */
        0x00,                                 /* bNumEndpoints */
        0x01,               /* bInterfaceClass */
        0x01,          /* bInterfaceSubClass */
        0x00,             /* bInterfaceProtocol */
        0x00,                                 /* iInterface */
        /* 09 byte*/
/* ---------------------------------------------------------------------------*/
        /* USB Microphone Class-specific AC Interface Descriptor */
        0x09,            /* bLength */
        0x24,      /* bDescriptorType */
        0x01,                 /* bDescriptorSubtype */
        0x00,          /* 1.00 */             /* bcdADC */
        0x01,
        0x29,                                 /* wTotalLength */
        0x00,
        0x01,                                 /* bInCollection */
        0x01,                                 /* baInterfaceNr */
        /* 09 byte*/

        /* USB Microphone Input Terminal Descriptor */
        0x0C,       /* bLength */
        0x24,      /* bDescriptorType */
        0x02,         /* bDescriptorSubtype */
        0x01,                            /* bTerminalID */
        0x01,                                 /* wTerminalType : Microphone 0x0201 */
        0x02,
        0x00,                                 /* bAssocTerminal */
        0x01,                                 /* bNrChannels */
        0x00,                                 /* wChannelConfig : Mono sets no position bits */
        0x00,
        0x00,                                 /* iChannelNames */
        0x00,                                 /* iTerminal */
        /* 12 byte*/

        /* USB Microphone Audio Feature Unit Descriptor */
        0x08,                                 /* bLength */
        0x24,      /* bDescriptorType */
        0x06,           /* bDescriptorSubtype */
        0x02,                            /* bUnitID */
        0x01,                            /* bSourceID */
        0x01,                                 /* bControlSize */
        0x03,                                 /* bmaControls(0) Mute & Volume */
        0x00,                                 /* ?? bmaControls(1) / iTerminal */
        /* 8 byte*/

        /*USB Microphone Output Terminal Descriptor */
        0x09,                                 /* bLength */
        0x24,      /* bDescriptorType */
        0x03,        /* bDescriptorSubtype */
        0x03,                            /* bTerminalID */
        0x01,                                 /* wTerminalType : USB Streaming */
        0x01,
        0x00,                                 /* bAssocTerminal */
        0x02,                            /* bSourceID */
        0x00,                                 /* iTerminal */
        /* 09 byte*/
/* ---------------------------------------------------------------------------*/
        /* --------------- AudioStreaming Interface --------------- */
        /* USB Microphone Standard AS Interface Descriptor - Audio Streaming Zero Bandwith */
        /* Interface 1, Alternate Setting 0                                             */
        0x09,            /* bLength */
        0x04,        /* bDescriptorType */
        0x01,                                 /* bInterfaceNumber */
        0x00,                                 /* bAlternateSetting */
        0x00,                                 /* bNumEndpoints */
        0x01,               /* bInterfaceClass */
        0x02,         /* bInterfaceSubClass */
        0x00,             /* bInterfaceProtocol */
        0x00,                                 /* iInterface */
        /* 09 byte*/
/* ---------------------------------------------------------------------------*/
        /* USB Microphone Standard AS Interface Descriptor - Audio Streaming Operational */
        /* Interface 1, Alternate Setting 1                                           */
        0x09,            /* bLength */
        0x04,        /* bDescriptorType */
        0x01,                                 /* bInterfaceNumber */
        0x01,                                 /* bAlternateSetting */
        0x01,                                 /* bNumEndpoints */
        0x01,               /* bInterfaceClass */
        0x02,        /* bInterfaceSubClass */
        0x00,             /* bInterfaceProtocol */
        0x00,                                 /* iInterface */
        /* 09 byte*/

        /* USB Microphone Class-specific AS General Interface Descriptor */
        0x07,  /* bLength */
        0x24,      /* bDescriptorType */
        0x01,              /* bDescriptorSubtype */
        0x03,                            /* bTerminalLink : Unit ID of the Output Terminal*/
        0x01,                                 /* bDelay */
        0x01,                                 /* wFormatTag : AUDIO_FORMAT_PCM */
        0x00,
        /* 07 byte*/

        /* USB Microphone Audio Type I Format Type Descriptor */
        0x0B,                               /* bLength */
        0x24,      /* bDescriptorType */
        0x02,          /* bDescriptorSubtype */
        0x01,                  /* bFormatType */
        0x01,                                 /* bNrChannels */
        0x04,                                 /* bSubFrameSize : 2 Bytes per audio subframe */
        0x18,                                 /* bBitResolution : 16 bits per sample */
        0x01,                                 /* bSamFreqType */
        //B3VAL(USBD_AUDIO_FREQ),               /* tSamFreq : Audio sampling frequency coded on 3 bytes */
//        B3VAL(48000),
        B3VAL(32000),
//        B3VAL(16000),
//        B3VAL(8000),
        /* 11+9 byte*/

        /* USB Microphone Standard AS Audio Data Endpoint Descriptor */
        0x09,    /* bLength */
        0x05,         /* bDescriptorType */
        0x81,                          /* bEndpointAddress : IN endpoint 1 */
        0x05,                                 /* bmAttributes ¶Ëµã´«ÊäÀàÐÍ */
        LOBYTE(AUDIO_IN_PACKET),              /* wMaxPacketSize */
        HIBYTE(AUDIO_IN_PACKET),
        0x01,                                 /* bInterval : one packet per frame */
        0x00,                                 /* bRefresh */
        0x00,                                 /* bSynchAddress */
        /* 09 byte*/

        /* USB Microphone Class-specific Isoc. Audio Data Endpoint Descriptor */
        0x07,                                 /* bLength */
        0x25,                                 /* bDescriptorType */
        0x01,                                 /* bDescriptor */
        0x01,                                 /* bmAttributes */
        0x00,                                 /* bLockDelayUnits */
        0x00,                                 /* wLockDelay */
        0x00,
        /* 07 byte*/
};不知道什么地方错了  电脑枚举不出来,希望给指点一下

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

29

主题

174

帖子

2

粉丝