Headphones do not function

At present, I debug the driver and check that the headset-related devices are available, but when I select the headset to play, there is no sound and the playback is abnormal.

Please check this thread to see if can help: Airpods Pro Bluetooth Connection - Jetson & Embedded Systems / Jetson Xavier NX - NVIDIA Developer Forums

kernel_dmesg.log (81.9 KB)
Hi, we add a headphone jack on board additionally, there is codec IC for driving it. The IC is alc5616.
There is a kernel log, please help to check it. Thanks.
kernel log: kernel_dmesg.log

Please refer to Alc5616 cannot work on xavier nx platform - Jetson & Embedded Systems / Jetson Xavier NX - NVIDIA Developer Forums

Hi, thanks for replying, but it’s not the same problem.
Now the i2c is ok. But there is no sound when I play and it ends too soon.
There is file with kernel log, codec driver for rt5616, machine driver and the dts.
Please help to check the problems. Thanks!
kernel_dmesg.log (82.6 KB)
rt5616.c (40.1 KB)
tegra_machine_driver_mobile.c (22.6 KB)
tegra186-p3636-0001-a00-audio.dtsi (3.1 KB)

It’s some info below, or what else need to help checking problems.
It’ pinmux state of i2s

user@user-desktop:~$ sudo grep pj /sys/kernel/debug/tegra_pinctrl_reg
[sudo] password for user: 
Bank: 0 Reg: 0x02431008 Val: 0x00000414 -> gpio_aud2_pj7
Bank: 0 Reg: 0x02431010 Val: 0x00000414 -> gpio_aud1_pj6
Bank: 0 Reg: 0x02431018 Val: 0x00000414 -> gpio_aud0_pj5
Bank: 0 Reg: 0x02431020 Val: 0x00000440 -> aud_mclk_pj4
Bank: 0 Reg: 0x02431028 Val: 0x00000440 -> dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000450 -> dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000400 -> dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000440 -> dap1_sclk_pj0

sound-cards

user@user-desktop:~$ cat /proc/asound/cards
 0 [tegrahda       ]: tegra-hda - tegra-hda
                      tegra-hda at 0x3518000 irq 382
 1 [tegrasndt186ref]: tegra-snd-t186r - tegra-snd-t186ref-mobile-rt565x
                      tegra-snd-t186ref-mobile-rt565x

aplay -l

root@user-desktop:/home/user# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: tegrahda [tegra-hda], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: tegrahda [tegra-hda], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 0: ADMAIF1 CIF ADMAIF1-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 1: ADMAIF2 CIF ADMAIF2-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 2: ADMAIF3 CIF ADMAIF3-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 3: ADMAIF4 CIF ADMAIF4-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 4: ADMAIF5 CIF ADMAIF5-4 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 5: ADMAIF6 CIF ADMAIF6-5 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 6: ADMAIF7 CIF ADMAIF7-6 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 7: ADMAIF8 CIF ADMAIF8-7 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 8: ADMAIF9 CIF ADMAIF9-8 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 9: ADMAIF10 CIF ADMAIF10-9 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 10: ADMAIF11 CIF ADMAIF11-10 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 11: ADMAIF12 CIF ADMAIF12-11 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 12: ADMAIF13 CIF ADMAIF13-12 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 13: ADMAIF14 CIF ADMAIF14-13 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 14: ADMAIF15 CIF ADMAIF15-14 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 15: ADMAIF16 CIF ADMAIF16-15 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 16: ADMAIF17 CIF ADMAIF17-16 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 17: ADMAIF18 CIF ADMAIF18-17 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 18: ADMAIF19 CIF ADMAIF19-18 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 19: ADMAIF20 CIF ADMAIF20-19 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
root@user-desktop:/home/user#

cat trace after play sound

