cancel
Showing results for 
Search instead for 
Did you mean: 

usb audio asynchronous prepare data out

sgpiqx
Associate II
Posted on June 30, 2016 at 11:25

hi guys,

I am doing usb audio asynch with stm32f072,

my problem is

USBD_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 bytes

So 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 #asynchronous
1 REPLY 1
tsuneo
Senior
Posted on July 01, 2016 at 19:16

> 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