AUDIO does't have BCLK/WCLK

We use I2S0 connect to audio Device, and also use I2C0 too.
It can make sure MCLK is OK, but BCLK/WCLK doesn’t any signal from SOM.
Could you give us some suggest?
ADUIO1129

Dear All,

Add the dts file.
Audio dts file which refer the tegra194-audio-e3900-0000.dtsi(AGX)
tegra194-audio-p3668.dtsi (2.6 KB)
The Whole dts file which revert from kernel/dtb/tegra194-p3668-all-p3509-0000.dtb

$ cp nx_nvidia/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/kernel/dtb/tegra194-p3668-all-p3509-0000.dtb tegra194-p3668-all-p3509-0000_20211126_1054.dtb
$ dtc -I dtb -O dts -o tegra194-p3668-all-p3509-0000_20211126_1054.dts tegra194-p3668-all-p3509-0000_20211126_1054.dtb

tegra194-p3668-all-p3509-0000_20211126_1054.dts (252.9 KB)
The Booting Log.
Xavier_ti_audio_20211129_1351.log (103.6 KB)
The driver will response about

tlv320aic32x4 1-0018: Failed getting the mclk. The current implementation does not support the usage of this codec without mclk
tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered

By the way, the Audio Chip’s MCLK is connect to Oscillator(not the SOM), Is there any configuration we need to note/tune for this one?

Best Regards,
MOMO Chen

Hi,

Please attach the full dts file converted from dtb file.

Dear Wayne,

There is the full dts file which converted from dtb file.
tegra194-p3668-all-p3509-0000_20211126_1054.dts (252.9 KB)

Best Regards,
MOMO Chen

Did you remember to use the correct pinmux for each pin? It should be generated by the pinmux spreadsheet.

Dear Wayne,

Yes, the Audio chip’s connect interface of pinmux table excel as below photo
(Sorry, The forums seems couldn’t upload the whole excel file)

The there’re the dts which generated by excel file.
tegra19x-jetson_xavier_nx_module_2021_1020-gpio-default.dtsi (1.6 KB)
tegra19x-jetson_xavier_nx_module_2021_1020-padvoltage-default.dtsi (1.3 KB)
tegra19x-jetson_xavier_nx_module_2021_1020-pinmux.dtsi (54.5 KB)

I’ve only add those part which we modifed ( such as the dap5’s function is I2S5 ) in the dts file which location as below.
Linux_for_Tegra/sources/hardware/nvidia/platform/t19x/jakku/kernel-dts/tegra194-p3668-all-p3509-0000.dts
tegra194-p3668-all-p3509-0000.dts (29.6 KB)

Please correct me if there is any step we missing or wrong, Thanks a lot.

Best Regards,
MOMO Chen

Hi,

You should use these dts files to generate a cfg file instead of putting it into the dts.

Dear Wayne,

I’ve refer this chapter To update the bootloader pinmux for generate a cfg file, but there’re some ERROR while generate cfg file via pinmux-dts2cfg.py as below.

$ cd Jetson_Xavier_1.5.1_7814/nx_nvidia/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/kernel/pinmux/t19x
$ ls
addr_info.txt
gpio_addr_info.txt
mandatory_pinmux.txt
pad_info.txt
pinmux-dts2cfg.py
por_val.txt
README.txt
tegra19x-jetson_xavier_nx_module_2021_1020-gpio-default.dtsi
tegra19x-jetson_xavier_nx_module_2021_1020-padvoltage-default.dtsi
tegra19x-jetson_xavier_nx_module_2021_1020-pinmux.dtsi

$ python pinmux-dts2cfg.py --pinmux addr_info.txt gpio_addr_info.txt por_val.txt --mandatory_pinmux_file mandatory_pinmux.txt tegra19x-jetson_xavier_nx_module_2021_1020-pinmux.dtsi tegra19x-jetson_xavier_nx_module_2021_1020-gpio-default.dtsi 1.0 > 123.cfg
ERROR: pin dap5_sclk_pt5(0x00000440) field nvidia,enable-input(0x00000040) is not matching, val = 0x01 expected = 0x00
ERROR: pin dap5_fs_pu0(0x00000440) field nvidia,enable-input(0x00000040) is not matching, val = 0x01 expected = 0x00
ERROR: pin eqos_rd3_pf1(0x00022470) field nvidia,lpbk(0x00000020) is not matching, val = 0x01 expected = 0x00
ERROR: pin eqos_sma_mdio_pf4(0x00022440) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
ERROR: pin sdmmc4_cmd(0x00002440) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
ERROR: pin soc_gpio10_pg6(0x00000410) field nvidia,tristate(0x00000010) is not matching, val = 0x01 expected = 0x00
ERROR: pin gp_pwm2_px2(0x00000410) field nvidia,tristate(0x00000010) is not matching, val = 0x01 expected = 0x00
ERROR: pin uart2_tx_px4(0x00000400) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
ERROR: pin uart2_rx_px5(0x00000450) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
ERROR: pin spi1_sck_pz3(0x00000440) field nvidia,enable-input(0x00000040) is not matching, val = 0x01 expected = 0x00
ERROR: pin can0_dout_paa2(0x0000c400) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
ERROR: pin can0_din_paa3(0x0000c450) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
ERROR: pin uart3_tx_pcc5(0x00000400) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
ERROR: pin uart3_rx_pcc6(0x00000450) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
ERROR: pin uart1_tx_pr2(0x00000400) field nvidia,pull(0x0000000c) is not matching, val = 0x00 expected = 0x02
ERROR: pin uart1_rx_pr3(0x00000454) field nvidia,pull(0x0000000c) is not matching, val = 0x01 expected = 0x02

