amixer: skip showing asoc tlv byte controls
PATCH v4 1/1 amixer: skip showing asoc tlv byte controls
ASoC TLV Byte controls are very large size controls so we should add new options for these. So skip dumping contents for these.
$amixer -c0 cget numid=16
numid=16,iface=MIXER,name='mdl params'
; type=BYTES,access=-----RW-,values=30336
; ASoC TLV Byte control, skipping bytes dump
Signed-off-by Vinod Koul <[email protected]>
--- amixer/amixer.c | 8 ++++++++ 1 file changed, 8 insertions(+)
amixer/amixer.c +8 -0
@@ -682,6 +682,14 @@ static int show_control(const char *space, snd_hctl_elem_t *elem, __skip_read:if (!snd_ctl_elem_info_is_tlv_readable (info)) goto __skip_tlv; +/* skip ASoC ext bytes controls that may have huge binary TLV data */ +if (type ==SND_CTL_ELEM_TYPE_BYTES && + !snd_ctl_elem_info_is_readable (info) && + !snd_ctl_elem_info_is_writable (info)) { +printf ("%s; ASoC TLV Byte control, skipping bytes dump\n" , space); + goto __skip_tlv; + } + tlv =malloc (4096 );if ((err =snd_hctl_elem_tlv_read (elem, tlv,4096 )) <0 ) {error ("Control %s element TLV read error: %s\n" , card,snd_strerror (err));
Signature · 1 line
1.9.1
Takashi Iwai
AppliedQuoted 10 lines · Vinod Koul
ASoC TLV Byte controls are very large size controls so we should add new options for these. So skip dumping contents for these.
$amixer -c0 cget numid=16
numid=16,iface=MIXER,name='mdl params'
; type=BYTES,access=-----RW-,values=30336
; ASoC TLV Byte control, skipping bytes dumpSigned-off-by Vinod Koul <[email protected]>
Applied, thanks.
Takashi
Quoted 26 lines
--- amixer/amixer.c | 8 ++++++++ 1 file changed, 8 insertions(+)amixer/amixer.c +8
-0@@ -682,6 +682,14 @@ static int show_control(const char *space, snd_hctl_elem_t *elem, __skip_read:if (!snd_ctl_elem_info_is_tlv_readable (info)) goto __skip_tlv; +/* skip ASoC ext bytes controls that may have huge binary TLV data */ +if (type ==SND_CTL_ELEM_TYPE_BYTES && + !snd_ctl_elem_info_is_readable (info) && + !snd_ctl_elem_info_is_writable (info)) { +printf ("%s; ASoC TLV Byte control, skipping bytes dump\n" , space); + goto __skip_tlv; + } + tlv =malloc (4096 );if ((err =snd_hctl_elem_tlv_read (elem, tlv,4096 )) <0 ) {error ("Control %s element TLV read error: %s\n" , card,snd_strerror (err));Signature · 1 line
1.9.1