Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions scripts/gen-uuid-reg.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def main():
all_uuids.add(uu)
all_syms.add(sym)
emit_uuid_rec(uu, sym)
print(f"Added UUID {uu} with symbol {sym}")

Copilot AI Sep 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug print statements should not be left in production code. This print statement should be removed or wrapped in a debug flag check.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional to show module UUID is being compiled.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This print statement adds unnecessary noise to the logs. If someone needs to inspect the UUIDs, they can easily find them in the uuid-registry.txt file, so logging each one during generation isn't really needed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The logging makes it more obvious to the module developer (most of whom will not know about UUIDs) which UUIDs are being added to the build. i.e. 3P developer can see their new module UUID is either in the build or not as they will see volume, mixin etc UUIDs and realize more quickly I need to add my UUID.


with open(sys.argv[2], "w") as f:
f.write(header)
Expand Down
434 changes: 434 additions & 0 deletions scripts/sdk-create-module.py

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion scripts/xtensa-build-zephyr.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,8 @@ def parse_args():
help="Prints version of this script.")
parser.add_argument("-m", "--menuconfig", required=False, action="store_true",
help="Build menuconfig for target")
parser.add_argument("-z", "--zephyrsdk", required=False, action="store_true",
help="Force Build using Zephyr SDK for target")

args = parser.parse_args()

Expand Down Expand Up @@ -836,7 +838,12 @@ def build_platforms():
_dict = dataclasses.asdict(platform_configs[platform])
platform_dict = { k:v for (k,v) in _dict.items() if _dict[k] is not None }

xtensa_tools_root_dir = os.getenv("XTENSA_TOOLS_ROOT")
if args.zephyrsdk:
print("Using Zephyr SDK for building")
xtensa_tools_root_dir = None
Comment on lines +841 to +843

Copilot AI Sep 9, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The xtensa_tools_root_dir variable assignment on line 846 is not properly indented and will only execute when args.zephyrsdk is False. The variable should be declared outside the conditional block or the indentation should be fixed.

Suggested change
if args.zephyrsdk:
print("Using Zephyr SDK for building")
xtensa_tools_root_dir = None
xtensa_tools_root_dir = None
if args.zephyrsdk:
print("Using Zephyr SDK for building")

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

False positive. the else: case catches this.

else:
print("Using Xtensa tools for building")
xtensa_tools_root_dir = os.getenv("XTENSA_TOOLS_ROOT")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just run this script with XTENSA_TOOLS_ROOT unset to get the same effect, but I guess this we can have an option as well.

# when XTENSA_TOOLS_ROOT environmental variable is set,
# use user installed Xtensa tools not Zephyr SDK
if "XTENSA_TOOLS_VERSION" in platform_dict and xtensa_tools_root_dir:
Expand Down
55 changes: 29 additions & 26 deletions src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
add_subdirectory(pcm_converter)
add_subdirectory(pipeline)

if(CONFIG_COMP_BASEFW_IPC4 AND NOT CONFIG_LIBRARY)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is this before aria?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the alpha sorting logic is only sorting on and inserting on a add_subdirectory() clause, adding other clauses would get too complex.

add_local_sources(sof base_fw.c)
endif()
add_local_sources_ifdef(CONFIG_IPC4_BASE_FW_INTEL sof base_fw_intel.c)

