Re: [PATCH v2] amixer: skip showing asoc tlv byte controls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 28 Jan 2016 05:49:42 +0100,
Vinod Koul wrote:
> 
> 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 <vinod.koul@xxxxxxxxx>

No, as I wrote before, checking the type isn't enough.
Assigning a TLV to BYTES type doesn't mean necessarily that it's an
ASoC EXT control.  You need to check the r/w capabilities as well.


thanks,

Takashi

> ---
>  amixer/amixer.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/amixer/amixer.c b/amixer/amixer.c
> index db1849333da3..9ae75bfa3632 100644
> --- a/amixer/amixer.c
> +++ b/amixer/amixer.c
> @@ -682,6 +682,12 @@ 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 show for ASoC TLV Byte controls */
> +		if (type == SND_CTL_ELEM_TYPE_BYTES) {
> +			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));
> -- 
> 1.9.1
> 
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux