"Unable to Listen Audio from i.MX8M Plus EVK Through Headphone Jack"

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

"Unable to Listen Audio from i.MX8M Plus EVK Through Headphone Jack"

1,287 次查看
MJD
Contributor II

root@imx8mp-lpddr4-evk:~# pactl list sinks
Sink #0
State: IDLE
Name: alsa_output.platform-sound-bt-sco.mono-fallback
Description: Built-in Audio Mono
Driver: module-alsa-card.c
Sample Specification: s16le 1ch 16000Hz
Channel Map: mono
Owner Module: 6
Mute: no
Volume: mono: 65536 / 100% / 0.00 dB
balance 0.00
Base Volume: 65536 / 100% / 0.00 dB
Monitor Source: alsa_output.platform-sound-bt-sco.mono-fallback.monitor
Latency: 90001 usec, configured 99937 usec
Flags: HARDWARE DECIBEL_VOLUME LATENCY
Properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "30c20000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0"
alsa.id = "30c20000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "0"
alsa.card_name = "bt-sco-audio"
alsa.long_card_name = "bt-sco-audio"
device.bus_path = "platform-sound-bt-sco"
sysfs.path = "/devices/platform/sound-bt-sco/sound/card0"
device.form_factor = "internal"
device.string = "hw:0"
device.buffering.buffer_size = "3198"
device.buffering.fragment_size = "1066"
device.access_mode = "mmap"
device.profile.name = "mono-fallback"
device.profile.description = "Mono"
device.description = "Built-in Audio Mono"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"
Ports:
analog-output: Analog Output (type: Analog, priority: 9900, availability unknown)
Active Port: analog-output
Formats:
pcm

Sink #1
State: IDLE
Name: alsa_output.platform-sound-hdmi.stereo-fallback
Description: Built-in Audio Stereo
Driver: module-alsa-card.c
Sample Specification: s32le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 7
Mute: no
Volume: front-left: 65536 / 100% / 0.00 dB, front-right: 65536 / 100% / 0.00 dB
balance 0.00
Base Volume: 65536 / 100% / 0.00 dB
Monitor Source: alsa_output.platform-sound-hdmi.stereo-fallback.monitor
Latency: 89487 usec, configured 99954 usec
Flags: HARDWARE DECIBEL_VOLUME LATENCY
Properties:
alsa.resolution_bits = "24"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "i.MX HDMI i2s-hifi-0"
alsa.id = "i.MX HDMI i2s-hifi-0"
alsa.subdevice = "0"
alsa[ 1222.811492] audit: type=1334 audit(1697738395.620:18): prog-id=15 op=LOAD
[ 1222.819009] audit: type=1334 audit(1697738395.628:19): prog-id=16 op=LOAD

alsa.device = "0"
alsa.card = "3"
alsa.card_name = "audio-hdmi"
alsa.long_card_name = "audio-hdmi"
alsa.driver_name = "snd_soc_imx_hdmi"
device.bus_path = "platform-sound-hdmi"
sysfs.path = "/devices/platform/sound-hdmi/sound/card3"
device.form_factor = "internal"
device.string = "hw:3"
device.buffering.buffer_size = "35264"
device.buffering.fragment_size = "8816"
device.access_mode = "mmap"
device.profile.name = "stereo-fallback"
device.profile.description = "Stereo"
device.description = "Built-in Audio Stereo"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"
Ports:
analog-output: Analog Output (type: Analog, priority: 9900, availability unknown)
Active Port: analog-output
Formats:
pcm

