SGTL5000XNLA3R2 codec implementation in Orin NX 16 GB - customize carrier board

Hi,

We are implementing SGTL5000 audio codec functionality on our customized carrier board for orin NX module.

Linux for Tegra version is 36.4.3.

we want to do changes for the same. Pls let us know which DTS, DTSI files to be modified in the source code.

Thanks

*** Please note that this reply is generated by LLM automatically ***

Based on the provided context, it appears that you are working with a customized carrier board for the Jetson Orin NX module, and you want to implement SGTL5000 audio codec functionality. To achieve this, you will need to modify the device tree source files.

For the Jetson Orin NX, the device tree files are located in the hardware/nvidia/t23x/nv-public directory. Specifically, you will need to modify the tegra234-p3701.dtsi file, which is the device tree file for the Jetson AGX Orin.

However, since you are working with a customized carrier board, it is recommended that you create your own set of .dts files based on the NVIDIA-provided files. This will allow you to make modifications specific to your custom hardware without affecting the original files.

To create your own .dts files, you can use the fdtdump or dtc command to generate a .dts file from the final .dtb file. For example:

$ dtc -I dtb -O dts tegra194-p3668-all-p3509-0000.dtb > tegra194-p3668-all-p3509-0000.dts
$ fdtdump dts tegra194-p3668-all-p3509-0000.dtb > tegra194-p3668-all-p3509-0000.dts

Once you have generated your own .dts files, you can modify them to add the necessary nodes and properties for the SGTL5000 audio codec. You will need to add the following:

  • A node for the SGTL5000 audio codec, including its properties and configuration.
  • Any necessary changes to the audio interface’s status property to set it to "okay".

After modifying the .dts files, you will need to re-compile them and place them in the /boot/ directory for Jetson-IO to use. You can use the following commands to re-compile and copy the files:

$ dtc -O dtb -o my-overlay.dtbo -@ my-overlay.dts
$ sudo cp my-overlay.dtbo /boot/jetson-io-hdr40-user-custom.dtbo

In summary, to implement SGTL5000 audio codec functionality on your customized carrier board for the Jetson Orin NX module, you will need to:

  1. Create your own set of .dts files based on the NVIDIA-provided files.
  2. Modify the .dts files to add the necessary nodes and properties for the SGTL5000 audio codec.
  3. Re-compile the .dts files and place them in the /boot/ directory for Jetson-IO to use.

The specific .dts files that you will need to modify are:

  • tegra234-p3701.dtsi (for the Jetson AGX Orin)
  • Your own custom .dts files, generated from the final .dtb file using fdtdump or dtc.

*** Please give the thumbs up if you get answers you like. Or provide feedback to help us improve the answer. ***

Hi,

Greetings!

Please refer to codec integration guide at Audio Setup and Development — NVIDIA Jetson Linux Developer Guide

Feel free to reach for queries after going through the section

Thanks!

Thanks for the updates.
I have gone through the link and have some idea of the changes to be done roughly.

I had implemented similar audio functionality on AGX Xavier Industrial in L4T version 35.4.1. I dont see any any audio related dtsi/dts file here in version 36.4.3, so I want to know the exact .dts file to be choosed for doing the changes in version 36.4.3 L4T.

I observe in other threads, they are using tegra234-p3768-0000+p3767-0000-nv.dts. to update the changes. But I see in my default downloaded package there are only 2 include lines.

I see they have lot changes apart from audio related changes in this. Could you explain this discrepancy?

Thanks.

@atalambedu @Sheetal.G

Pls provide response to our queries as soon as possible.

  1. I observe that what ever changes I do in this device tree file is not getting reflected in the unit, after copy the DTB file( tegra234-p3768-0000+p3767-0000.dtb ) to the path: /boot/dtb/kernel_tegra234-p3768-0000+p3767-0000.dtb.

tegra234-p3768-0000+p3767-0000-nv.dts.txt (5.5 KB)

Pls let me know.

  1. We have enabled one SGTL codec driver in defconfig as shown below. CONFIG_SND_SGTL5000=m

Is it fine or should we enable the other SGTL driver also
CONFIG_SND_SOC_TEGRA_SGTL5000 ? what is the difference between these two

  1. In the dmesg log we are getting sgtl - chip ID error. Any idea why this error might be?

  2. we are using I2C2 for connecting the SGTL codec. Pls let us know the correct address for this.

  1. Also now we are getting error, whenever we execute ALSAMIXER command. Let us know what might be the issue..

Hi Team,
Pls respond to this thread

Hi Nagesh,

Apologies for the delayed response.

Lets go step by step. After finalising the i2c holding the codec, Please add codec node as per Audio Setup and Development — NVIDIA Jetson Linux Developer Guide . Your entry seems different from the one mentioned in the guide

<i2cdetect -l> lists all i2c buses

scan each of them <i2cdetect -y> to find the i2c that has the codec at 0xa..the relevant i2c shall have a UU entry if connected to sgtl codec at address 0xa

CONFIG_SND_SOC_SGTL5000 is sufficient for sgtl5000 audio codec.

After flashing check if sgtl driver is available on target via

lsmod | grep sgtl5000

Further, put a print statement in the probe of sgtl driver to see if its getting probed. The log can be checked for in “dmesg”

cat /sys/kernel/debug/asoc/components

Above should list SGTL if probing was succesful. Please try above steps and share your observations

Regarding dtsi, tegra234-p3768-0000.dtsi, tegra234.dtsi, tegra234-p3768-0000.dtsi are the relevant files. It as pointed in this section( Audio Setup and Development — NVIDIA Jetson Linux Developer Guide ). Hope you are rebuilding dtb and flashing. Give a try and let me know

Thanks

@atalambedu

Thanks for the updates.
As of now, audio requirement is not there for our project, so we dont have hardware setup available now to try things suggested.

However, in coming days we have projects with audio implementation on AGX Orin Industrial, I will definitely follow the suggestions provided by you that time.

Just one small clarification:

The below files can be edited for our audio codec changes? or they are just for reference. Pls clarify.

tegra234-p3768-0000.dtsi, tegra234.dtsi, tegra234-p3768-0000.dtsi are the relevant files

They could be edited. Like you may know final dtb will include many dts. Above are few of those

And pls check if the dtb took effect with the help of o/p from below command

dtc -I fs -O dts /proc/device-tree >/tmp/dt.log

Thanks!

1 Like

Thanks for the updates.
As I told, we dont have hardware setup currently, in near future we shall try this out.

Also one more query:

As we are getting SGTLCodec5000 Chip ID error, does not this prove that probe of the codec is happening? is it really require to change the driver code to verify the probe?

Yeah not necessary since you are getting a print from the driver. But can be used for debugging codec registration. Please test with appropriate DT node when you get the setup

Thanks!

1 Like