TLV320AIC32x4 evaluation board with TX2

Hi, Igal!

I’m using yocto poky and there I just add my top-level *.dts file based on tegra186-quill-p3310-1000-c03-00-base.dts and change path to this file in configuration.

I’t more easy to create patches because patch for dtb will contain only this file and no other dts and dtsi files would be modified.

If I remember correctly, in JetPack, this file is used for Jetso-TX2 dev-doard:

64_TX2/Linux_for_Tegra_tx2/sources/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base.dts

So you could change this file to meet your dts changes.

Hi, Igal!
Hope you found info about DTS file helpfull.

I have a question. Maybe someone could help me.

root@jetson-tx2:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: tegrahda [tegra-hda], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: tegrahda [tegra-hda], device 7: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 0: ADMAIF1 CIF ADMAIF1-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 1: ADMAIF2 CIF ADMAIF2-1 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 2: ADMAIF3 CIF ADMAIF3-2 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 3: ADMAIF4 CIF ADMAIF4-3 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 4: ADMAIF5 CIF ADMAIF5-4 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 5: ADMAIF6 CIF ADMAIF6-5 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 6: ADMAIF7 CIF ADMAIF7-6 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: tegrasndt186ref [tegra-snd-t186ref-mobile-rt565x], device 7: ADMAIF8 CIF ADMAIF8-7 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
.......

gives 2 devices.
New one (tegrasndt186ref) is a “card 1”.
And I could use this info to change /etc/asound.conf to make this card default.

But, is there a way just to delete tegra-hda card completely from device-tree?
Maybe in that case tegrasndt186ref would be default right from the box?

Thanks everyone for help!

Hi, Igal!

Thank you so much for your guide! But I have a question to ask.
I’m using L4T 32.1, Jetpack 4.2.1. How should I change your files and configurations to avoid fatal system crashes?

Hi Michael,

I wish I could help you but I’m not there yet, I’m still with 28.2.

I tried to look into it but there are too many changes between the kernels. Sorry.

Hello igal,
I’m also using the same model TLV320AIC32x4 for custom board tx2i.
I have gone through all the conversion thread I’m replacing whatever you mentioned file but not able to find this file * Replace tegra_t186ref_mobile_rt565x.c with /usr/src/kernel/t18x/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x.c in the directory.

TX2i is still not detecting TLV320AIC32x4
I have added DT please have a look
aic32x4: tlv320aic32x4.1-0018@18 {
compatible = “ti,tlv320aic32x4”;
status = “okay”;
reg = <0x18>;
clocks = <&tegra_car TEGRA186_CLK_AUD_MCLK>;
clock-names = “mclk”;
};
In this file tegra186-quill-common.dtsi i have added whatever mentioned for Sound.
Codec is detecting as I2C device in i2cdetect tool as reserved mode(uu) 0x18
but I’m not able to get sound through the codec

could you please help me out.
any help will be greatly appreciated

Thanks,
Parashuram

Parashuram, hi,

are you useing the 28.3 version?

Hello igal,
Thank you for your reply.
The environment is Ubuntu 18.04. Jetpack 4.4 with 32.4.4

hi,

the files that I’ve uploaded are for 28.3, for the new Jetson releases (32.4, etc.), these files do not comply. Please address NVidia for support.

Hello jonathanh,

I’m currently using Jetpack 4.4 with 32.4.4 is there any changes from 28 to 32. cause not able to some files could you please let me know where we need to add the TLV320AIC32X4 changes.

Any help will be greatly appreciated.

Thanks,
Parashuram

Hello!

For L4T r32.x, the file you need to modify is called tegra_machine_driver_mobile.c. This file was renamed because it is a generic machine driver for Tegra and not specific to the RT565x codec.

By the way, I should also point out that r32 is based upon a Linux v4.9 kernel versus the Linux v4.4 in r28. So simply replacing this file may not be enough.

Regards
Jon

Hello Jonathanh,

I have made changes for TLV320AIC32x4 in tegra_machine_driver_mobile.c (please find the attached) and DT changes tegra186-quill-common.dtsi (Please find the attached).
we have enabled the driver CONFIG_SND_SOC_TLV320AIC32X4=y
But still tx2i is not detecting the TLV320AIC32x4.
[ 1.559623] ALSA device list:
[ 1.559626] #0: tegra-hda at 0x3518000 irq 385
[ 1.559628] #1: tegra-snd-t186ref-mobile-rt565x
please find the attached dmesg.log file. Is there anything need to add for detecting audio codec.

Regards
Parashuram
dmesg.log (97.3 KB) tegra_machine_driver_mobile.c (23.5 KB) tegra186-quill-common.dtsi.txt (34.1 KB) ,

Hello!

Let’s move the discussion to the thread that you opened.

Regards,
Jon

Hi @jonathanh and @igal.kroyter !
I’ve faced several problems and ask you to help please.

  1. It’s not possible to record and play with different sample rate. For example while recording at 44100 if start playing on 24000 the record will be damaged.
    Looking at the forum I found that it’s not possible to record and play on different sample rates because of the same clock parent. It it correct?

  2. Recording at any sample rate except 44100 works correctly only after play something on desired for recording sample rate. Especially for 96000.
    Also for 96000 playing kernel says that:
    aic32x4: master clock and sample rate is not supported
    But still able to play the 96000 wav file and it’s played correctly.
    I’ve looked at tlv320aic32x4.c and found that aic32x4_divs has no deviders for 9600. After searching Internet I found

/* 96k rate */
	{25000000, 96000, 2, 7, 8643, 64, 4, 4, 64, 4, 4, 1}

values and change
#define AIC32X4_RATES SNDRV_PCM_RATE_8000_48000
to
#define AIC32X4_RATES SNDRV_PCM_RATE_8000_96000
Should it help in something?
Why it throws error but still able to play 96000 files?
How to force changing of clocks to be able to record at different rates without needs to play same sample rate before?

rev28.2

Hi @jonathanh and @igal.kroyter ! One more time.
Is this so difficult question?

Is there any patches from future revisions that could be applied to @igal.kroyter 's code for rev28.2?

Hello!

This is correct. Each I2S interface has a single bit-clock and frame clock that is common to the data in and data out. This is consistent with the I2S specification and so there is no way you can support multiple sample rates on the same I2S interface for simultaneous playback/capture. You would need to use different I2S interfaces.

Regards,
Jon

Hello!

This would be a good question for the codec vendor. You may want to look at the codec registers after attempting capture and then after playback to see if something is being configured during playback that needs to be configured for capture. Under the debugfs regmap entry, /sys/kernel/debug/regmap/, you should see an entry for the codec and you should be able to dump the registers from there. Obviously you will need the review the driver/documentation for the codec to under what the various register settings are.

Regards,
Jon

Thank you @jonathanh for the answers.
Thanks for the tip about /sys/kernel/debug/regmap, it’s easier than use i2cset\i2cget.

One little question:
For current revision of JetPack was original @igal.kroyter 's code used? Or there is some patches apart from changes that needed for new kernel’s version?

Hello!

I believe that this was based upon an older version and so the changes do not apply to the current. However, I know that other’s have been able to get this working on more recent releases. Please see this thread.

Jon

Thanks @jonathanh!
BTW i mean that /sys/kernel/debug/regmap is easier to use than i2cset\get. I’ve edited the message =)