Skip to content

Conversation

@lgirdwood
Copy link
Member

This reverts commit 47dd8d3.

sof-ctl does not need git version of alsa-lib like the topology compiler but can use system version of alsa-lib to build.

Copilot AI review requested due to automatic review settings June 27, 2025 13:22
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR reverts the previous commit that forced building ALSA utilities locally, so sof-ctl and the topology compiler now use the system-installed alsa-lib and alsatplg.

  • Remove custom ALSATPLG_CMD and invoke alsatplg directly
  • Drop local ALSA library/include linking for sof-ctl
  • Update warning/debug messages to reference the system tool

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tools/topology/CMakeLists.txt Remove local ALSA tools dir, replace ${ALSATPLG_CMD} with alsatplg
tools/ctl/CMakeLists.txt Remove local ALSA include/link dirs, link against system -lasound
Comments suppressed due to low confidence (3)

tools/topology/CMakeLists.txt:5

  • Consider using CMake’s find_program to locate the alsatplg executable and store its full path in a variable. This ensures the correct binary is used even if multiple versions exist in PATH or in different install locations.
	execute_process(COMMAND alsatplg --version

tools/ctl/CMakeLists.txt:5

  • It would be more robust to use find_package(ALSA REQUIRED) and then link with the imported target (e.g., ALSA::ALSA) rather than hard-coding -lasound. This ensures CMake can locate both headers and libraries portably.
)

tools/topology/CMakeLists.txt:70

  • Similar to the version check, consider referencing the variable set by find_program(alsatplg ...) here instead of a bare alsatplg call to avoid surprises when multiple installations are present.
		COMMAND alsatplg \$\${VERBOSE:+-v 1} -c ${ARGV0} -o ${ARGV1}

Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Not sure do we want to revert the tplg part without an alternative solution in place?


function(alsatplg_version OUT_STATUS OUT_VERSION)
execute_process(COMMAND ${ALSATPLG_CMD} --version
execute_process(COMMAND alsatplg --version
Copy link
Collaborator

Choose a reason for hiding this comment

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

Commit message refers to alsactl but this reverts the whole thing. This will cause invalid tplgs to be created by our CI system... (as the system alsa-lib is too old).

Copy link
Member Author

Choose a reason for hiding this comment

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

ah right - the original commit does 2 things - will fix it to just do ctl only.

@lgirdwood lgirdwood force-pushed the lrg/topic/sof-ctl-fix branch from 183d580 to 4da9a87 Compare July 1, 2025 12:53
Copy link
Collaborator

@kv2019i kv2019i left a comment

Choose a reason for hiding this comment

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

Looks good now. Only concern is that this require build host to have system asound-dev installed. I know @cgturner1 had at least one build environment where asound-dev was on purpose not installed to ensure the the locallyl built alsa is used used. maybe @cgturner1 to ack this?

@lgirdwood
Copy link
Member Author

@lyakh ping for review.

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 have a note explaining the reason for the revert somewhere

@lgirdwood
Copy link
Member Author

would be good to have a note explaining the reason for the revert somewhere

See above bug - and its no longer a full patch revert now. Updated in PR title.

@lgirdwood lgirdwood changed the title Revert "topology: cmake: use local ALSA utilities to build topology" Fix with a partial revert. "topology: cmake: use local ALSA utilities to build topology" Jul 4, 2025
@wszypelt
Copy link

SOFCI TEST

1 similar comment
@lgirdwood
Copy link
Member Author

SOFCI TEST

The SOF ctl tool is conservative with API and does not need a bleeding
edge ALSA library so it can be built with system ALSA.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
@lgirdwood lgirdwood force-pushed the lrg/topic/sof-ctl-fix branch from 4da9a87 to 389fab9 Compare August 12, 2025 12:20
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.

5 participants