2016-06-30 02:25 AM
hi guys,
I am doing usb audio asynch with stm32f072,my problem isUSBD_LL_PrepareReceive(pdev, AUDIO_OUT_EP, &PlaybackBuf[buftoogle], AUDIO_MAX_PACKET_SIZE);My audio is 48Khz 24bit which will generate 288bytes so I set my endpoint max buffer size to 300 for 12 extra bytesSo when I tried to set it to 300 and my feedback value is exactly 48<<14, it will simply count until 300 not stop at 288 as I need. As result my audio mess up.So how to received different size of data as host will adjust data length according to feedback that we send? do we need to change the size dynamically ? if yes when ? #audio #usb #usb #audio #asynchronous2016-07-01 10:16 AM
> my feedback value is exactly 48<<14, it will simply count until 300 not stop at 288 as I need.
Maybe, wrong feedback value (or nothing) is passed to host. 1) Did you put the feedback value in LS-byte first on the 3 bytes array to pass the array to the feedback IN EP? 2) Is the bRefresh field of the feedback IN EP is set to 3 or more?/* Endpoint - Standard Descriptor - Feedback EP */
AUDIO_STANDARD_ENDPOINT_DESC_SIZE, /* bLength */
USB_ENDPOINT_DESCRIPTOR_TYPE, /* bDescriptorType */
USB_ENDPOINT_IN(3), /* bEndpointAddress */
USB_ENDPOINT_TYPE_ISOCHRONOUS, /* bmAttributes */
WBVAL(3), /* wMaxPacketSize */
0x01, /* bInterval */
0x03, /* bRefresh */ // <-----
0x00, /* bSynchAddress */
When bRefresh is set to 3 (= 8 frames: 2^3), host put isoc IN transaction every 8 frames for feedback.
Tsuneo