Hauppauge LIRC remote, FC3, buttons

Message ID 4D4286FDC9%linux@youmustbejoking.demon.co.uk
State New
Headers

Commit Message

Darren Salt Feb. 25, 2005, 2:10 a.m. UTC
  I demand that Simon Baxter may or may not have written...

> I'm having some strange problems with my VDR keymaps on Xine (running FC3
> with a DVB Nova-T). I use the xine keymap editor to 'grab' keystrokes for
> the VDR buttons, but none of the coloured buttons (green, red, blue) are
> recognised?

I can't help with LIRC, but you *can* get this working with the remote plugin
and my patches (attached).

The -kernel patch is applicable to 2.6.x kernel source and the LinuxTV DVB
driver tarballs (1.1.0, 1.1.1 and possibly some older versions); the -linuxtv
patch is for DVB CVS (and *should* still be applicable; I've not checked
recently). For the record, these are based on the IR keymap interface in the
av7110 code.

The third patch is for the DVB utilities - you'll get an extra binary,
budget_ci_loadkeys, which you can use as follows (once you've loaded the
patched budget_ci module):

  # budget_ci_loadkeys hauppauge_grey.rc5 >/proc/budget_ci_ir

For those who are already using these patches: no need to update - the
patches are unchanged.

Debian testing/unstable users: these patches are present in dvb-utils 1.1.0-3
and dvb-driver-source 1.1.1-4 and later versions.

(BTW, you need to switch on text wrapping or to stop using OE.)
  

Comments

Linux TV Feb. 25, 2005, 6:13 a.m. UTC | #1
---- Original Message ----- 
From: "Darren Salt" <linux@youmustbejoking.demon.co.uk>
To: <vdr@linuxtv.org>
Sent: Friday, February 25, 2005 2:10 AM
Subject: Re: [vdr] Hauppauge LIRC remote, FC3, buttons

> The -kernel patch is applicable to 2.6.x kernel source and the LinuxTV DVB
> driver tarballs (1.1.0, 1.1.1 and possibly some older versions); 
> the -linuxtv
> patch is for DVB CVS (and *should* still be applicable; I've not checked
> recently). For the record, these are based on the IR keymap interface in 
> the
> av7110 code.
Please excuse my ignorance, but do I need to patch and compile both the 
kernel and the DVB-CVS?
Or should I use the -kernel patch for if I'm doing DVB in the kernel tree 
and -linuxtv if I'm doing DVB outside the kernel tree?

> (BTW, you need to switch on text wrapping or to stop using OE.)
Thanks.  You never know these things unless someone tells you!
  
Darren Salt Feb. 25, 2005, 6:22 p.m. UTC | #2
I demand that Simon Baxter may or may not have written...

> From: "Darren Salt" <linux@youmustbejoking.demon.co.uk>
>> The -kernel patch is applicable to 2.6.x kernel source and the LinuxTV DVB
>> driver tarballs (1.1.0, 1.1.1 and possibly some older versions); the
>> -linuxtv patch is for DVB CVS (and *should* still be applicable; I've not
>> checked recently). For the record, these are based on the IR keymap
>> interface in the av7110 code.

> Please excuse my ignorance, but do I need to patch and compile both the
> kernel and the DVB-CVS?

No. Only whichever you intend to use.

> Or should I use the -kernel patch for if I'm doing DVB in the kernel tree
> and -linuxtv if I'm doing DVB outside the kernel tree?

For the kernel DVB drivers, that's correct. (I'm using that patch with
2.6.10 and previously with 2.6.8.1.)

For drivers sourced from the LinuxTV site, it depends on the age of the
drivers. The -kernel driver wasn't applicable without rejects to driver
source from CVS when I last checked, which is why there are two versions of
the patch; if the -linuxtv patch isn't cleanly applicable any more, then feel
free to post a fixed-up patch :-)

As usual with this kind of thing, testing whether the patch is applicable by
using patch's --dry-run option is recommended.
  
Linux TV March 8, 2005, 10:04 a.m. UTC | #3
Hi Darren.

I've been building a new kernel for my new machine, based on the 2.6.11-rc4 
patches from Bytesex, and was hoping to include your kernel patch for the 
extra buttons.  But I got the following failure:

 patch -p0 <budget-ci-keys-kernel.patch
