Noise in WM8904 audio Codec with imx8m mini :

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

Noise in WM8904 audio Codec with imx8m mini :

846 Views
msharma
Contributor II

Hello NXP,

I have integrated wm8904 audio codec IC with my customised board, supporting imx8m mini.I am using SAI3, I2S connections.I have enabled IN1L, MICBIASHPOUTR and HPOUTL in my device tree as per my schematics :

Following are my device tree configurations : 

sound-wm8904 {
compatible = "simple-audio-card";
simple-audio-card,name = "wm8904-audio";
simple-audio-card,format = "i2s"; 
//audio-cpu = <&sai3>;
simple-audio-card,frame-master = <&dailink>;
simple-audio-card,bitclock-master = <&dailink>;
simple-audio-card,widgets =
"Headphone", "Headphone Jack",
"Line", "Line Out Jack",
"Microphone", "Microphone Jack",
"Line", "Line In Jack";
simple-audio-card,routing =
// "Line Out Jack", "LINEOUTR",
// "Line Out Jack", "LINEOUTL",
"Headphone Jack", "HPOUTR",
"Headphone Jack", "HPOUTL",
"IN1L", "Microphone Jack",
// "IN1R", "Line In Jack",
"Microphone Jack", "MICBIAS";
// "IN2L", "Microphone Jack",
// "IN2R", "Microphone Jack";
simple-audio-card,mclk-fs = <256>;
dailink: simple-audio-card,cpu {
sound-dai = <&sai3>;
};

simple-audio-card,codec {
sound-dai = <&wm8904>;
clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
};
};


i2c2    {

wm8904: audio-codec {
#sound-dai-cells = <0>;
compatible = "wlf,wm8904";
reg = <0x1a>;
wlf,shared-lrclk;
clocks = <&clk IMX8MM_CLK_SAI3_ROOT>;
clock-names = "mclk";
    };
};

And SAI3 configurations as : 

&sai3 {
pinctrl-names = "default";
assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL2_OUT>;
assigned-clock-rates = <24576000>; 
clocks = <&clk IMX8MM_CLK_SAI3_IPG>, <&clk IMX8MM_CLK_DUMMY>,<&clk IMX8MM_CLK_SAI3_ROOT>, <&clk IMX8MM_CLK_DUMMY>,<&clk IMX8MM_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
fsl,sai-mclk-direction-output;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
status = "okay";
};

pinctrl_sai3: sai3grp {
fsl,pins = <
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_SAI3_RX_DATA0 0xd6
>;
};


I am able to record as well as play the wav file, but getting more noise and very less sound while playing the wav file. Even if the the headphone device is not connected, I can hear the noise while playing.

Attaching a recorded wav file for your reference.
Waiting for your response,


Thanks & Regards,
Monica Sharma.



0 Kudos
Reply
4 Replies

121 Views
deepakbeniya
Contributor III

Hi I am using WM8904 audio codec and its working fine . I am abel to play any audio through the speakers.
The main issue is whenever i connect audio jack(wired earphone) the audio is audiabel through the earphones as well as fromm the speaker and earpeice. That shouldn't happen in this case.

I want when ever i connect the audio jack (wired earphone) the speaker and earpeice should stop playing the audion only the audio output should come from wired earphone.
How it can be done ?

Thanks and Regards
Deepak Kumar Beniya

0 Kudos
Reply

813 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @msharma,

I hope you are doing well.

One can try increasing the speaker volume.

Please refer to https://community.nxp.com/t5/i-MX-Processors/Recording-is-noisy-i-MX6dl-with-wm8960-codec/m-p/259924.

Can you play any other audio .WAV file to test if the problem is not with the speaker?

Please share the command used to capture and play audio.

Thanks & Regards,
Dhruvit Vasavada

0 Kudos
Reply

793 Views
msharma
Contributor II

Hello @Dhruvit,

 I tried playing the external wav file and it played fine.
I can not find any config_wm8904.h file as mentioned in the link, however my driver  have  the bellow left and Right parameter:


SOC_DOUBLE_R_TLV("Digital Playback Volume", WM8904_DAC_DIGITAL_VOLUME_LEFT,
WM8904_DAC_DIGITAL_VOLUME_RIGHT, 1, 96, 0, digital_tlv), 

SOC_DOUBLE_R_TLV("Digital Playback Volume", WM8904_DAC_DIGITAL_VOLUME_LEFT,
WM8904_DAC_DIGITAL_VOLUME_RIGHT, 1, 96, 0, digital_tlv),

I am using the following commands for audio recording and playing :

arecord -D hw:0,0 -c 2 -f S16_LE -r 441000 -t wav -q line.wav

 

aplay -D hw:0,0 -c 2 -f S16_LE -r 48000 line.wav  or

gst-launch-1.0 filesrc location=output.wav ! decodebin ! audioconvert ! audioresample ! alsasink device=hw:0,0

Is there any other possiblity, for noise reduction please let me know.

Thanks & Regards,
Monica







0 Kudos
Reply

752 Views
Dhruvit
NXP TechSupport
NXP TechSupport

Hi @msharma,

I hope you are doing well.

Please make sure that there is no Quality issue with the pin connection for MIC.

One can refer to 7.3.5 Audio recording in i.MX Linux User's Guide

Thanks & Regards,
Dhruvit Vasavada

 

 

0 Kudos
Reply