AUDIO does't have BCLK/WCLK

Dear kayccc,

I think I need time to tune the dts file and circuit step by step.
ex : the mclk in other case(TX2i of the post link that atalambedu provided), the audio chip’s mclk seems connect to TEGRA186_CLK_AUD_MCLK which meaning we need to follow their configuration in dts file/circuit/pinmux table…etc.

After adjust, the “Failed getting the mclk” is disappear, but there is the next one need to solve about those below. I will tried to add those argument to the dts file which the TI driver need.

[    9.680719] tlv320aic32x4 1-0018: Missing supply 'iov'
[    9.680723] tlv320aic32x4 1-0018: Failed to setup regulators

Dear kaycc,

There is one news need consult with you guys,
As our reply early, I had tried to add those argument as the dts file show which follow the post to fixed the “tlv320aic32x4 1-0018: Missing supply ‘iov/dv/av’”.
tegra194-audio-p3668.dtsi (3.2 KB)
But It will cause the system crash( as the log show) when I add the av-supply as below.
(the others doesn’t cause system crash such as iov-supply/dv-supply.)

 av-supply = <&battery_reg>;

Xavier_ti_audio_20220113_1527.log (97.3 KB)
Would you mind to give us some suggestion for this configuration??

Best Regards,
MOMO Chen

Dear kaycc,

Sorry to update for this one, it seems not be caused by the regulators’s parameter.
that more like be caused by snd_soc_register_codec(dev, &soc_codec_dev_aic32x4, &aic32x4_dai, 1) which in Linux_for_Tegra/sources/kernel/kernel-4.9/sound/soc/codecs/tlv320aic32x4.c;

