cancel
Showing results for 
Search instead for 
Did you mean: 

Speaker outputs with WM8994

Fabien B
Associate III
Posted on May 17, 2017 at 10:32

Hello everybody,

 

I am currently working on a STM324x9I-EVAL board. I ran the next project:

STM32Cube_FW_F4_V1.16.0\Projects\STM324x9I_EVAL\Applications\Audio\Audio_playback_and_record.

The application is set to be used in stereo (SPKMODE connected to Gnd), so I have connected a headset to CN23 and 2 loudspeakers on CN24 (8ohm each).

Audio is working well on HPOUT1 (CN23) but not on SPKOUT (CN24).

I checked the source code and tried to change the parameters �OutputDevice� of the next function:

BSP_AUDIO_OUT_Init(uint16_t OutputDevice, uint8_t Volume, uint32_t AudioFreq);

To OUTPUT_DEVICE_SPEAKER: No sound came from my loudspeaker

To OUTPUT_DEVICE_BOTH: Sound came from my headset connected to CN23 but no sound from my loudspeakers on CN24.

Someone was able to used the speakers (CN24) output?

If you have any clue that could help me, don�t hesitate to answer to my post.

Thanks in advance for your help

Best regards

Fabien

#wm8994 #stm324x9i-eval #speaker
1 ACCEPTED SOLUTION

Accepted Solutions
Fabien B
Associate III
Posted on August 21, 2017 at 14:56

Please find the final answer from ST support

-----------------------------------------

I received developer answer and for them my patch is not correct.

If you remove it.

And do this modification, in  file waveplayer.c : you will have sound on the speaker.

static uint8_t PlayerInit(uint32_t AudioFreq)

  /* Initialize the Audio codec and all related peripherals (I2S, I2C, IOExpander, IOs...) */  

  if(BSP_AUDIO_OUT_Init(OUTPUT_DEVICE_BOTH, uwVolume, AudioFreq) != 0)

  {

    return 1;

  }

  else

  {

    BSP_AUDIO_OUT_SetAudioFrameSlot(CODEC_AUDIOFRAME_SLOT_13);

    return 0;

  } 

}

-----------------------------------------

I checked and speaker are working well on my side. Thanks a lot to ST support

View solution in original post

4 REPLIES 4
Pavel Bo
Associate
Posted on July 06, 2017 at 15:44

Hello, man!

Today I have the same problem with f746 discovery: reCompile with OUTPUT_DEVICE_SPEAKER / OUTPUT_DEVICE_BOTH...  - and nothing. With HEADPHONES - OK

I think they (ST MCD Application Team) don't checked codec driver wm8994.c with this settings. My version of this file:

  * @version V2.1.0

  * @date    22-February-2016

In datasheet of codec wolfson 'Loudspeaker' B1-A2, B3-C3 is the same that in sheme of my disco board.

Do you solve the problem?

Fabien B
Associate III
Posted on July 06, 2017 at 18:05

Hello,

I am currently in touch with T.O.M.A.S. team from ST.

They find a solution to be able to use loudspeaker. Please find the solution they provide me:

---------------------------

I was able to have speaker working with this configuration OUTPUT_DEVICE_BOTH :

   waveplayer.c 

...

      if(BSP_AUDIO_OUT_Init(OUTPUT_DEVICE_BOTH, uwVolume, I2S_AUDIOFREQ_48K) == 0 )

....

      if(BSP_AUDIO_OUT_Init(OUTPUT_DEVICE_BOTH, uwVolume, AudioFreq) != 0)

And a patch in the file STM32Cube_FW_F4_V1.16.0\Drivers\BSP\Components\wm8994\wm8994.c

in the function

    uint32_t wm8994_Init(uint16_t DeviceAddr, uint16_t OutputInputDevice, uint8_t Volume, uint32_t AudioFreq)

 .....

    /* Unmute DAC2 (Left) to Left Speaker Mixer (SPKMIXL) path,

    Unmute DAC2 (Right) to Right Speaker Mixer (SPKMIXR) path */

    /* counter += CODEC_IO_Write(DeviceAddr, 0x36, 0x0300);*/

      counter += CODEC_IO_Write(DeviceAddr, 0x36, 0x0303);

---------------------------

On my board, loudspeaker are working very well with this solution.

There are still issues with '

OUTPUT_DEVICE_SPEAKER

' but there are working on it and will provide me an solution.

Best regards

Fabien

Posted on July 07, 2017 at 17:25

Hi

Blanchet.Fabien

,

Thank you for your reported issue.

I would inform you that your reported issue is raised internally and is under investigation.

Best Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Fabien B
Associate III
Posted on August 21, 2017 at 14:56

Please find the final answer from ST support

-----------------------------------------

I received developer answer and for them my patch is not correct.

If you remove it.

And do this modification, in  file waveplayer.c : you will have sound on the speaker.

static uint8_t PlayerInit(uint32_t AudioFreq)

  /* Initialize the Audio codec and all related peripherals (I2S, I2C, IOExpander, IOs...) */  

  if(BSP_AUDIO_OUT_Init(OUTPUT_DEVICE_BOTH, uwVolume, AudioFreq) != 0)

  {

    return 1;

  }

  else

  {

    BSP_AUDIO_OUT_SetAudioFrameSlot(CODEC_AUDIOFRAME_SLOT_13);

    return 0;

  } 

}

-----------------------------------------

I checked and speaker are working well on my side. Thanks a lot to ST support