AnsweredAssumed Answered

WM8960 in Linux 3.14.28, AUD3_TXFS has no clock when playing

Question asked by XiongJun He on Jun 4, 2016
Latest reply on Dec 6, 2017 by Wu Mr

@Hi I'm using the WM8960 codec with in imx6Q board(TQE9), the kernel is 3.14.28,  when I play the wav file, there're no BCLOCK in AUD3_TXFS pin,  but the MCLK is 24M. And I don't know where's the problem, and I wish someone would give me a hand to fix this . Below is the detail.

 

The connections between Codec and SoC is show below:

 

Selection_187.png

 

In the dts :

sound {
compatible = "fsl,imx-audio-wm8960";
model = "wm8960-audio";

        cpu-dai = <&ssi1>;

audio-codec = <&codec>;

 

 

audio-routing =
"Headphone Jack", "HP_L",
"Headphone Jack", "HP_R",
"Ext Spk", "SPK_LP",
"Ext Spk", "SPK_RP",
"LINPUT1", "MICB",
"MICB", "AMIC";
mux-int-port = <2>;
mux-ext-port = <3>;
hp-det-gpios = <&gpio3 31 1>;
};

 

the codec settings:

&i2c2 {
  clock-frequency = <100000>;
  pinctrl-names = "default";
  pinctrl-0 = <&pinctrl_i2c2>;
  status = "okay";


  codec: wm8960@1a {
  compatible = "wlf,wm8960";
  reg = <0x1a>;
  //clocks = <&clks 201>;
  DCVDD-supply = <&reg_audio>;
  DBVDD-supply = <&reg_audio>;
  AVDD-supply = <&reg_audio>;
  SPKVDD1-supply = <&reg_audio>;
  SPKVDD2-supply = <&reg_audio>;
#if 0
  CPVDD-supply = <&reg_audio>;
  MICVDD-supply = <&reg_audio>;
  PLLVDD-supply = <&reg_audio>;        
#endif
  //shared_lrclk;
  clock-names = "mclk";
  wlf,shared-lrclk;
  clocks = <&clks IMX6QDL_CLK_CKO>;
#if 0
  assigned-clocks =  <&clks IMX6QDL_CLK_CKO1_SEL>,  <&clks IMX6QDL_CLK_CKO1_PODF>, <&clks IMX6QDL_CLK_CKO>;
  assigned-clock-parents = <&clks IMX6QDL_CLK_PLL4_AUDIO_DIV>, <&clks IMX6QDL_CLK_CKO1_SEL>, <&clks IMX6QDL_CLK_CKO1>;
  assigned-clock-rates = <0>, <12000000>;        
#endif
  /* capless; */
  };


  hdmi: edid@50 {
  compatible = "fsl,imx6-hdmi-i2c";
  reg = <0x50>;
  };
};

 

and the regulator is :

reg_audio: wm8960_supply {
compatible = "regulator-fixed";
regulator-name = "wm8960-supply";
//gpio = <&gpio4 10 0>;
enable-active-high;
regulator-always-on;
};

 

And the MCLOCK:

pinctrl_hog: hoggrp {
fsl,pins = <
MX6QDL_PAD_GPIO_0__CCM_CLKO10x0001b0b0  /* wm8960 mclk */
MX6QDL_PAD_EIM_D31__GPIO3_IO310x80000000  /* headphone detect */
>;
};

When the Linux booting, some relative logs:

root@imx6qsabresd:~# dmesg | grep wm -i
    lowmem  : 0x80000000 - 0xe6000000   (1632 MB)
[    0.188110] wm8960-supply: no parameters
[    3.383562] imx-wm8960 sound.29: wm8960-hifi <-> 2028000.ssi mapping ok
[    3.390259] imx-wm8960 sound.29: ASoC: no sink widget found for Headphone Jack
[    3.397516] imx-wm8960 sound.29: ASoC: Failed to add route HP_L -> direct -> Headphone Jack
[    3.405897] imx-wm8960 sound.29: ASoC: no sink widget found for Headphone Jack
[    3.413133] imx-wm8960 sound.29: ASoC: Failed to add route HP_R -> direct -> Headphone Jack
[    3.421521] imx-wm8960 sound.29: ASoC: no source widget found for AMIC
[    3.428077] imx-wm8960 sound.29: ASoC: Failed to add route AMIC -> direct -> MICB
[    7.738782]   #2: wm8960-audio
[   10.900057] wm8960 1-001a: Set deemphasis 0

 

Also the sound card is shown in aplay:

root@imx6qsabresd:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Loopback [Loopback], device 0: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: Loopback [Loopback], device 1: Loopback PCM [Loopback PCM]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 2: wm8960audio [wm8960-audio], device 0: HiFi wm8960-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 3: imxhdmisoc [imx-hdmi-soc], device 0: i.MX HDMI Audio Tx hdmi-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 

 

 

When Playing the wav file, the mclk is 24M:

Selection_188.png

 

===========================================================================================

Also I have tried using the codec-master in Codec, but there would case other problem:

root@imx6qsabresd:~# aplay -D hw:2,0 /1_ST_48K.wav 
Playing WAVE '/1_ST_48K.wav' : [ 2401.235653] WM8960 PLL: setting 24000000Hz->12288000Hz
Signed 16 bit Little Endian, Rate[ 2401.242160] WM8960 PLL: setting 24000000Hz->12288000Hz
 48000 Hz, Stereo
[ 2401.250086] WM8960 PLL: Unsupported N=4
[ 2401.255535] WM8960 PLL: setting 24000000Hz->18432000Hz
[ 2401.260712] WM8960 PLL: setting 24000000Hz->18432000Hz
[ 2401.265882] WM8960 PLL: N=6 K=24dd2f pre_div=1
[ 2401.527021] wm8960 1-001a: Set deemphasis 0
[ 2411.525931] ALSA sound/core/pcm_lib.c:1947 playback write error (DMA or IRQ trouble?)
aplay: pcm_write:1947: write error: Input/output error

 

 

Thanks in advance.

 

Petar Bajic

The specified item was not found.

ChuYuan Chiang

igorpadykov

Outcomes