2019-04-01 03:15 PM
Hi,
I'm using the STM32F411RE device to decode MP3 audio files, i'm sending the decoded data to a MAX98357A amplifier via I2S and DMA, when the SCK signal is removed from the amplifier there's a DC offset at it's output which is causing a distorted audio output and a current peak, to avoid it i have two options:
Is it possible to configure the I2S peripheral to keep SCK and WS running even when i'm not sending data? If it's not possible i can try to send 0's until i got decoded data so both SCK and WS keep running but i would prefer to avoid it.
Any ideas?
Image showing both SCK and WS stopping when there's no more data to send, this capture shows sending a whole audio slip to the amplifier.
Similar issue, not solved here.
2019-04-01 11:52 PM
The standard way to handle I2S is to use circular DMA to feed it continuously. It's the responsibility of the application to fill the circular source buffer for the DMA with enough data, i.e. also with zeros if there are no data.
JW
2019-04-02 10:13 AM
Thanks for the reply JW, i did tried keeping the I2S sending data continuously (zeroes when i need to mute the amp) and i think i got it working, tomorrow i will be able to test it with the amplifiers, today i just saw the signals with the logic analyzer.
So far I was working with two arrays and a pointer that keep track of the current array being sent to the amplifier, i guess this can be improved by using a single array and the DMA in circular mode, i will try that later this week.
Regards,
Carlos