cancel
Showing results for 
Search instead for 
Did you mean: 

Hearing the voices not clear when i transmit the signal via I2S in the STM32WLE5JC

AA.21
Associate II

I used STM32WLE5JC control for playing the song via I2S. I have used SPI2 (alternat function of I2S) in the STM32WLE5JC. I can read the song in SD card and transmit the signal to the I2S in the I2S module (MAX98357A). The signal is transmitted to the I2S module and speaker ready to play. But I set the I2S exact hearable frequency(44.1khz) in the I2S initialization, that time noise is produced by the speaker. When I set the 8khz,11.025khz the song played slowly in the speaker. I am using MAX98357A mentioned frequency in the STM32WLE5JC, but no result.

I have attached the system clock & I2S configuration:

0693W00000aIgNCQA0.png0693W00000aIgNvQAK.png 

13 REPLIES 13
LCE
Principal

"Hearing the voices not clear" - what does that mean?

Do you hear the song, but noisy or distorted?

Are you sure the data from SD card has the correct format and endianness?

Maybe you're playing the LSB as MSB.

And check if you can setup all data transfers via DMA (I don't know that STM32):

SD -> DMA -> SRAM -> DMA -> I2S

or maybe even directly SD -> DMA -> I2S

AScha.3
Principal III

when 44k making problems and slower data 11k not, you have a speed problem.

how you get the data to the i2S ? DMA?

btw i made a player, from SDcard to I2S -> DAC , with stm32F411 ; can play wav, MP3 and flac files. 🙂

If you feel a post has answered your question, please click "Accept as Solution".
AA.21
Associate II

@Community member​ 

Do you hear the song, but noisy or distorted?

No, I can be able to hear some sound. But I couldn't identify whether the playing song is correct or not.

Are you sure the data from SD card has the correct format and endianness?

I have verified the same wav file formats song in ESP32 using I2S library.

How could I verify whether the LSB or MSB transmit first?

I didn't use DMA method for I2S data transmission. I am using interrupt method for I2S transmission.

@AScha.3​ For your information too.

@AScha.3​  btw i made a player, from SDcard to I2S -> DAC , with stm32F411 ; can play wav, MP3 and flac files

could you share any GitHub reference for our development.

I had gone through many web sites, and I got some references. While i trying to compile same code, it was showing multiple errors.

So, kindly share some reference, if you know.

AScha.3
Principal III
AA.21
Associate II

@Community member​ @AScha.3​ 

I gone through the you shared GitHub linkes. But I didn't understood. 

Kindly share some reference or documents of I2S protocol is integration to the stm32wl series .

 Also share the I2S protocol CLOCK reference.

I read the i2s protocol in many websites. But proper explanation and No clock details on websites.

Practical i changed the PWR_REGULATOR_VOLTAGE_SCALE (AHB, APB1 frequency 16Mhz,64Mhz) song frequency in 8khz,11.025Khz,16khz,22.050khz, 32.khz,44.1khz and 48khz. I can be able to hear some sound. But I couldn't identify whether the playing song is correct or not.

I think i mistaked in the system and I2S clocks. So kindly share the reference for the Clock.

How could I verify whether the LSB or MSB transmit first?

Piranha
Chief II

Are you capable of finding a door in a room?

https://en.wikipedia.org/wiki/I%C2%B2S

https://www.nxp.com/docs/en/user-manual/UM11732.pdf

> How could I verify whether the LSB or MSB transmit first?

By reading the reference manual!

LCE
Principal

> How could I verify whether the LSB or MSB transmit first?

You could write a wav-file for SD card that contains audio samples like 0x00FF or 0xFF00 and check sdata with scope.

And yes, read the manual and try to understand, compare source code and register settings.

AA.21
Associate II

@LCE

I have used I2S in Interrupt method. I have used 16bit array (size - 4096) and stored the SD card read data. every I2S transmit the 4096 of data to send the I2S Module (MAX98357A).

Which method should I use for I2S data transfer? Interrupt or DMA.

AScha.3
Principal III

>3 days ago

you have to use circular DMA for player .

If you feel a post has answered your question, please click "Accept as Solution".