linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: linux-input@vger.kernel.org
Subject: Losing events from USB barcode reader
Date: Mon, 23 May 2011 21:02:28 +0200	[thread overview]
Message-ID: <20110523210228.7738801f@surf> (raw)

Hello,

I have a Qt-based application which reads events from a Linux input
device through /dev/input/eventX. The device I have is an USB barcode
scanner, which works just like a keyboard.

Unfortunately, I sometimes lose events coming from this USB barcode
scanner, and I'm worried about the size of the in-kernel buffer for
events. The USB barcode scanner acts like a keyboard, but sends events
much, much faster. For example, when it scans a barcode such as
"AZERTYUIOP1234", it generates the Shift press, key press, key release,
Shift release for every character, generating at least 56 events in a
row, very quickly (and the kernel only buffers 64 events if I'm
correct).

There are even worse cases: I have an USB barcode reader which is
connected by Bluetooth with the barcode reader itself. When the barcode
reader is far away from the base station, it just buffers the scanned
barcodes, and when the barcode reader is again within the Bluetooth
range from the base station, it sends all the buffered scanned barcode
in a row. Potentially hundreds and hundreds of Linux input events
coming in.

Shouldn't the in-kernel buffer be larger for such devices, in order to
leave more time for the applications to come and fetch the events ?

As far as I could see, it doesn't seem to be possible to adjust the
size of the in-kernel buffer from userspace (through some ioctl() call,
for example). Did I miss something ?

Thanks,

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

             reply	other threads:[~2011-05-23 19:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-23 19:02 Thomas Petazzoni [this message]
2011-05-24  9:55 ` Losing events from USB barcode reader Henrik Rydberg
2011-05-25 15:38   ` Thomas Petazzoni
2011-06-03  8:15     ` Thomas Petazzoni
2011-06-03 13:54       ` Thadeu Lima de Souza Cascardo

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=20110523210228.7738801f@surf \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=linux-input@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).