在 iMX8M mini android 9 設計 WM8962 audio codec,撥放音樂,I2S DAC 無輸出

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

在 iMX8M mini android 9 設計 WM8962 audio codec,撥放音樂,I2S DAC 無輸出

1,846 Views
macochen
Contributor I

以下附上目前的程式碼、DTS 及線路

目前使用環境為Android 9 
 
在 driver 上的設定開啟 config 檔案 如下 :
 
CONFIG_SND_SOC_IMX_WM8962=y
CONFIG_SND_SOC_WM8962=y
 
dts 設定如下 如附檔 imx8mm-pico-wizard.dts :
 
wm8962: wm8962@1a {
                compatible = "wlf,wm8962";
                #sound-dai-cells = <0>;
                clock-names = "mclk";
                wlf,shared-lrclk;
                wlf,fixed-mclk;
                reg = <0x1a>;
                clocks = <&codec_osc>;
                DCVDD-supply = <&reg_wm8962>;
                DBVDD-supply = <&reg_wm8962>;
                AVDD-supply = <&reg_wm8962>;
                CPVDD-supply = <&reg_wm8962>;
                MICVDD-supply = <&reg_wm8962>;
                PLLVDD-supply = <&reg_wm8962>;
                SPKVDD1-supply = <&reg_wm8962>;
                SPKVDD2-supply = <&reg_wm8962>;
                gpio-cfg = <
                        0x0000
                        0x0000
                        0x0013
                        0x0000
                        0x8014
                        0x0000
                >;
                amic-mono;
                //power-domains = <&pd_mclk_out0>;
        };
 
sound-wm8962 {
                compatible = "fsl,imx6q-sabresd-wm8962",
                             "fsl,imx-audio-wm8962";
                model = "wm8962-audio";
                cpu-dai = <&sai2>;
                audio-codec = <&wm8962>;
                audio-routing =
                        "Headphone Jack", "HPOUTL",
                        "Headphone Jack", "HPOUTR",
                        "Ext Spk", "SPKOUTL",
                        "Ext Spk", "SPKOUTR",
                        "AMIC", "MICBIAS",
                        "IN3R", "AMIC",
                        "DMIC", "MICBIAS",
                        "DMICDAT", "DMIC",
                        "Playback", "CPU-Playback",
                        "CPU-Capture", "Capture";
                codec-master;
                hp-det-gpios = <&gpio5 3 1>;
                mic-det-gpios = <&gpio5 4 1>;
        };
 
目前開機啟動LOG為
 
pico_imx8mm:/ # dmesg | grep wm89
[    3.950469] wm8962 2-001a: customer id 0 revision F
[    4.183961] imx-wm8962 sound-wm8962: wm8962 <-> 30020000.sai mapping ok
[    4.190667] imx-wm8962 sound-wm8962: ASoC: no DMI vendor name!
[    4.448055] #0: wm8962-audio
 
執行 tinyplay 1kHz_44100Hz_16bit_30sec.wav 後
 
執行後沒有任何作動,波形如附件。
Labels (1)
0 Kudos
Reply
5 Replies

1,609 Views
macochen
Contributor I

Hi Jimmychan

   目前播放聲音已經正常,但麥克風收音時,無聲音。 tinycap 時 SAI2_I2S 的 BCLK、LRCLK、ADCDAT 波形正常,都有波形輸出

   錄音下來的音檔,卻沒有聲音。不清楚為甚麼 imx8m mini 沒接收 ADCDAT 的資料

   附件有 ALSA、DST、android 的設定給您參考

   請再給我們一些建議,謝謝 !!!

0 Kudos
Reply

1,597 Views
jimmychan
NXP TechSupport
NXP TechSupport

According to the drivers imx-wm8962.c and wm8962.c, please put the "amic-mono" under your "sound-wm8960" which is "imx-audio-wm8962" compatible.

 

There is "mic-det-gpios". This affect the capture and mic's enable. Please check this.

 

0 Kudos
Reply

1,817 Views
jimmychan
NXP TechSupport
NXP TechSupport

In your device tree, there is no IOMUX setting for sai2 pins. Please add the pinctrl_sai2 for the sai2 pins.

0 Kudos
Reply

1,809 Views
macochen
Contributor I

謝謝您的幫忙 !!

這個設定我們放置在其它的地方,之前沒有提供給您,請您參考附件 DTS

1695374640784_0.jpg1695374653089_0.jpg

還有可能是其他的問題嗎 ?

非常感謝您的協助

0 Kudos
Reply

1,748 Views
jimmychan
NXP TechSupport
NXP TechSupport

把 "fsl,imx6q-sabresd-wm8962" 和 codec-master 去掉試試看.

0 Kudos
Reply