i.MX8M Mini is no sound in MIC recording.

cancel
Showing results for 
Search instead for 
Did you mean: 

i.MX8M Mini is no sound in MIC recording.

247 Views
jack_huang1
Contributor II

1. CPU model: MIMX8MM6CVTKZAA, CODEC chip is WM8960, Android version is NXP_IMX-P9.0.0_2.3.4, CPU is slave, CODEC chip is the main device, can play music, can't record.Please help to check whether the register configuration is correct. There is no sound in MIC recording.Thank you very much!

sound {
compatible = "fsl,imx6ul-evk-wm8960","fsl,imx-audio-wm8960";
model = "wm8960-audio";
cpu-dai = <&sai3>;
audio-codec = <&codec>;
codec-master;
gpr = <&gpr 4 0x100000 0x100000>;
hp-det = <2 0>;
hp-det-gpios = <&gpio4 0 0>;
mic-det-gpios = <&gpio4 0 0>;
audio-routing =
"Headphone Jack", "HP_L",
"Headphone Jack", "HP_R",
"Ext Spk", "SPK_LP",
"Ext Spk", "SPK_LN",
"Ext Spk", "SPK_RP",
"Ext Spk", "SPK_RN",
"LINPUT1", "Main MIC",
"LINPUT2", "Main MIC",
"RINPUT1", "Hp MIC",
"RINPUT2", "Hp MIC",
"Mic Jack", "MICB",
"Main MIC", "MICB",
"CPU-Playback", "ASRC-Playback",
"Playback", "CPU-Playback",
"ASRC-Capture", "CPU-Capture",
"CPU-Capture", "Capture";
};
};
codec: wm8960@1a {
compatible = "wlf,wm8960";
reg = <0x1a>;
clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
clock-names = "mclk";
wlf,shared-lrclk;};&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>;
status = "okay";};
pinctrl_sai3: sai3grp {
fsl,pins = <
MX8MM_IOMUXC_SAI3_RXFS_SAI3_RX_SYNC 0xd6
MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6
MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK 0xd6
MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK 0xd6
MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0 0xd6
MX8MM_IOMUXC_SAI3_RXD_SAI5_RX_DATA0 0xd6
>;
};
pinctrl_sai3_hp_det_b: sai3_hp_det_grp {
fsl,pins = <
MX8MM_IOMUXC_SAI1_RXFS_GPIO4_IO0 0x16
>;
};

2. The code of IMX-WM8960. c, WM8960. c, FSL_SAI. C has not been modified.

3. LINPUT1 acts as the input terminal of main MIC.

4. Register values during recording are as follows:

[ 127.991755] reg=0x000 val=0x1bc
[ 127.995640] reg=0x001 val=0x1bc
[ 127.998813] reg=0x002 val=0x178
[ 128.002111] reg=0x003 val=0x178
[ 128.005476] reg=0x004 val=0x121
[ 128.009389] reg=0x005 val=0x008
[ 128.012584] reg=0x006 val=0x000
[ 128.015766] reg=0x007 val=0x042
[ 128.018912] reg=0x008 val=0x1cd
[ 128.022127] reg=0x009 val=0x040
[ 128.025343] reg=0x00a val=0x1e6
[ 128.028520] reg=0x00b val=0x1e6
[ 128.031674] reg=0x00c val=0x1e6
[ 128.034816] reg=0x00d val=0x1e6
[ 128.037999] reg=0x00e val=0x1e6
[ 128.041164] reg=0x00f val=0x1e6
[ 128.044339] reg=0x010 val=0x000
[ 128.047533] reg=0x011 val=0x1fb
[ 128.050686] reg=0x012 val=0x100
[ 128.053868] reg=0x013 val=0x032
[ 128.057045] reg=0x014 val=0x000
[ 128.060202] reg=0x015 val=0x1e6
[ 128.063355] reg=0x016 val=0x1e6
[ 128.066497] reg=0x017 val=0x1c3
[ 128.069737] reg=0x018 val=0x044
[ 128.072934] reg=0x019 val=0x0ee
[ 128.076127] reg=0x01a val=0x001
[ 128.079293] reg=0x01b val=0x000
[ 128.082501] reg=0x01c val=0x008
[ 128.085673] reg=0x01d val=0x000
[ 128.088827] reg=0x01e val=0x000
[ 128.092079] reg=0x01f val=0x000
[ 128.095251] reg=0x020 val=0x108
[ 128.098393] reg=0x021 val=0x100
[ 128.101576] reg=0x022 val=0x150
[ 128.104745] reg=0x023 val=0x150
[ 128.107976] reg=0x024 val=0x150
[ 128.111148] reg=0x025 val=0x150
[ 128.114291] reg=0x026 val=0x000
[ 128.117468] reg=0x027 val=0x000
[ 128.120622] reg=0x028 val=0x178
[ 128.123780] reg=0x029 val=0x178
[ 128.126922] reg=0x02a val=0x040
[ 128.130141] reg=0x02b val=0x000
[ 128.133305] reg=0x02c val=0x000
[ 128.136475] reg=0x02d val=0x050
[ 128.139654] reg=0x02e val=0x050
[ 128.142804] reg=0x02f val=0x030
[ 128.145989] reg=0x030 val=0x03a
[ 128.149167] reg=0x031 val=0x037
[ 128.152342] reg=0x032 val=0x037
[ 128.155505] reg=0x033 val=0x080
[ 128.158646] reg=0x034 val=0x027
[ 128.161861] reg=0x035 val=0x059
[ 128.165138] reg=0x036 val=0x099
[ 128.168328] reg=0x037 val=0x09a

 

