Skip to content

Commit

Permalink
tplgtool2: show pcm id before name
Browse files Browse the repository at this point in the history
print_pcm_info() will show pcm ID before its name.

Also adjust alignment:
- id: 2 characters, right alignment.
- name: 22 characters, left alignment. Current longest PCM name
  is 'Deepbuffer HDA Analog', 21 characters. We can modify later.
- type (playback/capture/duplex): 8 characters, left alignment.
- rate: 6 characters, right alignment, for highest rate '192000'.

Strings longer than the alignment won't be cut.

Signed-off-by: Mengdong Lin <[email protected]>
  • Loading branch information
mengdonglin committed Sep 17, 2023
1 parent b0c2cd5 commit f7d236f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/tplgtool2.py
Original file line number Diff line number Diff line change
Expand Up @@ -736,8 +736,8 @@ def print_pcm_info(self):
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};"
f"rate_min={rate_min};rate_max={rate_max};ch_min={ch_min};ch_max={ch_max};"
print(f"pcm {pcm_id:>2}: {name:<22};type={pcm_type:<8};"
f"rate_min={rate_min:>6};rate_max={rate_max:>6};ch_min={ch_min};ch_max={ch_max};"
f"fmt={fmts}")

@cached_property
Expand Down

0 comments on commit f7d236f

Please sign in to comment.