[alsa-devel] [alsa-lib][PATCH] test: fix comment about first two fields of TLV data payload

Takashi Iwai tiwai at suse.de
Tue Aug 30 07:32:32 CEST 2016


On Tue, 30 Aug 2016 02:21:45 +0200,
Takashi Sakamoto wrote:
> 
> I misunderstand TLV packet structure (struct snd_ctl_tlv) nests in its
> payload. But actually, the payload stores different type of data.
> 
> This commit corrects a comment in a test program of user control element
> set including my misunderstanding.
> 
> Signed-off-by: Takashi Sakamoto <o-takashi at sakamocchi.jp>
> ---
>  test/user-ctl-element-set.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/test/user-ctl-element-set.c b/test/user-ctl-element-set.c
> index 9b9dc59..f6f050a 100644
> --- a/test/user-ctl-element-set.c
> +++ b/test/user-ctl-element-set.c
> @@ -418,11 +418,11 @@ static int check_tlv(struct elem_set_trial *trial)
>  	int err;
>  
>  	/*
> -	 * See a layout of 'struct snd_ctl_tlv'. I don't know the reason to
> -	 * construct this buffer with the same layout. It should be abstracted
> -	 * inner userspace library...
> +	 * When transferring threshold level information via TLV feature of
> +	 * ALSA control interface, the first two fields of packet payload
> +	 * consist of data type and data length.
>  	 */
> -	orig[0] = snd_ctl_elem_id_get_numid(trial->id);
> +	orig[0] = SNDRV_CTL_TLVT_CONTAINER;
>  	orig[1] = 6 * sizeof(orig[0]);
>  	orig[2] = 'a';
>  	orig[3] = 'b';

The container TLV type expects other TLVs as its content.  So the
above looks buggy to me...


Takashi


More information about the Alsa-devel mailing list