Interfacing wm8960 audio module in imx8mp-phyboard-pollux board in linux source code 5.4.70 kernel

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

Interfacing wm8960 audio module in imx8mp-phyboard-pollux board in linux source code 5.4.70 kernel

200 Views
prasanthi
Contributor I

Hi Team,

Greetings for the day!!

We are working on phycore i MX 8M plus and we are trying to integrate the WM8960 Audio Codec with it.

We have added wm8960 audio codec node our dts file and we are able to generate the dtb file as well.

sound-wm8960 {
compatible = "fsl,imx7d-evk-wm8960","fsl,imx-audio-wm8960";
model = "wm8960-audio";
cpu-dai = <&sai2>;
audio-codec = <&wm8960>;
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", "Mic Jack",
"LINPUT3", "Mic Jack",
"Mic Jack", "MICB";
};
in i2c4 

wm8960: codec@1a {
compatible = "wlf,wm8960";
reg = <0x1a>;
clocks = <&clk IMX8MP_CLK_SAI2>;
clock-names = "mclk", "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
wlf,shared-lrclk;
wlf,hp-cfg = 2 3>;
#sound-dai-cells = <0>;
wlf,gpio-cfg = <1 3>;
};

card also detected in the list of cards.

root@phyboard-pollux-imx8mp-3:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Dummy [Dummy], device 0: Dummy PCM [Dummy 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 1: wm8960audio [wm8960-audio], device 0: 30c20000.sai-wm8960-hifi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: audiohdmi [audio-hdmi], device 0: imx8 hdmi i2s-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0

 

but when i'm playing the music any .wav files its playing but sound not getting from speaker.

root@phyboard-pollux-imx8mp-3:~# aplay -D hw:1,0 sample-15s.wav -vvv
Playing WAVE 'sample-15s.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Hardware PCM card 1 'wm8960-audio' device 0 subdevice 0
Its setup is:
stream : PLAYBACK
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 2
rate : 44100
exact rate : 44100 (44100/1)
msbits : 16
buffer_size : 16384
period_size : 4096
period_time : 92879
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 4096
period_event : 0
start_threshold : 16384
stop_threshold : 16384
silence_threshold: 0
silence_size : 0
boundary : 4611686018427387904
appl_ptr : 0
hw_ptr : 0
Max peak (8192 samples): 0x00001681 #### 17%
Max peak (8192 samples): 0x00000a8e ## 8%
Max peak (8192 samples): 0x0000175c #### 18%
Max peak (8192 samples): 0x00001681 #### 17%
Max peak (8192 samples): 0x00000a8e ## 8%
Max peak (8192 samples): 0x0000175c #### 18%
Max peak (8192 samples): 0x00000abb ## 8%
Max peak (8192 samples): 0x00001d33 ##### 22%
Max peak (8192 samples): 0x00001513 #### 16%
Max peak (8192 samples): 0x00001afd ##### 21%
Max peak (8192 samples): 0x0000172f #### 18%
Max peak (8192 samples): 0x00002410 ###### 28%
Max peak (8192 samples): 0x00001da9 ##### 23%
Max peak (8192 samples): 0x000041d9 ########### 51%
Max peak (8192 samples): 0x0000360a ######### 42%

please let me know how to fixed this issue.

 

Note: previously we are using simple audio card machine  driver its perfectly working fine. now  we are replaced to fsl machine driver its playing the audio but  sound not getting  from speaker .

Tags (2)
0 Kudos
1 Reply

108 Views
prasanthi
Contributor I

Hi Team,

Greetings for the day!!

We are working on phycore i MX 8M plus and we are trying to integrate the WM8960 Audio Codec with it.

We have added hp det in wm8960 audio codec node our dts file

sound-wm8960 {
compatible = "fsl,imx7d-evk-wm8960","fsl,imx-audio-wm8960";
model = "wm8960-audio";
cpu-dai = <&sai2>;
audio-codec = <&wm8960>;

hp det = <2 0>    // added this line
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", "Mic Jack",
"LINPUT3", "Mic Jack",
"Mic Jack", "MICB";
};

 i'm playing the music any .wav files its playing sound getting from headphone.

we are trying to capturee the music from mic but its not capturing.

root@phyboard-pollux-imx8mp-3:~# arecord -D hw:1,0 -f S16_LE -r 44100 -t wav -d 10 rec.wav -vvv
Recording WAVE 'rec.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Mono
Warning: rate is not accurate (requested = 44100Hz, got = 48000Hz)
please, try the plug plugin
Hardware PCM card 1 'wm8960-audio' device 0 subdevice 0
Its setup is:
stream : CAPTURE
access : RW_INTERLEAVED
format : S16_LE
subformat : STD
channels : 1
rate : 48000
exact rate : 48000 (48000/1)
msbits : 16
buffer_size : 24000
period_size : 6000
period_time : 125000
tstamp_mode : NONE
tstamp_type : MONOTONIC
period_step : 1
avail_min : 6000
period_event : 0
start_threshold : 1
stop_threshold : 24000
silence_threshold: 0
silence_size : 0
boundary : 6755399441055744000
appl_ptr : 0
hw_ptr : 0
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
Max peak (6000 samples): 0x00000000 # 0%
root@phyboard-pollux-imx8mp-3:~#

 

we have enable these alsa configurations

amixer -c 1 set 'Left Boost Mixer LINPUT1' on
amixer -c 1 set 'Left Boost Mixer LINPUT2' off
amixer -c 1 set 'Left Boost Mixer LINPUT3' off
amixer -c 1 set 'ADC PCM' 195
amixer -c 1 set 'Capture ' 40

Please can you help me on that we have enable any configurations related to capturing.

NOTE: playback is working fine but issue on capturing.

Thanks,

Prasanthi

 

 

0 Kudos