Hi!
I’m trying to connect an i2s codec to my board. If I understand correctly I need to use the tegra-audio-t210ref machine driver, which I specify in my dts (there are plenty examples on this forum).
But tegra-audio-t210ref is not compiled by default in the kernel. And when I try to compile it, it just seems broken. First when selecting it, it crashes here:
../sound/soc/tegra-alt/tegra210_adsp_alt.c:2609:19: error: 'snd_soc_new_compress' undeclared here (not in a function)
.compress_new = snd_soc_new_compress,
It seems that CONFIG_SND_SOC_COMPRESS for some reason is not selected. Strange, since if should be selected automatically by tegra-audio-t210ref. Problem is, it cannot be selected by menuconfig, so I had to patch sound/soc/Kconfig to select it (weird).
This solves the issue, but is crashes soon enough:
../sound/soc/tegra-alt/tegra_t210ref_alt.c: In function 'tegra_t210ref_driver_probe':
../sound/soc/tegra-alt/tegra_t210ref_alt.c:998:1: error: label 'err_unregister_card' defined but not used [-Werror=unused-label]
err_unregister_card:
Here the compiler is right, err_unregister_card is not used! Is this code supposed to compile? I comment that out and it crashes when linking:
sound/built-in.o: In function `tegra210_adsp_runtime_resume':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:2338: undefined reference to `nvadsp_os_start'
sound/built-in.o: In function `tegra210_adsp_runtime_suspend':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:2291: undefined reference to `nvadsp_os_suspend'
sound/built-in.o: In function `tegra210_adsp_send_msg':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:437: undefined reference to `msgq_queue_message'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:437: undefined reference to `msgq_queue_message'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:440: undefined reference to `nvadsp_mbox_send'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:448: undefined reference to `msgq_queue_message'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:460: undefined reference to `nvadsp_mbox_send'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:460: undefined reference to `nvadsp_mbox_send'
sound/built-in.o: In function `tegra210_adsp_send_raw_data_msg':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:513: undefined reference to `msgq_queue_message'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:517: undefined reference to `nvadsp_mbox_send'
sound/built-in.o: In function `tegra210_adsp_get_msg':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:407: undefined reference to `msgq_dequeue_message'
sound/built-in.o: In function `tegra210_adsp_get_raw_data_msg':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:417: undefined reference to `msgq_dequeue_message'
sound/built-in.o: In function `tegra210_adsp_preallocate_dma_buffer':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:324: undefined reference to `nvadsp_alloc_coherent'
sound/built-in.o: In function `tegra210_adsp_deallocate_dma_buffer':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:345: undefined reference to `nvadsp_free_coherent'
sound/built-in.o: In function `tegra210_adsp_init':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:356: undefined reference to `nvadsp_os_load'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:362: undefined reference to `nvadsp_os_start'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:369: undefined reference to `nvadsp_app_load'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:379: undefined reference to `nvadsp_os_suspend'
sound/built-in.o: In function `tegra210_adsp_deinit':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:396: undefined reference to `nvadsp_os_stop'
sound/built-in.o: In function `tegra210_adsp_app_init':
../sound/soc/tegra-alt/tegra210_adsp_alt.c:747: undefined reference to `nvadsp_app_init'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:767: undefined reference to `nvadsp_mbox_open'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:785: undefined reference to `nvadsp_app_start'
../sound/soc/tegra-alt/tegra210_adsp_alt.c:817: undefined reference to `nvadsp_mbox_close'
I’m at loss now. Is this driver supposed to work? Is there another one I should use? Any input is appreciated…
The generic machine driver handles DAI link management based on the initialized platform specific data in the DT file. This step is platform/machine dependent.
The Jetson TX1 and TX2 machine drivers are available in the kernel sources archive at:
kernel/kernel-4.4/sound/soc/tegra-alt/tegra_t210ref_mobile_rt565x_alt.c
kernel/t18x/sound/soc/tegra-alt/tegra_t186ref_mobile_rt565x_alt.c
The Jetson TX1 and TX2 reference device tree “sound” nodes are available in the kernel source archive at:
hardware/nvidia/platform/t210/jetson/kernel-dts/tegra210-jetson-cv-base-p2957-2180-a00.dts
hardware/nvidia/platform/t18x/common/kernel-dts/t18x-common-platforms/tegra186-quill-common.dtsi
But doesn’t ‘tegra_t210ref_mobile_rt565x_alt.c’ contain code specific to the realtek chipset? I’m using another one, will this machine driver still work?
Thanks Shane, so I basically need to remove all the rt565 specific stuff from the driver? I’m a bit confused, my ADC is quite “dumb”, I don’t even need i2c configuration and I was hoping I did not need to write from scratch the machine driver.
I have the same issue could you please help me out.
please find the attached log for sound error.
I can’t find the file tegra_t186ref_mobile_rt565x.c
~/Linux_for_Tegra/sources/kernel$ ls
kernel-4.9 nvgpu nvidia
/Linux_for_Tegra/sources/kernel/nvidia/sound/soc/tegra-alt$ ls
include Makefile tegra186_dspk_alt.c tegra210_adx_alt.c tegra210_dmic_alt.c tegra210_mbdrc_alt.c tegra210_ope_alt.c tegra210_spdif_alt.c
Kconfig tegra186_arad_alt.c tegra210_admaif_alt.c tegra210_afc_alt.c tegra210_i2s_alt.c tegra210_mixer_alt.c tegra210_peq_alt.c tegra210_xbar_alt.c
machine_drivers tegra186_asrc_alt.c tegra210_adsp_alt.c tegra210_amx_alt.c tegra210_iqc_alt.c tegra210_mvc_alt.c tegra210_sfc_alt.c utils
Any help will be greatly appreciated.
Thanks
Parashuram sound_error.txt (32.4 KB)
You don’t actually need to remove anything from the driver. The driver will detect if the rt565x codec is present or not dynamically. However, if it is not present that the I2S will use a dummy codec and so will still work. So to drive the I2S pins no changes need to be made.
The name of the driver is misleading because nowadays it is meant to be a generic driver for the APE subsystem and not specific to the rt565x codec. In fact, if you look at the driver you will also see support for the FE-PI Audio Z V2 which features the SGTL5000 codec.
So if you are using a simple ADC, then it should just work. You may need to configure the pinmux for the I2S pins, but that is all.
I see there is another thread for this issue here. I recommend that you continue with the other thread you started rather than using this one, because these are some what different problems.