int aic32x4_probe(struct device *dev, struct regmap *regmap)
{
...
        ret = aic32x4_setup_regulators(dev, aic32x4);
        if (ret) {
                dev_err(dev, "Failed to setup regulators\n");
                return ret;
        }

        ret = snd_soc_register_codec(dev,
                        &soc_codec_dev_aic32x4, &aic32x4_dai, 1);
        if (ret) {
                dev_err(dev, "Failed to register codec\n");
                aic32x4_disable_regulators(aic32x4);
                return ret;
        }
        return 0;

I’ve been mark the aic32x4_setup_regulators(dev, aic32x4) and the situation is same.
Best Regards,
MOMO Chen

Hi momo_chen,

Did you connect required power supplies to codec. ?
From data sheet I found online, I see that 3.3V supply should be connected to the relevant pins on codec. Assuming you have sourced your power from 40 pin header’s 3.3V pin, try using “&hdr40_vdd_3v3” instead of &battery_reg and check if the codec gets registered.

Thanks

Dear atalambedu,

Sorry to reply late, there’re something we need update/sync with you.

  1. There is an i2c problem between XavierNX DevKit and TI’s EVB, our hardware engineer is still check about it. We may hard to debug with this one before this problem be fixed.

With the Image which built with those file above, the EVB will show no acknowledge as below show via i2cdump, but there is no this problem in our carrier board.
Xavier DevKit + TI EVB log
Xavier_ti_audio_20220119_1641_XavierDevKit.log (51.1 KB)
Our carrier board log
Xavier_ti_audio_20220119_1734.log (37.5 KB)

root@lanner-desktop:~# i2cdump -y 0x1 0x18
No size specified (using byte-data access)
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: [ 1459.530727] tegra-i2c c240000.i2c: no acknowledge from address 0x18
XX [ 1459.531215] tegra-i2c c240000.i2c: no acknowledge from address 0x18
XX [ 1459.531583] tegra-i2c c240000.i2c: no acknowledge from address 0x18
  1. According your suggestion before, we’ve been keep the original dts.
    Then the TI has provide some sample command as the Xavier_ti_audio_20220119_1734.log above show. the line out could work even the volume is very small.
    But we’re still prefer to make the kernel/TI driver could work well,
    so we’re still analysis why the codec-dai register fail.

  2. Since the EVB has I2C problem is still exist as item.1 description. we’re only could to debug with our carrier board. About the system crash, it is disappear after I modify the “link-name” of the audio dts file as the post you provide.
    Audio DTSI
    tegra194-audio-p3668.dtsi (3.7 KB)
    DTS
    tegra194-p3668-all-p3509-0000_20220120_1351.dts (230.6 KB)

                hdr40_snd_link_i2s: nvidia,dai-link-5 {
//                      name-prefix = "x";
                        name-prefix = "z";
//                      link-name = "rt565x-playback";
                        link-name = "ti-capture";
                        codec-dai = <&aic32x4>;
                        codec-dai-name = "tlv320aic32x4-hifi";

LOG file
Xavier_ti_audio_20220120_1347.log (96.2 KB)


but, there’re still something need to trace.
a. System feedback two WARNING message to instead of the system crash as the log show.

[    9.876535] WARNING: CPU: 0 PID: 2535 at /home/lanner/workspace/nVIDIA/Jetson_Xavier_1.5.1_7814/nx_nvidia/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/sources/kernel/kernel-4.9/drivers/clk/clk.c:840 clk_core_disable+0x21c/0x240
[    9.883415] Modules linked in: snd_soc_tlv320aic32x4_i2c zram igb spidev overlay cdc_mbim cdc_wdm cdc_ncm usbnet qcserial usb_wwan usbserial userspace_alert nvgpu bluedroid_pm ip_tables x_tables
[    9.883491] CPU: 0 PID: 2535 Comm: kworker/u12:5 Not tainted 4.9.201+ #96
[    9.883495] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[    9.883513] Workqueue: events_unbound async_run_entry_fn
[    9.883521] task: ffffffc1e0987000 task.stack: ffffffc1de718000
[    9.883530] PC is at clk_core_disable+0x21c/0x240
[    9.883535] LR is at clk_core_disable_lock+0x28/0x40
[    9.883541] pc : [<ffffff800868962c>] lr : [<ffffff8008689678>] pstate: 80c000c5
[    9.883544] sp : ffffffc1de71bc30
[    9.883557] x29: ffffffc1de71bc30 x28: 0000000000000000
[    9.883566] x27: 0000000000000000 x26: ffffffc1f69d5400
[    9.883576] x25: ffffff800a0ad000 x24: 0000000000000000
[    9.883585] x23: 0000000000000000 x22: ffffffc1f69d3c00
[    9.883595] x21: ffffffc1d0fc1818 x20: ffffffc1e11ddc00
[    9.883604] x19: ffffffc1e11ddc00 x18: 0000000000000000
[    9.883614] x17: 0000007f808004e0 x16: ffffff8008270390
[    9.883623] x15: 0000000000000040 x14: 0000000000030eab
[    9.883633] x13: 000000000007bbc4 x12: 0000000000000400
[    9.883642] x11: 0000000000000400 x10: 0000000000000000
[    9.883652] x9 : 000000000217b9a6 x8 : 0000000000000400
[    9.883661] x7 : 0000000000000800 x6 : 0000000001a93076
[    9.883671] x5 : ffffff8008f59910 x4 : 0000000000000002
[    9.883680] x3 : 0000000000000000 x2 : 00000000098d098d
[    9.883690] x1 : ffffffc1e0987000 x0 : 0000000000000000

[    9.883703] ---[ end trace be65547650375f3c ]---
[    9.887099] Call trace:
[    9.887115] [<ffffff800868962c>] clk_core_disable+0x21c/0x240
[    9.887123] [<ffffff8008689678>] clk_core_disable_lock+0x28/0x40
[    9.887129] [<ffffff80086896bc>] clk_disable+0x2c/0x38
[    9.887138] [<ffffff8008d479c8>] aic32x4_set_bias_level+0x110/0x1d8
[    9.887147] [<ffffff8008d25d94>] snd_soc_codec_set_bias_level+0x34/0x40
[    9.887154] [<ffffff8008d2dabc>] snd_soc_dapm_set_bias_level+0x6c/0x210
[    9.887161] [<ffffff8008d2fedc>] dapm_pre_sequence_async+0x44/0xd0
[    9.887170] [<ffffff80080dee08>] async_run_entry_fn+0x48/0x158
[    9.887178] [<ffffff80080d40cc>] process_one_work+0x1e4/0x4b0
[    9.887184] [<ffffff80080d43e8>] worker_thread+0x50/0x4c8
[    9.887190] [<ffffff80080db074>] kthread+0xec/0xf0
[    9.887197] [<ffffff80080838a0>] ret_from_fork+0x10/0x30
[    9.887455] ------------[ cut here ]------------
[    9.890852] WARNING: CPU: 0 PID: 2535 at /home/lanner/workspace/nVIDIA/Jetson_Xavier_1.5.1_7814/nx_nvidia/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/sources/kernel/kernel-4.9/drivers/clk/clk.c:722 clk_core_unprepare+0x1d8/0x1f8
[    9.898210] Modules linked in: snd_soc_tlv320aic32x4_i2c zram igb spidev overlay cdc_mbim cdc_wdm cdc_ncm usbnet qcserial usb_wwan usbserial userspace_alert nvgpu bluedroid_pm ip_tables x_tables

[    9.898284] CPU: 0 PID: 2535 Comm: kworker/u12:5 Tainted: G        W       4.9.201+ #96
[    9.898289] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[    9.898305] Workqueue: events_unbound async_run_entry_fn
[    9.898313] task: ffffffc1e0987000 task.stack: ffffffc1de718000
[    9.898320] PC is at clk_core_unprepare+0x1d8/0x1f8
[    9.898327] LR is at clk_unprepare+0x34/0x48
[    9.898332] pc : [<ffffff8008688e50>] lr : [<ffffff800868ba54>] pstate: 60c00045
[    9.898335] sp : ffffffc1de71bc60
[    9.898339] x29: ffffffc1de71bc60 x28: 0000000000000000
[    9.898349] x27: 0000000000000000 x26: ffffffc1f69d5400
[    9.898359] x25: ffffff800a0ad000 x24: 0000000000000000
[    9.898369] x23: 0000000000000000 x22: ffffffc1f69d3c00
[    9.898379] x21: ffffffc1d0fc1818 x20: 0000000000000000
[    9.898388] x19: ffffffc1e11ddc00 x18: 000000000000108f
[    9.898398] x17: 0000007f808004e0 x16: ffffff8008270390
[    9.898408] x15: 0000000000000000 x14: 00000000000060be
[    9.898417] x13: 0000000000024e96 x12: 00000000000005db
[    9.898427] x11: 0000000000001f18 x10: 0000000000000a10
[    9.898438] x9 : ffffffc1de71bb50 x8 : ffffffc1e0987a70
[    9.898448] x7 : 0000000000000000 x6 : 0000000000000400
[    9.898458] x5 : 0000000000000400 x4 : 0000000000000000
[    9.898468] x3 : 0000000000000000 x2 : 0000000000000000
[    9.898478] x1 : ffffffc1e0987000 x0 : 0000000000000000

[    9.898491] ---[ end trace be65547650375f3d ]---
[    9.902758] Call trace:
[    9.902770] [<ffffff8008688e50>] clk_core_unprepare+0x1d8/0x1f8
[    9.902778] [<ffffff800868ba54>] clk_unprepare+0x34/0x48
[    9.902787] [<ffffff8008d479d0>] aic32x4_set_bias_level+0x118/0x1d8
[    9.902796] [<ffffff8008d25d94>] snd_soc_codec_set_bias_level+0x34/0x40
[    9.902804] [<ffffff8008d2dabc>] snd_soc_dapm_set_bias_level+0x6c/0x210
[    9.902812] [<ffffff8008d2fedc>] dapm_pre_sequence_async+0x44/0xd0
[    9.902820] [<ffffff80080dee08>] async_run_entry_fn+0x48/0x158
[    9.902828] [<ffffff80080d40cc>] process_one_work+0x1e4/0x4b0
[    9.902835] [<ffffff80080d43e8>] worker_thread+0x50/0x4c8
[    9.902841] [<ffffff80080db074>] kthread+0xec/0xf0
[    9.902849] [<ffffff80080838a0>] ret_from_fork+0x10/0x30

b. the codec dai is still not register,

[    5.124091] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered

c. the i2c adapter seems be bind with TI’s i2c driver

root@lanner-desktop:~# i2cdump -y 0x1 0x18
No size specified (using byte-data access)
Error: Could not set address to 0x18: Device or resource busy
root@lanner-desktop:~# lsmod | grep tlv
snd_soc_tlv320aic32x4_i2c     3119  1

d. The line out is no sound while aplay be executed, and the aplay only executed less 3 sec.
(the song should be play 90 sec).

Best Regards,
MOMO Chen

Dear atalambedu,

Is there any adjust we need at the dts file or driver??
We want to consult with you about the aud_mclk, too.

As our audio dtsi above show, we’ve add these line.

clocks = <&bpmp_clks TEGRA194_CLK_AUD_MCLK>;
clock-names = "mclk";

And the pinmux config as this log show.
Xavier_20220128_1953.log (12.6 KB)

But this pin seems no signal while execute aplay.
Is there anything we need to tune for this section?
How do I to issue the signal/clock in this pin?
Or which situation it will issue the signal/clock?

Best Regards,
MOMO Chen

Hi momo_chen,

Sorry for delayed reply. Need some clarification wrt your earlier comment

  1. I assumed that you are working on non-working i2c detect on TI’s EVB. Please clarify about your setup
    Is it a) or b)
    a) Xavier NX + TI’s EVB or
    b) Xavier NX + Carrier Board

  2. From earlier comments, I see that you were able to probe codec and resolve the crash as well on carrier board. Since its working on carrier board. If i2c detect issue is seen with TI’s EVB, may be you need to debug the TI’s EVB hw

  3. Let me know the status of codec registration on your b) setup. This can be checked under
    cat /sys/kernel/debug/asoc/codecs (if your codec is registered it will be listed here). ​

  4. If codec registration is fine, let me know if card registration is fine on b) setup

  5. I have shared commands for setting pinmux in earlier comment (AUDIO does't have BCLK/WCLK - #24 by atalambedu). It is different from the log you attached. Pls use settings from the earlier comment. Note that until codec DAI is registered and corresponding dai link is registered, playback wont work

Please reply to above points in numbered sequence to avoid confusion

Thanks

Dear atalambedu,

Sorry to reply late, I’ve tried to sort out the 1. if there is any step not clear or wrong.
Please correct/notify me.

For 1. we have validated it with b) so far, but it could be validated with a) now.
non-working i2c detect is belong a) before, but this one be fixed with jumper wired for common ground between Xavier NX and TI’s EVB.