Is that my argument wrong for pinmux-dts2cfg.py??

  • There is the cfg file for reference. 123.cfg (25.7 KB)

Best Regards,
MOMO Chen

Remove the --mandatory_pinmux_file from your parameters and try again.

Dear Wayne,

Thanks, the pinmux-dts2cfg.py’s ERROR is disappear.
I’ve backup the original tegra19x-mb1-pinmux-p3668-a01.cfg and use the cfg file to replace it.

These message just for reference.
those line with -pinmux is from the tegra19x-mb1-pinmux-p3668-a01.cfg which original.
those line with +pinmux is from the tegra19x-mb1-pinmux-p3668-a01.cfg which generate by pinmux-dts2cfg.py
$ diff -ruN backup/tegra19x-mb1-pinmux-p3668-a01.cfg \ 
bootloader/t186ref/BCT/tegra19x-mb1-pinmux-p3668-a01.cfg | grep dap5
-pinmux.0x02431080 = 0x00000000; # GPIO dap5_sclk_pt5
-pinmux.0x02431078 = 0x00000000; # GPIO dap5_dout_pt6
-pinmux.0x02431070 = 0x00000000; # GPIO dap5_din_pt7
-pinmux.0x02431068 = 0x00000000; # GPIO dap5_fs_pu0
+pinmux.0x02431080 = 0x00000440; # dap5_sclk_pt5: i2s5, tristate-disable, input-enable, lpdr-disable
+pinmux.0x02431078 = 0x00000400; # dap5_dout_pt6: i2s5, tristate-disable, input-disable, lpdr-disable
+pinmux.0x02431070 = 0x00000450; # dap5_din_pt7: i2s5, tristate-enable, input-enable, lpdr-disable
+pinmux.0x02431068 = 0x00000440; # dap5_fs_pu0: i2s5, tristate-disable, input-enable, lpdr-disable
-pinmux.0x02431080 = 0x00000056; # dap5_sclk_pt5: rsvd2, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431078 = 0x00000056; # dap5_dout_pt6: rsvd2, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431070 = 0x00000057; # dap5_din_pt7: rsvd3, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431068 = 0x00000057; # dap5_fs_pu0: rsvd3, pull-down, tristate-enable, input-enable, lpdr-disable

After flash SOM, as the log show, I’ve dump the tegra_pinctrl_reg for compare. I think the cfg file has replace it successfully, but the audio problem is still there.
Xavier_NX_20211201_1644.log (109.6 KB)

Best Regards,
MOMO Chen

Hi,

We recommend you to remove all the changes you have made to the device-tree and any drivers at this moment.

By default playing audio to I2S5 should drive the BCLK and WCLK if the pinmux is set up correctly. We are afraid this might be broken when you add those drivers. So firstly, just change the pinmux and validate I2S5 first.

1 Like

Dear Wayne,

Sorry to reply late, we’ve restore the original bootloader,kernel,rootfs which folder under Linux_for_Tegra/ for a clear environment which we had been tune.

The pinmux table we’re only tune the dap5 to I2S5 as the green block below.


Then validate this I2S interface with oscilloscope, but the BCLK and WCLK seems still no signal/clock so far
( whatever validate it with our carrier board or DeveloperKit, those photo below are validate with DeveloperKit)

There is the log file which booting with DeveloperKit
Xavier_NX_I2S5_only.log (104.6 KB)
Those dts file which generate by pinmux table(excel file)
tegra19x-jetson_xavier_nx_module_20211202_i2s5_only-gpio-default.dtsi (1.8 KB)
tegra19x-jetson_xavier_nx_module_20211202_i2s5_only-padvoltage-default.dtsi (1.3 KB)
tegra19x-jetson_xavier_nx_module_20211202_i2s5_only-pinmux.dtsi (54.4 KB)
The cfg file which generate by pinmux-dts2cfg.py with those dts file above
tegra19x-mb1-pinmux-p3668-a01.cfg (26.8 KB)
And the different between original cfg file and the new one.
Those line with - that is the original.
Those line with + that is the new one.
This file could be open by vim, WordPad…etc.
cfg.diff (3.5 KB)
The dts file which revert from the final tegra194-p3668-all-p3509-0000.dtb that from the original kernel/dtb/
tegra194-p3668-all-p3509-0000_default.dts (246.4 KB)
Would you mind to help us for check?

