Skip to content

Commit e8e3468

Browse files
author
Chao Song
committed
sof-tplgreader.py: support filtering for IPC4 WoV pipeline
Adds support to filter IPC4 WoV pipeline. The IPC4 WoV pipeline is blocked by default for normal capture tests, if we want to test WoV pipeline, we can use a filter '-f kpb:any'. Signed-off-by: Chao Song <chao.song@linux.intel.com>
1 parent aa7727e commit e8e3468

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tools/sof-tplgreader.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from tplgtool import TplgParser, TplgFormatter
44
from common import format_pipeline, export_pipeline
5+
import re
56

67
class clsTPLGReader:
78
def __init__(self):
@@ -43,6 +44,7 @@ def loadFile(self, filename, sofcard=0):
4344
pgas = formatter.find_comp_for_pcm(pcm, 'PGA')
4445
eqs = formatter.find_comp_for_pcm(pcm, 'EQ')
4546
kwds = formatter.find_comp_for_pcm(pcm, 'KPBM')
47+
kwds_ipc4 = formatter.find_comp_for_pcm(pcm, 'kpb')
4648
asrcs = formatter.find_comp_for_pcm(pcm, 'ASRC')
4749
codec_adapters = formatter.find_comp_for_pcm(pcm, 'CODEC_ADAPTER')
4850
pipeline_dict = {}
@@ -55,6 +57,7 @@ def loadFile(self, filename, sofcard=0):
5557
clsTPLGReader.attach_comp_to_pipeline(pgas, pcm['capture'], "PGA", pipeline_dict)
5658
clsTPLGReader.attach_comp_to_pipeline(eqs, pcm['capture'], "EQ", pipeline_dict)
5759
clsTPLGReader.attach_comp_to_pipeline(kwds, pcm['capture'], "KPBM", pipeline_dict)
60+
clsTPLGReader.attach_comp_to_pipeline(kwds_ipc4, pcm['capture'], "kpb", pipeline_dict)
5861
clsTPLGReader.attach_comp_to_pipeline(asrcs, pcm['capture'], "ASRC", pipeline_dict)
5962
clsTPLGReader.attach_comp_to_pipeline(codec_adapters, pcm['capture'], "CODEC_ADAPTER", pipeline_dict)
6063
# supported formats of playback pipeline in formats[0]
@@ -351,14 +354,14 @@ def parse_and_set_block_keyword(block_str, tplgreader):
351354

352355
# If run general test case on WOV pipeline or ECHO REFERENCE capture pipeline, there will be error
353356
# due to no feed data, and they should be blocked in general test case.
354-
default_block_keyword = 'kpbm:any;type:capture & echo;'
357+
default_block_keyword = 'kpbm:any;kpb:any;type:capture & echo;'
355358
# if no filter or block item is specified, the "block_none" here will help to
356359
# block nothing
357360
block_str = "block_none"
358361
# user specified block items from command line
359362
cmd_block_str = ret_args['block'].strip() if ret_args['block'] is not None else ''
360363

361-
if ret_args['filter'] is not None and 'kpbm' not in ret_args['filter'] and 'echo' not in ret_args['filter']:
364+
if ret_args["filter"] is not None and not re.search('echo|kpb', ret_args["filter"]):
362365
block_str = default_block_keyword + cmd_block_str
363366
else:
364367
block_str = cmd_block_str if cmd_block_str != '' else block_str

0 commit comments

Comments
 (0)