a), the TI’s EVB has no oscillator for mclk. it will depend on the SOM’s.

b), there might be 2 phase as below.

b-1), Original version, there is a 25MHz oscillator connect to TI Chip’s mclk. This version
could work well with your command and TI’s configuration via i2c utility. But consider there will be a error about the “Failed to get mclk” and probe error for TI’s driver,
so we move to b-2) now.

b-2), we’ve cut off the 25MHz oscillator, and make a jumper wired between SOM’s aud_mclk and TI’s mclk. then adjust those file below for fixed the “Failed getting the mclk.” and “tlv320aic32x4: probe of 1-0018 failed with error -2”
Audio DTS file
tegra194-audio-p3668.dtsi
Pinmux file which generated by pinmux excel
tegra19x-mb1-pinmux-p3668-a01.cfg (25.5 KB)

pinmux.0x02431020 = 0x00000400; # aud_mclk_ps4: aud, tristate-disable, input-disable, lpdr-disable
pinmux.0x02431080 = 0x00000440; # dap5_sclk_pt5: i2s5, tristate-disable, input-enable, lpdr-disable
pinmux.0x02431078 = 0x00000400; # dap5_dout_pt6: i2s5, tristate-disable, input-disable, lpdr-disable
pinmux.0x02431070 = 0x00000450; # dap5_din_pt7: i2s5, tristate-enable, input-enable, lpdr-disable
pinmux.0x02431068 = 0x00000440; # dap5_fs_pu0: i2s5, tristate-disable, input-enable, lpdr-disable

