Disable sound in kernel

My board is devkit, detail information is below:

  • NVIDIA Jetson Xavier NX (Developer Kit Version)
    • Jetpack 4.6 [L4T 32.6.1]
    • NV Power Mode: MODE_15W_6CORE - Type: 2
    • jetson_stats.service: active
  • Board info:
    • Type: Xavier NX (Developer Kit Version)
    • SOC Family: tegra194 - ID:25
    • Module: P3668 - Board: P3509-000
    • Code Name: jakku
    • CUDA GPU architecture (ARCH_BIN): 7.2
    • Serial Number: 1424920027702
  • Libraries:
    • CUDA: 10.2.300
    • cuDNN:
    • TensorRT:
    • Visionworks:
    • OpenCV: 4.5.1 compiled CUDA: YES
    • VPI: ii libnvvpi1 1.1.12 arm64 NVIDIA Vision Programming Interface library
    • Vulkan: 1.2.70

I dont need any sound functionalities, how can I disable/remove sound in kernel? I tried to remove some sound configuration in kernel config, but it caused build failure.

is there any safe way to disable/remove sound in kernel?

I couldn’t answer most of that, I’ve never disabled audio in kernel. Mostly I’d just remove the user space packages (e.g., pulse audio). If you do want to remove something in the kernel, then you always start by building a kernel configured to be an exact match to the existing kernel. Normally I would also say set the same “CONFIG_LOCALVERSION” (the default is “-tegra”), but when removing an integrated feature of the kernel you’d want to also build and install all kernel modules, and this means you’d want a different “CONFIG_LOCALVERSION” to avoid searching for modules in the old location.

A contrived example is that if you build a kernel which is version 4.10.140, and you set the default “CONFIG_LOCALVERSION” is “-tegra”, then that kernel will search for modules at “/lib/modules/4.10.140-tegra/kernel”. If you instead change this to “-test”, then the modules would have to be rebuilt and added at “/lib/modules/4.10.140-test/kernel”.

For any removal of a kernel feature, after the kernel is configured to match the current system (e.g., “make tegra_defconfig” will set the default config a Jetson ships with), then you’d use an application such as “make menuconfig” or “make nconfig” to disable that feature (you would not want to do this with a text editor since a text editor does not understand other dependencies which might change).

Yes. I did want to rebuild kernel to remove audio from kernel. I disabled some sound configs in tegra_defconfig, but got build failure because others depend on them. Maybe the menu UI configuration (make menuconfig) can help.

Did you edit tegra_defconfig directly? That is not recommended due to those dependencies. Normally one would “make tegra_defconfig”, and then use something like menuconfig (I use “nconfig” since it is almost the same as menuconfig, but has a symbol search function I like) since it understands those dependencies. You could look at what menuconfig wants to do and then manually edit the file, but it is possible a dependency of the dependency has a chain of other dependencies.

When you save after using either “make tegra_defconfig” or “make menuconfig” it creates a file “.config” in the output location for the build. You could copy this somewhere else before you remove audio in order to see what the basic configuration is. Then use menuconfig to remove audio, and compare the two “.config” files (one you copied elsewhere, and after save of menuconfig you get a second one less the audio). This would tell you what is different between the two.

Do be sure to change CONFIG_LOCALVERSION when you install this new kernel, and install all modules to its new module directory. If you’ve modified (especially removed) integrated features in the kernel it is likely that it becomes a “bad idea” to reuse the old modules (they might be fine, but it isn’t worth future surprises).

Hi harry_xiaye

Can you try with below?

diff --git a/common/tegra194-audio-p3668.dtsi b/common/tegra194-audio-p3668.dtsi
index 32ea0bd..c86e1c0 100644
--- a/common/tegra194-audio-p3668.dtsi
+++ b/common/tegra194-audio-p3668.dtsi
@@ -30,11 +30,11 @@

        hda@3510000 {
                hda,card-name = "tegra-hda-xnx";
-               status = "okay";
+               status = "disabled";

        tegra_sound: sound {
-               status = "okay";
+               status = "disabled";
                compatible = "nvidia,tegra-audio-t186ref-mobile-rt565x";
                nvidia,model = "jetson-xaviernx-ape";
                clocks = <&bpmp_clks TEGRA194_CLK_PLLA>,

This means, at kernel level driver probe does not happen and no sound card/devices would be registered.

thanks all your information. I will try them.

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