Can't build 2nd I2S <-> ADMAIF path

We are able to build one I2S path for speaker and microphone(I2S3), but having trouble to make another I2S path(I2S1) working.

When I set all the parameters the same from amixer, I can see that all the regmap registers are the same (/sys/kernel/debug/regmap/tegra210-i2s.0 and /sys/kernel/debug/regmap/tegra210-i2s.2). However when I tried to Mux the I2S1 to ADMAIF1, it did not build any path related to the I2S1 ports(Through watching /sys/kernel/debug/tracing/events). Then playing an audio file to the ADMAIF1 port, the aplay program exited immediately. The issue happened regardless if the first path was built or not. There wasn’t any kernel warning or error observed related to this I2S during all the tests.

There wasn’t any clock signal can be dected for I2S3 port when setting the port to run as master or slave clocking.

Pinmux:

701000465 root@jeteye /sys/kernel/debug/pinctrl/2430000.pinmux $ cat pinmux-functions  | grep i2s
function: i2s1, groups = [ dap1_fs_pj3 dap1_din_pj2 dap1_dout_pj1 dap1_sclk_pj0 ]
function: i2s3, groups = [ dmic1_clk_pm1 dmic1_dat_pm0 dmic2_dat_pm2 dmic2_clk_pm3 ]
function: i2s4, groups = [ dap4_fs_pcc3 dap4_din_pcc2 dap4_dout_pcc1 dap4_sclk_pcc0 ]
function: i2s2, groups = [ dap2_din_pc3 dap2_dout_pc2 dap2_fs_pc4 dap2_sclk_pc1 ]
function: i2s6, groups = [ gpio_pq0_pi0 gpio_pq1_pi1 gpio_pq2_pi2 gpio_pq3_pi3 ]
function: i2s5, groups = [ gen7_i2c_scl_pl0 gen7_i2c_sda_pl1 gen9_i2c_sda_pl3 gen9_i2c_scl_pl2 ]

Device tree:

	tegra_sound: sound {
		nvidia,audio-routing =
			"x Headphone",          "x HP_OUT",
			"x MIC_IN",             "x Mic",
			"x ADC",                "x Mic Bias",
			"x LINE_IN",            "x Line In",
			"x Line Out",           "x LINE_OUT",
			"y Headphone",          "y OUT",
			"y IN",                 "y Mic";

		cellular_audio: nvidia,dai-link-1 {
			link-name = "spdif-dit-0";
			cpu-dai = <&tegra_i2s1>;
			codec-dai = <&spdif_dit0>;
			cpu-dai-name = "I2S1";
			codec-dai-name = "dit-hifi";
			format = "i2s";
			bitclock-master;
			frame-master;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "y";
			status = "okay";
		};

		hdr40_snd_link_i2s: rt565x_dai_link: nvidia,dai-link-3 {
			link-name = "fe-pi-audio-z-v2";
			cpu-dai = <&tegra_i2s3>;
			codec-dai = <&sgtl5000>;
			cpu-dai-name = "I2S3";
			codec-dai-name = "sgtl5000";
			format = "i2s";
			bitclock-master;
			frame-master;
			bitclock-noninversion;
			frame-noninversion;
			bit-format = "s16_le";
			srate = <48000>;
			num-channel = <2>;
			ignore_suspend;
			name-prefix = "x";
			status = "okay";
		};
	};

Full device tree and I2S register are attached.
device_tree.txt (383.2 KB)
tegra210-i2s.0.registers.txt (666 Bytes)
pinmux.txt (14.0 KB)

Hi rwang4,
As a quick info can you provide Jetpack release version used for your testing.

Hi mkumard,

Thanks for your quick response, the version used is: Jetson Linux R32.7.4(JetPack SDK 4.6.4).

Can you provide the dump of below command on target.

sudo cat /sys/kernel/debug/tegra_pinctrl_reg
amixer -c 1 contents

Also, provide all the mixer control commands used from your side.

The information is included in the attachment, commands used:

# alsactl init tegrasndt186ref
amixer -c tegrasndt186ref cset name='ADMAIF1 Mux' I2S1 | grep -v ';'
#amixer -c tegrasndt186ref cset name='MDV1 Vol' 13500 | grep -v ';'
amixer -c tegrasndt186ref cset name='I2S3 codec bit format' 32 | grep -v ';'
amixer -c tegrasndt186ref cset name='I2S3 input bit format' 32 | grep -v ';'
amixer -c tegrasndt186ref cset name='I2S3 codec frame mode' "i2s" | grep -v ';'
amixer -c tegrasndt186ref cset name='I2S3 codec master mode' "cbs-cfs" | grep -v ';'
amixer -c tegrasndt186ref cset name="I2S1 Mux" "ADMAIF1" | grep -v ';'
sleep 1

time aplay -D hw:tegrasndt186ref,0 ding.wav -vvv

dumps.txt (300.7 KB)

Can you try with below dt change