But there will be another problem futher…
Xavier_ti_audio_20220120_1347.log (96.2 KB)

[    9.873367] ------------[ cut here ]------------
[    9.876535] WARNING: CPU: 0 PID: 2535 at /home/lanner/workspace/nVIDIA/Jetson_Xavier_1.5.1_7814/nx_nvidia/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/sources/kernel/kernel-4.9/drivers/clk/clk.c:840 clk_core_disable+0x21c/0x240
[    9.883703] ---[ end trace be65547650375f3c ]---
[    9.887455] ------------[ cut here ]------------
[    9.890852] WARNING: CPU: 0 PID: 2535 at /home/lanner/workspace/nVIDIA/Jetson_Xavier_1.5.1_7814/nx_nvidia/JetPack_4.5.1_Linux_JETSON_XAVIER_NX_DEVKIT/Linux_for_Tegra/sources/kernel/kernel-4.9/drivers/clk/clk.c:722 clk_core_unprepare+0x1d8/0x1f8
[    9.898491] ---[ end trace be65547650375f3d ]---
[    9.347130] tegra-asoc: sound: ASoC: CODEC DAI tlv320aic32x4-hifi not registered
[    9.350676] tegra-asoc: sound: snd_soc_register_card failed (-517)
  1. The probe codec is solve with b-2), but there’re other problem as above description.
    Yes, the i2c detect issue is seen with TI’s EVB and be solved with jumper wired.
  2. I will prepare the log for you for check, but I think the codec register is not fine for CODEC DAI at least.
  3. same as 3.
  4. I will add those value to our pinmux config file and make a log( with 3.), if this step is OK to you.