5. As measured by oscilloscope, when recording, LINPUT1 has analog signal input, and MCLK is 24.576MHZ, BCLK is 1.412mhz, and ADCLRC is 44.1khz.

6. Tinycap test.wav-t 50 recording, no error, but no sound when playing test.wav,

Capturing sample: 2 ch, 44100 hz, 16 bit

7. Kernel log, no error.

 

 

 

0 Kudos
2 Replies

227 Views
jack_huang1
Contributor II

Dear igorpadykov:

          

  1.  With regard to the two DTS references previously provided, imx8mm-axon-pi.dts does not use IMX-Wm8960. c, and MCLK  is an external 24Mhz fixed clock, which does not match our hardware, so the reference is not very significant. After I modified the device tree by referring to imx8mm-nitrogen8mm.dts, WM8960 can also play music normally, but not record normally.

        The device tree configuration is as follows:

         sound {

compatible = "fsl,imx-audio-wm8960";

model = "wm8960-audio";

cpu-dai = <&sai3>;

codec-master;

gpr = <&gpr 4 0x100000 0x100000>;

audio-routing =

"Headphone Jack", "HP_L",

"Headphone Jack", "HP_R",

"Ext Spk", "SPK_LP",

"Ext Spk", "SPK_LN",

"Ext Spk", "SPK_RP",

"Ext Spk", "SPK_RN",

"LINPUT1", "Main MIC",

"Main MIC", "MICB",

"RINPUT2", "Mic Jack",

"Mic Jack", "MICB",

"CPU-Playback", "ASRC-Playback",

"Playback", "CPU-Playback",

"ASRC-Capture", "CPU-Capture",

"CPU-Capture", "Capture";

hp-det = <2 0>;

hp-det-gpios = <&gpio4 0 0>;

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_sound_wm8960>;

};

};

&i2c2 {

clock-frequency = <400000>;

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_i2c2>;

status = "okay";

codec: wm8960@1a {

compatible = "wlf,wm8960";

reg = <0x1a>;

clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;

clock-names = "mclk";

wlf,shared-lrclk;

};

};

&sai3 {

assigned-clocks =<&clk IMX8MM_AUDIO_PLL1>,<&clk

IMX8MM_AUDIO_PLL2>, <&clk IMX8MM_CLK_SAI3>;

assigned-clock-parents =<0>, <0>, <&clk IMX8MM_AUDIO_PLL1_OUT>;

assigned-clock-rates = <786432000>, <722534400>, <12288000>;

pinctrl-names = "default";

pinctrl-0 = <&pinctrl_sai3>;

status = "okay";

};

pinctrl_sai3: sai3grp {

fsl,pins = <

MX8MM_IOMUXC_SAI3_RXFS_SAI3_RX_SYNC 0xd6

MX8MM_IOMUXC_SAI3_TXFS_SAI3_TX_SYNC 0xd6

MX8MM_IOMUXC_SAI3_TXC_SAI3_TX_BCLK 0xd6

MX8MM_IOMUXC_SAI3_MCLK_SAI3_MCLK 0xd6

MX8MM_IOMUXC_SAI3_TXD_SAI3_TX_DATA0 0xd6

MX8MM_IOMUXC_SAI3_RXD_SAI5_RX_DATA0 0xd6

>;

};

pinctrl_sound_wm8960: sai3_hp_det_grp {

fsl,pins = <

MX8MM_IOMUXC_SAI1_RXFS_GPIO4_IO0 0x16

>;

};

 

  1. At present, our company cannot record on IMX8mm and IMX8MQ using WM8960. In addition to configuring the device tree, is it necessary to modify other code such as IMX-WM8960. c, fsl_sai. c?
  2. Read the following post:
  3. https://community.nxp.com/t5/i-MX-Processors/imx8mm-sai3-and-adau1761-driver/m-p/1061639

The meaning of this post seems to be that codec needs to be slave, not master.

We don't know if being unable to record is associated with codec as master, but we will get the following error when configuring codec as Slave:

[ 122.193487] fsl-sai 30030000.sai: failed to derive required Tx rate:1411200

[ 122.200613] fsl-sai 30030000.sai: ASoC: can't set 30030000.sai hw params:-22

  1.  What aspects can you debug (software registers, hardware signals, etc.) if you can't record, or if you need us to provide some information, please help to analyze it.

 

That is all.  Thank you very much.

 

0 Kudos