tegra_sound: sound {
nvidia,audio-routing =
“x Headphone”, “x OUT”,
“x IN”, “x Mic”,
“y Headphone”, “y OUT”,
“y IN”, “y Mic”,
“z Headphone”, “z HP_OUT”,
“z MIC_IN”, “z Mic”,
“z ADC”, “z Mic Bias”,
“z LINE_IN”, “z Line In”,
“z Line Out”, “z LINE_OUT”,
“m Headphone”, “m OUT”,
“m IN”, “m Mic”,
“n Headphone”, “n OUT”,
“n IN”, “n Mic”,
“o Headphone”, “o OUT”,
“o IN”, “o Mic”,
“a IN”, “a Mic”,
“b IN”, “b Mic”,
“c IN”, “c Mic”,
“d IN”, “d Mic”,
“d1 Headphone”, “d1 OUT”,
“d2 Headphone”, “d2 OUT”;

	cellular_audio: nvidia,dai-link-1 {
		link-name = "spdif-dit-0";
		cpu-dai = <&tegra_i2s1>;
		codec-dai = <&spdif_dit0>;
		cpu-dai-name = "I2S1";
		codec-dai-name = "dit-hifi";
		format = "i2s";
		bitclock-master;
		frame-master;
		bitclock-noninversion;
		frame-noninversion;
		bit-format = "s16_le";
		srate = <48000>;
		num-channel = <2>;
		ignore_suspend;
		name-prefix = "x";
		status = "okay";
	};

	hdr40_snd_link_i2s: rt565x_dai_link: nvidia,dai-link-3 {
		link-name = "fe-pi-audio-z-v2";
		cpu-dai = <&tegra_i2s3>;
		codec-dai = <&sgtl5000>;
		cpu-dai-name = "I2S3";
		codec-dai-name = "sgtl5000";
		format = "i2s";
		bitclock-master;
		frame-master;
		bitclock-noninversion;
		frame-noninversion;
		bit-format = "s16_le";
		srate = <48000>;
		num-channel = <2>;
		ignore_suspend;
		name-prefix = "z";
		status = "okay";
	};
};

Thanks, just put the nvidia,audio-routing in an device tree overlay, and patched onto the device. I verified the running device tree content before making the test, there was no improve observed.

Overlay device tree is:

/dts-v1/;
 
/ {
    overlay-name = "My Jetson Overlay Example";
    jetson-header-name = "Jetson 40pin Header";
    compatible = "nvidia,p3509-0000+p3636-0001";
 
    fragment@0 {
        target-path = "/sound";
        __overlay__ {
            nvidia,audio-routing = "x Headphone", "x OUT",
"x IN", "x Mic",
"y Headphone", "y OUT",
"y IN", "y Mic",
"z Headphone", "z HP_OUT",
"z MIC_IN", "z Mic",
"z ADC", "z Mic Bias",
"z LINE_IN", "z Line In",
"z Line Out", "z LINE_OUT",
"m Headphone", "m OUT",
"m IN", "m Mic",
"n Headphone", "n OUT",
"n IN", "n Mic",
"o Headphone", "o OUT",
"o IN", "o Mic",
"a IN", "a Mic",
"b IN", "b Mic",
"c IN", "c Mic",
"d IN", "d Mic",
"d1 Headphone", "d1 OUT",
"d2 Headphone", "d2 OUT";
        };
    };
};

Hi,
Just a suggestion, Is I2S1 DAPM path completed without any of your local change on top of BSP. If so, you can take your change one by one. As aplay exits immediately, I feel DAPM path got broken with your change.

Please try my suggested change and let me know if it works.

Our understanding is that other part of device tree changes are unrelated to the audio, but yes the reasonable way to think is that it somehow impacts the audio - something we need to figure out - we’ll follow your suggestion to narrow down which part may impact the 2nd audio path. In the same time, I am uploading the entire device tree change, and hope you can help us review it.

peripherals.txt (7.5 KB)
pinmux.txt (1.3 KB)
spi.txt (993 Bytes)

That’s correct, unrelated audio nodes won’t have any effect. What I found was same name-prefix was used for more than one dai link in the initial device-tree attachment. Based on that, I have provided the above suggestion to replace the sound node with slight change.

If the above suggestion not working, then we need to check further.

1 Like

Thanks, I missed bit of change(name-prefix updates for the two dai-link nodes) from the original device tree change suggestion, so the original test failed. Now the test has been successful in establishing the links, for all I2S3 port1/2/3 to ADMAIF ports. However another failure was noticed in setting the volume for port 1/2, but not port three. The names used match with the names registered in the driver(kernel/kernel-4.9/sound/soc/codecs/spdif_transmitter.c).

[    4.757146] tegra-asoc: sound: ASoC: no source widget found for z Line In
[    4.763976] tegra-asoc: sound: ASoC: Failed to add route z Line In -> direct -> z LINE_IN
[    4.801225] tegra-asoc: sound: ASoC: no sink widget found for z Line Out
[    4.801230] tegra-asoc: sound: ASoC: Failed to add route z LINE_OUT -> direct -> z Line Out
 jeteye@jeteye ~/audio $ amixer -c tegrasndt186ref  | grep "x "
Simple mixer control 'DSPK1 Rx fifo threshold',0
Simple mixer control 'DSPK2 Rx fifo threshold',0
Simple mixer control 'codec-x format',0
Simple mixer control 'codec-x rate',0
 jeteye@jeteye ~/audio $ amixer -c tegrasndt186ref  | grep "y "
 jeteye@jeteye ~/audio $ amixer -c tegrasndt186ref  | grep "z "
Simple mixer control 'z Capture Attenuate Switch (-6dB)',0
Simple mixer control 'z Capture Mux',0
Simple mixer control 'z Capture ZC',0
Simple mixer control 'z Headphone',0
Simple mixer control 'z Headphone Mux',0
Simple mixer control 'z Headphone Playback ZC',0
Simple mixer control 'z Lineout',0
Simple mixer control 'z Mic',0
Simple mixer control 'z PCM',0

exported_device_tree.txt (383.4 KB)

Silly me, I think the issue can be closed now, the dummy codecs got no capability of volume adjustment. We need mux them to the other volume adjustments elements provided by the audio hub.

Hi rwang4.
Thanks for the update. Good luck!

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