AUDIO does't have BCLK/WCLK

Dear atalambedu,

There’re some NEWS need update with you, the TI’s driver is bring up.
It could playback as well. volume tuning, mute is work,too.
There’re adjust list we do.

  1. I’ve refer the rt565x-playback to add some add the ti-capture section in the machine driver
    tegra_machine_driver_mobile_20220421_1047.c (23.8 KB)
  2. Sort out the audio dts again that include the regulator.
    tegra194-audio-p3668_20220421_1047.dtsi (2.9 KB)
    tegra194-fixed-regulator-p3668_20220421_1047.dtsi (2.0 KB)
  3. Add some Register adjust in codec/TI’s driver.
    tlv320aic32x4_20220421_1047.c (35.7 KB)

There is the log which include booting/dmesg/aplay/fetch clk summary/arecord.
Xavier_ti_audio_20220421_1047.log (292.1 KB)

There’re still some problem.

  1. There is the WARNING about the clock, I will tried to found out root caused.
  2. The SOM’s aud_mclk seems only 12M, Is that possible up to 25M as our original designed with oscillator.
  3. As the log file show, the arecord will issue error about pcm_read.
    Is that caused by codec’s configuration or any other side we need to tune?
    (Our codec design is IN1 connect to Line-in, not Mic)
    Would you mind to give us suggestion about these?

Best Regards,
MOMO Chen

Hi momo_chen,

You could refer sample dapm routes here (I see two routes missing related to Capture )and sample mixer controls from here or from codec vendor in case the one’s in previous link did not help.

Codec expects aud_mclk running at 256*sample_rate (i.e 12.28M for 48 playbac kor record). In case you are using fixed oscillator, you might need to correct circuit so that it offers desired aud_mclk.

I am nnot able to find clock related warning. Could you point.

Thanks

Dear atalambedu,

Do you meaning the routes of the audio dtsi? I’ve little confused about ‘two routes missing related to Capture’ you mention. Is there any missing in my route setting below?

Line-out(LO) part.

"x Line Out", "x LOL",
"x Line Out", "x LOR",
"x Left DAC", "x Playback",
"x Right DAC", "x Playback",

Line-in part

"x IN1_L", "x Line In",
"x IN1_R", "x Line In",
"x Capture", "x Left ADC",
"x Capture", "x Right ADC";

Our product not design with headphone(HP) and Mic, so I don’t have add those argument so far.

About the aud_mclk, I got it. So the 12MHz is enough for 48Ksps sample rate, right?

About the clock related warning, please refer those info below which fetch from the
Xavier_ti_audio_20220421_1047.log (292.1 KB)

[   12.451156] ------------[ cut here ]------------
[   12.454502] WARNING: CPU: 1 PID: 6 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
[   12.461679] Modules linked in: snd_soc_tlv320aic32x4_i2c zram snd_soc_tlv320aic32x4 spidev igb overlay cdc_mbim qcserial cdc_wdm cdc_ncm usbnet usb_wwan usbserial userspace_alert nvgpu bluedroid_pm ip_tables x_tables
[   12.461777] CPU: 1 PID: 6 Comm: kworker/u12:0 Not tainted 4.9.201+ #72
[   12.461782] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[   12.461799] Workqueue: events_unbound async_run_entry_fn
[   12.461808] task: ffffffc1f6b2c600 task.stack: ffffffc1f6b60000
[   12.461816] PC is at clk_core_disable+0x21c/0x240
[   12.461822] LR is at clk_core_disable_lock+0x28/0x40
[   12.461827] pc : [<ffffff800868962c>] lr : [<ffffff8008689678>] pstate: 80c000c5
[   12.461831] sp : ffffffc1f6b63c30
[   12.461848] x29: ffffffc1f6b63c30 x28: 0000000000000000 
[   12.461876] x27: 0000000000000000 x26: ffffffc1f69d5400 
[   12.461904] x25: ffffff800a0ad000 x24: 0000000000000000 
[   12.461930] x23: 0000000000000000 x22: ffffffc1f69d3c00 
[   12.461958] x21: ffffffc1e2be4f18 x20: ffffffc1e241f000 
[   12.461985] x19: ffffffc1e241f000 x18: 0000000000000000 
[   12.462012] x17: 0000007fb5453838 x16: 0000007fb53daf18 
[   12.462039] x15: 0000000000000130 x14: 000000000244bd8b 
[   12.462107] x13: 000000000071eb65 x12: 0000000000000000 
[   12.462121] x11: 0000000000000400 x10: 0000000000000000 
[   12.462134] x9 : 00000000010064ed x8 : 0000000000000400 
[   12.462148] x7 : 0000000000002000 x6 : 0000000002386bdc 
[   12.462161] x5 : ffffff8008f59910 x4 : 0000000000000002 
[   12.462173] x3 : 0000000000000000 x2 : 000000000d570d57 
[   12.462186] x1 : ffffffc1f6b2c600 x0 : 0000000000000000 
[   12.462202] ---[ end trace e750bde7e1abb8d1 ]---
[   12.465742] Call trace:
[   12.465760] [<ffffff800868962c>] clk_core_disable+0x21c/0x240
[   12.465770] [<ffffff8008689678>] clk_core_disable_lock+0x28/0x40
[   12.465779] [<ffffff80086896bc>] clk_disable+0x2c/0x38
[   12.465796] [<ffffff800116a630>] aic32x4_set_bias_level+0x120/0x200 [snd_soc_tlv320aic32x4]
[   12.465807] [<ffffff8008d267cc>] snd_soc_codec_set_bias_level+0x34/0x40
[   12.465814] [<ffffff8008d2f844>] snd_soc_dapm_set_bias_level+0x6c/0x210
[   12.465821] [<ffffff8008d31c64>] dapm_pre_sequence_async+0x44/0xd0
[   12.465828] [<ffffff80080dee08>] async_run_entry_fn+0x48/0x158
[   12.465837] [<ffffff80080d40cc>] process_one_work+0x1e4/0x4b0
[   12.465844] [<ffffff80080d43e8>] worker_thread+0x50/0x4c8
[   12.465850] [<ffffff80080db074>] kthread+0xec/0xf0
[   12.465858] [<ffffff80080838a0>] ret_from_fork+0x10/0x30

