Re: iio_buffer length

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

 




Denis Ciocca <denis.ciocca@xxxxxxxxx> wrote:

>Hi guys,
>
>I finally managed to resolve the issues about iio_trigger and
>iio_buffer.
>Now I ask please you if you can clarify to me about use of
>iio_generic_buffer and how I can use the /dev/iio:deviceX char-event
>to catch data from buffer.
>I compiled the generic-buffer program and I don't understand how datas
>come out. My driver has 4 channels:
>- 3 for accelerometer raw data (x,y,z)
>- 1 for timestamp
>
>The application set up the length of buffer to 32, but when I run the
>application I don't see 32 samples but only 16. What means 32?
>It is possible the use of buffer to catch every sample? (buffer length
>= 1)?
>When I set buffer length to 1 the application doesn't work!

Firstly please confirm you are using a kfifo buffer? Swring is deprecated but will do precisely what you are seeing I think. It uses a half full watershead to decide to signal userspace.  If you wait till the buffer is full, unless your sampling is very slow you will have data coming in before userspace has read the whole buffer out. Hence you will loose data.  Kfifo has a more conventional poll and will fire off userspace whenever any data is in the buffer. Hence kfifo will work for your usecase.  I would like to have a fill level capable buffer again in the future as they are very useful in high speed uses where latency doesn't matter. 

If you are using kfifo then something odd is going on!  Its trivial to switch a driver between them.
>
>Thanks,
>Denis
>--
>To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>the body of a message to majordomo@xxxxxxxxxxxxxxx
>More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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