(Stripping trailing CRs from patch.)
patching file linux/drivers/media/dvb/ttpci/budget-ci.c
Hunk #1 FAILED at 34.
Hunk #2 succeeded at 181 (offset -1 lines).
Hunk #3 succeeded at 244 (offset 1 line).
Hunk #4 succeeded at 258 with fuzz 1 (offset -1 lines).
1 out of 4 hunks FAILED -- saving rejects to file 
linux/drivers/media/dvb/ttpci/budget-ci.c.rej

[root@nzbaxters kernels]# less linux/drivers/media/dvb/ttpci/budget-ci.c.rej
***************
*** 34,39 ****
  #include <linux/slab.h>
  #include <linux/interrupt.h>
  #include <linux/input.h>

  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
  #include "input_fake.h"
--- 34,40 ----
  #include <linux/slab.h>
  #include <linux/interrupt.h>
  #include <linux/input.h>
+ #include <linux/proc_fs.h>

  #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
  #include "input_fake.h"
[root@nzbaxters kernels]#


Can you help?
----- Original Message ----- 
From: "Darren Salt" <linux@youmustbejoking.demon.co.uk>
To: <vdr@linuxtv.org>
Sent: Friday, February 25, 2005 2:10 AM
Subject: Re: [vdr] Hauppauge LIRC remote, FC3, buttons


>I demand that Simon Baxter may or may not have written...
>
>> I'm having some strange problems with my VDR keymaps on Xine (running FC3
>> with a DVB Nova-T). I use the xine keymap editor to 'grab' keystrokes for
>> the VDR buttons, but none of the coloured buttons (green, red, blue) are
>> recognised?
>
> I can't help with LIRC, but you *can* get this working with the remote 
> plugin
> and my patches (attached).
>
> The -kernel patch is applicable to 2.6.x kernel source and the LinuxTV DVB
> driver tarballs (1.1.0, 1.1.1 and possibly some older versions); 
> the -linuxtv
> patch is for DVB CVS (and *should* still be applicable; I've not checked
> recently). For the record, these are based on the IR keymap interface in 
> the
> av7110 code.
>
> The third patch is for the DVB utilities - you'll get an extra binary,
> budget_ci_loadkeys, which you can use as follows (once you've loaded the
> patched budget_ci module):
>
>  # budget_ci_loadkeys hauppauge_grey.rc5 >/proc/budget_ci_ir
>
> For those who are already using these patches: no need to update - the
> patches are unchanged.
>
> Debian testing/unstable users: these patches are present in dvb-utils 
> 1.1.0-3
> and dvb-driver-source 1.1.1-4 and later versions.
>
> (BTW, you need to switch on text wrapping or to stop using OE.)
>
> -- 
> | Darren Salt | nr. Ashington, | d youmustbejoking,demon,co,uk
> | Debian,     | Northumberland | s zap,tartarus,org
> | RISC OS     | Toon Army      | @
> |   Retrocomputing: a PC card in a Risc PC
>
> Anything worth doing is worth overdoing.
>


--------------------------------------------------------------------------------


> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>


--------------------------------------------------------------------------------


Internal Virus Database is out-of-date.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 266.1.0 - Release Date: 18/02/2005
  
Darren Salt March 8, 2005, 6:52 p.m. UTC | #4
I demand that Simon Baxter may or may not have written...

> I've been building a new kernel for my new machine, based on the 2.6.11-rc4
> patches from Bytesex, and was hoping to include your kernel patch for the
> extra buttons.  But I got the following failure:

>  patch -p0 <budget-ci-keys-kernel.patch
> (Stripping trailing CRs from patch.)
> patching file linux/drivers/media/dvb/ttpci/budget-ci.c
> Hunk #1 FAILED at 34.
> Hunk #2 succeeded at 181 (offset -1 lines).
> Hunk #3 succeeded at 244 (offset 1 line).
> Hunk #4 succeeded at 258 with fuzz 1 (offset -1 lines).
> 1 out of 4 hunks FAILED -- saving rejects to file linux/drivers/media/dvb/ttpci/budget-ci.c.rej

Apply the reject manually (add the extra #include). It'll work :-)

[snip quoted text, including .sig...]
  
Linux TV March 9, 2005, 12:51 p.m. UTC | #5
Thanks.  I now know a little more about patch files and syntax!

Simon
----- Original Message ----- 
From: "Darren Salt" <linux@youmustbejoking.demon.co.uk>
To: <vdr@linuxtv.org>
Sent: Tuesday, March 08, 2005 6:52 PM
Subject: Re: [vdr] Hauppauge LIRC remote, FC3, buttons


>I demand that Simon Baxter may or may not have written...
>
>> I've been building a new kernel for my new machine, based on the 
>> 2.6.11-rc4
>> patches from Bytesex, and was hoping to include your kernel patch for the
>> extra buttons.  But I got the following failure:
>
>>  patch -p0 <budget-ci-keys-kernel.patch
>> (Stripping trailing CRs from patch.)
>> patching file linux/drivers/media/dvb/ttpci/budget-ci.c
>> Hunk #1 FAILED at 34.
>> Hunk #2 succeeded at 181 (offset -1 lines).
>> Hunk #3 succeeded at 244 (offset 1 line).
>> Hunk #4 succeeded at 258 with fuzz 1 (offset -1 lines).
>> 1 out of 4 hunks FAILED -- saving rejects to file 
>> linux/drivers/media/dvb/ttpci/budget-ci.c.rej
>
> Apply the reject manually (add the extra #include). It'll work :-)
>
> [snip quoted text, including .sig...]
> -- 
> | Darren Salt | d youmustbejoking,demon,co,uk | nr. Ashington,
> | Debian,     | s zap,tartarus,org            | Northumberland
> | RISC OS     | @                             | Toon Army
> |   I don't ask for much, just untold riches...
>
> Prune yoghurt. For that "get up and go" feeling.
>
> _______________________________________________
> vdr mailing list
> vdr@linuxtv.org
> http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
>
>
> -- 
> No virus found in this incoming message.
> Checked by AVG Anti-Virus.
> Version: 7.0.308 / Virus Database: 266.6.4 - Release Date: 07/03/2005
>
>
  

Patch

--- linux/drivers/media/dvb/ttpci/budget-ci.c.orig	2003-11-20 10:50:15.000000000 +0000
+++ linux/drivers/media/dvb/ttpci/budget-ci.c	2004-09-27 22:16:19.000000000 +0100
@@ -34,6 +34,7 @@ 
 #include <linux/slab.h>
 #include <linux/interrupt.h>
 #include <linux/input.h>
+#include <linux/proc_fs.h>
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
 #include "input_fake.h"
@@ -181,10 +182,48 @@ 
 }
 
 
+static int budget_ci_ir_write_proc (struct file *file,
+				    const char __user *buffer,
+				    unsigned long count, void *data)
+{
+	/* adapted from av7110_ir.c */
+	char *page;
+	int i;
+	struct input_dev *input = (struct input_dev *)data;
+
+	if (count < sizeof (key_map))
+		return -EINVAL;
+	
+	page = (char *)vmalloc(sizeof (key_map));
+	if (!page)
+		return -ENOMEM;
+	
+	if (copy_from_user(page, buffer, sizeof (key_map))) {
+		vfree(page);
+		return -EFAULT;
+	}
+
+	memcpy (&key_map, page, sizeof (key_map));
+	vfree(page);
+
+	memset (input->keybit, 0, sizeof(input->keybit));
+
+	for (i=0; i<sizeof(key_map)/sizeof(key_map[0]); i++) {
+		if (key_map[i] > KEY_MAX)
+			key_map[i] = 0;
+		else if (key_map[i] > KEY_RESERVED)
+			set_bit (key_map[i], input->keybit);
+	}
+
+	return count;
+}
+
+
 static int msp430_ir_init (struct budget_ci *budget_ci)
 {
 	struct saa7146_dev *saa = budget_ci->budget.dev;
 	int i;
+	static struct proc_dir_entry *e;
 
 	memset(&budget_ci->input_dev, 0, sizeof(struct input_dev));
 
@@ -204,6 +243,13 @@ 
 
 	saa7146_setgpio(saa, 3, SAA7146_GPIO_IRQHI); 
 
+	e = create_proc_entry ("budget_ci_ir", S_IFREG | S_IRUGO | S_IWUSR, NULL);
+	if (e) {
+		e->write_proc = budget_ci_ir_write_proc;
+		e->data = &budget_ci->input_dev;
+		e->size = sizeof (key_map);
+	}
+
 	return 0;
 }
 
@@ -213,6 +259,8 @@ 
 	struct saa7146_dev *saa = budget_ci->budget.dev;
 	struct input_dev *dev = &budget_ci->input_dev;
 
+	remove_proc_entry ("budget_ci_ir", NULL);
+
 	saa7146_write(saa, IER, saa7146_read(saa, IER) & ~MASK_06);
 	saa7146_setgpio(saa, 3, SAA7146_GPIO_INPUT);
 	saa7146_setgpio(saa, 2, SAA7146_GPIO_INPUT);