[   12.466679] ------------[ cut here ]------------
[   12.470443] WARNING: CPU: 5 PID: 6 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
[   12.478464] Modules linked in: snd_soc_tlv320aic32x4_i2c zram snd_soc_tlv320aic32x4 spidev igb overlay cdc_mbim qcserial cdc_wdm cdc_ncm usbnet usb_wwan usbserial userspace_alert nvgpu bluedroid_pm ip_tables x_tables
[   12.478550] CPU: 5 PID: 6 Comm: kworker/u12:0 Tainted: G        W       4.9.201+ #72
[   12.478556] Hardware name: NVIDIA Jetson Xavier NX Developer Kit (DT)
[   12.478573] Workqueue: events_unbound async_run_entry_fn
[   12.478582] task: ffffffc1f6b2c600 task.stack: ffffffc1f6b60000
[   12.478591] PC is at clk_core_unprepare+0x1d8/0x1f8
[   12.478600] LR is at clk_unprepare+0x34/0x48
[   12.478606] pc : [<ffffff8008688e50>] lr : [<ffffff800868ba54>] pstate: 60c00045
[   12.478610] sp : ffffffc1f6b63c60
[   12.478627] x29: ffffffc1f6b63c60 x28: 0000000000000000 
[   12.478644] x27: 0000000000000000 x26: ffffffc1f69d5400 
[   12.478655] x25: ffffff800a0ad000 x24: 0000000000000000 
[   12.478667] x23: 0000000000000000 x22: ffffffc1f69d3c00 
[   12.478677] x21: ffffffc1e2be4f18 x20: 0000000000000000 
[   12.478688] x19: ffffffc1e241f000 x18: 0000000000000000 
[   12.478699] x17: 0000000000001400 x16: 0000000000000000 
[   12.478709] x15: 0000000000000001 x14: 000000000096ab76 
[   12.478720] x13: 0000000000000000 x12: 000000000028ab18 
[   12.478730] x11: 000000000096ab76 x10: 0000000000000a10 
[   12.478741] x9 : ffffffc1f6b63b50 x8 : ffffffc1f6b2d070 
[   12.478752] x7 : 00000000000b3400 x6 : 000000001a2e4a19 
[   12.478763] x5 : 0000000000000000 x4 : 0000000000000000 
[   12.478774] x3 : 0000000000000008 x2 : 0000000000000000 
[   12.478785] x1 : ffffffc1f6b2c600 x0 : 0000000000000000 
[   12.478799] ---[ end trace e750bde7e1abb8d2 ]---
[   12.482926] Call trace:
[   12.482939] [<ffffff8008688e50>] clk_core_unprepare+0x1d8/0x1f8
[   12.482947] [<ffffff800868ba54>] clk_unprepare+0x34/0x48
[   12.482961] [<ffffff800116a638>] aic32x4_set_bias_level+0x128/0x200 [snd_soc_tlv320aic32x4]
[   12.482972] [<ffffff8008d267cc>] snd_soc_codec_set_bias_level+0x34/0x40
[   12.482979] [<ffffff8008d2f844>] snd_soc_dapm_set_bias_level+0x6c/0x210
[   12.482986] [<ffffff8008d31c64>] dapm_pre_sequence_async+0x44/0xd0
[   12.482993] [<ffffff80080dee08>] async_run_entry_fn+0x48/0x158
[   12.483003] [<ffffff80080d40cc>] process_one_work+0x1e4/0x4b0
[   12.483009] [<ffffff80080d43e8>] worker_thread+0x50/0x4c8
[   12.483016] [<ffffff80080db074>] kthread+0xec/0xf0
[   12.483024] [<ffffff80080838a0>] ret_from_fork+0x10/0x30

Best Regards,
MOMO Chen

Hi momo_chen,

Sorry for delayed reply. Yes I meant the routes involving mic. But if your path involves mics connected to line in, those routes can be ignored.

Yes 12.28 MHz is good enough for 48kHz usecase

The record error in log indicates that either DAPM path is not complete or looks like some clock source in capture path is not activated or available. Suggest to debug further on codec driver by checking the capture path in data sheet.

Thanks

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