Best Regards,
MOMO Chen

Hi momo_chen,

Good to hear that you could resolve the i2c detect issue for TI’s EVB

And regarding pinmux, use attached file instead. I have modified dap5 settings.
tegra19x-mb1-pinmux-p3668-a01.cfg (25.5 KB)

But for the codec dai registration issue, suggest to debug the probe function(aic32x4_probe) to get the clue as to why codec registration is failing.

Will wait for update on codec registration next

Thanks

Dear atalambedu,

Sorry, Update the log first.
This log file is based on the b-2 which flash with your configuration file.
Then I’ve tried to fetch some message.

/sys/kernel/debug/clk/clk_summary
/sys/kernel/debug/tegra_pinctrl_reg
/proc/asound/cards
/proc/asound/pcm
/sys/kernel/debug/asoc/codecs

As your mention about the /sys/kernel/debug/asoc/codecs.
There is one qeustion, I saw there is a tlv320aic32x4.1-0018.
Is that correct for it? I thought the 1-0018 should indicate i2c bus and device address…
But it is weird if the TI chip register it’s i2c section as a CODEC DAI.

*Sorry, forgot to upload log
Xavier_ti_audio_20220214_1423.log (146.3 KB)

Best Regards,
MOMO Chen

Hi momo_chen,

Although there are errors in logs, I see that the card and codec are registered succesfully in the later part of the log. Could you try playback and let me know if its working fine.

If there are any codec specific mixer controls to be set, you might need to set them before trying playback.

If the playback fails, pls share the dmesg log, mixer control settings (amixer -c 1 contents)

Thanks

Dear atalambedu,

