Re: Hauppauge IR remote codes & basic C programming

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

 



I demand that Simon Baxter may or may not have written...

>> (Don't worry if you see 37fd or 37bd. That's normal; bit 11 is toggled by
>> the remote control on each new key press. Bits 12 to 15 are fixed; bits 0
>> to 5 are the key code.)

>> Plugging the numbers into ((value >> 6) & 0x1F), we get 0x1F and 0x1E.

> Sorry, I'm confused.  How do we arrive at 0x1F and 0x1E ?

  $ printf %#x\\n $(((0x37fd >> 6) & 0x1F))
  0x1f
  $ printf %#x\\n $(((0x37bd >> 6) & 0x1F))
  0x1e
  $

The numbers are pulled from the "biphase decoded" lines in the kernel message
buffer.

> Here's where I'm up to now:

> [root@media ~]# echo 1 >/sys/module/cx88xx/parameters/ir_debug
> [root@media ~]# input-events -t 240 2
> /dev/input/event2
>    bustype : BUS_PCI
>    vendor  : 0x70
>    product : 0x9002
>    version : 1
>    name    : "cx88 IR (Hauppauge Nova-T DVB-T"
>    phys    : "pci-0000:00:0a.2/ir0"
>    bits ev : EV_SYN EV_KEY EV_REP
[snip]
> ------------>>>  above:  Hit the 'menu' key on the R808, and then the
> 'mute' key on my Phillips TV remote

> and the 'dmesg' for that action:

> cx88[0] IR: biphase decoded: 3fcd
[snip repeat then 2×0x37fd]

=> 0x1F.

> cx88[0] IR: biphase decoded: 300d
[snip repeat then 2×0x380d]

=> 0x00.

[snip]
> 3fcd/37cd = Hauppauge menu button
> 300d/380d = Phillips mute button

That looks about right.

> ------------>>>  above:  As you can see, the cx88xx is seeing different
> codes, but the IR decode is seeing it as the same keystroke...

Yes; your module isn't checking bit 11. The attached patch (apply on top of
my other cx88-input patch) should fix this.

-- 
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
|   <URL:http://www.youmustbejoking.demon.co.uk/> (PGP 2.6, GPG keys)

The wise shepherd never trusts his flock to a smiling wolf.
cx88-input: properly handle new-keypress edge signal for Hauppauge RCs
From: Darren Salt <linux@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

This patch causes key-up events to be generated whenever bit 11 of the IR
data is toggled. (This bit is toggled by the remote control whenever it
detects a keypress.)

Signed-off-by: Darren Salt <linux@xxxxxxxxxxxxxxxxxxxxxxxxxxx>

diff -r 9112ece99990 linux/drivers/media/video/cx88/cx88-input.c
--- a/linux/drivers/media/video/cx88/cx88-input.c	Thu Apr 27 14:30:46 2006 +0100
+++ b/linux/drivers/media/video/cx88/cx88-input.c	Thu Apr 27 18:17:14 2006 +0100
@@ -402,6 +402,16 @@ void cx88_ir_irq(struct cx88_core *core)
 		if (!ir_any_address &&
 		    ((ircode ^ ir->sampling) & (0x1F << 6)))
 			break;
+
+		/* if either the new-keypress edge signal is changed or the
+		 * RC5 address doesn't match that of the previous keypress,
+		 * say "key-up"
+		 */
+		if (((ircode ^ ir->last_gpio) & (1 << 11)) ||
+		    ((ircode ^ ir->last_gpio) & (0x1F << 6)))
+			ir_input_nokey(ir->input, &ir->ir);
+
+		ir->last_gpio = ircode;
 		ir_input_keydown(ir->input, &ir->ir, ircode & 0x3f, ircode);
 		ir->release = jiffies + msecs_to_jiffies(120);
 		break;
_______________________________________________

linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux