Skip to main content
Visitor II
December 11, 2024
Question

audio clarity issues while using the WM8904 audio codec

  • December 11, 2024
  • 2 replies
  • 972 views

Hello everyone,

I am currently using the WM8904 audio codec in my project. The audio is stored in external flash memory, and I am reading it in chunks of 1024 bytes at a time. The audio format is 16-bit WAV with an 8000 Hz sample rate.

For playback, we are using a mono speaker. I have attached the schematic of our codec for reference.

Issue: The audio output is not clear. I have verified the data being read from the flash, and it matches the stored data.

I would like to know:

  1. What audio formats (sample rate, bit width, clock configuration, etc.) are supported by the WM8904 codec?
  2. How can I ensure proper reading and playback of audio from the flash memory?
    This topic has been closed for replies.

    2 replies

    Graduate II
    December 11, 2024

    1. read the datasheet of WM8904, which is not a product from ST

    2. working source code... you're not telling us which STM32 you are using and how it is connected to the DAC

    Tharun123Author
    Visitor II
    December 20, 2024

    sorry for missing details, we are using stm32f407G evaluation board in that there is on board audio codec which is cs43l22 we are storing the audio data in internal buffer which is of 12 kb just for testing purpose.

    in stm32 I2S function expects 16 bit data 

    HAL_StatusTypeDef HAL_I2S_Transmit(I2S_HandleTypeDef *hi2s, uint16_t *pData, uint16_t Size, uint32_t Timeout)

     

    can you have any suggestions how we can store and how we can send the data or is there any library

    of audio codec like nxp controllers?

     

    Super User
    December 20, 2024

    @Tharun123 wrote:

     we are using stm32f407G evaluation board


    This: https://www.st.com/en/evaluation-tools/stm3240g-eval.html ?

     


    @Tharun123 wrote:

    in that there is on board audio codec which is cs43l22


    So are there not examples which illustrate the use of it?

    Super User
    December 11, 2024

    As @LCE said, you need to provide more details - please see the Posting Tips:

    https://community.st.com/t5/community-guidelines/how-to-write-your-question-to-maximize-your-chances-to-find-a/ta-p/575228

     


    @Tharun123 wrote:

    I have attached the schematic of our codec for reference.


    I think you forgot that?

     


    @Tharun123 wrote:

    Issue: The audio output is not clear.


    What, exactly, do you mean by that?

    • Too quiet?
    • Distorted? give details
    • other?

    Have you viewed the output on an oscilloscope?

     


    @Tharun123 wrote:
    1. What audio formats (sample rate, bit width, clock configuration, etc.) are supported by the WM8904 codec?

    It's not an ST Product - you need to consult the manufacturer's specifications & other supporting documentation for that:

    https://www.cirrus.com/products/wm8904/

    https://www.cirrus.com/products/wm8904/#supportRequest=true&formType=design&supportProduct=wm8904