How to disable hdmi sound output in kernel

Hi everyone
i want to disable the output about the hdmi’s sound in kernel
so what should i do, i dont find the device tree or menuconfig about the hdmi output which i can set to disable the hdmi sound function.
The device is AGX Xavier
The version is <Linux dev-desktop 4.9.201-tegra #2 SMP PREEMPT Mon Apr 12 20:42:57 PDT 2021 aarch64 aarch64 aarch64 GNU/Linux>
The L4T is # R32 (release), REVISION: 5.1, GCID: 26202423, BOARD: t186ref, EABI: aarch64, DATE: Fri Feb 19 16:50:29 UTC 2021.

Thank you very much!

Hello,

Do you want to totally disable it from kernel or disabling it from the userspace configuration is also fine for you?

Hi waynewww
i want to choose the way which can disable the hdmi port send the singnal without sound data

Hi,

You can try to remove from the makefile of tegra display controller, so that it will not enable the audio.

kernel/nvidia/drivers/video/tegra/dc-> Makefile.
obj-$(CONFIG_TEGRA_HDA_DC) += hda_dc.o

Hi WayneWWW

Thank you for your reply.
I set change the Makefile and close the config option And now some .c file need it , i dont know which file i can close to make sure the hdmi can work well

UPD kernel/config_data.h
CC kernel/configs.o
LD kernel/built-in.o
CC drivers/video/tegra/dc/dp.o
CC drivers/video/tegra/dc/hdmi2.0.o
LD drivers/video/tegra/dc/built-in.o
LD drivers/video/tegra/built-in.o
LD drivers/video/built-in.o
LD drivers/built-in.o
GEN .version
LD vmlinux.o
MODPOST vmlinux.o
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
drivers/built-in.o: In function tegra_hdmi_edid_eld_setup': /home/zhou/lab/nvdia_sdk/sdk/JetPack_4.5.1_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/sources/kernel/nvidia/drivers/video/tegra/dc/hdmi2.0.c:570: undefined reference to tegra_hdmi_setup_hda_presence’
sound/built-in.o: In function hdmi_pcm_close': /home/zhou/lab/nvdia_sdk/sdk/JetPack_4.5.1_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/sources/kernel/kernel-4.9/out/../sound/pci/hda/patch_hdmi.c:1876: undefined reference to tegra_hdmi_audio_null_sample_inject’
sound/built-in.o: In function generic_hdmi_playback_pcm_prepare': /home/zhou/lab/nvdia_sdk/sdk/JetPack_4.5.1_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/sources/kernel/kernel-4.9/out/../sound/pci/hda/patch_hdmi.c:1815: undefined reference to tegra_hdmi_audio_null_sample_inject’
/home/zhou/lab/nvdia_sdk/sdk/JetPack_4.5.1_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/sources/kernel/kernel-4.9/out/…/sound/pci/hda/patch_hdmi.c:1819: undefined reference to tegra_hdmi_setup_audio_freq_source' /home/zhou/lab/nvdia_sdk/sdk/JetPack_4.5.1_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/sources/kernel/kernel-4.9/out/../sound/pci/hda/patch_hdmi.c:1812: undefined reference to tegra_hdmi_audio_null_sample_inject’
sound/built-in.o: In function hda_tegra_create_sysfs': /home/zhou/lab/nvdia_sdk/sdk/JetPack_4.5.1_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/sources/kernel/nvidia/sound/pci/hda/hda_tegra.c:768: undefined reference to tegra_hda_get_switch_name’
/home/zhou/lab/nvdia_sdk/sdk/JetPack_4.5.1_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/sources/kernel/kernel-4.9/Makefile:1102: recipe for target ‘vmlinux’ failed
make[1]: *** [vmlinux] Error 1
make[1]: Leaving directory ‘/home/zhou/lab/nvdia_sdk/sdk/JetPack_4.5.1_Linux_JETSON_AGX_XAVIER/Linux_for_Tegra/sources/kernel/kernel-4.9/out’
Makefile:171: recipe for target ‘sub-make’ failed
make: *** [sub-make] Error 2

Or you can try to comment out tegra_hda_init in tegra_dc_hdmi_init in hdmi2.0.c.

Hi

I comment out tegra_hda_init in tegra_dc_hdmi_init in hdmi2.0.c. But it still has sound singnal output. By the way the board use the hdmi1.4 interface

Please also disable tegra_hda_enable in hdmi2.0.c.


i changed but still have

What is your method to update kernel?

make ARCH=arm64 O=$TEGRA_KERNEL_OUT Image -j8

./flash.sh -r -k kernel jetson-xavier mmcblk0p1

What is your jetpack version?

JetPack_4.5.1_Linux_JETSON_AGX_XAVIER

Please add arbitrary string in the hdmi2.0.c driver and re-build it again.

Directly copy and replace the old image in /boot/Image on your device. Reboot the device and see if your string shows up in dmesg.

The default path of kernel is the /boot/Image. The partition “kernel” will only be used when /boot/Image is missing or broken.

Hi

it’s ok now,thank you very much.
By the way, would you tell me what can i do to confirm the true version i flash to the board?

Do you mean where is the place to load kernel?

no, for EX. In the past i use the command “cat /proc/version” to confirm the firmware version, But now, for xavier it may be dont work very well

The jetpack version could be checked by /etc/nv_tegra_release.

OK, thanks very much

1 Like