How to receiving Audio input data through GPIO on TX2

Hi all?

I tried to receive I2S audio data by gpio pins.

What i have to using gpio pin is "GPIO0_CAM0_PWR (G8) and connected by Max9296 for sound.
( HW teams did that…)

GTS

  • 1st question is … how to connect to codec?
    using DMIC? or how to set to data ouput pin on DT?

  • 2nd question is how to setting gpio pins for i2s.
    so i find to TX2 pinmux teamplate for enable that…

GPIO0_CAM0_PWR#	G8	QSPI_SCK	AW39	AV37	unused_QSPI_SCK	GPIO3_PR.00					B	B				QSPI	RSVD1	RSVD2	RSVD3	RSVD1	qspi_sck_pr0	vddio_spi			LV_CZ	BDSDMEMLV_BFCR90_VXVDP1P1P1	18k	pd	GPIO_PR0		NORMAL	NORMAL	DISABLE	0	1	1	1	1	1	1	VALID	GPIO3_PR.00	Output	Drive 0					Disable					GPIO3/CAM1_RST#

… how to change that

direction is ouput and … pad category? pull strength?
i am really confusing plz help

Hello!

My understanding is that the MAX9296 is not an audio codec but a deserialiser. So this is not something that can be interfaced to the DMIC or I2S interfaces. I have seen that we have used this in conjunction with cameras as described here. I am not sure what is connected to the serialiser/deserialisers but more information can be useful.

The pin GPIO0_CAM0_PWR cannot be used for I2S. This can only be used as a GPIO. The I2S pins are available on pins G2, H2, G1 and H1. The pinmux for I2S pins on the 40-pin header can be configured by …

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

For more details see this doc.

Regards,
Jon

Thx to reply !
i was confused a lot and dont know what to do.
so i reviewed again

Serdes is not do something about sound. it just a path for sending i2s data. Another chipset is already encode sound and send i2s data on gpio.

i already using audio codec rt5631 and i2s1 is already .
so my goal is get i2s data from GPIO0_CAM0_PWR(G8) pin and pass to rt5631 codec . can i get any other advise?

ps … bad new is… custom borard’s GPIO0_CAM0_PWR(G8) is already connected…

Hello!

Unfortunately, I do not see a way to do this. The above GPIO pin is not able to operate as an I2S pin. Furthermore, for I2S, you need clock, fsync and data-in/out. So typically there are 4 pins required for I2S.

Jon

i recheck hw pins again and hw said my paper is too old and that has some of mistakes. it connect to i2s1 data in/ out lrclk , clk pins and i enabled these.

i2s0 is already connected rt5631 codec and outer i2s lines are i2s1.
i want to play sound on speaker and how to connect that?

i dont know how to enable, i think that enable DT is key point and anything else?

      nvidia,dai-link-1 {
  	/* link-name = "spdif-dit-0"; */
  	link-name = "rt5631-playback";
  	cpu-dai = <&tegra_i2s1>;
  	/* codec-dai = <&spdif_dit0>; */
          codec-dai = <&rt5631_codec>; 
  	cpu-dai-name = "I2S1";
  	/* codec-dai-name = "dit-hifi"; */
  	codec-dai-name = "rt5631-hifi"; 
  	format = "i2s";	
  	bit-format = "s16_le";
  	srate = <48000>;
  	num-channel = <2>;
  	ignore_suspend;
  	name-prefix = "x";
  	status = "okay";
  };

  nvidia,dai-link-2 {
  	link-name = "spdif-dit-1";
  	cpu-dai = <&tegra_i2s2>;
  	codec-dai = <&spdif_dit1>;
  	cpu-dai-name = "I2S2";
  	codec-dai-name = "dit-hifi";
  	format = "i2s";
  	bit-format = "s16_le";
  	srate = <48000>;
  	num-channel = <2>;
  	ignore_suspend;
  	name-prefix = "y";
  	status = "okay";
  };

Hello!

What is the speaker connected to? Is it connected to the rt5631 codec? Do you have the rt5631 codec working for playback?

It is not clear to me what your hardware setup looks like.

Regards,
Jon

Hi jonathanh

Screenshot from 2021-06-22 09-28-36

The speaker is connected codec and i2s0 playback is working now
Yesterday, I I2S1 tested by amixer and checking signals .

amixer -c 1 sset ‘I2S1 Mux’ ‘I2S2’
aplay -Dhw:tegrasndt186ref,1 test.wav
→ signal is work sound is not working
i2s0 playback is not working too

amixer -c 1 sset ‘I2S1 Mux’ ‘ADMAIF2’
aplay -Dhw:tegrasndt186ref,1 test.wav
→ signal is work sound is work.
but i2s0 playback is not working

other i2s device which sending I2S signals is not coming yet and i wait that.

Hello!

I believe that you asked the same question here. Please can you respond to that thread if it is not working.

Regards,
Jon