Re: Buffer size for iio_push_to_buffers_with_timestamp()

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

 



On Thu, 9 May 2019 12:54:34 +0200
Gaëtan Carlier <gcembed@xxxxxxxxx> wrote:

> Dear,
> 
> I have a question about the function iio_push_to_buffers_with_timestamp().
> 
> How kernel knows the size of the buffer ? Should the buffer always be 128 bits (with last 64 bits for timestamp) ?
Hi Gaëtan,

All fields in IIO buffers are 'naturally' aligned and must be power of 2 size
(8, 16, 32, 64)

This function is a bit 'odd' in that it needs a buffer that has space to insert
the 64 bit aligned, 64 bit timestamp.

So if your devices other channels fit in 64 bits then your conclusion is
correct.  If you have more channels then it may well be that the buffer
is already greater than 64 bits long before leaving space for the timestamp
and hence your buffer may need to be 192, 256 etc..

Hope that answers your question,

Jonathan

> 
> Best regards,
> Gaëtan.




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux