2023-03-10 06:20 AM
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:
2023-03-10 07:16 AM
"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
2023-03-10 07:45 AM
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. :)
2023-03-10 08:15 AM
@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.
2023-03-10 09:50 AM
you have to use circular DMA for player .
some to read:
https://github.com/pjanczyk/stm32-flac-player
https://github.com/mackron/dr_libs
+ Audio Player demonstration: by STM on H7B3
2023-03-10 11:09 PM
@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?
2023-03-11 08:36 AM
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!
2023-03-12 10:29 PM
> 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.
2023-03-13 06:57 AM
@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.
2023-03-13 07:13 AM
>3 days ago
you have to use circular DMA for player .