Skip to content

Conversation

@kv2019i
Copy link
Collaborator

@kv2019i kv2019i commented Mar 18, 2025

First set of patches to convert audio cmake rules to common ones.

Link: #8260

Copy link
Collaborator

@lyakh lyakh left a comment

Choose a reason for hiding this comment

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

would be good to add a commit to convert src/math/CMakeLists.txt to the new macro

kv2019i added 2 commits March 19, 2025 10:57
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

The audio directory is one of the more complex cmake files in
the tree, so make the changes incrementally. This commit starts
by adding including top/src/audio to Zephyr cmake, and moving
over the first set of files.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Add sof_list_append_ifdef() macro and make it available for both Zephyr
and XTOS builds. This is helpful when writing cmake rules for SOF
modules.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@kv2019i kv2019i force-pushed the 202403-cmake-decentr-audio-part1 branch from eb203fc to df8b5e7 Compare March 19, 2025 09:10
@kv2019i
Copy link
Collaborator Author

kv2019i commented Mar 19, 2025

V2 pushed:

  • build error with sof-plugin fixed
  • added eq-fir/eq-iir move to the patchset

@kv2019i
Copy link
Collaborator Author

kv2019i commented Mar 19, 2025

@lyakh Let's convert math in a separate PR once this is merged and makes the macro available to all. The old conventions weren't unifrom either, some build rules used helpers, some not. So having more verbose code now in math won't break the bank if we don't fix it immediately.

@kv2019i
Copy link
Collaborator Author

kv2019i commented Mar 19, 2025

Getting a failure with SRC_LITE on MTL in Intel internal tests:

12:47:44,338 INFO  - Creating module 0xa (SRCLite) instance: 0.
12:47:44,338 INFO  - Sending InitInstance (C000000A, 1000000B)
12:47:44,338 INFO  - Payload:
12:47:44,338 INFO  - 000186A0 00000180 00000100 00000000 
12:47:44,338 INFO  - 0000BB80 00000020 FFFFFF10 00000000 
12:47:44,338 INFO  - 00000000 00002002 00003E80 
12:47:44,338 INFO  - Module: 10
12:47:44,338 INFO  - Instance: 0
12:47:44,338 INFO  - Core: 0
12:47:44,338 INFO  - Pipeline: 0
12:47:44,338 INFO  - Proc_domain: DP
12:47:44,338 INFO  - Extended_init: False
12:47:44,338 INFO  - Response InitInstance (E0000068, 1000000B) received!

@kv2019i kv2019i force-pushed the 202403-cmake-decentr-audio-part1 branch from df8b5e7 to a50b287 Compare March 19, 2025 13:35
# SPDX-License-Identifier: BSD-3-Clause

add_local_sources(sof src_generic.c src_hifi2ep.c src_hifi3.c src_hifi4.c src_hifi5.c src_common.c src.c)
set(base_files src_generic.c src_hifi2ep.c src_hifi3.c src_hifi4.c src_hifi5.c src_common.c src.c)
Copy link
Member

Choose a reason for hiding this comment

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

I know this is a copy of existing, but we should not need to build hifi2 for hifi 5 targets

Copy link
Member

Choose a reason for hiding this comment

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

Can be fixed later though. @singalsu fyi.

Comment on lines +13 to +14
is_zephyr(it_is)
if(it_is) ### Zephyr ###
Copy link
Member

Choose a reason for hiding this comment

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

Would it not be simpler and more readable with

if(is_zephyr)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@lgirdwood there's a slight risk of broken telephone when I've been continueing Marc's work, but this would seem a standard cmake macro trick. possible more readable:

-is_zephyr(it_is)
-if(it_is) ###  Zephyr ###
+is_zephyr(zephyr)
+if(zephyr) ###  Zephyr ###

...?

Copy link
Member

Choose a reason for hiding this comment

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

ok, lest factor this improvement in as we go, not blocking this one though.

@kv2019i
Copy link
Collaborator Author

kv2019i commented Mar 19, 2025

V3 pushed:

  • candidate fix for the src_lite fail in Intel internal tests

kv2019i added 11 commits March 19, 2025 17:26
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/buffers/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/pipeline/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The register to testbench needs the init function prototype
into sof/audio/component.h. Add src_lite to the prototype list,
so it can be enabled in testbench builds.

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/src/
instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio for dai and
host component source files.

Link: thesofproject#8260

Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
The audio top-level CMakeLists.txt is a bit complex to follow
as it has two separate set of build rules. One to build normal
SOF firmware target, with rules in subfolders and another
for the host-library build (not using subfolder CMakeLists.txt).
The two sets are broken with a return() in the middle.

Add inline commentary to the different sections making this
easier to follow.

Link: thesofproject#8606
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/eq-iir
and src/audio/eq-fir instead.

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/asrc instead

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/dcblock instead

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio/selector instead

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
Adding all source files in a single, giant zephyr/CMakeLists.txt is
inconvenient and does not scale.

Modify Zephyr rules to use definitions in src/audio instead

Link: thesofproject#8260
Signed-off-by: Kai Vehmanen <kai.vehmanen@linux.intel.com>
@kv2019i kv2019i force-pushed the 202403-cmake-decentr-audio-part1 branch from a50b287 to df91fc1 Compare March 19, 2025 15:46
@kv2019i kv2019i requested review from a team and tlissows as code owners March 19, 2025 15:46
@kv2019i
Copy link
Collaborator Author

kv2019i commented Mar 19, 2025

V4 pushed:

  • fixed the issue with testbench and src_lite
  • simplified the eqfir/iir, pipeline and buffers patches to avoids the separate is_zephyr rules
  • fixed bug in iir_eq rules
  • added a few more modules to the series

@kv2019i kv2019i merged commit 4a6ac13 into thesofproject:main Mar 20, 2025
46 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants