Skip to content

Commit

Permalink
pipeline.sh: export proc pipeline info to test case
Browse files Browse the repository at this point in the history
Signed-off-by: Amery Song <chao.song@intel.com>
  • Loading branch information
Amery Song committed Oct 28, 2020
1 parent 7af5c7c commit b6235e8
Showing 1 changed file with 24 additions and 3 deletions.
27 changes: 24 additions & 3 deletions case-lib/pipeline.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,32 @@
#!/bin/bash

# This function will evaluate pipeline parameter related shell code generated by
# - sof-tplgreader.py (for SOF, pipeline parameters dumped from topology)
# - sof-dump-status.py (for legacy HDA, pipeline paramters dumped from proc)
# Args: $1: SOF topology path
# $2: Pipeline filter in string form
# Note: for legacy HDA, topology is not present, $1 will be empty.
func_pipeline_export()
{
# no parameter input the function
if [ $# -lt 1 ]; then
die "Topology file name is not specified, unable to run command: $SCRIPT_NAME"

# function parameter check
if [ $# -ne 2 ]; then
die "Not enough parameters, expect two parameters: topology path and pipeline filter"
fi

# For legacy HDA platform, there is no topology, we have to export pipeline
# parameters from proc file system.
is_sof_used || {
filter_str="$2"
dlogi "No SOF sound card found, exporting pipeline parameters from proc file system"
tmp_pipeline_params=$(mktemp /tmp/pipeline-params.XXXXXXXX)
sof-dump-status.py -e "$filter_str" > "$tmp_pipeline_params" ||
die "Failed to export pipeline parameters from proc file system"
source "$tmp_pipeline_params" || return 1
rm "$tmp_pipeline_params"
return 0
}

# got tplg_file, verify file exist
tplg_path=$(func_lib_get_tplg_path "$1") || {
die "Topology $1 not found, check the TPLG environment variable or specify topology path with -t"
Expand Down

0 comments on commit b6235e8

Please sign in to comment.