Re: [PATCH] ucm: add cset-tlv command

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

 



On Wed, Mar 23, 2016 at 5:21 PM, Takashi Iwai <tiwai@xxxxxxx> wrote:
> On Wed, 23 Mar 2016 10:15:21 +0100,
> Hsin-yu Chao wrote:
>>
>> On Tue, Mar 22, 2016 at 7:48 PM, Takashi Iwai <tiwai@xxxxxxx> wrote:
>> > On Tue, 22 Mar 2016 10:10:34 +0100,
>> > Hsin-Yu Chao wrote:
>> >>
>> >> This patch enables UCM to set a file in TLV format to kcontrol by:
>> >> cset-tlv "name='<kcontrol-name>' <path-to-file>"
>> >> This new 'cset-tlv' command will be used to write audio DSP to
>> >> specific alsa control, where the driver expectes a file in TLV
>> >> format.
>> >>
>> >> Signed-off-by: Hsin-Yu Chao <hychao@xxxxxxxxxxxx>
>> >
>> > One problem in this approach is that the provided TLV data file isn't
>> > portable.  Since we deal TLV as int arrays, it's endian-sensitive.
>> > At least, some endian check would be needed.
>> Thanks for the review. I think by extracting the length attribute (i.e
>> tlv[1]) and compare it with the file size is sufficient here, since
>> there is no way to figure out the endianness of the binary file passed
>> in.
>
> Yeah, that should be good enough.
>
>
>> Also I agree that additional check for crazy large or small file is
>> necessary. According to the dsp files I test with, I'll set the tlv
>> file size limit to between 8 bytes and 1MB.
>
> I guess the size will grow quickly in near future, so it'd be safer to
> take a bit bigger.
>
How about using 16MB as upper limit?
DSP file larger than that would take 1 second or more to load through USB 2.0.

Hsin-yu
>
> thanks,
>
> Takashi
_______________________________________________
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