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:
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?
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
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.
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.
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.
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?
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
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?
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.
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.
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?
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.