Sink #2
State: IDLE
Name: alsa_output.platform-sound-xcvr.iec958-stereo
Description: Built-in Audio Digital Stereo (IEC958)
Driver: module-alsa-card.c
Sample Specification: s16le 2ch 44100Hz
Channel Map: front-left,front-right
Owner Module: 9
Mute: no
Volume: front-left: 47168 / 72% / -8.57 dB, front-right: 47168 / 72% / -8.57 dB
balance 0.00
Base Volume: 65536 / 100% / 0.00 dB
Monitor Source: alsa_output.platform-sound-xcvr.iec958-stereo.monitor
Latency: 83178 usec, configured 99954 usec
Flags: HARDWARE DECIBEL_VOLUME LATENCY SET_FORMATS
Properties:
alsa.resolution_bits = "16"
device.api = "alsa"
device.class = "sound"
alsa.class = "generic"
alsa.subclass = "generic-mix"
alsa.name = "XCVR PCM snd-soc-dummy-dai-0"
alsa.id = "XCVR PCM snd-soc-dummy-dai-0"
alsa.subdevice = "0"
alsa.subdevice_name = "subdevice #0"
alsa.device = "0"
alsa.card = "2"
alsa.card_name = "imx-audio-xcvr"
alsa.long_card_name = "imx-audio-xcvr"
alsa.driver_name = "snd_soc_imx_card"
device.bus_path = "platform-sound-xcvr"
sysfs.path = "/devices/platform/sound-xcvr/sound/card2"
device.form_factor = "internal"
device.string = "iec958:2"
device.buffering.buffer_size = "17632"
device.buffering.fragment_size = "4408"
device.access_mode = "mmap"
device.profile.name = "iec958-stereo"
device.profile.description = "Digital Stereo (IEC958)"
device.description = "Built-in Audio Digital Stereo (IEC958)"
module-udev-detect.discovered = "1"
device.icon_name = "audio-card"
Ports:
iec958-stereo-output: Digital Output (S/PDIF) (type: SPDIF, priority: 0, availability unknown)
Active Port: iec958-stereo-output
Formats:
pcm

pacmd set-default-sink 
Even though sink list status is Running, I'm not able to listen from the audio jack connected earphones?

Followed with IMXLUG
i.MX Linux User's Guide
Rev. LF6.1.36_2.1.0 — 29 September 2023

pulseaudio 16.1
Yocto Image (imx-Image-full)

plugged earphones checked with other devices, working in condition.

Please guide to fix this issue.

0 项奖励
回复
4 回复数

1,263 次查看
JorgeCas
NXP TechSupport
NXP TechSupport

Hello, I hope you are doing well.

Could you please send me the log of next command?

aplay -l

With this you can see the card options to play audio, the headphone jack uses the WM8960 codec.

And the command to play audio should be something like:

aplay -Dplughw:3,0 sample.wav

Example:

Jorge7u7_0-1697743168215.png

Jorge7u7_1-1697743195353.png

Best regards.

0 项奖励
回复

1,256 次查看
MJD
Contributor II

@JorgeCas 

Thankyou.

log attached below.

 