*Dear Allison, Please correct me if there is any thing I missing.

Best Regards,
MOMO Chen

Dear Sir,

Sorry to bother you, Is there any suggestion further to us??

Best Regards,
MOMO Chen

Hi momo_chen,

cfg seems fine and I see that sound card is registered from the log.
Ensure that you initiate playback on I2S to start seeing BCLK/LRCK

amixer -c jetsonxaviernxa cset name="I2S5 Mux" ADMAIF1
aplay -D hw:jetsonxaviernxa,0 <playback.wav>

If still seeing issues, try setting pinmux manually

sudo apt-get install -y busybox
busybox devmem  0x02431068 32 0x00000444
busybox devmem 0x02431070 32 0x00000454
busybox devmem 0x02431078 32 0x00000404
busybox devmem 0x02431080 32 0x00000444

and ensure they are set with the help of below command

root@tegra-ubuntu:/home/ubuntu# cat /sys/kernel/debug/tegra_pinctrl_reg | grep -i dap5
Bank: 0 Reg: 0x02431068 Val: 0x00000444 -> dap5_fs_pu0
Bank: 0 Reg: 0x02431070 Val: 0x00000454 -> dap5_din_pt7
Bank: 0 Reg: 0x02431078 Val: 0x00000404 -> dap5_dout_pt6
Bank: 0 Reg: 0x02431080 Val: 0x00000444 -> dap5_sclk_pt5

and re-probe signals after starting playback on I2S as specified above

Thanks

Dear atalambedu,

The amixer seems will feedback the message about “Invalid card number.” even I tried it after tune the pinctrl’s register.

This is the log which we validated.
Xavier_ti_audio_20211216_1559.log (106.1 KB)

Best Regards,
MOMO Chen

Hi momo_chen,

In earlier comments, you had mentioned that you have reverted to original kernel DTB i.e taken as it is from kernel source. But I see below errors which indicate that you have not used original default kernel DTB.

[    5.153408] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    5.153464] tegra-asoc: sound: snd_soc_register_card failed (-517)

Please note that my comments apply to original kernel DTB. Try steps in my earlier comment with original DTB to observe the signals on BCLK/WCLK.

Sound card and codec registration can be attempted as a subsequent step

Thanks

Dear atalambedu,

Thanks for your advice kindly, I’ve validate with the original default environment.
Then amixer and aply seems work( Our Hardware Engineer seems still check those signal further.)
There is the log for amixer and aply.
Xavier_ti_audio_20211222_1935.log (92.4 KB)

I’ve tried to narrow down the root caused. It seems be caused by my setting wrong at the hardware/nvidia/platform/t19x/jakku/kernel-dts/common/tegra194-audio-p3668.dtsi
(which I refer the hardware/nvidia/platform/t19x/mccoy/kernel-dts/common/tegra194-audio-e3900-0000.dtsi)
tegra194-audio-p3668.dtsi (2.9 KB)

These lines which I mark below, they will make the “jetsonxaviernxa” disappear which amixer need. Then left the “tegrahdaxnx”. (check by cat /proc/asound/cards)

//momo++
//		nvidia,dai-link-5 {
//			link-name = "rt565x-playback";
//			codec-dai = <&aic32x4>;
//			codec-dai-name = "tlv320aic32x4-hifi";
//			codec-dai-name = "rt5659-aif1";
//		};
//momo--

I’ve also use the argument codec-dai-name, but the system always show this one is not registered as below( whatever I use the tlv320aic32x4-hifi or rt5659-aif1)

tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered

Would you mind to help me to figured out which part I missing or wrong?

Best Regards,
MOMO Chen

Hi momo_chen,

CODEC DAI (tlv320aic32x4-hifi) registration fails as the codec is not registered which is indicated by below logs

[   10.149595] tlv320aic32x4 1-0018: Failed getting the mclk. The current implementation does not support the usage of this codec without mclk
[   10.163164] tlv320aic32x4: probe of 1-0018 failed with error -2

The clock entry in codec node under i2c bus needs to be corrected for succesful codec registration and subsequently modify the dail link entry for the sound card to be registered succesfully.

This earlier forum post lists all the necessary changes for integrating the codec same as yours. Use this as a reference for making changes

More troubleshooting information is available here.

Thanks

Dear atalambedu,

Thanks for your advice, we got little busy in other side of our product/carrier board.
About the audio, we will come back to validate and feedback result ASAP.

Best Regards,
MOMO Chen

Anu update/result can be shared? Thanks