# directories and files included conditionally (alphabetical order)
if(CONFIG_COMP_ARIA)
add_subdirectory(aria)
endif()
if(CONFIG_COMP_ASRC)
add_subdirectory(asrc)
endif()
if(CONFIG_COMP_BASEFW_IPC4 AND NOT CONFIG_LIBRARY)
add_local_sources(sof base_fw.c)
endif()
add_local_sources_ifdef(CONFIG_IPC4_BASE_FW_INTEL sof base_fw_intel.c)
if(CONFIG_COMP_CHAIN_DMA)
add_local_sources(sof chain_dma.c)
endif()
if(CONFIG_COMP_COPIER)
add_subdirectory(copier)
endif()
Expand All @@ -52,19 +50,17 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
if(CONFIG_COMP_IIR)
add_subdirectory(eq_iir)
endif()
if(CONFIG_COMP_KPB AND NOT CONFIG_LIBRARY_STATIC)
add_local_sources(sof
kpb.c
)
if(CONFIG_COMP_LEVEL_MULTIPLIER)
add_subdirectory(level_multiplier)
endif()
if(CONFIG_COMP_MFCC)
add_subdirectory(mfcc)
endif()
if(CONFIG_COMP_MIXER)
add_subdirectory(mixer)
add_subdirectory(mixer)
endif()
if(CONFIG_COMP_MIXIN_MIXOUT)
add_subdirectory(mixin_mixout)
add_subdirectory(mixin_mixout)
endif()
if(CONFIG_COMP_MODULE_ADAPTER)
add_subdirectory(module_adapter)
Expand All @@ -90,42 +86,49 @@ if(NOT CONFIG_COMP_MODULE_SHARED_LIBRARY_BUILD)
if(CONFIG_COMP_TDFB)
add_subdirectory(tdfb)
endif()
if(CONFIG_COMP_TONE)
add_local_sources(sof
tone.c
)
if(CONFIG_COMP_TEMPLATE)
add_subdirectory(template)
endif()
if(CONFIG_COMP_TENSORFLOW)
add_subdirectory(tensorflow)
endif()
if(CONFIG_COMP_UP_DOWN_MIXER)
add_subdirectory(up_down_mixer)
endif()
if(CONFIG_COMP_VOLUME)
add_subdirectory(volume)
endif()
if(CONFIG_COMP_TENSORFLOW)
add_subdirectory(tensorflow)
endif()
if(CONFIG_DTS_CODEC)
add_subdirectory(codec)
endif()
# end of directories and files included conditionally (alphabetical order)

add_subdirectory(google)
add_subdirectory(nxp)

if(CONFIG_COMP_CHAIN_DMA)
add_local_sources(sof chain_dma.c)
endif()
if(CONFIG_COMP_KPB AND NOT CONFIG_LIBRARY_STATIC)
add_local_sources(sof
kpb.c
)
endif()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And why these are here, shouldn't these be in above alphabetical listing?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto - and these should really be in their own directories.

if(CONFIG_INTEL_ADSP_MIC_PRIVACY)
add_subdirectory(mic_privacy_manager)
endif()
if(CONFIG_COMP_TONE)
add_local_sources(sof
tone.c
)
endif()
if(CONFIG_ZEPHYR_NATIVE_DRIVERS)
list(APPEND base_files host-zephyr.c)
sof_list_append_ifdef(CONFIG_COMP_DAI base_files dai-zephyr.c)
else()
list(APPEND base_files host-legacy.c)
sof_list_append_ifdef(CONFIG_COMP_DAI base_files dai-legacy.c)
endif()
if(CONFIG_COMP_TEMPLATE_COMP)
add_subdirectory(template_comp)
endif()
if(CONFIG_COMP_LEVEL_MULTIPLIER)
add_subdirectory(level_multiplier)
endif()
endif()

### Common files (also used in shared library build)
Expand Down
77 changes: 27 additions & 50 deletions src/audio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

menu "Audio components"

rsource "volume/Kconfig"
rsource "aria/Kconfig"

config COMP_BASEFW_IPC4
bool "BASEFW component"
default y
Expand All @@ -20,8 +17,6 @@ config IPC4_BASE_FW_INTEL
This implements a set of additional IPC4 properties that
extend the base spec.

rsource "copier/Kconfig"

config HOST_DMA_RELOAD_DELAY_ENABLE
bool "Delay reloading DMA for host interfaces"
default y
Expand Down Expand Up @@ -77,8 +72,6 @@ config MODULE_MAX_CONNECTIONS
Specifies the maximum number of sink and source connections a module
may have to other modules.

rsource "up_down_mixer/Kconfig"

