[alsa-devel] snd_ctl_add_enumerated_elem_set and TLV

Fulup Ar Foll fulup.arfoll at iot.bzh
Mon Jul 31 00:56:16 CEST 2017


Thank you. I will write an empty container. Hopefully most clients will 
be happy with it.

I understand that it not a critical BUG, but as you said the flag should 
not be set to readable, when they is no TLV.

On 30/07/17 16:49, Clemens Ladisch wrote:
> Fulup Ar Foll wrote:
>> I'm using snd_ctl_add_enumerated_elem_set to create user controls, I
>> do not understand why it set "TLV readable" option at true by default.
> 
> As far as I can see, the library API has no mechanism to set or clear
> this access right, so it's set by default to allow TLVs for controls
> where it makes sense.
> 
> (In theory, the code could be changed to clear the readable flag when
> there is no TLV.)
> 
>> I have a simple enumeration without TLV. I use snd_ctl_elem_write but
>> do not call snd_ctl_elem_tlv_write. I do no understand how to prevent
>> snd_ctl_elem_info_is_tlv_readable to return true for this control,
> 
> This is not possible at the moment.
> 
>> obviously even if TLV is set as readable, it is empty and reading fail.
> 
> You'll have to write a fake TLV (an empty container).
> 
> 
> Regards,
> Clemens
> 



More information about the Alsa-devel mailing list