Skip to main content
Visitor II
December 14, 2020
Solved

Reading audio from CN11 jack connector on 32F746GDISCOVERY

  • December 14, 2020
  • 3 replies
  • 1305 views

Hello, is there any example available that implements audio reads from the from CN11 jack connector on 32F746GDISCOVERY board?

    This topic has been closed for replies.
    Best answer by AZane.1

    I solved looking into this very thorough video: https://www.youtube.com/watch?v=O2XaCFsWxSw&t=1272s&ab_channel=PizzaBeerEngineering and its associated repo: https://github.com/bootladder/audioprocessor for the STM32F769 Discovery board. I have set up a fork of the original that implements a simple pass-through on the 32F746GDISCOVERY: https://github.com/zanellia/audioprocessor.

    Note: Note: Just in case someone else finds this useful, I figured that a simple pass-through can be obtained adapting https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Projects/STM32746G-Discovery/Examples/BSP/Src/audio_loopback.c from the STM32Cube repo. It mostly requires changing this line https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_audio.c#L893 such that it allows 

    INPUT_DEVICE_INPUT_LINE_1

     too and fix the gain of the wm8994 codec here https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Drivers/BSP/Components/wm8994/wm8994.c#L310 from 0x0035  to 0x0025 (both right and left channel).

    3 replies

    Technical Moderator
    December 14, 2020

    Hello @AZane.1​ ,

    Welcome to the STM32 Community :smiling_face_with_smiling_eyes:

    There is an ready for use "Audio" example in the STM32CubeF7 MCU package called "Audio_playback_and_record" based on STM32746G-Discovery at this path: \STM32Cube_FW_F7_V1.16.0\Projects\STM32746G-Discovery\Applications\Audio\Audio_playback_and_record

    You find more details on how to use this example in the readme.txt file.

    Here is the STM32746G-Discovery user manual UM1907, You find in page 17 more information about Audio hardware features on this board.

    Hope this helps you.

    Please mark my answer as best by clicking on the "Select as Best" button if it fully solved your issue. This will help other users find this solution more quickly.

    Imen

    AZane.1Author
    Visitor II
    December 14, 2020

    Hi @Imen DAHMEN​ , thanks for your reply! Unfortunately, the example by you indicated records audio from the MEMS microphones MP45DT02 (similarly to what is done in the preloaded Demo). I was wondering if there is any example that uses the jack input (CN11). Also, I was wondering why for this board it is not possible to use INPUT_DEVICE_INPUT_LINE_1 when calling BSP_AUDIO_IN_OUT_Init (see https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_audio.c#L893). Is it possible at all to stream audio on the jack output CN10 while reading from the jack input CN11? Thanks!

    AZane.1AuthorAnswer
    Visitor II
    December 28, 2020

    I solved looking into this very thorough video: https://www.youtube.com/watch?v=O2XaCFsWxSw&t=1272s&ab_channel=PizzaBeerEngineering and its associated repo: https://github.com/bootladder/audioprocessor for the STM32F769 Discovery board. I have set up a fork of the original that implements a simple pass-through on the 32F746GDISCOVERY: https://github.com/zanellia/audioprocessor.

    Note: Note: Just in case someone else finds this useful, I figured that a simple pass-through can be obtained adapting https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Projects/STM32746G-Discovery/Examples/BSP/Src/audio_loopback.c from the STM32Cube repo. It mostly requires changing this line https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Drivers/BSP/STM32746G-Discovery/stm32746g_discovery_audio.c#L893 such that it allows 

    INPUT_DEVICE_INPUT_LINE_1

     too and fix the gain of the wm8994 codec here https://github.com/STMicroelectronics/STM32CubeF7/blob/master/Drivers/BSP/Components/wm8994/wm8994.c#L310 from 0x0035  to 0x0025 (both right and left channel).