From: Ge Gao <ggao@invensense.com>
To: Denis Ciocca <denis.ciocca@gmail.com>, jic23@jic23.retrosnub.co.uk
Cc: linux-iio@vger.kernel.org
Subject: RE: iio_buffer length
Date: Tue, 25 Sep 2012 18:32:51 -0700 [thread overview]
Message-ID: <5348d4d4e8f4766e2ed416b6b8318ee5@mail.gmail.com> (raw)
In-Reply-To: <C0999E24-1BF1-4B7D-835B-8E3AC76C61F8@gmail.com>
To use KFIFO, you need Jonanthan's KFIFO poll patch, you probably also
need a patch from me that fixed the industrial-buffer.c. But that buffer
is not well tested and is only used by me. The original KFIFO does not
have poll functionality and has some other minor bug.
Ge
-----Original Message-----
From: linux-iio-owner@vger.kernel.org
[mailto:linux-iio-owner@vger.kernel.org] On Behalf Of Denis Ciocca
Sent: Tuesday, September 25, 2012 2:35 PM
To: jic23@jic23.retrosnub.co.uk
Cc: linux-iio@vger.kernel.org
Subject: iio_buffer length
Hi Jon,
> Firstly please confirm you are using a kfifo buffer?
No, I use sw-ring.
> 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.
You are right. I saw exatly what you said.
> 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.
Ok, I will change my sw-ring buffer to kfifo!
Thanks,
Denis
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@vger.kernel.org More majordomo info at
http://vger.kernel.org/majordomo-info.html
next parent reply other threads:[~2012-09-26 1:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <C0999E24-1BF1-4B7D-835B-8E3AC76C61F8@gmail.com>
2012-09-26 1:32 ` Ge Gao [this message]
2012-09-26 7:27 ` iio_buffer length Jonathan Cameron
2012-09-26 8:04 ` Lars-Peter Clausen
2012-09-26 12:37 ` Denis Ciocca
2012-09-26 14:23 ` Jonathan Cameron
2012-09-26 18:10 ` Ge Gao
2012-09-25 14:05 Denis Ciocca
2012-09-25 16:20 ` Jonathan Cameron
2012-09-25 21:20 ` Denis Ciocca
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5348d4d4e8f4766e2ed416b6b8318ee5@mail.gmail.com \
--to=ggao@invensense.com \
--cc=denis.ciocca@gmail.com \
--cc=jic23@jic23.retrosnub.co.uk \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).