cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4 Speaker and Microphone USB

nortowianski
Associate II
Posted on December 07, 2015 at 16:10

 

 

The original post was too long to process during our migration. Please click on the attachment to read the original post.
8 REPLIES 8
delphi
Associate II
Posted on August 03, 2016 at 19:23

You are not alone. It seems that ST engineers are just weak to get an answer. I seen that LPC users solved such problems and generate a lot of project with mic+speaker both

Andy Rochette
Associate II
Posted on April 03, 2017 at 16:14

Hello,

Up,

Same for me, it works alone but not together.

Can someone provide a simple example with mic+speaker please ?

AR

Pradeep Gowda
Associate II
Posted on May 26, 2017 at 17:47

I have descriptors figured out. PC identifies the device as both speaker and microphone. But I cam not getting IN stage call back for isochronous IN endpoint. Has any one figured it out?

Posted on June 01, 2017 at 12:39

Hi,

The host needs to send IN packets, you can tell the rate of these IN packets with a field in the standard descriptor of your Endpoint. Check that everything ok (endpoint available and well configured, terminal connected to EP...), it's easier with 'tdd.exe' if you are on Windows, and it will tell u if something wrong. I can send u a working example too, to check the differences with a specific soft.

+

Posted on June 01, 2017 at 20:53

Hi Andy, Thank you for the response.

I got the IN endpoint to work. If I configure the endpoint to have a maxPacketSize of any thing more than 128, host ends up reading only 4 bytes.

I configured the endpoint to 64 bytes MPS and it works fine. To use this, I tried 16K, 2 channel, 2 bytes per frame configuration. 16000 * 2 * 2 /1000 gives me the MPS of 64.

Any idea if this restriction is form Windows or from STM32F407?

Now I am facing the audio distortion issue. I have I2S full duplex mode configured for audio communication which is connected to an external codec. Trying to figure out if the issue is from I2S or the synchronization of buffers.

Thanks once again,

Pradeep.

Posted on June 02, 2017 at 10:02

Hi,

ok just found, check if u have this code below in the USBD_AUDIO_Setup() function (in usbd_audio.c) :

case USB_REQ_SET_INTERFACE :

if ((uint8_t)(req->wValue) <= USBD_MAX_NUM_INTERFACES)

{

haudio->alt_setting = (uint8_t)(req->wValue);

if( haudio->alt_setting == 1)

{

USBD_AUDIO_DataIn(pdev,0x81);

}

}

U can change the alt_setting condition if u have other configuration.

If this doesnt work, send me your config descriptor, ill have a look

AR.

Posted on June 09, 2017 at 03:44

Thanks Andy,

I got it to work.

Posted on August 22, 2017 at 06:23

Can you share your code? Thank you.