root@user-desktop:/sys/kernel/debug/tracing# cat trace
# tracer: nop
#
# entries-in-buffer/entries-written: 16/16   #P:4
#
#                              _-----=> irqs-off
#                             / _----=> need-resched
#                            | / _---=> hardirq/softirq
#                            || / _--=> preempt-depth
#                            ||| /     delay
#           TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
#              | |       |   ||||       |         |
 alsa-sink-ADMAI-19912 [003] ....  3365.160138: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
 alsa-sink-ADMAI-19912 [003] ....  3365.160371: snd_soc_dapm_walk_done: tegra-snd-t186ref-mobile-rt565x: checks 2 power, 2 path, 0 neighbour
 alsa-sink-ADMAI-19912 [000] ....  3370.184577: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
 alsa-sink-ADMAI-19912 [000] ....  3370.184689: snd_soc_dapm_path: *ADMAIF1 Receive <- (direct) <- Playback 1
 alsa-sink-ADMAI-19912 [000] ....  3370.184691: snd_soc_dapm_path: *ADMAIF1ADMAIF1 Receive <- (direct) <- ADMAIF1 CIF Receive-ADMAIF1 Receive
 alsa-sink-ADMAI-19912 [000] ....  3370.184817: snd_soc_dapm_walk_done: tegra-snd-t186ref-mobile-rt565x: checks 2 power, 2 path, 2 neighbour
 alsa-source-ADM-19922 [004] ....  3385.090394: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
 alsa-source-ADM-19922 [004] ....  3385.090530: snd_soc_dapm_walk_done: tegra-snd-t186ref-mobile-rt565x: checks 2 power, 2 path, 0 neighbour
 alsa-sink-ADMAI-19912 [003] ....  3387.690118: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
 alsa-sink-ADMAI-19912 [003] ....  3387.690283: snd_soc_dapm_walk_done: tegra-snd-t186ref-mobile-rt565x: checks 2 power, 2 path, 0 neighbour
 alsa-sink-ADMAI-19912 [000] ....  3392.761567: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
 alsa-sink-ADMAI-19912 [000] ....  3392.761690: snd_soc_dapm_path: *ADMAIF1 Receive <- (direct) <- Playback 1
 alsa-sink-ADMAI-19912 [000] ....  3392.761693: snd_soc_dapm_path: *ADMAIF1 Receive <- (direct) <- ADMAIF1 CIF Receive-ADMAIF1 Receive
 alsa-sink-ADMAI-19912 [000] ....  3392.761824: snd_soc_dapm_walk_done: tegra-snd-t186ref-mobile-rt565x: checks 2 power, 2 path, 2 neighbour
 alsa-sink-ADMAI-19912 [003] ....  3413.667188: snd_soc_dapm_start: card=tegra-snd-t186ref-mobile-rt565x
 alsa-sink-ADMAI-19912 [003] ....  3413.667355: snd_soc_dapm_walk_done: tegra-snd-t186ref-mobile-rt565x: checks 2 power, 2 path, 0 neighbour

Hi donglinhui2006

I believe you are trying to interface ALC5616 codec on 40-pin GPIO expander of Xavier NX. Xavier NX platform is based on T194 chip. I see you are modifying T186 DTSI file. Can you please confirm about your setup?

Thanks.

Hi,
I’am sorry for the mistake about platform of topic.
My platform is jetson-xavier-nx-devkit-tx2-nx with BOARDID 3636.

Hi,
Is there any progress for this problem?
Thanks

From your trace log it looks like the DAPM path is not complete. Pinmux looks fine.
Do you see clocks on I2S BCLK and WCLK?
Do you see driver callbacks to be happening on rt5616 driver when you start playback?
Share the dump of “amixer -c 1 contents”.

Hi spujar,
Thanks for Replying.
There no clocks on I2S BCLK and WCLK with when playback with codes uploaded before.

But now, we can see clocks on MCLK, WCLK and MCLK when we start playback with the codes below.
And i2s_dout has signals else.
update codes: 

tegra186-p3636-0001-a00-audio.dtsi (3.7 KB)
rt5616.c (40.7 KB) --just add some log prints

We don’t still see driver callbacks to be happening on rt5616 driver when we start playback. The kernel’s log show in
kernel_dmesg2.log (87.4 KB)

Info captured with command "amixer -c 1 contents" is written in 

amixer_contents_info.txt (270.1 KB)

Thanks

Your “nvidia,audio-routing” looks incorrect and that is why you are seeing below errors.

[   11.811011] tegra-asoc: sound: ASoC: no source widget found for x OUT
[   11.817498] tegra-asoc: sound: ASoC: Failed to add route x OUT -> direct -> x Headphone
[   11.825558] tegra-asoc: sound: ASoC: no sink widget found for x IN
[   11.831765] tegra-asoc: sound: ASoC: Failed to add route x Mic -> direct -> x IN

Keep you previous bindings (I see those commented out now and remove the new ones).
The driver callback does not happen unless the DAPM path is correct. You need to review below switches from the codec driver and set the status of those to ON using amixer.

INF1 Switch
DAC L1 Switch
HPVOL Switch

After this try playback and check if you are getting codec driver callbacks.

Hi spujar,
We use get info with command “amixer -c 1 constols” and can’t found controls for “INF1 Switch” “DAC L1 Switch” and “HPVOL Switch”.
card1_controls.txt (46.3 KB)

Hi,
Now we solve the errors that “ASoC: no source widget found for xxx”. It is because it do not load dai_link and not register the widget of rt5616.
But there are still the problem that it have not sound when we playback.
We had set below controls with amixer, alse have no any improving.

amixer -c1 cset name='x DAC MIXL INF1 Switch' 1
amixer -c1 cset name='x LOUT MIX DAC L1 Switch' 1
amixer -c1 cset name='x HPO MIX HPVOL Switch' 1
There are logs, codes, and other infomations below. please help to check they solve the problem.

kernel_dmesg10.log (189.1 KB)
trace.txt (2.1 KB)
rt5616.c (40.8 KB)
tegra186-p3636-0001-a00-audio.dtsi (3.7 KB)
contents.txt (276.4 KB)
controls.txt (48.7 KB)
Thanks

There is no update from you for a period, assuming this is not an issue any more.
Hence we are closing this topic. If need further support, please open a new one.
Thanks

Sorry for the delayed reply.

From this it still seems that your DAPM path is not complete. There are no traces of I2S1 in the log.

Can you try turning this ON as well?
x HPO MIX DAC1 Switch

Please confirm if you are getting the driver callbacks on rt5616.c and I2S clock signals are fine?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.