topology2: Add build support#5153
Conversation
marc-hb
left a comment
There was a problem hiding this comment.
Maybe move the renames to a separate commit?
There was a problem hiding this comment.
| export ALSA_CONFIG_DIR=${SOF_TOP}/tools/topology/topology2 | |
| export ALSA_CONFIG_DIR="${SOF_TOP}"/tools/topology/topology2 |
Use shellcheck. Shellcheck saves lives.
There was a problem hiding this comment.
The last one does not belong to the foreach loop.
There was a problem hiding this comment.
You don't need to omit the entire subdirectory, instead omit only the edge in the dependency graph and don't add this target to the default ALL target. In other words, only this line needs to be conditional:
add_dependencies(topologies2 topology2_cavs)
So everyone is aligned and runs the exact same CMake code at configuration time no matter what their ALSA version is. The difference comes later only at build time.
This is also more flexible for any adventurer who has multiple ALSA versions installed.
There was a problem hiding this comment.
but as far as topology2 goes everything in the topology2 folder should be conditionally built based on version right? its not just topology2_cavs
There was a problem hiding this comment.
Yes sorry, hasty review and copy/paste. The point is to use a scalpel to conditionally cut only the topology2 dependency in the graph, then all v2 dependency "leaves" will be configured and available but not built by default.
There was a problem hiding this comment.
No, instead of return() here use:
add_dependencies(ALL topologies2)
+ remove ALL above
There was a problem hiding this comment.
Should you make the MINOR optional?
There was a problem hiding this comment.
no, we want the 1.2.6 version which has the -I option added.
There was a problem hiding this comment.
Not supporting version 1.3 will be OK? Only allowed from 1.3.1 and above?
There was a problem hiding this comment.
i don;t understand. we check if version is less than 1.2.6, why will 1.3 be not supported?
There was a problem hiding this comment.
the string command doesnt check for version number. it only extracts it here
There was a problem hiding this comment.
I believe REGEX MATCH "[0-9].[0-9].[0-9] will fail to extract 1.3
There was a problem hiding this comment.
you're right. fixed now
0e63f95 to
4b743af
Compare
|
SOFCI TEST |
|
https://github.com/thesofproject/sof/runs/4721408331?check_suite_focus=true failed the testbench (that depends on test topologies) because of #5155 / #5156. Re-running it now (SOFCI TEST is only for sof-ci/jenkins) EDIT: passed in https://github.com/thesofproject/sof/runs/4722009946?check_suite_focus=true |
|
The zephyr build failure in https://github.com/thesofproject/sof/runs/4721407875?check_suite_focus=true is not related to Zephyr and can be reproduced with commit 4b743af40cf4 like this: Same for |
That was wrong, my bad. I got confused by the message |
|
Found it! The zephyr image has no alsatplg. Reproduction: sudo mv /usr/bin/alsatplg /usr/bin/alsatplg.disabled
./scripts/build-tools.sh -l
-- The C compiler identification is GNU 9.3.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- No CMAKE_BUILD_TYPE, defaulting to Debug
CMake Error at topology/topology2/CMakeLists.txt:8 (string):
string sub-command REGEX, mode MATCH needs at least 5 arguments total to
command.
CMake Error at topology/topology2/CMakeLists.txt:9 (if):
if given arguments:
"VERSION_LESS" "1.2.2"
Unknown arguments specified
-- Configuring incomplete, errors occurred!
|
557245e to
f813869
Compare
There was a problem hiding this comment.
| message(WARNING "Topology2 will be skipped. Minimum required version for alsatplg: 1.2.6") | |
| message(WARNING "alsatplg error ${STATUS}, topology2 will be skipped") |
There was a problem hiding this comment.
| add_custom_target(topologies2 ALL) | |
| add_custom_target(topologies2) |
See below
There was a problem hiding this comment.
No, instead of return() here use:
add_dependencies(ALL topologies2)
+ remove ALL above
There was a problem hiding this comment.
| add_custom_target(topology2_cavs ALL | |
| add_custom_target(topology2_cavs |
There was a problem hiding this comment.
Is this the "silent" v1 -> v2 upgrade? If yes add a short comment.
Assuming there will be other subdirectories later besides cavs/, can this be done only once for all in the ../CMakeLists.txt?
There was a problem hiding this comment.
In general ${CMAKE_CURRENT_BINARY_DIR} is not required. You haven't used it below. Quick enough to try.
f813869 to
fa307d8
Compare
fa307d8 to
41572eb
Compare
There was a problem hiding this comment.
Would GREATER be more future-proof?
| if (${last_index} EQUAL 2) | |
| if (${length} GREATER 2) | |
| math(EXPR last_index "${length}-1") |
In any case I think testing ${length} would be slightly more readable.
There was a problem hiding this comment.
Is this dependency real? Or is it just to make sure the v2 copy_directory "wins"? Either way a comment would probably not hurt.
There was a problem hiding this comment.
Why is topology2_cavs optional (should probably be called: topologiesV2_cavs) but topologies2 is not optional? In other words, shouldn't this test be located one level up in ../CMakeLists.txt?
5f431cd to
81a9cee
Compare
marc-hb
left a comment
There was a problem hiding this comment.
Some nits left but good enough.
|
SOFCI TEST |
Move all cavs tooplogies to the cavs folder. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Add build support for topology2. Topology2 will be built only if the alsatplg version if 1.2.6 or greater. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
81a9cee to
bd659e1
Compare
All .tplg output files have been compared and are strictly identical after the change. The deprecation warnings were added more than one year ago in https://github.com/alsa-project/alsa-lib/commits//706192341d1d0bbb906 Now that we just upgraded our Docker image to ALSA 1.2.6 (https://hub.docker.com/r/thesofproject/sof/tags) so thesofproject#5153 can enable topology v2, the volume of warnings has became unbearable. For instance good luck trying to find the actual error messages for the build failures of thesofproject#5155 - they're totally drowned in these deprecation warnings. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
All .tplg output files have been compared and are strictly identical after the change. The deprecation warnings were added more than one year ago in https://github.com/alsa-project/alsa-lib/commits//706192341d1d0bbb906 Now that we just upgraded our Docker image to ALSA 1.2.6 (https://hub.docker.com/r/thesofproject/sof/tags) so #5153 can enable topology v2, the volume of warnings has became unbearable. For instance good luck trying to find the actual error messages for the build failures of #5155 - they're totally drowned in these deprecation warnings. Signed-off-by: Marc Herbert <marc.herbert@intel.com>
|
If we add a new topology, which doesn't have any defines, that means the |
|
Does In the mean time how about the |
|
Fix in #5249 |
Move the cavs topologies to the cavs folder and build support for these
topologies.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com