All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@redhat.com>
To: Andy Walls <awalls@md.metrocast.net>
Cc: linux-input@vger.kernel.org,
	Linux Media Mailing List <linux-media@vger.kernel.org>
Subject: Re: [PATCH 04/15] V4L/DVB: ir-core: Add logic to decode IR protocols at the IR core
Date: Tue, 06 Apr 2010 02:33:15 -0300	[thread overview]
Message-ID: <4BBAC79B.5030107@redhat.com> (raw)
In-Reply-To: <4BBA2D05.2080505@infradead.org>

Mauro Carvalho Chehab wrote:
> Andy Walls wrote:
>> I have an RC-5 decoder in cx23885-input.c that isn't as clean as the NEC
>> protocol decoder I developed.  The cx23885-input.c RC-5 decoder is not a
>> very explicit state machine however (it is a bit hack-ish).
> 
> The state machine seems to be working fine with the code, but I think I
> found the issue: it was expecting 14 bits after the start+toggle bits, instead
> of a total of 14 bits. I'll fix it. I'll probably end by simplifying it to have
> only 3 states: inactive, mark-space and trailer.

Done. I've re-written the state machine logic. The code is now simpler to understand,
require less processing and works properly with RC-5.

Instead of generating an intermediate code, like the code in ir-functions, it measures
directly the length of each pulse or space event and generate the corresponding bit directly,
putting it into a shift register. At the end of the 14 bits reception, the shift register
will contain the scancode.

When compared with saa7134 original RC5 decoder, this code is much more reliable, since it doesn't
propagate the errors, if the frequency is not precisely 36 kHz.

I tested here with my device and it is properly recognizing the Hauppauge Grey IR keys.

Both NEC and RC-5 decoders can run in parallel.


The patch here:

http://git.linuxtv.org/mchehab/ir.git?a=commitdiff;h=37b215ea1280a621d652469cd35328a208f8ef77

And the complete code:

http://git.linuxtv.org/mchehab/ir.git?a=blob;f=drivers/media/IR/ir-rc5-decoder.c;h=a62277b625a8ed78028e7060a677598eeae03ffe;hb=37b215ea1280a621d652469cd35328a208f8ef77

I'll likely send an email to the ML with the RC patches that are on my experimental tree,
to properly document, and merge it at the -git, together with the other pending requests.

-- 

Cheers,
Mauro

  reply	other threads:[~2010-04-06  5:33 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1270142346.git.mchehab@redhat.com>
2010-04-01 17:56 ` [PATCH 12/15] V4L/DVB: ir-core: rename sysfs remote controller class from ir to rc Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 13/15] V4L/DVB: ir-core: Add callbacks for input/evdev open/close on IR core Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 14/15] V4L/DVB: cx88: Only start IR if the input device is opened Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 11/15] V4L/DVB: saa7134: clear warning noise Mauro Carvalho Chehab
2010-04-01 17:56   ` Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 09/15] V4L/DVB: ir-core: prepare to add more operations for ir decoders Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 15/15] V4L/DVB: input: Add support for EVIO[CS]GKEYCODEBIG Mauro Carvalho Chehab
2010-04-24  9:09   ` David Härdeman
2010-04-24  9:09     ` David Härdeman
2010-04-01 17:56 ` [PATCH 10/15] V4L/DVB: ir-nec-decoder: Add sysfs node to enable/disable per irrcv Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 07/15] V4L/DVB: saa7134: don't wait too much to generate an IR event on raw_decode Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 01/15] V4L/DVB: ir-core: be less pedantic with RC protocol name Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 02/15] V4L/DVB: saa7134: use a full scancode table for M135A Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 03/15] V4L/DVB: saa7134: add code to allow changing IR protocol Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 05/15] V4L/DVB: ir-core: add two functions to report keyup/keydown events Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 04/15] V4L/DVB: ir-core: Add logic to decode IR protocols at the IR core Mauro Carvalho Chehab
2010-04-02 23:39   ` Andy Walls
2010-04-03  0:59     ` Andy Walls
2010-04-03  1:11       ` Mauro Carvalho Chehab
2010-04-03  1:32     ` Mauro Carvalho Chehab
2010-04-03 17:16       ` Andy Walls
2010-04-03 22:56         ` Mauro Carvalho Chehab
2010-04-04 12:35           ` Andy Walls
2010-04-04 18:00             ` Mauro Carvalho Chehab
2010-04-05  1:45               ` Andy Walls
2010-04-05 18:33                 ` Mauro Carvalho Chehab
2010-04-06  5:33                   ` Mauro Carvalho Chehab [this message]
2010-04-01 17:56 ` [PATCH 06/15] V4L/DVB: ir-core/saa7134: Move ir keyup/keydown code to the ir-core Mauro Carvalho Chehab
2010-04-01 17:56 ` [PATCH 08/15] V4L/DVB: ir-core: dynamically load the compiled IR protocols Mauro Carvalho Chehab

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=4BBAC79B.5030107@redhat.com \
    --to=mchehab@redhat.com \
    --cc=awalls@md.metrocast.net \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-media@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.