Porting realtek rt5639 codec to Nano

Hello!

There is a problem with the audio path and until we see the trace enabling all DAPMs (including the I2S interface) we will not see anything on the I2S pins. So there is either a problem with the audio routing or the codec configuration. Have you configured the various codec mixer settings?

Regards,
Jon

Hi Jon,

At the end of codec (5640), I’ve asked Realtek to configure the route.

Let’s assume that codec (5640) is not connected. If I2S4 is used to send signals, for example, on nano, if snd-soc-dummy is used to determine I2S4 signals, can you give me some guidance?(such as : use i2s4 to snd-soc-dummy )

thanks.

Hello!

After installing L4T on Jetson Nano, to get the I2S interface to output, all you need to do is …

  1. Configure the pinmux for I2S4 [0]
$ sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb i2s4
$ sudo reboot
  1. Play any WAV file or use speaker-test
$ speaker-test -D hw:tegrasndt210ref,0 -c 2 -r 48000 -F S16_LE -t sine -f 500

Note that if you run the trace now you should see all the DAPM switches turn on.

Regards,
Jon

[0] Welcome — Jetson Linux<br/>Developer Guide 34.1 documentation

1 Like

Hi Jon,

Sorry! I exce “sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb i2s4” , there are some errs!

test@test-desktop:~$ sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb i2s4

Traceback (most recent call last):
File “/opt/nvidia/jetson-io/config-by-function.py”, line 92, in
main()
File “/opt/nvidia/jetson-io/config-by-function.py”, line 76, in main
jetson = board.Board()
File “/opt/nvidia/jetson-io/Jetson/board.py”, line 147, in init
self.name = _board_get(self.compat)
File “/opt/nvidia/jetson-io/Jetson/board.py”, line 81, in _board_get
raise RuntimeError(“No board data found!”)
RuntimeError: No board data found!
test@test-desktop:~$

Hello!

What version of L4T are you using? If you are using the latest r32.4.2 then this should be fixed. Otherwise, please see …

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

Regards,
Jon

Hi Jon,

I use “sudo /opt/nvidia/jetson-io/config-by-function.py -o dtb i2s4” , A “*-user-custom.dtb” is generated .
then I use “aplay -D plughw:1,0 dsj.wav”, but i2s4 port still has no signal output

./tegra-snd-t210ref-mobile-rt565x/codec:3.spdif-dit.3/dapm/bias_level:1:On
./tegra-snd-t210ref-mobile-rt565x/codec:2.spdif-dit.2/dapm/bias_level:1:On
./tegra-snd-t210ref-mobile-rt565x/codec:1.spdif-dit.1/dapm/bias_level:1:On
./tegra-snd-t210ref-mobile-rt565x/codec:0.spdif-dit.0/dapm/x Playback:1:x Playback: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/codec:0.spdif-dit.0/dapm/x OUT:1:x OUT: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/codec:0.spdif-dit.0/dapm/bias_level:1:On
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-i2s.3/dapm/I2S4 CIF Receive:1:I2S4 CIF Receive: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-i2s.3/dapm/I2S4 DAP Transmit:1:I2S4 DAP Transmit: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-i2s.3/dapm/I2S4 DAP TX:1:I2S4 DAP TX: On in 1 out 1 - R0(0x0) mask 0x1
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-i2s.3/dapm/I2S4 CIF RX:1:I2S4 CIF RX: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-i2s.3/dapm/bias_level:1:On
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-axbar/dapm/ADMAIF1 Receive:1:ADMAIF1 Receive: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-axbar/dapm/I2S4 Transmit:1:I2S4 Transmit: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-axbar/dapm/I2S4 Mux:1:I2S4 Mux: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-axbar/dapm/I2S4 TX:1:I2S4 TX: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-axbar/dapm/ADMAIF1 RX:1:ADMAIF1 RX: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/codec:tegra210-axbar/dapm/bias_level:1:On
./tegra-snd-t210ref-mobile-rt565x/tegra210-admaif/dapm/Playback 1:1:Playback 1: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/tegra210-admaif/dapm/bias_level:1:On
./tegra-snd-t210ref-mobile-rt565x/dapm/I2S4 Transmit-I2S4 CIF Receive:1:I2S4 Transmit-I2S4 CIF Receive: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/dapm/I2S4 DAP Transmit-x Playback:1:I2S4 DAP Transmit-x Playback: On in 1 out 1
./tegra-snd-t210ref-mobile-rt565x/dapm/x Headphone:1:x Headphone: On in 1 out 1

Hello!

Did you reboot the board? Can you run the following command …

$ sudo /opt/nvidia/jetson-io/config-by-function.py -l enabled

Regards,
Jon

1 Like

Hi Jon,
About pinmux, how to make sure that the pinmux configuration of “ i2s4 and aud_mclk” is successful ?

thanks .

1 Like

Hello!

Please run the command …

$ sudo /opt/nvidia/jetson-io/config-by-function.py -l enabled

This will indicate if the i2s4 and aud_mclk functions are enabled. The tool is parsing the output from the following sysfs node and so you can also dump the contents of this file to check as well …

sudo cat /sys/kernel/debug/pinctrl/700008d4.pinmux/pinconf-groups

Regards
Jon

1 Like

Hi Jon,
I want to configure this pinmux from DTS instead of using the python script. And my version is 32.2.1.

Hello!

The jetson-io tool does reconfigure the DTB for configuring the pinmux. However, if you are using r32.2.1 then please refer to the following document …

Regards,
Jon

1 Like

Hi Jon,

This PDF link can’t be opened .

https://developer.download.nvidia.com/assets/embedded/secure/jetson/Nano/docs/customizing_the_jetson_nano_40-pin_expansion_header_v1.2.pdf?C_R4fFLJArGYNNZisVc-wQM715rapqr8Gds4u4UFP-4LogOZFew3P5nxZ4aAgTHEGPwv2V678JnbWBL2q_YAsc0QTKUyn-u4gf3MqBNYPCU2cWIV1v8OgB1YuLSlQCJd4v_my0e2gIJJFU8CmRstbgZQCLue70c_JocqreD4cPmj6IX0W1TYuH2Bno-3lzAku5InuJC39vyI5djy74AFVB--uw

Hello!

Can you try this link …

https://developer.download.nvidia.com/assets/embedded/secure/jetson/Nano/docs/customizing_the_jetson_nano_40-pin_expansion_header_v1.2.pdf?tPqIFTJLjVFV59sch7yZ8DTw1NSg2ZkWJ_mnQ_ISIwnFnHY9YpybiPyFt4DSTq0Tw9whAR-osxZCegsUEnkilviLCuj-9EFvOgTF6G0hLYOCTwbd6hByMge1HbvJ1bKvfZMz1D2pv_58s4U6kO7u2KtcxkwaBXUL_rbaPFYo7jV2iMDJjZ3gs_JZfAeHm6PCLfko4XU87wdXQn2N83bmD6UftA

Otherwise go to the download center and search for the document …

Regards,
Jon

Hi Jon,

Am I right ?

Hello!

That part looks good, but you also need to check the GPIO configuration. The GPIO registers define if a pin is configured as a GPIO or a SFIO (ie. I2S, etc). So you also need to dump …

$ sudo cat /sys/kernel/debug/tegra_gpio

If you dump the above I can confirm if I2S is enabled or not.

Cheers
Jon

Hi jon

$ sudo cat /sys/kernel/debug/tegra_gpio

Hello!

Thanks. The DAP4/I2S4 pins are GPIOs PJ4-7, which means that we need to look at the ‘J:’ row above. The value in the CNF register for ‘J’ is 0xf0 and this means that GPIO J4-7 are GPIO and not SFIO. So I2S4 will not work with the above configuration. Therefore, you need to refer the document provided, to make the necessary changes.

Regards,
Jon

1 Like

Hi Jon,

By the document*(customizing_the_jetson_nano_40-pin_expansion_header_v1.2.pdf)*, I used excel to generate DTS, and replaced the corresponding DTS,

But in the document, I didn’t find out how to change GPIO to SFIO. Can you tell me how to change it ?

Hello!

You need to update both the U-Boot and C-Boot pinmux using the generated DTS file as described.

Jon

1 Like

Hi Jon,
Now $ sudo cat /sys/kernel/debug/tegra_gpio

then, use “speaker-test -D hw:tegrasndt210ref,0 -c 2 -r 48000 -F S16_LE -t sine -f 500” and “alsactrl init tegrasndt210ref” , but, I2s4 still has no signal output .