Skip to content

Commit c7eb27c

Browse files
author
Chao Song
committed
Revert "tools: DSM and ECHO REFERENCE pipelines filtering" partially
The multiple stream feature in IPC4 makes the previous code for finding smart_amp/echo_reference playback and capture hosts not work, because there are multiple playback and capture hosts. Revert the code now, and re-do a compatible version for both IPC3 and IPC4 later. The smart_amp and echo_reference tests are not added in CI, so this change won't break anything. Signed-off-by: Chao Song <chao.song@linux.intel.com>
1 parent 4c32c87 commit c7eb27c

2 files changed

Lines changed: 0 additions & 63 deletions

File tree

tools/sof-tplgreader.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,6 @@ def loadFile(self, filename, sofcard=0):
102102
pipeline['snd'] += 'p'
103103
else:
104104
pipeline['snd'] += 'c'
105-
# find interweaved pipelines
106-
# echo: echo reference pipelines
107-
# smart_amp: dsm pipelines
108-
interweaved_comps = ['echo', 'smart_amp']
109-
for comp in interweaved_comps:
110-
interweaved_dict = formatter.find_interweaved_pipeline(comp)
111-
if interweaved_dict:
112-
for pipeline in self._pipeline_lst:
113-
if pipeline['cap_name'] in interweaved_dict['sname']:
114-
pipeline[comp] = interweaved_dict[comp]
115105
return 0
116106

117107
# The following functions re-implement built-in Python sets

tools/tplgtool.py

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -803,59 +803,6 @@ def format_pcm(self):
803803
%(pcm["pcm_name"], pcm["pcm_id"], pcm_type, fmt[0], rates[0], rates[1], \
804804
channel[0], channel[1]))
805805

806-
@staticmethod
807-
def find_second_end_point(first_end_point, node_list):
808-
second_end_point = []
809-
for node in node_list:
810-
if node["source"] is not None and node["sink"] is not None:
811-
continue
812-
if node["source"] is None and node["sink"] is None:
813-
continue
814-
if node["name"].startswith(first_end_point["name"][0:3]):
815-
continue
816-
end_node = TplgFormatter.find_connected_comp(first_end_point, node["name"])
817-
[second_end_point.append(node) for node in end_node]
818-
assert(len(second_end_point) == 1)
819-
return second_end_point[0]
820-
821-
# If there is one/more link between two pipelines, these two pipeline are interweaved.
822-
# eg. PCM0P and PCM6C in echo reference topology: sof-tgl-max98357a-rt5682.tplg.
823-
# PCM0P and PCM0C in DSM topology: sof-tgl-mas98373-rt5682.tplg.
824-
# Return example:
825-
# {"name":['PCM0C', 'PCM0P'], "sname":['Low Latency Playback 0', 'Passthrough Capture 6'] 'smart_amp':'SMART_AMP_1.0' }
826-
def find_interweaved_pipeline(self, comp):
827-
head_list, node_list = self.link_graph()
828-
interweaved_list = []
829-
# find all interweaved pipelines' endpoints. If two pipelines are interweaved, there should
830-
# be four endpoints.
831-
for head in head_list:
832-
# If we can find a PCM* from a PCM*, (check sof-tgl-max98357a-rt5682.png)
833-
# find a SSP* from a SSP*, (check sof-tgl-max98373-rt5682.png)
834-
# or find a ALH* from a ALH*, (check sof-tgl-sdw-max98373-rt5682-2ch.png)
835-
# then these two pipeline are interweaved.
836-
# should only use the first three char to match.
837-
endpoints = TplgFormatter.find_connected_comp(head, head["name"][0:3])
838-
# if we find the second PCM*, SSP* or ALH*, end_points should contain 2 elements,
839-
# one is the referenc widget, the other is the found widget.
840-
if len(endpoints) < 2: continue
841-
endpoints_nodes = [self.find_node_by_name(widget["name"], node_list) for widget in endpoints]
842-
interweaved_endpoints = []
843-
# find the other two endpoints
844-
for ed in endpoints_nodes:
845-
second_endpoint = TplgFormatter.find_second_end_point(ed, node_list)
846-
interweaved_endpoints.append(self.find_node_by_name(second_endpoint["name"], node_list))
847-
interweaved_endpoints.extend(endpoints_nodes)
848-
interweaved_list.append(interweaved_endpoints)
849-
interweaved_dict = {}
850-
for interweaved_endpoints in interweaved_list:
851-
comp_found = [TplgFormatter.find_connected_comp(node, comp) for node in interweaved_endpoints]
852-
if any(comp_found):
853-
interweaved_dict["name"] = [node["name"] for node in interweaved_endpoints if node["name"].startswith("PCM")]
854-
interweaved_dict["sname"] = [node["widget"]["sname"] for node in interweaved_endpoints if node["name"].startswith("PCM")]
855-
comp_name = list(set([comp[0]["name"] for comp in comp_found if comp != []]))[0]
856-
interweaved_dict[comp] = comp_name
857-
return interweaved_dict
858-
859806
if __name__ == "__main__":
860807
warnings.warn("tplgtool.py is deprecated, use tplgtool2.py instead.", DeprecationWarning)
861808

0 commit comments

Comments
 (0)