AnsweredAssumed Answered

No sound with wm8731 on i.MX6UL

Question asked by GARRAS Yann on Apr 3, 2017
Latest reply on Apr 11, 2017 by GARRAS Yann

Hi, 

 

I am trying to use wm8731 codec with i.MX6UL.

 

The wm8731 codec is on a MIKROE-506 proto board and is wired this way for the SAI part : 

 

imx6ul                        <=>            MIKROE-506   <=>   wm8731

CSI_D6 (SAI1_RX_DATA)                  MISO                    ADCDAT

CSI_D2 (SAI1_RX_SYNC)                 ADCL                  ADCLRC

CSI_D3 (SAI1_RX_BCLK)                  SCK                     BCLK

CSI_D7 (SAI1_TX_DATA)                  MOSI                   DACDAT

CSI_D4 (SAI1_TX_SYNC)                  DACL                  DACLRC

CSI_D1 (SAI1_MCLK)                        SCK                     BCLK

 

The I2C wiring is OK, I am able to send control command to the codec, for example I can make a loop between microphone and HP with amixer.

 

I'm using linux 4.8.10 and the here is the relevant parts of the device tree : 

 

sound {
   compatible = "simple-audio-card";
   simple-audio-card,model = "wm8731-audio";
   simple-audio-card,format = "i2s";
   simple-audio-card,audio-routing =
      "Line Out", "LOUT",
      "Line Out", "ROUT",
      "Headphone Jack", "RHPOUT",
      "Headphone Jack", "LHPOUT",
      "LLINEIN","Line In",
      "RLINEIN","Line In";
   simple-audio-card,cpu {
      sound-dai = <&sai1>;
      bitclock-master;
      frame-master;
   };
   simple-audio-card,codec {
      sound-dai = <&codec>;
   };
};

 

&sai1 {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_sai1>;
   assigned-clocks = <&clks IMX6UL_CLK_SAI1_SEL>,<&clks IMX6UL_CLK_SAI1>;
   assigned-clock-parents = <&clks IMX6UL_CLK_PLL4_AUDIO_DIV>;
   assigned-clock-rates = <0>,<12288000>,<11289600>;
   status = "okay";
};

 

&i2c1 {
   pinctrl-names = "default";
   pinctrl-0 = <&pinctrl_i2c1>;
   clock_frequency = <400000>;
   status = "okay";
};

 

pinctrl_sai1: sai1grp {
fsl,pins = <

   MX6UL_PAD_CSI_DATA05__SAI1_TX_BCLK 0x17088
   MX6UL_PAD_CSI_DATA03__SAI1_RX_BCLK 0x17088
   MX6UL_PAD_CSI_DATA04__SAI1_TX_SYNC 0x17088
   MX6UL_PAD_CSI_DATA02__SAI1_RX_SYNC 0x17088
   MX6UL_PAD_CSI_DATA07__SAI1_TX_DATA 0x11088
   MX6UL_PAD_CSI_DATA06__SAI1_RX_DATA 0x11088
   MX6UL_PAD_JTAG_TMS__CCM_CLKO1 0x17088
>;
};

 

When trying to play a sound with aplay, I can hear the codec sending some kind of noise during aplay execution but nothing related with the sound I am trying to play.

 

I am really not sure with the sai1grp part of the device tree.

 

Any help will be really appreciated.

 

Regards 

 

Yann

Outcomes