Porting TLV320AIC3104 Audio Codec Source Code as a Driver Package to Linux Kernel for Nvidia Jetson Orin NX

I’m currently embarking on the challenge of integrating the TLV320AIC3104 audio codec with the Nvidia Jetson Orin NX platform. I’ve successfully obtained the source code for the codec, which is available at TLV320AIC3XSW-LINUX Driver or library | TI.com.

My current objective is to port this source code as a driver package to the Linux kernel for the Jetson Orin NX. I’m seeking guidance on the essential steps and considerations required for accomplishing this task effectively.

If anyone within the community has experience or insights into porting source code to the Linux kernel specifically as a driver package for audio codec integration with the Jetson Orin NX, I would be immensely grateful for any advice or assistance you can provide.

Thank you sincerely for your time and support.

Hello,

Welcome to the NVIDIA Developer forums! Your topic will be best served in the Jetson category.

I will move this post over for visibility.

Cheers,
Tom

Hi Pranal,

Please provide information regarding which JP release are you using. Accordingly, I shall provide the codec integration guide. For ex: for JP 6.0 link guides you on how to integrate codec

The source code is already present in the BSP source that nvidia shares for building kernel image or DTB. So you many need to just enable the relevant below codec configs for the TLVAIC3x codec driver to compile. Ref: link as to how to enable below configs
CONFIG_SND_SOC_TLV320AIC3X_I2C
CONFIG_SND_SOC_TLV320AIC3X_SPI
CONFIG_SND_SOC_TLV320AIC3X

Other important links for reference:
Troubleshooting : link
Overall Audio BSP documentation: link

Regards

Hello Atalambedu,

We are using JetPack 5.1, also If you can share the link to the BSP source code for building the kernel image for the Jetson Orin Nano, that would be very helpful.

Hi Pranal,

Here are the relevant links for JP 5.1. Suggest to have a readthrough to get an understanding of how to start

Codec Integration Guide: Audio Setup and Development — Jetson Linux Developer Guide documentation

TroubleShooting:
https://docs.nvidia.com/jetson/archives/r35.2.1/DeveloperGuide/text/SD/Communications/AudioSetupAndDevelopment.html#troubleshooting

Overall Audio BSP Guide:
https://docs.nvidia.com/jetson/archives/r35.2.1/DeveloperGuide/text/SD/Communications/AudioSetupAndDevelopment.html#

Thanks

Okay, thank you for your reply. Since the source code is already present Do I need to implement an initialization function and initialization registers? and we are using I2C and I2S, should the configuration options be:
CONFIG_SND_SOC_TLV320AIC3X_I2C
CONFIG_SND_SOC_TLV320AIC3X_I2S
CONFIG_SND_SOC_TLV320AIC3X
is that right?

And what other changes need to be done?

Hi,

Yes above configs should be enabled as mentioned in my first comment

And generic steps that need to be followed to integrate has been pointed in my earlier comment under “Codec Integration Guide”

Did you happen to go through the same

Regards

Yes, I have gone through that, but I have a question. Do I need to flash the code first, or can I directly edit the device tree file from the host Linux PC and then flash it to the Orion NX? Additionally, I am unable to find the correct device tree file for this version, as there are multiple DTS and DTSI files present in the arch=> arm=> boot=> DTS folder. Can youguide me on which specific file I should use?

Hi,

Edit DT code in BSP source shared by NVIDIA, compile and reflash it

Please refer below links for help

  1. Kernel Customization — Jetson Linux Developer Guide documentation for modifying DT and building kernel
  2. Refer Flashing Support — Jetson Linux Developer Guide documentation and Flashing Support — Jetson Linux Developer Guide documentation for flashing kernel-dtb or kernel as needed
  3. For Orin Nano, you could modify hardware/nvidia/platform/t23x/p3768/kernel-dts/cvb/tegra234-p3767-common-audio.dtsi. (Refer: Audio Setup and Development — NVIDIA Jetson Linux Developer Guide 1 documentation)

If facing any issues specifically with editing DT and flashing it, please raise a different query for that while audio related discussion can continue on this

Thanks

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