Skip to content

Commit 756941d

Browse files
Amery Songxiulipan
authored andcommitted
pipeline.sh: export proc pipeline info to test case
Signed-off-by: Amery Song <chao.song@intel.com>
1 parent f4849ca commit 756941d

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

case-lib/pipeline.sh

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,33 @@
11
#!/bin/bash
22

3+
# This function will evaluate pipeline parameter related shell code generated by
4+
# - sof-tplgreader.py (for SOF, pipeline parameters dumped from topology)
5+
# - sof-dump-status.py (for legacy HDA, pipeline paramters dumped from proc)
6+
# Args: $1: SOF topology path
7+
# $2: Pipeline filter in string form
8+
# Note: for legacy HDA, topology is not present, $1 will be empty.
39
func_pipeline_export()
410
{
5-
# no parameter input the function
6-
if [ $# -lt 1 ]; then
7-
die "Topology file name is not specified, unable to run command: $SCRIPT_NAME"
11+
12+
# function parameter check
13+
if [ $# -ne 2 ]; then
14+
die "Not enough parameters, expect two parameters: topology path and pipeline filter"
815
fi
16+
17+
# For legacy HDA platform, there is no topology, we have to export pipeline
18+
# parameters from proc file system.
19+
is_sof_used || {
20+
filter_str="$2"
21+
dlogi "No SOF sound card found, exporting pipeline parameters from proc file system"
22+
tmp_pipeline_params=$(mktemp /tmp/pipeline-params.XXXXXXXX)
23+
sof-dump-status.py -e "$filter_str" > "$tmp_pipeline_params" ||
24+
die "Failed to export pipeline parameters from proc file system"
25+
# shellcheck disable=SC1090
26+
source "$tmp_pipeline_params" || return 1
27+
rm "$tmp_pipeline_params"
28+
return 0
29+
}
30+
931
# got tplg_file, verify file exist
1032
tplg_path=$(func_lib_get_tplg_path "$1") || {
1133
die "Topology $1 not found, check the TPLG environment variable or specify topology path with -t"

0 commit comments

Comments
 (0)