AnsweredAssumed Answered

IMX6UL wm8960 used SAI1 failed

Question asked by jiang zhifei on May 12, 2017
Latest reply on May 22, 2017 by igorpadykov

#Hello,

 

I encounter an audio problem on our IMX6UL board.

But the board uses SAI1,  it's different from IMX6ULEVK which uses SAI2.

I  use ALSA "aplay" utility  to test.

But can't play successfully.

error message:

aplay -D "plug:SLAVE='hw:0,0'" /test/test.wav
Playing WAVE '/test/test.wav' : Signed 16 bit Little Endian, Rate 22050 Hz, Stereo
aplay: pcm_write:1682: write error: Input/output error

 

I will be appreciated if someone can help to fix the issue.

Thanks.

kernel start message:

...

[ 5.359750] imx-wm89601 sound1.14: wm8960-hifi <-> 2028000.sai mapping ok
[ 5.368187] imx-wm89601 sound1.14: snd-soc-dummy-dai <-> 2034000.asrc mapping ok
[ 5.375877] imx-wm89601 sound1.14: wm8960-hifi <-> 2028000.sai mapping ok
...
[ 5.575216] ALSA device list:
[ 5.578342] #0: wm8960-audio

 

 

Our DTS configuration is modified as below.

IMX6UL.dtsi:

sai1: sai@02028000 {
   compatible = "fsl,imx6ul-sai";
   reg = <0x02028000 0x4000>;
   interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
   clocks = <&clks IMX6UL_CLK_SAI1_IPG>,
   <&clks IMX6UL_CLK_SAI1>,
   <&clks 0>, <&clks 0>;
   clock-names = "bus", "mclk1", "mclk2", "mclk3";
   dma-names = "rx", "tx";
   dmas = <&sdma 35 25 0>, <&sdma 36 25 0>;
   status = "disabled";
};

 

imx6ul-14x14-evk-7.dts:

sound {
   compatible = "fsl,imx6ul-evk-wm8960",
   "fsl,imx-audio-wm8960";
   model = "wm8960-audio";
   cpu-dai = <&sai1>;
   audio-codec = <&codec1>;
   asrc-controller = <&asrc>;
   codec-master;
   gpr = <&gpr>;
   audio-routing =
   "Headset Jack", "HP_L",
   "Headset Jack", "HP_R",
   "Ext Spk", "SPK_LP",
   "Ext Spk", "SPK_LN",
   "Ext Spk", "SPK_RP",
   "Ext Spk", "SPK_RN",
   "LINPUT2", "Hp MIC",
   "LINPUT3", "Hp MIC",
   "RINPUT1", "Main MIC",
   "RINPUT2", "Main MIC",
   "Hp MIC", "MICB",
   "Main MIC", "MICB",
   "CPU-Playback", "ASRC-Playback",
   "Playback", "CPU-Playback",
   "ASRC-Capture", "CPU-Capture",
   "CPU-Capture", "Capture";
};

 

&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>, <11289600>;

   status = "okay";
};

 

pinctrl_sai1: sai1grp {
   fsl,pins = <
      MX6UL_PAD_CSI_DATA01__SAI1_MCLK 0x17088
      MX6UL_PAD_CSI_DATA05__SAI1_TX_BCLK 0x17088
      MX6UL_PAD_CSI_DATA07__SAI1_TX_DATA 0x11088
      MX6UL_PAD_CSI_DATA04__SAI1_TX_SYNC 0x17088
      MX6UL_PAD_CSI_DATA06__SAI1_RX_DATA 0x11088
   >;
};

Outcomes