From 54c562d458a9a75bdd8ffab2619c631a02f469ac Mon Sep 17 00:00:00 2001 From: Mengdong Lin Date: Sun, 17 Sep 2023 07:29:40 -0400 Subject: [PATCH] tplgtool2: adjust print order and alignment of PCM attributes 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 --- tools/tplgtool2.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/tplgtool2.py b/tools/tplgtool2.py index 0bbb6acb..aeef8006 100755 --- a/tools/tplgtool2.py +++ b/tools/tplgtool2.py @@ -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