root@imx8mp-lpddr4-evk:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: btscoaudio [bt-sco-audio], device 0: 30c20000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0 [30c20000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: imxaudioxcvr [imx-audio-xcvr], device 0: XCVR PCM snd-soc-dummy-dai-0 [XCVR PCM snd-soc-dummy-dai-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: audiohdmi [audio-hdmi], device 0: i.MX HDMI i2s-hifi-0 [i.MX HDMI i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
root@imx8mp-lpddr4-evk:~# aplay -Dplughw:3,0 sample.wav
sample.wav: No such file or directory
root@imx8mp-lpddr4-evk:~# aplay -Dplughw:3,0
.bash_history .config/ .nxp-demo-experience/ 10-Crazy-Frog-Axel-F.mp3
.cache/ .lesshst .profile gstshark_2023-10-19_11:29:09/
root@imx8mp-lpddr4-evk:~# aplay -Dplughw:3,0 10-Crazy-Frog-Axel-F.mp3
Playing raw data '10-Crazy-Frog-Axel-F.mp3' : Unsigned 8 bit, Rate 8000 Hz, Mono (I was not able to listen)

ManjuJ_0-1697779146338.png

root@imx8mp-lpddr4-evk:~# lsmod
Module Size Used by
fsl_jr_uio 16384 0
caam_jr 176128 0
caamkeyblob_desc 16384 1 caam_jr
caamhash_desc 16384 1 caam_jr
caamalg_desc 36864 1 caam_jr
crypto_engine 20480 1 caam_jr
overlay 122880 0
authenc 16384 1 caam_jr
libdes 24576 1 caam_jr
crct10dif_ce 16384 1
polyval_ce 16384 0
polyval_generic 16384 1 polyval_ce
snd_soc_fsl_asoc_card 28672 0
snd_soc_imx_audmux 16384 1 snd_soc_fsl_asoc_card
snd_soc_imx_hdmi 16384 0
snd_soc_imx_card 20480 0
snd_soc_fsl_sai 36864 2
imx8_media_dev 20480 0
snd_soc_fsl_easrc 45056 0
dw_hdmi_cec 16384 0
snd_soc_fsl_micfil 24576 2
snd_soc_fsl_utils 16384 2 snd_soc_fsl_micfil,snd_soc_fsl_sai
snd_soc_fsl_xcvr 36864 2
snd_soc_fsl_aud2htx 16384 2
snd_soc_fsl_asrc 36864 1 snd_soc_fsl_easrc
snd_soc_wm8962 98304 0
secvio 20480 0
flexcan 28672 0
imx_dsp_rproc 20480 0
can_dev 40960 1 flexcan
caam 28672 1 caam_jr
error 24576 7 caamalg_desc,secvio,caamkeyblob_desc,caamhash_desc,caam,caam_jr,fsl_jr_uio
fuse 135168 1
root@imx8mp-lpddr4-evk:~#


root@imx8mp-lpddr4-evk:/lib/modules/6.1.22+g66e442bc7fdc# lsmod | grep wm8962
snd_soc_wm8962 98304 0
root@imx8mp-lpddr4-evk:/lib/modules/6.1.22+g66e442bc7fdc# modinfo snd-soc-wm8962
filename: /lib/modules/6.1.22+g66e442bc7fdc/kernel/sound/soc/codecs/snd-soc-wm8962.ko
license: GPL
author: Mark Brown <broonie@opensource.wolfsonmicro.com>
description: ASoC WM8962 driver
alias: i2c:wm8962
alias: of:N*T*Cwlf,wm8962C*
alias: of:N*T*Cwlf,wm8962
depends:
intree: Y
name: snd_soc_wm8962
vermagic: 6.1.22+g66e442bc7fdc SMP preempt mod_unload modversions aarch64
root@imx8mp-lpddr4-evk:/lib/modules/6.1.22+g66e442bc7fdc# dmesg | grep wm8962
[ 8.464317] wm8962 2-001a: Failed to read ID register
[ 20.197772] platform sound-wm8962: deferred probe pending
root@imx8mp-lpddr4-evk:/lib/modules/6.1.22+g66e442bc7fdc#

ManjuJ_0-1697784245078.png

lab3@daikokunw-Server:~/Y/imx-yocto-bsp/build$ vi tmp/work-shared/imx8mp-lpddr4-evk/kernel-source/arch/arm64/boot/dts/freescale/imx8mp-evk-revb4-sof-wm8962.dts

1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * Copyright 2023 NXP
4 */
5
6 #include "imx8mp-evk.dts"
7
8 /delete-node/ &codec;
9
10 &i2c3 {
11 #address-cells = <1>;
12 #size-cells = <0>;
13
14 wm8962: wm8962@1a {
15 compatible = "wlf,wm8962";
16 reg = <0x1a>;
17 clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>;
18 DCVDD-supply = <&reg_audio_pwr>;
19 DBVDD-supply = <&reg_audio_pwr>;
20 AVDD-supply = <&reg_audio_pwr>;
21 CPVDD-supply = <&reg_audio_pwr>;
22 MICVDD-supply = <&reg_audio_pwr>;
23 PLLVDD-supply = <&reg_audio_pwr>;
24 SPKVDD1-supply = <&reg_audio_pwr>;
25 SPKVDD2-supply = <&reg_audio_pwr>;
26 gpio-cfg = <
27 0x0000 /* 0:Default */
28 0x0000 /* 1:Default */
29 0x0000 /* 2:FN_DMICCLK */
30 0x0000 /* 3:Default */
31 0x0000 /* 4:FN_DMICCDAT */
32 0x0000 /* 5:Default */
33 >;
34 };
35 };
36
37 / {
38 /delete-node/ sound-wm8960;
39
40 reserved-memory {
41 /delete-node/ dsp_reserved;
42 /delete-node/ dsp_reserved_heap;
43 /delete-node/ dsp_vdev0vring0;
44 /delete-node/ dsp_vdev0vring1;
45 /delete-node/ dsp_vdev0buffer;
46
47 dsp_reserved: dsp@92400000 {
48 reg = <0 0x92400000 0 0x2000000>;
49 no-map;
50 };
51 };
52
53 sof-sound-wm8962 {
54 compatible = "simple-audio-card";
55 label = "wm8962-audio";
56 simple-audio-card,bitclock-master = <&sndcodec>;
57 simple-audio-card,frame-master = <&sndcodec>;
58 simple-audio-card,hp-det-gpio = <&gpio4 28 0>;
59 simple-audio-card,widgets =
60 "Headphone", "Headphones",
61 "Microphone", "Headset Mic",
62 "Microphone", "Digital Mic",
63 "Speaker", "Speaker";
64 simple-audio-card,routing =
65 "Headphones", "HPOUTL",
66 "Headphones", "HPOUTR",
67 "Speaker", "SPKOUTL",
68 "Speaker", "SPKOUTR",
69 "Headset Mic", "MICBIAS",
70 "IN1R", "Headset Mic",
71 "IN1L", "Headset Mic",
72 "DMICDAT", "Digital Mic";
73 simple-audio-card,dai-link {
74 format = "i2s";
75 cpu {
76 sound-dai = <&dsp 1>;
77 };
78 sndcodec: codec {
79 sound-dai = <&wm8962>;
80 };
81 };
82 };
83 };
84
85 &dsp {
86 #sound-dai-cells = <1>;
87 compatible = "fsl,imx8mp-dsp";
88 reg = <0x0 0x3B6E8000 0x0 0x88000>;
89
90 pinctrl-names = "default";
91 pinctrl-0 = <&pinctrl_sai3>;
92
93 power-domains = <&audiomix_pd>;
94
95 assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
96 assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
97 assigned-clock-rates = <12288000>;
98 clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_OCRAMA_IPG>,
99 <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_DSP_ROOT>,
100 <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_DSPDBG_ROOT>,
101 <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_IPG>, <&clk IMX8MP_CLK_DUMMY>,
102 <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
103 <&clk IMX8MP_CLK_DUMMY>,
104 <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SDMA3_ROOT>;
105
106 clock-names = "ipg", "ocram", "core",
107 "sai3_bus", "sai3_mclk0", "sai3_mclk1", "sai3_mclk2", "sai3_mclk3",
108 "sdma3_root";
109
110 mbox-names = "txdb0", "txdb1", "rxdb0", "rxdb1";
111 mboxes = <&mu2 2 0>, <&mu2 2 1>,
112 <&mu2 3 0>, <&mu2 3 1>;
113 memory-region = <&dsp_reserved>;
114 /delete-property/ firmware-name;
115
116 tplg-name = "sof-imx8mp-wm8962.tplg";
117 machine-drv-name = "asoc-simple-card";
118 status = "okay";
119 };
120
121 &wm8962 {
122 #sound-dai-cells = <0>;
123 status = "okay";
124 };
125
126 &sai3 {
127 status = "disabled";
128 };
129
130 &sdma3 {
131 status = "disabled";
132 };

Please guide me to make any changes

 

 

 

 

0 项奖励
回复

1,226 次查看
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

Got it, you need to change your device tree on U-boot to imx8mp-evk.dtb as is showed on the next image:

Jorge7u7_0-1698163672265.png

Now, you will be able to see the CODEC on aplay -l play audio through headphone jack:

Jorge7u7_1-1698163796953.png

Jorge7u7_2-1698163861633.png

Best regards.

 

871 次查看
MJD
Contributor II

Hi @JorgeCas 
We are working with custom board with same imx8mp processor, we are using TLV320AIC3101 chip for audio codec, i have configured imx8mp-evk.dts file as below 

#include <dt-bindings/phy/phy-imx8-pcie.h>
#include <dt-bindings/usb/pd.h>
#include "imx8mp.dtsi"
....
sound-tlv320aic3101 {
compatible = "simple-audio-card";
simple-audio-card,name = "HTC2-Sound-Card";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,frame-master = <&dailink_master>;
simple-audio-card,mclk-fs = <256>;
simple-audio-card,widgets =
"Microphone", "Microphone Jack",
"Line", "Line In Jack",
"Line", "Line Out Jack",
"Headphone", "Headphone Jack",
"Speaker", "Speaker External";
simple-audio-card,routing =
"Headphone Jack", "HPLOUT",
"Headphone Jack", "HPROUT";
dailink_master: simple-audio-card,cpu {
sound-dai = <&sai3>;
};
};
&i2c3 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c3>;
status = "okay";
tlv320aic3101: tlv320aic3101@18 {
#sound-dai-cells = <0>;
compatible = "ti,tlv320aic31xx";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_tlv320>;
reg = <0x18>;
reset-gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
IOVDD-supply = <&buck5>; /* 3V3 buck5 */
DVDD-supply = <&buck5>; /* 1V8 buck5 */
AVDD-supply = <&buck4>; /* 3V3 buck4 */
DRVDD-supply = <&buck4>; /* 3V3 buck4 */
};
&sai3 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12288000>;
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_IPG>, <&clk IMX8MP_CLK_DUMMY>,
<&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
<&clk IMX8MP_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll8k", "pll11k";
fsl,sai-mclk-direction-output;
status = "okay";
};

pinctrl_sai3: sai3grp { 
fsl,pins = <
MX8MP_IOMUXC_SAI3_TXFS__AUDIOMIX_SAI3_TX_SYNC 0xd6
MX8MP_IOMUXC_SAI3_TXC__AUDIOMIX_SAI3_TX_BCLK 0xd6
MX8MP_IOMUXC_SAI3_RXD__AUDIOMIX_SAI3_RX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_TXD__AUDIOMIX_SAI3_TX_DATA00 0xd6
MX8MP_IOMUXC_SAI3_MCLK__AUDIOMIX_SAI3_MCLK 0xd6
MX8MP_IOMUXC_SAI3_RXFS__GPIO4_IO28 0xd6
MX8MP_IOMUXC_SAI3_RXC__GPIO4_IO29 0xd6
>;
};
 
pinctrl_tlv320: tlv320grp {
fsl,pins = <
MX8MP_IOMUXC_GPIO1_IO10__GPIO1_IO10 0x00 
>;
};
i2c bus 2 
root@imx8mp-lpddr4-evk:~# i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20: UU -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
root@imx8mp-lpddr4-evk:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: imxaudioxcvr [imx-audio-xcvr], device 0: XCVR PCM snd-soc-dummy-dai-0 [XCVR PCM snd-soc-dummy-dai-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 2: btscoaudio [bt-sco-audio], device 0: 30c20000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0 [30c20000.sai-bt-sco-pcm-wb bt-sco-pcm-wb-0]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 3: audiohdmi [audio-hdmi], device 0: i.MX HDMI i2s-hifi-0 [i.MX HDMI i2s-hifi-0]
Subdevices: 1/1
Subdevice #0: subdevice #0

is my dtb configuration is correct? are do i need make any changes?



Thankyou.










0 项奖励
回复