Sorry to reply late, the playback is fails.
The sound file should longer than 1 min, but the aplay is done less half min…

lanner@lanner-desktop:~/workspace$ date +%s
1645595489
lanner@lanner-desktop:~/workspace$ aplay -D hw:jetsonxaviernxa,0 song_short.wav
Playing WAVE 'song_short.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
lanner@lanner-desktop:~/workspace$ date +%s
1645595501

There is the log we prepare which we prepare that include the dmesg and ‘amixer -c 1 contents’.
Xavier_ti_audio_20220223_1342.log (528.4 KB)

Best Regards,
MOMO Chen

Hi momo_chen,

Please check the i2s clock rate from cat /sys/kernel/debug/clk/clk_summary and upload the clk_summary for referrence here.

and how is the playback data. Does it sound fine(on speaker/headset present on codec)?

Thanks

Hi momo_chen,

Is this still an issue to support? Any result can be shared? Thanks

Dear atalambedu,

Sorry to upgrade so late, be stuck with other issue.
There is the log which I fetch info

/sys/kernel/debug/clk/clk_summary          which you need
/sys/kernel/debug/tegra_pinctrl_reg
/proc/asound/cards
/proc/asound/pcm
/sys/kernel/debug/asoc/codecs

Xavier_ti_audio_20220401_1545.log (146.0 KB)
About the playback data, it seems no sound so far.
But the music file is fine, we’ve validate it with configure TI chip; playback it with aplay.

Best Regards,
MOMO Chen

Hi momo_chen,

From provided data, apart fom codec and card being registered fine, I see that pinmux is also fine.

I needed clk summary during the usecase (/sys/kernel/debug/clk/clk_summary) as you mentioned that the playback finishes immediately

But before that, ensure to set mixer controls before playback. If not, codec vendor should be able to provide the appropriate mixer settings for configuring codec for playback.

Thanks

Dear atalambedu,

The playback could execute for few seconds, I can execute it in back ground.
Then fetch the clk summary. Is this suitable for fetch the info you need?

About the set mixer controls, Did you mean config the codec chip which as we do the TI configuration( to Stereo DAC playback with 48ksps Sample Rate) before?

If you meaning it, I will tried to add those configuration to the TI’s driver since the codec driver “snd_soc_tlv320aic32x4_i2c” couldn’t remove then it will preemptive the codec that I couldn’t config the TI chip via i2c-utility now.

Best Regards,
MOMO Chen

Hi momo_chen,

By mixer control, I mean settings similar to first 3 commands in link

It might be difficult to fetch clk_summary if playback finishes immediately.

Apart from speaker related mixer settings, set Jetson I2S as master i.e codec as slave and see if it helps

amixer -c 1 cset name="I2S5 codec master mode" "cbs-cfs"

Set Jetson I2S as slave incase codec is operating as master

amixer -c 1 cset name="I2S5 codec master mode" "cbm-cfm"

Thanks

Dear atalambedu,

Sorry to reply late, there is the log I tried to validate with speaker-test that refer the link you share.

My command as below, we’ve been validated the amixer & arecord and work well before enable driver since a long time ago, but there will be an error with driver enable. So I use the speaker-test to replace the arecord first.

dmesg
amixer -c jetsonxaviernxa cset name="ADMAIF1 Mux" I2S5
arecord -D hw:jetsonxaviernxa,0 -r 48000 -c 2 -f S16_LE  123.wav &
speaker-test -D plughw:jetsonxaviernxa,0 -c 2 -r 48000 -F  S16_LE -t sine -f 500 > speaker.log &
cat /sys/kernel/debug/clk/clk_summary

Xavier_ti_audio_20220413_2336.log (287.9 KB)
Please correct me if there is any steps not valid with your expect.

Best Regards,
MOMO Chen

Hi momo_chen,

My question if you have set codec specific mixer controls (reference available in my previous comment)

Until DAPM path trace is complete playback may not start (Ref toubleshooting example at link)

Thanks