Skip to content

Commit

Permalink
tplgtool2: show all supported formats of pcm
Browse files Browse the repository at this point in the history
Make print_pcm_info() show all supported formats of a PCM, not only
the first format.

And show the formats after other attributes, thus other attributes may
have better alignment.

Signed-off-by: Mengdong Lin <[email protected]>
  • Loading branch information
mengdonglin committed Sep 17, 2023
1 parent 10ace84 commit b0c2cd5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/tplgtool2.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,13 +729,16 @@ def print_pcm_info(self):
fmt_list = self.get_pcm_fmt(pcm)
cap_index = int(pcm_type == "capture") # 1 for capture, 0 for playback
cap = pcm["caps"][cap_index]
fmt = fmt_list[cap_index][0] # only show first format
fmts = ''
for fmt in fmt_list[cap_index]:
fmts = fmts + fmt + ' '
rate_min = cap["rate_min"]
rate_max = cap["rate_max"]
ch_min = cap["channels_min"]
ch_max = cap["channels_max"]
print(f"pcm={name};id={pcm_id};type={pcm_type};fmt={fmt};"
f"rate_min={rate_min};rate_max={rate_max};ch_min={ch_min};ch_max={ch_max};")
print(f"pcm={name};id={pcm_id};type={pcm_type};"
f"rate_min={rate_min};rate_max={rate_max};ch_min={ch_min};ch_max={ch_max};"
f"fmt={fmts}")

@cached_property
def coreids(self):
Expand Down

0 comments on commit b0c2cd5

Please sign in to comment.