cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F4Discovery Audio Problem

igal
Associate II
Posted on January 20, 2013 at 15:12

Hi all,

I use the STM32F4Discovery Audio playback and recording example. I sound 1KHz from speakers and record the audio. The wav file I get is filled with click sounds.

Also if I modify the code and keep everything in RAM, export it to Matlab I see distortions in the waveform (though maybe the problem is write speed to USB Stick).

What could be the problem?

Thank you
6 REPLIES 6
igal
Associate II
Posted on January 24, 2013 at 08:09

No one has any ideas?

frankmeyer9
Associate II
Posted on January 24, 2013 at 09:09

Also if I modify the code and keep everything in RAM, export it to Matlab I see distortions in the waveform (though maybe the problem is write speed to USB Stick).

 

 

What could be the problem?

 

Without any code or more detailed description, this is hard to judge. But your suspicion might be correct. Flash writes (that's what your USB stick is) can take a rather long time if a block erase is involved. You might need some more elaborate buffering mechanism.

I would sample a lower frequency, and view the results in Matlab or whatever.

The size of the gaps should give a measure of the delays involved.

And second, you could set a GPIO signal while a USB Flash write is in progress, and observe this signal with a scope.

sadatan
Associate
Posted on May 23, 2013 at 09:13

I have made a PCB with STM32F207IGT with complete audio section including CS43L22 & TS472IQT .Now i am recording some audio using mic on this board and storing it on Pen drive connected on the USB port available on the board.Now Iam trying to play it on the speaker connected on the Speaker pins (Pin No. 4,6,7,9) configured in mono mode i.e pin no.6&4 are short and pin no. 7&9 shorted as connected in evaluation board.Further I am using same code as available for Evaluation board and this same code is working properly on the evaluation board.?No Iam unable to hear the recorded file from the speaker,What i am hearing is only the Bump sound(like THAK-THAK) with membrane of the speaker going IN & OUT. Even we have accessed the status registers of the Codec and their status is also same they have in the evaluation board.Can someone please help me out ans suggest some thing for this problem.

Thanks in advance.

Sadatan

Posted on May 23, 2013 at 13:27

Examine the data that you have recorded, make sure the samples are valid/useful.

Examine the output signal with a scope.

Generate test data on the PC, say sine waves with different frequency and amplitudes, check them on the board, and with a scope.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sadatan
Associate
Posted on May 24, 2013 at 06:14

Thanks for the reply Clive,But same file is working on the Evaluation board properly which is not working on my board.

igal
Associate II
Posted on May 30, 2013 at 14:17

This is an old post but I thought for future reference I should update you all regarding the solution.

ST was kind enough to give me a working example, apparently there was an error in the I2C interrupt, it took too long, and so the solution incorporates double buffer which is in use by the filter outside of the ISR