Loading...
 
Skip to main content

System Workbench for STM32


STM32F4 DAC Audio configuration

Hello Everyone,

I have a custom board with STM32F4xx chipset DAC_OUT pin connected to audio amplifier.
I am configuring DAC with DMA and TIM6 trigger for Audio playback.
With the attached configuration code, I hear a initial click sound as I start playing audio file.
After the initial click sound, the audio file is getting played fine.

Below are the observations:
• The click is heard every time we initiate playback.
• The click is independent of the file being played.
• The click is not caused by noise on the line.
• The line is noise free before and after playback.
• The click waveform does not look analog in nature.
• The click is observable at the DAC output.
• The click is observable across multiple boards, multiple MCUs (405/446), and multiple generations of boards and electrical layouts.

Can anyone help me figuring out if there is any configuration issue or is this a known DAC issue ?

Thanks,
Ravi

France

Hi Ravi,

The click has nothing to do with the MCU or the DAC; it is inherent to your way to start playing sound. The only configuration issue could be the position of the "idle" output: it must be at the middle of the output range (thus corresponding to "no signal"); otherwise you will get a steep front (thus a click) when switching even to no-signal waveform.

However even in this case you will still hear a click if you start playing sound at full volume immediatly as going from no-signal to full-signal (even a sinus waveform), when converted in frequency space will have a wide spectrum at the beginning, heard as a click by your ear. Note that this artefact can be heard even on some high quality devices (like Bose Quiet-Comfort noise reducing headphones...)

The cleanest way to suppress the click is thus to start playing your waveform at 0 volume, then raise it progressively to full volume in a few hudrends of milliseconds.

Bernard (Ac6)