config COMP_BLOB
bool "Large IPC data as compound message blobs"
default y
Expand All @@ -94,31 +87,19 @@ config MODULE_MAX_BLOB_SIZE
Specify the maximum size of IPC4 module blob data that can be
appended to each message.

rsource "src/Kconfig"

config COMP_STUBS
bool "Build all selected third-party (3P) components with stubs"
help
Select to force all 3P blocks to link against stubs rather than their libraries. This
should only be used in testing environments like fuzzers or CI.

rsource "eq_fir/Kconfig"

rsource "eq_iir/Kconfig"

config COMP_TONE
bool "Tone component"
select CORDIC_FIXED
help
Select for Tone component.
Warning: This component is deprecated and will be removed from SOF v2.8.

rsource "mixer/Kconfig"

rsource "mixin_mixout/Kconfig"

rsource "mux/Kconfig"

config COMP_KPB
bool "KPB component"
default y
Expand All @@ -135,28 +116,6 @@ config KPB_FORCE_COPY_TYPE_NORMAL

endif # COMP_KPB

rsource "google/Kconfig"

rsource "nxp/Kconfig"

rsource "selector/Kconfig"

rsource "crossover/Kconfig"

rsource "drc/Kconfig"

rsource "multiband_drc/Kconfig"

rsource "dcblock/Kconfig"

rsource "smart_amp/Kconfig"

rsource "asrc/Kconfig"

rsource "tdfb/Kconfig"

rsource "tensorflow/Kconfig"

config COMP_MODULE_ADAPTER
bool "Module adapter"
default y
Expand All @@ -168,17 +127,35 @@ config COMP_MODULE_ADAPTER
"src\include\sof\audio\module_adapter\interfaces.h". It is possible to link several
different codecs and use them in parallel.

rsource "module_adapter/Kconfig"

# --- Kconfig Sources (alphabetical order) ---
rsource "aria/Kconfig"
rsource "asrc/Kconfig"
rsource "codec/Kconfig"
rsource "copier/Kconfig"
rsource "crossover/Kconfig"
rsource "dcblock/Kconfig"
rsource "drc/Kconfig"
rsource "eq_fir/Kconfig"
rsource "eq_iir/Kconfig"
rsource "google/Kconfig"
rsource "igo_nr/Kconfig"

rsource "rtnr/Kconfig"

rsource "mfcc/Kconfig"

rsource "codec/Kconfig"

rsource "template_comp/Kconfig"
rsource "mixer/Kconfig"
rsource "mixin_mixout/Kconfig"
rsource "module_adapter/Kconfig"
rsource "multiband_drc/Kconfig"
rsource "mux/Kconfig"
rsource "nxp/Kconfig"
rsource "rtnr/Kconfig"
rsource "selector/Kconfig"
rsource "smart_amp/Kconfig"
rsource "src/Kconfig"
rsource "tdfb/Kconfig"
rsource "template/Kconfig"
rsource "tensorflow/Kconfig"
rsource "up_down_mixer/Kconfig"
rsource "volume/Kconfig"
# --- End Kconfig Sources (alphabetical order) ---

rsource "level_multiplier/Kconfig"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SPDX-License-Identifier: BSD-3-Clause

if(CONFIG_COMP_TEMPLATE_COMP STREQUAL "m")
add_subdirectory(llext ${PROJECT_BINARY_DIR}/template_comp_llext)
add_dependencies(app template_comp)
if(CONFIG_COMP_TEMPLATE STREQUAL "m")
add_subdirectory(llext ${PROJECT_BINARY_DIR}/template_llext)
add_dependencies(app template)
else()
add_local_sources(sof template.c)
add_local_sources(sof template-generic.c)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# SPDX-License-Identifier: BSD-3-Clause

config COMP_TEMPLATE_COMP
tristate "Template_comp example component"
config COMP_TEMPLATE
tristate "Template example component"
default y
help
Select for template_comp component. Reason for existence
Select for template component. Reason for existence
is to provide a minimal component example and use as
placeholder in processing pipelines. As example processing
it swaps or reverses the channels when the switch control
Expand Down
Loading
Loading