public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: "Mauro Carvalho Chehab" <mchehab@infradead.org>,
	"David Härdeman" <david@hardeman.nu>
Cc: linux-media@vger.kernel.org
Subject: IR code autorepeat issue?
Date: Sun, 29 Aug 2010 16:40:36 +1000	[thread overview]
Message-ID: <20100829064036.GB22853@kryten> (raw)


I'm seeing double IR events on 2.6.36-rc2 and a DViCO FusionHDTV DVB-T Dual
Express. I enabled some debug and it looks like we are only getting one IR
event from the device as expected:

[ 1351.032084] ir_keydown: i2c IR (FusionHDTV): key down event, key 0x0067, scancode 0x0051
[ 1351.281284] ir_keyup: keyup key 0x0067

ie one key down event and one key up event 250ms later. I wonder if the input
layer software autorepeat is the culprit. It seems to set autorepeat to start
at 250ms:

        /*
         * If delay and period are pre-set by the driver, then autorepeating
         * is handled by the driver itself and we don't do it in input.c.
         */
        init_timer(&dev->timer);
        if (!dev->rep[REP_DELAY] && !dev->rep[REP_PERIOD]) {
                dev->timer.data = (long) dev;
                dev->timer.function = input_repeat_key;
                dev->rep[REP_DELAY] = 250;
                dev->rep[REP_PERIOD] = 33;
        }

If I shorten the IR key up events to 100ms via the patch below the problem
goes away. I guess the other option would be to initialise REP_DELAY and
REP_PERIOD so the input layer autorepeat doesn't cut in at all. Thoughts?

Anton
--

diff --git a/drivers/media/IR/ir-keytable.c b/drivers/media/IR/ir-keytable.c
index 7e82a9d..cf44d5a 100644
--- a/drivers/media/IR/ir-keytable.c
+++ b/drivers/media/IR/ir-keytable.c
@@ -22,7 +22,7 @@
 #define IR_TAB_MAX_SIZE	8192
 
 /* FIXME: IR_KEYPRESS_TIMEOUT should be protocol specific */
-#define IR_KEYPRESS_TIMEOUT 250
+#define IR_KEYPRESS_TIMEOUT 100
 

             reply	other threads:[~2010-08-29  6:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-29  6:40 Anton Blanchard [this message]
2010-08-29 15:44 ` IR code autorepeat issue? Mauro Carvalho Chehab
2010-09-08 16:29   ` Mauro Carvalho Chehab
2010-09-20 22:55     ` Anton Blanchard
2010-09-21  4:44       ` Jarod Wilson
  -- strict thread matches above, loose matches on Subject: below --
2010-08-30  1:26 Andy Walls
2010-08-30 12:50 ` Mauro Carvalho Chehab
2010-08-31 13:55   ` David Härdeman

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=20100829064036.GB22853@kryten \
    --to=anton@samba.org \
    --cc=david@hardeman.nu \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@infradead.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