Audio Codec RT5639 on TX2 with 28.3

Hi,

I used attached patch file & amixer_settings to enable rt5639 on our TX2 custom board with R28.2.1.

But I can’t use them on R28.3.
It doesn’t output any sound.
Please find the boot log in attachment rt5639_dmesg.txt

I tried to use R28.2.1’s rootfs with R28.3’s kernel Image and dtb, and I can hear sound from rt5639 by running aplay command.
It seems like R28.3’s rootfs has some problem on output sound by rt5639.
Can anyone help me to fix this issue on R28.3?

Thx
Yen
amixer_settings.txt (3.22 KB)
patch_file.txt (45.3 KB)
rt5639_dmesg.txt (69.4 KB)

Hi,
Why can’t I attach any files?

Hi,

I don’t why I can’t upload any files,
so please download the files from the following links.

patch file
[url]Dropbox - File Deleted

amixer_settings
[url]Dropbox - File Deleted

rt5639_dmesg
[url]Dropbox - File Deleted

Thx
Yen

You can attach files to an existing post, but not add them while creating a post. If you hover your mouse over the quote mark in the upper right corner of an existing post, then other icons will show up. One icon is a paper clip icon which is used for file attach.

Hi,

Any suggestions for this rt5639 on R28.3 problem?

Thx
Yen

Hello!

When you say you are using the R28.2.1 rootfs, are you only using the R28.2.1 rootfs or are you using the rootfs and bootloaders from R28.2.1?

My first thought was that maybe the default pin configuration for the I2S pins has changed between the releases and so the pins are not configured for I2S. We can check by …

$ sudo grep dap1 /sys/kernel/debug/tegra_pinctrl_reg
Bank: 0 Reg: 0x02431028 Val: 0x00000055 -> dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000055 -> dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000055 -> dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000055 -> dap1_sclk_pj0

For the pins to be configured for I2S, we need to ensure that bit 10 in the above registers is 1 and bits [1:0] are 0. In the above case this is not the case and so the pins are not setup for I2S (note this is from the R32 release).

If the pins are not configured for I2S, then please refer to the ‘Jetson TX2 Adaptation Guide’ on how to reconfigure the pins.

Regards,
Jon

Hi jonathanh,

I just used R28.2.1’s rootfs, no bootloader

  1. Is this correct?
gvidia@jetson-0321917026260:~$ sudo grep dap1 /sys/kernel/debug/tegra_pinctrl_re
[sudo] password for nvidia:
Bank: 0 Reg: 0x02431028 Val: 0x00000055 -> dap1_fs_pj3
Bank: 0 Reg: 0x02431030 Val: 0x00000055 -> dap1_din_pj2
Bank: 0 Reg: 0x02431038 Val: 0x00000055 -> dap1_dout_pj1
Bank: 0 Reg: 0x02431040 Val: 0x00000055 -> dap1_sclk_pj0
Bank: 0 Reg: 0x0243102c Val: 0x01616000 -> drive_dap1_fs
Bank: 0 Reg: 0x02431034 Val: 0x01616000 -> drive_dap1_din
Bank: 0 Reg: 0x0243103c Val: 0x01616000 -> drive_dap1_dout
Bank: 0 Reg: 0x02431044 Val: 0x01616000 -> drive_dap1_sclk

Thx
Yen

Hi Yen,

From the above, the I2S pins are not configured for I2S mode. Per the ‘Jetson TX2 Adaptation Guide’ [0] …

‘For information on customizing the configuration files, refer to the Tegra Linux Driver
Package Development Guide “MB1 Platform Configuration” and “Configuring Pinmux,
GPIO and PAD” topics.’

Regards,
Jon

[0] https://developer.nvidia.com/embedded/dlc/l4t-driver-package-tx2-adaptation-guide

Hi jonathanh,

Is there any risk that I copy R28.2.1’s Linux_for_Tagra/bootloader/t186ref/BCT/tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg to R28.3’s Linux_for_Tagra directly?

Thx
Yen

Hi Yen,

I had a quick look at the differences and there are quite a few. Without going through all of them it is not easy to say if it is OK or not. What I would do is update the r28.3 tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg with the settings from r28.2.1 for the pins you care about. So for example, for I2S1/DAP1 I would make the following change …

$ diff -u r28.3/Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg r28.2.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg  | grep "# dap1"
+pinmux.0x02431040 = 0x00000440; # dap1_sclk_pj0: i2s1, tristate-disable, input-enable
+pinmux.0x02431038 = 0x00000440; # dap1_dout_pj1: i2s1, tristate-disable, input-enable
+pinmux.0x02431030 = 0x00000450; # dap1_din_pj2: i2s1, tristate-enable, input-enable
+pinmux.0x02431028 = 0x00000440; # dap1_fs_pj3: i2s1, tristate-disable, input-enable
-pinmux.0x02431040 = 0x00000055; # dap1_sclk_pj0: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431038 = 0x00000055; # dap1_dout_pj1: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431030 = 0x00000055; # dap1_din_pj2: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431028 = 0x00000055; # dap1_fs_pj3: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable

Regards,
Jon

Hi jonathanh,

I have tried to change the pins relative to I2S1, but it didn’t work.
(same change as you)
So I copied the whole file directly.

Thx
Yen

Hi Yen,

It is working now? Do you use the aud_mclk to clock the codec? If so, you may also need …

$ diff -u r28.3/Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg r28.2.1/Linux_for_Tegra/bootloader/t186ref/BCT/tegra186-mb1-bct-pinmux-quill-p3310-1000-c03.cfg  | grep "# dap1\|# aud_mclk"
+pinmux.0x02431040 = 0x00000440; # dap1_sclk_pj0: i2s1, tristate-disable, input-enable
+pinmux.0x02431038 = 0x00000440; # dap1_dout_pj1: i2s1, tristate-disable, input-enable
+pinmux.0x02431030 = 0x00000450; # dap1_din_pj2: i2s1, tristate-enable, input-enable
+pinmux.0x02431028 = 0x00000440; # dap1_fs_pj3: i2s1, tristate-disable, input-enable
+pinmux.0x02431020 = 0x00000400; # aud_mclk_pj4: aud, tristate-disable, input-disable
-pinmux.0x02431040 = 0x00000055; # dap1_sclk_pj0: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431038 = 0x00000055; # dap1_dout_pj1: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431030 = 0x00000055; # dap1_din_pj2: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431028 = 0x00000055; # dap1_fs_pj3: rsvd1, pull-down, tristate-enable, input-enable, lpdr-disable
-pinmux.0x02431020 = 0x00000059; # aud_mclk_pj4: rsvd1, pull-up, tristate-enable, input-enable, lpdr-disable

Regards,
Jon

Hi jonathanh,

It works now!!
Thanks for your help!!

Thx
Yen