This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB audio microphone: Windows recording and bSubFrameSize

Hey,

I'm working on a USB microphone using an isochronous endpoint. Although 8 bits would be sufficient resolution, it turns out that Windows' standard USB driver only supports 16 bit PCM or higher.

In going from:

    0x01,                                 // bSubFrameSize
    0x08,                                 // bBitResolution

to

    0x02,                                 // bSubFrameSize (two bytes per subframe)
    0x10,                                 // bBitResolution (16 bit PCM)

... it seems something breaks. Attempting to start recording the device in Windows yields an uninformative 'cannot start' error. Using arecord -f S16_LE in Linux works fine.

The EP ISR is really simple, and just returns 16 bytes every time (sample rate 8 kHz, one channel, two bytes/sample = 16 bytes). Thus, the ENDP1 TX count is always equal to 16:

void EP1_IN_Callback(void){
    SetEPTxCount(ENDP1, 16);
    ToggleDTOG_TX(ENDP1);
    SetEPTxValid(ENDP1);
}

Finally, note that I'm still on single buffering (double buffering would be next after this issue is fixed). The device is an STM32F103.

Much obliged for any pointers.

0