IMX8MM linux5.4.70使用wm8904 codecs问题

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

IMX8MM linux5.4.70使用wm8904 codecs问题

Jump to solution
6,306 Views
sclu
Contributor I

我现在遇到的问题是播放音乐是不是发出滋滋的声音,像是电流声,我测了列bclk,lrclk的波形,像是codec和imx8两端都同时输出列波形,导致叠加在一起了;但是我打印出来看到codec这端的寄存器配置是没有输出的;还有录音也不行,全是电流声,无法听到声音。

我的配置:

sound {
compatible = "fsl,imx-audio-wm8904";
model = "imx-wm8904";
status = "okay";
sai-controllers = <&sai3 &sai3>;
cpu-dai = <&sai3>;
audio-cpu = <&sai3>;
audio-codec = <&wm8904>;
//codec-master;
audio-routing =
"Headphone Jack", "HPOUTR",
"Headphone Jack", "HPOUTL",
"IN2L", "Line In Jack",
"IN2R", "Line In Jack",
"Mic Jack", "MICBIAS",
"IN1L", "Mic Jack",
"IN1R", "Mic Jack";
};

wm8904: wm8904@1a {
compatible = "wlf,wm8904";
reg = <0x1a>;
clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
clock-names = "mclk";
status = "okay";
};

我播放声音时候会有如下log,我不确定这个频率对不对,像是和我设置的对不上:

root@imx8mmlpddr4evk:~# aplay beijing_beijing.wav
[ 324.199334] wm8904 1-001a: Target BCLK is 1411200Hz
[ 324.204250] wm8904 1-001a: Using 12288000Hz MCLK
[ 324.208916] wm8904 1-001a: CLK_SYS is 12288000Hz
[ 324.213560] wm8904_hw_params 1393 aif1=0x0 aif3=0x22
[ 324.248974] fsl_asoc_card_set_bias_level 274 pll_out=11289600
[ 324.254756] wm8904_set_fll 1705 clock2=0, source=1 fll_id=0, Fref=12288000, Fout=11289600
[ 324.266274] wm8904 1-001a: Using 11289600Hz MCLK
[ 324.270914] wm8904 1-001a: CLK_SYS is 11289600Hz
Playing WAVE 'beijing_beijing.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

我的驱动代码见附件,wm8904.c没有改动过,imx-wm8904.c是仿照imx-wm8962.c复制过来的

Labels (2)
0 Kudos
Reply
1 Solution
6,245 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @sclu ,

I hope you are doing well.

One could try using simple-sound card driver initially to test.

Please refer to /arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi. for more information.

Please refer to 7.3.1.1 Audio-only playback in i.MX Linux User's Guide for audio playback commands.

Thanks & Regards,
Sanket Parekh

View solution in original post

0 Kudos
Reply
3 Replies
6,301 Views
sclu
Contributor I

这是示波器测量的mclk, bclk, lrclk波形

0 Kudos
Reply
6,246 Views
Sanket_Parekh
NXP TechSupport
NXP TechSupport

Hi @sclu ,

I hope you are doing well.

One could try using simple-sound card driver initially to test.

Please refer to /arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi. for more information.

Please refer to 7.3.1.1 Audio-only playback in i.MX Linux User's Guide for audio playback commands.

Thanks & Regards,
Sanket Parekh

0 Kudos
Reply
6,194 Views
sclu
Contributor I
你的回答完美的解决了我的问题
0 Kudos
Reply