Hello!
Please ensure that the ‘prefix’ specified under the dai-link in DT for the codec matches what you have in the nvidia,audio-routing. So if the prefix is ‘z’, then you want …
nvidia,audio-routing =
"z Headphone", "z LOL",
"z Headphone", "z LOR",
"z IN1_L", "z Mic",
"z IN1_R", "z Mic";
If it is ‘x’, then you need to replace ‘z’ with ‘x’.
Regards.
Jon
Hello Jonathanh,
yes, I got it now. error is solved.
But I’m not able to see the sound output in the setting.
setting->sound
Dmesg are here
nfs@nfs-desktop:~$ dmesg | grep sound
[ 0.466363] iommu: Adding device sound to group 52
[ 2.507589] input: tegra-hda HDMI/DP,pcm=3 as /devices/3510000.hda/sound/card0/input3
[ 2.507751] input: tegra-hda HDMI/DP,pcm=7 as /devices/3510000.hda/sound/card0/input4
[ 2.653956] tegra-asoc: sound: ADMAIF1 <-> ADMAIF1 mapping ok
[ 2.654036] tegra-asoc: sound: ADMAIF2 <-> ADMAIF2 mapping ok
[ 2.654108] tegra-asoc: sound: ADMAIF3 <-> ADMAIF3 mapping ok
[ 2.654181] tegra-asoc: sound: ADMAIF4 <-> ADMAIF4 mapping ok
[ 2.654254] tegra-asoc: sound: ADMAIF5 <-> ADMAIF5 mapping ok
[ 2.654324] tegra-asoc: sound: ADMAIF6 <-> ADMAIF6 mapping ok
[ 2.654394] tegra-asoc: sound: ADMAIF7 <-> ADMAIF7 mapping ok
[ 2.654466] tegra-asoc: sound: ADMAIF8 <-> ADMAIF8 mapping ok
[ 2.654539] tegra-asoc: sound: ADMAIF9 <-> ADMAIF9 mapping ok
[ 2.654609] tegra-asoc: sound: ADMAIF10 <-> ADMAIF10 mapping ok
[ 2.654682] tegra-asoc: sound: ADMAIF11 <-> ADMAIF11 mapping ok
[ 2.654752] tegra-asoc: sound: ADMAIF12 <-> ADMAIF12 mapping ok
[ 2.654821] tegra-asoc: sound: ADMAIF13 <-> ADMAIF13 mapping ok
[ 2.654894] tegra-asoc: sound: ADMAIF14 <-> ADMAIF14 mapping ok
[ 2.654965] tegra-asoc: sound: ADMAIF15 <-> ADMAIF15 mapping ok
[ 2.655035] tegra-asoc: sound: ADMAIF16 <-> ADMAIF16 mapping ok
[ 2.655105] tegra-asoc: sound: ADMAIF17 <-> ADMAIF17 mapping ok
[ 2.655176] tegra-asoc: sound: ADMAIF18 <-> ADMAIF18 mapping ok
[ 2.655252] tegra-asoc: sound: ADMAIF19 <-> ADMAIF19 mapping ok
[ 2.655321] tegra-asoc: sound: ADMAIF20 <-> ADMAIF20 mapping ok
nfs@nfs-desktop:~$ dmesg | grep tlv
[ 2.642998] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[ 2.643003] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 10 kOhm -> CM_R to Right Mixer Negative Resistor
[ 2.643030] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[ 2.643033] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 20 kOhm -> CM_R to Right Mixer Negative Resistor
[ 2.643059] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[ 2.643062] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 40 kOhm -> CM_R to Right Mixer Negative Resistor
[ 2.648253] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[ 2.648255] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 10 kOhm -> CM_L to Left Mixer Negative Resistor
[ 2.648274] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[ 2.648276] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 20 kOhm -> CM_L to Left Mixer Negative Resistor
[ 2.648306] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[ 2.648308] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 40 kOhm -> CM_L to Left Mixer Negative Resistor
[ 2.674784] tlv320aic32x4 0-0018: ASoC: mux z CM_R to Right Mixer Negative Resistor has no paths
[ 2.675296] tlv320aic32x4 0-0018: ASoC: mux z CM_L to Left Mixer Negative Resistor has no paths
My target is should play some sound with the audio codec and should show in the sound setting.
Regards,
Parashuram
Hello!
A couple questions …
- Have you configured the MCLK to output 12MHz? This needs to be configured in device-tree. To check you can …
$ sudo grep aud_mclk /sys/kernel/debug/clk/clk_summary
- Have you configured the codec? Igal posted some playback and capture scripts which configure the appropriate mixer controls for the codec. It is recommended that you try his scripts for playback/capture.
Regards
Jon
Hello Jonathanh,
The answer is here below
1
nfs@nfs-desktop:~$ sudo grep aud_mclk /sys/kernel/debug/clk/clk_summary
aud_mclk 0 0 9600000 11289600 0 0
DT configuration
nvidia,num-clk = <8>;
nvidia,clk-rates = < 270950400 /* PLLA_x11025_RATE */
11289600 /* AUD_MCLK_x11025_RATE */
45158400 /* PLLA_OUT0_x11025_RATE */
45158400 /* AHUB_x11025_RATE */
245760000 /* PLLA_x8000_RATE */
12288000 /* AUD_MCLK_x8000_RATE */
49152000 /* PLLA_OUT0_x8000_RATE */
49152000 >;/* AHUB_x8000_RATE */
clocks = <&tegra_car TEGRA186_CLK_PLLP_OUT0>,
<&tegra_car TEGRA186_CLK_PLLA>,
<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
<&tegra_car TEGRA186_CLK_AHUB>,
<&tegra_car TEGRA186_CLK_CLK_M>,
<&tegra_car TEGRA186_CLK_AUD_MCLK>;
clock-names = "pll_p_out1", "pll_a", "pll_a_out0", "ahub",
"clk_m", "extern1";
resets = <&tegra_car TEGRA186_RESET_AUD_MCLK>;
reset-names = "extern1_rst";
- Using Igle script please find attached outputs Play.sh.txt (1.7 KB) play.log (3.8 KB) Record.sh.txt (1.7 KB) record.log (4.5 KB)
Regards,
Parashuram
Hello!
You need to configure the aud_mclk, otherwise it will not work.
Regards,
Jon
Hello Jonathanh,
Thank you. Could you please tell me where can I update the aud_mclk whetherin DT or tlv.c or Tegra mobile.c
Regards,
Parashuram
Hello!
Please refer to this comment.
Jon
Hello Jonathanh,
I have followed this wiki Added TLV sysclk
file is tegra_machine_driver_mobile.c
+//Added tlv320aic32x4
+static int tegra_machine_aic32x4_init(struct snd_soc_pcm_runtime *rtd)
+{
+ struct device *dev = rtd->card->dev;
+ int err;
+
+ err = snd_soc_dai_set_sysclk(rtd->codec_dai, AIC32X4_FREQ_12000000, 12000000,
+ SND_SOC_CLOCK_IN);
+ if (err) {
+ dev_err(dev, "failed to set aic32x4 sysclk!\n");
+ return err;
+ }
+ return 0;
+}
+//Ended
Igle code complete different that all are old file think that is L4T 28 right now we are using L4T 32.4.4 so it has lot difference.
could you please let me know how to update the aud_mclk for TLV.
please find the made changes in tegra_machine_driver_mobile.ctegra_machine_driver_mobile.c.txt (3.6 KB)
regards,
Parashuram
Hello!
Please see the above comment and refer to the document referenced. Refer to the sub-section ‘AUD_MCLK for Codec SYSCLK’.
Regards,
Jon
Hello Jonathanh
As per the document, I have modified code. but still not able to detect in sound setting
tegra_sound: sound {
compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
nvidia,model = "tegra-snd-t186ref-mobile-rt565x";
nvidia,num-codec-link = <13>;
nvidia,num-clk = <8>;
nvidia,clk-rates = < 270950400 /* PLLA_x11025_RATE */
11289600 /* AUD_MCLK_x11025_RATE */
45158400 /* PLLA_OUT0_x11025_RATE */
45158400 /* AHUB_x11025_RATE */
245760000 /* PLLA_x8000_RATE */
12000000 /* AUD_MCLK_x8000_RATE */
49152000 /* PLLA_OUT0_x8000_RATE */
49152000 >;/* AHUB_x8000_RATE */
clocks = <&tegra_car TEGRA186_CLK_PLLP_OUT0>,
<&tegra_car TEGRA186_CLK_PLLA>,
<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
<&tegra_car TEGRA186_CLK_AHUB>,
<&tegra_car TEGRA186_CLK_CLK_M>,
<&tegra_car TEGRA186_CLK_AUD_MCLK>;
assigned-clocks = <&tegra_car TEGRA186_CLK_PLL_A_OUT0>, <&tegra_car TEGRA186_CLK_AUD_MCLK>;
assigned-clock-parents = <&tegra_car TEGRA186_CLK_PLLA>, <&tegra_car TEGRA186_CLK_PLL_A_OUT0>;
assigned-clock-rates = <12000000>;
clock-names = "pll_p_out1", "pll_a", "pll_a_out0", "ahub",
"clk_m", "extern1";
resets = <&tegra_car TEGRA186_RESET_AUD_MCLK>;
reset-names = "extern1_rst";
The aud_mclk is setted now 12MHz
root@nfs-desktop:~# sudo grep aud_mclk /sys/kernel/debug/clk/clk_summary
aud_mclk 1 1 11289599 11289600 0 0
Is there anything to add for AUD_MCLK ? I’m not clear could you please help me out.
regards,
Parashuram
Hello!
Per the document the format of assigned-clock-rates is …
assigned-clock-rates = <0>, <desired_fixed_rate>;desired_fixed_rate1
And so you need …
assigned-clock-rates = <0>, <12000000>;
Once this is configured correctly, you should see the correct rate in the clk_summary.
Regards,
Jon
Hello!
You also need to check the pinmux settings for the aud_mclk and dap1 pins. See this post and this post.
$ sudo grep "aud_mclk\|dap1" /sys/kernel/debug/tegra_pinctrl_reg
Regards,
Jon
Hello Jonathanh,
root@nfs-desktop:~# sudo grep dap1 /sys/kernel/debug/tegra_pinctrl_reg
Bank: 0 Reg: 0x02431028 Val: 0x00000405 -> dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000055 -> dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000405 -> dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000405 -> dap1_sclk_pj0
root@nfs-desktop:~# sudo grep aud /sys/kernel/debug/tegra_pinctrl_reg
Bank: 0 Reg: 0x02431000 Val: 0x00000401 -> gpio_aud3_pk0
Bank: 0 Reg: 0x02431008 Val: 0x00000401 -> gpio_aud2_pj7
Bank: 0 Reg: 0x02431010 Val: 0x00000058 -> gpio_aud1_pj6
Bank: 0 Reg: 0x02431018 Val: 0x00000054 -> gpio_aud0_pj5
Bank: 0 Reg: 0x02431020 Val: 0x00000409 -> aud_mclk_pj4
I have made pinmux setting as per bmanyu
Pinmux changes in tegra186-mb1-bct-pinmux-quill-p3489-1000-a00.cfgtegra186-mb1-bct-pinmux-quill-p3489-1000-a00.cfg (27.8 KB)
pinmux.0x02431040 = 0x00000405; # dap1_sclk_pj0: rsvd1, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02431038 = 0x00000405; # dap1_dout_pj1: rsvd1, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02431030 = 0x00000055; # dap1_din_pj2: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
pinmux.0x02431028 = 0x00000405; # dap1_fs_pj3: rsvd1, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02431020 = 0x00000409; # aud_mclk_pj4: rsvd1, pull-up, tristate-disable, input-disable, lpdr-disable
clk_possible_parents
root@nfs-desktop:~# sudo cat /sys/kernel/debug/clk/aud_mclk/clk_possible_parents
pllp_grtbb pll_p_out0 pll_a_out0 clk_32k clk_m
clk_summary
root@nfs-desktop:~# grep pll_p_out0 /sys/kernel/debug/clk/clk_summary
pll_p_out0 16 16 408000000 408000000 0 0
Still, I am not able to TI audio codec in sound setting.
Could you please help me out.
Regards,
Parashuram
Hello!
The pinmux settings still do not look correct, because they all are default to the ‘rsvd1’ function. So you need to update the function in the pinmux spreadsheet appropriately for the I2S and AUD_MCLK functions.
With regard to the clocks. You want the pll_p_out0 to drive the AUD_MCLK and so you want …
assigned-clocks = <&tegra_car TEGRA186_CLK_PLL_A_OUT0>, <&tegra_car TEGRA186_CLK_AUD_MCLK>;
assigned-clock-parents = <&tegra_car TEGRA186_CLK_PLLA>, <&tegra_car TEGRA186_CLK_PLLP_OUT0>;
assigned-clock-rates = <0>, <12000000>;
Regards,
Jon
Hello Jonathanh,
Pinmux changes are here
pinmux.0x02431040 = 0x00000404; # dap1_sclk_pj0: i2s1, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02431038 = 0x00000404; # dap1_dout_pj1: i2s1, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02431030 = 0x00000458; # dap1_din_pj2: i2s1, pull-up, tristate-enable, input-enable, lpdr-disable
pinmux.0x02431028 = 0x00000404; # dap1_fs_pj3: i2s1, pull-down, tristate-disable, input-disable, lpdr-disable
pinmux.0x02431020 = 0x00000408; # aud_mclk_pj4: aud, pull-up, tristate-disable, input-disable, lpdr-disable
pinmux settings for the aud_mclk and dap1 pins.
regt@bnfs-desktop:~# sudo grep "aud_mclk\|dap1" /sys/kernel/debug/tegra_pinctrl_
Bank: 0 Reg: 0x02431020 Val: 0x00000408 -> aud_mclk_pj4
Bank: 0 Reg: 0x02431028 Val: 0x00000404 -> dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000458 -> dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000404 -> dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000404 -> dap1_sclk_pj0
clk_possible_parents
root@bnfs-desktop:~# sudo cat /sys/kernel/debug/clk/aud_mclk/clk_possible_parents
pllp_grtbb pll_p_out0 pll_a_out0 clk_32k clk_m
clk_summary
root@bnfs-desktop:~# grep pll_p_out0 /sys/kernel/debug/clk/clk_summary
pll_p_out0 16 16 408000000 408000000 0 0
Dmesg logs for sound card
root@bnfs-desktop:~# dmesg | grep tlv
[ 2.504164] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[ 2.504167] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 10 kOhm -> CM_R to Right Mixer Negative Resistor
[ 2.504189] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[ 2.504191] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 20 kOhm -> CM_R to Right Mixer Negative Resistor
[ 2.504212] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_R
[ 2.504214] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_R -> 40 kOhm -> CM_R to Right Mixer Negative Resistor
[ 2.509483] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[ 2.509485] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 10 kOhm -> CM_L to Left Mixer Negative Resistor
[ 2.509504] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[ 2.509506] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 20 kOhm -> CM_L to Left Mixer Negative Resistor
[ 2.509524] tlv320aic32x4 0-0018: ASoC: no source widget found for CM_L
[ 2.509526] tlv320aic32x4 0-0018: ASoC: Failed to add route CM_L -> 40 kOhm -> CM_L to Left Mixer Negative Resistor
[ 2.535895] tlv320aic32x4 0-0018: ASoC: mux z CM_R to Right Mixer Negative Resistor has no paths
[ 2.536416] tlv320aic32x4 0-0018: ASoC: mux z CM_L to Left Mixer Negative Resistor has no paths
root@bnfs-desktop:~# dmesg | grep sound
[ 0.462131] iommu: Adding device sound to group 52
[ 2.389045] input: tegra-hda HDMI/DP,pcm=3 as /devices/3510000.hda/sound/card0/input3
[ 2.389172] input: tegra-hda HDMI/DP,pcm=7 as /devices/3510000.hda/sound/card0/input4
[ 2.515094] tegra-asoc: sound: ADMAIF1 <-> ADMAIF1 mapping ok
[ 2.515173] tegra-asoc: sound: ADMAIF2 <-> ADMAIF2 mapping ok
[ 2.515244] tegra-asoc: sound: ADMAIF3 <-> ADMAIF3 mapping ok
[ 2.515317] tegra-asoc: sound: ADMAIF4 <-> ADMAIF4 mapping ok
[ 2.515391] tegra-asoc: sound: ADMAIF5 <-> ADMAIF5 mapping ok
[ 2.515486] tegra-asoc: sound: ADMAIF6 <-> ADMAIF6 mapping ok
[ 2.515566] tegra-asoc: sound: ADMAIF7 <-> ADMAIF7 mapping ok
[ 2.515652] tegra-asoc: sound: ADMAIF8 <-> ADMAIF8 mapping ok
[ 2.515734] tegra-asoc: sound: ADMAIF9 <-> ADMAIF9 mapping ok
[ 2.515807] tegra-asoc: sound: ADMAIF10 <-> ADMAIF10 mapping ok
[ 2.515886] tegra-asoc: sound: ADMAIF11 <-> ADMAIF11 mapping ok
[ 2.515957] tegra-asoc: sound: ADMAIF12 <-> ADMAIF12 mapping ok
[ 2.516030] tegra-asoc: sound: ADMAIF13 <-> ADMAIF13 mapping ok
[ 2.516101] tegra-asoc: sound: ADMAIF14 <-> ADMAIF14 mapping ok
[ 2.516170] tegra-asoc: sound: ADMAIF15 <-> ADMAIF15 mapping ok
[ 2.516245] tegra-asoc: sound: ADMAIF16 <-> ADMAIF16 mapping ok
[ 2.516317] tegra-asoc: sound: ADMAIF17 <-> ADMAIF17 mapping ok
[ 2.516389] tegra-asoc: sound: ADMAIF18 <-> ADMAIF18 mapping ok
[ 2.516461] tegra-asoc: sound: ADMAIF19 <-> ADMAIF19 mapping ok
[ 2.516567] tegra-asoc: sound: ADMAIF20 <-> ADMAIF20 mapping ok
Regards,
Parashuram
Hello!
Great! What is the parent clock and frequency reported for the aud_mclk now?
Also can you confirm what you currently have in the dai-link node for the codec? We need to make sure that the codec is the bit clock and frame-sync master.
Jon
Hello Jonathanh,
parent clock and frequency are here
tegra_sound: sound {
compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
nvidia,model = "tegra-snd-t186ref-mobile-rt565x";
nvidia,num-codec-link = <13>;
clocks = <&tegra_car TEGRA186_CLK_PLLA>,
<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
<&tegra_car TEGRA186_CLK_AHUB>,
<&tegra_car TEGRA186_CLK_AUD_MCLK>;
clock-names = "pll_a", "pll_a_out0", "ahub", "extern1";
assigned-clocks = <&tegra_car TEGRA186_CLK_PLL_A_OUT0>, <&tegra_car TEGRA186_CLK_AUD_MCLK>;
assigned-clock-parents = <&tegra_car TEGRA186_CLK_PLLA>, <&tegra_car TEGRA186_CLK_PLLP_OUT0>;
assigned-clock-rates = <0>, <12000000>;
resets = <&tegra_car TEGRA186_RESET_AUD_MCLK>;
reset-names = "extern1_rst";
dai link node changes in DT
nvidia,dai-link-2 {
link-name = "ti-capture";
cpu-dai = <&tegra_i2s1>;
codec-dai = <&aic32x4>;
cpu-dai-name = "I2S1";
codec-dai-name = "tlv320aic32x4-hifi";
tx-mask = <0xFF>;
rx-mask = <0xFF>;
format = "i2s";
bitclock-slave;
frame-slave;
bitclock-noninversion;
frame-noninversion;
bit-format = "s16_le";
bclk_ratio = <1>;
srate = <44100>;
num-channel = <2>;
ignore_suspend;
name-prefix = "z";
status = "okay";
};
Regards,
Parashuram
Hello!
Sorry, if I was not clear, I mean can you show the aud_mclk parent and rate as reported in the sysfs to ensure that it is actually configured as expected …
$ sudo cat /sys/kernel/debug/clk/aud_mclk/clk_parent
$ sudo cat /sys/kernel/debug/clk/aud_mclk/clk_rate
Hopefully, the above now align with what you have in DT.
For the dai-link, you should set replace ‘bitclock-slave’ and ‘frame-slave’ and ‘bitclock-master’ and ‘frame-master’ because we want the codec to be the master. See Igal’s configuration.
Regards
Jon
Hello Jonathanh,
Could you please look the below outputs.
root@bnfs-desktop:~# cat /sys/kernel/debug/clk/aud_mclk/clk_rate
12000000
root@bnfs-desktop:~# cat /sys/kernel/debug/clk/aud_mclk/
clk_accuracy clk_flags clk_phase clk_prepare_count frequency_stats_table
clk_enable_count clk_notifier_count clk_possible_parents clk_rate
root@bnfs-desktop:~# cat /sys/kernel/debug/clk/aud_mclk/*
0
1
0x00002000
0
0
pllp_grtbb pll_p_out0 pll_a_out0 clk_32k clk_m
1
12000000
[ default_freq 0]
For the dai link changes are here
nvidia,dai-link-2 {
link-name = "ti-capture";
cpu-dai = <&tegra_i2s1>;
codec-dai = <&aic32x4>;
cpu-dai-name = "I2S1";
codec-dai-name = "tlv320aic32x4-hifi";
tx-mask = <0xFF>;
rx-mask = <0xFF>;
format = "i2s";
bitclock-master;
frame-master;
bitclock-noninversion;
frame-noninversion;
bit-format = "s16_le";
bclk_ratio = <1>;
srate = <44100>;
num-channel = <2>;
ignore_suspend;
name-prefix = "z";
status = "okay";
};
Regards,
Parashuram
Hello!
That all looks good. Have you tried Igal’s playback and capture scripts?
Regards,
Jon