Tx2_ubuntu18.04 I2S1

How to enable I2S1 base on tx2_ubuntu18.04 ?
The HW board was verified OK base on tx2_ubuntu16.04 .

Thanks,

Hello!

Please see the following document …

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%2520Linux%2520Driver%2520Package%2520Development%2520Guide%2Fhw_setup_jetson_io.html%23

Regards,
Jon

Hi Jonathan,

The tegra_i2s1 in ubuntu16.04:
tegra_i2s1: i2s@2901000 {
compatible = “nvidia,tegra210-i2s”;
reg = <0x2901000 0x100>;
nvidia,ahub-i2s-id = <0>;
clocks = <&tegra_car TEGRA186_CLK_I2S1>,
<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
<&tegra_car TEGRA186_CLK_I2S1_SYNC_INPUT>,
<&tegra_car TEGRA186_CLK_SYNC_I2S1>;
clock-names = “i2s1”, “pll_a_out0”, “ext_audio_sync”,
“audio_sync”;
pinctrl-names = “dap_active”, “dap_inactive”;
pinctrl-0 = <>;
pinctrl-1 = <>;
fsync-width = <31>;
status = “disabled”;
};
But, tegra_i2s1 in ubuntu18.04:
tegra_i2s1: i2s@2901000 {
compatible = “nvidia,tegra210-i2s”;
reg = <0x0 0x2901000 0x0 0x100>;
nvidia,ahub-i2s-id = <0>;
clocks = <&tegra_car TEGRA186_CLK_I2S1>,
<&tegra_car TEGRA186_CLK_PLL_A_OUT0>,
<&tegra_car TEGRA186_CLK_I2S1_SYNC_INPUT>,
<&tegra_car TEGRA186_CLK_SYNC_I2S1>,
<&tegra_car TEGRA186_CLK_I2S1_SYNC_INPUT>;
clock-names = “i2s”, “i2s_clk_parent”, “ext_audio_sync”,
“audio_sync”, “clk_sync_input”;
assigned-clocks = <&tegra_car TEGRA186_CLK_I2S1>;
assigned-clock-parents =
<&tegra_car TEGRA186_CLK_PLL_A_OUT0>;
assigned-clock-rates = <1536000>;
pinctrl-names = “dap_active”, “dap_inactive”;
pinctrl-0 = <>;
pinctrl-1 = <>;
fsync-width = <31>;
status = “disabled”;
};
Is there something I should modify to enable I2S1’s clock ?

Thanks,

Hi Jonathan,

Please help show me the steps to check if there is no clock and data output from tegra_i2s1 base on ubuntu18.04 ?

Thanks,

Hello!

The simplest way to do this is …

  1. Apply fix for jetson-io tool (only needs to be done once)
$ sudo find /opt/nvidia/jetson-io/ -mindepth 1 -maxdepth 1 -type d -exec touch {}/__init__.py \;
  1. Configure the I2S1 pins on TX2 using jetson-io
sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb i2s1
sudo reboot
  1. Test the I2S1 interface
$ alsactl init tegrasndt186ref
$ speaker-test -D hw:tegrasndt186ref,0 -c 2 -r 48000 -F S16_LE -t sine -f 500

Regards,
Jon

Hi Jonathan,

Could I modify dtsi file directly without using jetson-io tool?

Thanks,

Hi Jonathan,

I found clock&data output from I2S1 after using jetson-io tool,
but there is no sound could be hear in headphone.
Anything I should check it?

Thanks,

Hello!

What audio codec have you connected to the I2S interface?

Please note that in this case we are simply using jetson-io to configure the I2S pins, it is not actually modifying the audio/sound nodes.

Regards,
Jon

Hi Jonathan,

My codec is rt5659:
rt565x_dai_link: nvidia,dai-link-1 {
link-name = “rt565x-playback”;
cpu-dai = <&tegra_i2s1>;
codec-dai = <&rt5659_codec>;
cpu-dai-name = “I2S1”;
codec-dai-name = “rt5659-aif1”;
format = “i2s”;
bit-format = “s16_le”;
srate = <48000>;
num-channel = <2>;
ignore_suspend;
name-prefix = “x”;
status = “okay”;
};
By the way, I could not found “nvidia,function = “i2s1”;” in my dtb,
but I can found it in dtb which created by jetson-io,
Is it normal or not?

Thanks,

Hello!

Thanks. When you run ‘alsactl init tegrasndt186ref’ what output do you see?

Do you use the aud_mclk to drive the rt5659 mclk? If so then this also needs to be enabled as it is disabled by default. To do this …

sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb i2s1 aud_mclk
sudo reboot

Yes it is normal that ‘nvidia,function = “i2s1”’ is only seen after running jetson-io. This is simply because that the I2S1 is disabled by default and needs to be enabled.

Regards,
Jon

Hi Jonathan,

Thanks for you quick response!

Here is output:
nvidia@nvidia-desktop:~$ alsactl init tegrasndt186ref
[ 300.836059] *** rt5659_set_bias_level, 2 ***
[ 300.866660] *** rt5659_set_bias_level, 1 ***
[ 300.876361] *** rt5659_set_bias_level, 2 ***
[ 300.907209] *** rt5659_set_bias_level, 3 ***
Reset Tegra APE sound-card controls
Initialised RT565x codec with prefix ‘x’

I could hear sound from headphone after enable mclk now.
How to transfer dtb from:
tegra186-quill-p3310-1000-c03-00-base-user-custom.dtb
into my dtb:
tegra186-quill-p3310-1000-c03-00-base.dtb

Thanks,

Hello!

Great news! If it is easier to see the changes that jetson-io is making you can get the tool to generate an overlay (dtbo file) and then extract the details from the overlay …

$ sudo /opt/nvidia/jetson-io/config-by-function.py -o dtbo i2s1 aud_mclk
$ fdtdump /boot/tegra186-quill-p3310-1000-c03-00-base-user-custom.dtbo

Regards,
Jon

Hi Jonathan,

How to create “header-40pin-pinmux” in my tegra186-quill-p3310-1000-c03-00-base.dtb

I add it to tegra186-quill-p3310-1000-c03-00-base.dts as follow:
pinmux@2430000 {
header-40pin-pinmux {
pin40 {
nvidia,lpdr = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_DISABLE>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
nvidia,pins = “dap1_dout_pj1”;
nvidia,function = “i2s1”;
};
};

But it could not work, could not found phandle in my dtb
header-40pin-pinmux {
phandle = <0x1f2>;
linux,phandle = <0x1f2>;

Thanks,

Hello!

The ‘header-40-pinmux’ is not a phandle but the name of the node. You should have something like …

pinmux@2430000 {
        pinctrl-name = "default";
        pinctrl-0 <&hdr40_pinmux>;
        hdr40_pinmux: header-40pin-pinmux {
                ...
        };
};

Regards,
Jon

Hi Jonathan,

It’s workable.

Thank you very much,