Audio acquisition issue (microphone and lineIn)

  • We are trying to verify the audio acquisition functionality in the armstoneMX8MP board.

    Reading the document "F&S i.MX8M-Plus Linux" in the Audio section the command "arecord -c 1 -r 8000 -f s16_le -d <duration> <file.wav>" is indicated to acquire audio from the microphone, but this functionality directly fails on your default image "sdcard-fsimx8mp-Y2023.03.tar.bz2 ". Using our own compilation using Yocto Kirkstone the execution works correctly but we do not acquire anything, neither through capsule or LineIn.

    In the documentation of this board, commands like "amixer sset 'Capture Mux' LINE_IN" are indicated but they are not applicable to the IMX8MPlus, I think they are to the IMX8MMini. From what we have been able to observe, the IMX8MP uses the WM8960 codec that does not have these controls.

    The microphone has been connected between PIN41 (AUDIO_MICIN) and PIN42 (GND) of the "Feature connector". The 0dB line inputs have been connected to PIN44 (AUDIO_LIN_R)+PIN46(GND) and PIN48 (AUDIO_LIN_L)+PIN47(GND).

    Playback works fine.

    Can you indicates how can we use this functionality and how are routed AUDIO_MICIN, AUDIO_LIN_R & AUDIO_LIN_L to WM8960 codec.


    Regards,

    Marc.

  • Hello,


    you are right, the documentation is still mostly for the SGTL5000 codec.

    The WM8960 is a little more complicated and needs different amixer settings.


    Please try the following amixer commands for MIC



    For LINE_IN try the flowing settings

    Code
    1. amixer sset 'Left Input Boost Mixer LINPUT3' 50% on
    2. amixer sset 'Right Input Boost Mixer RINPUT3' 50% on


    Your F&S Support team

  • Hi,

    thanks for your answer.

    Finally I managed to acquire audio through microphone and line-in satisfactorily. With the configuration sent, I was able to acquire but with noise and didn't understand the configured controls very well.

    After review the driver "linux/sound/soc/codecs/wm8960.c" and the wm8960 datasheet I got a correct configuration. Can you confirm please your internal connection of your codec with your "Feature connector" (signals AUDIO_MICIN, AUDIO_LIN_R, AUDIO_LIN_L...). After some tests I think you connect AUDIO_MICIN to LINPUT1 in single-ended microphone input configuration (we need to disconnect LINPUT2 and LINPUT3 from PGA to be switched to VMID and get a good acquisition), AUDIO_LIN_R to RINPUT3 and AUDIO_LIN_L to LINPUT3, is right?


    //Example audio acquisition by AUDIO_MICIN (Mic -45dB)


    //Example audio acquisition by AUDIO_LIN_L (Input 0dB)



    Thanks in advance,

    Regards.