Skip to contentSkip to conversation

Add remote control support to Nova-TD (52009)

PATCH In review Chris Rankin 7 participants 10 messages Sep 24, 2008 – Sep 25, 2008 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add remote control support to Nova-TD (52009)

Hi,

This patch is against the 2.6.26.5 kernel, and adds remote control support for the Hauppauge WinTV Nova-TD (Diversity) model. (That's the 52009 version.) It also adds the key-codes for the credit-card style remote control that comes with this particular adapter.

Cheers,
Chris

drivers/media/dvb/dvb-usb/dib0700_devices.c renamed from drivers/media/dvb/dvb-usb/dib0700_devices.c.orig +43 -1
@@ -677,6 +677,43 @@
 	{ 0x01, 0x7d, KEY_VOLUMEDOWN },
 	{ 0x02, 0x42, KEY_CHANNELUP },
 	{ 0x00, 0x7d, KEY_CHANNELDOWN },
+
+	/* Key codes for Nova-TD "credit card" remote control. */
+	{ 0x1d, 0x00, KEY_0 },
+	{ 0x1d, 0x01, KEY_1 },
+	{ 0x1d, 0x02, KEY_2 },
+	{ 0x1d, 0x03, KEY_3 },
+	{ 0x1d, 0x04, KEY_4 },
+	{ 0x1d, 0x05, KEY_5 },
+	{ 0x1d, 0x06, KEY_6 },
+	{ 0x1d, 0x07, KEY_7 },
+	{ 0x1d, 0x08, KEY_8 },
+	{ 0x1d, 0x09, KEY_9 },
+	{ 0x1d, 0x0a, KEY_TEXT },
+	{ 0x1d, 0x0d, KEY_MENU },
+	{ 0x1d, 0x0f, KEY_MUTE },
+	{ 0x1d, 0x10, KEY_VOLUMEUP },
+	{ 0x1d, 0x11, KEY_VOLUMEDOWN },
+	{ 0x1d, 0x12, KEY_CHANNEL },
+	{ 0x1d, 0x14, KEY_UP },
+	{ 0x1d, 0x15, KEY_DOWN },
+	{ 0x1d, 0x16, KEY_LEFT },
+	{ 0x1d, 0x17, KEY_RIGHT },
+	{ 0x1d, 0x1c, KEY_TV },
+	{ 0x1d, 0x1e, KEY_NEXT },
+	{ 0x1d, 0x1f, KEY_BACK },
+	{ 0x1d, 0x20, KEY_CHANNELUP },
+	{ 0x1d, 0x21, KEY_CHANNELDOWN },
+	{ 0x1d, 0x24, KEY_LAST },
+	{ 0x1d, 0x25, KEY_OK },
+	{ 0x1d, 0x30, KEY_PAUSE },
+	{ 0x1d, 0x32, KEY_REWIND },
+	{ 0x1d, 0x34, KEY_FASTFORWARD },
+	{ 0x1d, 0x35, KEY_PLAY },
+	{ 0x1d, 0x36, KEY_STOP },
+	{ 0x1d, 0x37, KEY_RECORD },
+	{ 0x1d, 0x3b, KEY_GOTO },
+	{ 0x1d, 0x3d, KEY_POWER },
 };
 
 /* STK7700P: Hauppauge Nova-T Stick, AVerMedia Volar */
@@ -1387,7 +1424,12 @@
 				{ &dib0700_usb_id_table[35], NULL },
 				{ NULL },
 			}
-		}
+		},
+
+		.rc_interval      = DEFAULT_RC_INTERVAL,
+		.rc_key_map       = dib0700_rc_keys,
+		.rc_key_map_size  = ARRAY_SIZE(dib0700_rc_keys),
+		.rc_query         = dib0700_rc_query
 	}, { DIB0700_DEFAULT_DEVICE_PROPERTIES,
 
 		.num_adapters = 1,

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#1 lore raw
Quoted 3 lines · Chris Rankin

Hi,

This patch is against the 2.6.26.5 kernel, and adds remote control support for the Hauppauge WinTV Nova-TD (Diversity) model. (That's the 52009 version.) It also adds the key-codes for the credit-card style remote control that comes with this particular adapter.

Committed and ask to be pulled, thanks.

Patrick.

--
Mail: [email protected]
WWW: http://www.wi-bw.tfh-wildau.de/~pboettch/

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#2 lore raw
Quoted 7 lines · Patrick Boettcher
Quoted 5 lines

This patch is against the 2.6.26.5 kernel, and adds remote control support for the Hauppauge WinTV Nova-TD (Diversity) model. (That's the 52009 version.) It also adds the key-codes for the credit-card style remote control that comes with this particular adapter.

Committed and ask to be pulled, thanks.

Am curious, would it be possible to augment these drivers to provide the raw IR codes on a raw hid device, eg. /dev/hidraw0 etc, so that other RC5 remotes than the ones that actually are sold with the card can be used with the card?

Signature · 11 lines
Torgeir Veimo
[email protected]





_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
#3 lore raw

[linux-dvb] getting rid of input dev in dvb-usb (was: Re: [PATCH] Add remote control support to Nova-TD (52009))

Quoted 9 lines · Torgeir Veimo
Quoted 6 lines · Patrick Boettcher
Quoted 5 lines

This patch is against the 2.6.26.5 kernel, and adds remote control support for the Hauppauge WinTV Nova-TD (Diversity) model. (That's the 52009 version.) It also adds the key-codes for the credit-card style remote control that comes with this particular adapter.

Quoted 6 lines
Quoted 1 line

Committed and ask to be pulled, thanks.

Am curious, would it be possible to augment these drivers to provide the raw IR codes on a raw hid device, eg. /dev/hidraw0 etc, so that other RC5 remotes than the ones that actually are sold with the card can be used with the card?

I would love that idea. Maybe this is the solution I have searched for so long. I desparately want to put those huge remote-control-table into user-space.

If hidraw is the right way, I'm with you. So far I wasn't sure what to do?!

How would it work with the key-table onces it is done with hidraw?

Patrick.

--
Mail: [email protected]
WWW: http://www.wi-bw.tfh-wildau.de/~pboettch/

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#4 lore raw

Re: [linux-dvb] getting rid of input dev in dvb-usb (was: Re: [PATCH] Add remote control support to Nova-TD (52009))

Quoted 18 lines · Patrick Boettcher
Quoted 8 lines · Torgeir Veimo
Quoted 5 lines · Patrick Boettcher
Quoted 5 lines

This patch is against the 2.6.26.5 kernel, and adds remote control support for the Hauppauge WinTV Nova-TD (Diversity) model. (That's the 52009 version.) It also adds the key-codes for the credit-card style remote control that comes with this particular adapter.

Quoted 7 lines
Quoted 1 line

Committed and ask to be pulled, thanks.

Am curious, would it be possible to augment these drivers to provide the raw IR codes on a raw hid device, eg. /dev/hidraw0 etc, so that other RC5 remotes than the ones that actually are sold with the card can be used with the card?

Quoted 8 lines

I would love that idea. Maybe this is the solution I have searched for so long. I desparately want to put those huge remote-control- table into user-space.

If hidraw is the right way, I'm with you. So far I wasn't sure what to do?!

How would it work with the key-table onces it is done with hidraw?

I'm not sure if I'm the right person to answer that. But at least I could use lircd with /dev/hidraw0 and I would be able to configure filtering of IR events as I please.

Maybe a generic table could be set in an input device by cat'ing the table in some format to a /sys/../ file.

Signature · 11 lines
Torgeir Veimo
[email protected]





_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
#5 lore raw

Re: [linux-dvb] getting rid of input dev in dvb-usb (was: Re: [PATCH] Add remote control support to Nova-TD (52009))

In reply to Patrick Boettcher
Quoted 18 lines · Patrick Boettcher
Quoted 9 lines · Torgeir Veimo
Quoted 6 lines · Patrick Boettcher
Quoted 5 lines

This patch is against the 2.6.26.5 kernel, and adds remote control support for the Hauppauge WinTV Nova-TD (Diversity) model. (That's the 52009 version.) It also adds the key-codes for the credit-card style remote control that comes with this particular adapter.

Quoted 6 lines
Quoted 1 line

Committed and ask to be pulled, thanks.

Am curious, would it be possible to augment these drivers to provide the raw IR codes on a raw hid device, eg. /dev/hidraw0 etc, so that other RC5 remotes than the ones that actually are sold with the card can be used with the card?

Quoted 8 lines

I would love that idea. Maybe this is the solution I have searched for so long. I desparately want to put those huge remote-control-table into user-space.

If hidraw is the right way, I'm with you. So far I wasn't sure what to do?!

How would it work with the key-table onces it is done with hidraw?

Patrick,

If implemented properly, key code tables can be replaced anytime in userspace.

We have already a tool for this, under v4l2-apps/util. It is called keytable. The tool can be used to get the current key association of an input device, generating a text file, or to load a text file into an input device.

When you build the tool, the Makefile will parse several keycode tables already existing on V4L and at the common IR files, writing them into keycodes/ dir. It would be really easy to parse other files and create their tables as well.

Cheers,
Mauro

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#6 lore raw

Re: [linux-dvb] getting rid of input dev in dvb-usb (was: Re: [PATCH] Add remote control support to Nova-TD (52009))

In reply to Patrick Boettcher
Quoted 14 lines · Patrick Boettcher
Quoted 12 lines · Torgeir Veimo
Quoted 7 lines · Patrick Boettcher
Quoted 5 lines

This patch is against the 2.6.26.5 kernel, and adds remote control support for the Hauppauge WinTV Nova-TD (Diversity) model. (That's the 52009 version.) It also adds the key-codes for the credit-card style remote control that comes with this particular adapter.

Committed and ask to be pulled, thanks.

Quoted 8 lines
Quoted 3 lines

Am curious, would it be possible to augment these drivers to provide the raw IR codes on a raw hid device, eg. /dev/hidraw0 etc, so that other RC5 remotes than the ones that actually are sold with the card can be used with the card?

I would love that idea. Maybe this is the solution I have searched for so long. I desparately want to put those huge remote-control-table into user-space.

I'd also vote for this, the problem I experienced is that the timer api has problems at the
deinitialization if the polling rate is too high. I read alot other remote control code too even
figured out a bug in the i2c-kbd-dev module and submitted the situation about it.

It's also commonly that the same USBid have different remote controls using the same protocol (eg rc5, although
64bit keycodes are also coming up and those keymaps are just designed for 32bit matching keys.

Markus

Quoted 7 lines

If hidraw is the right way, I'm with you. So far I wasn't sure what to do?!

How would it work with the key-table onces it is done with hidraw?

Patrick.

Quoted 9 lines

--
Mail: [email protected]
WWW: http://www.wi-bw.tfh-wildau.de/~pboettch/

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#7 lore raw
In reply to Torgeir Veimo
Quoted 6 lines · On Thursday 25 September 2008 11:56:02 Torgeir Veimo wrote:
Quoted 5 lines · Patrick Boettcher
Quoted 4 lines

This patch is against the 2.6.26.5 kernel, and adds remote control support for the Hauppauge WinTV Nova-TD (Diversity) model. (That's the 52009 version.) It also adds the key-codes for the credit-card style remote control that comes with this particular adapter.

Quoted 6 lines
Quoted 1 line

Committed and ask to be pulled, thanks.

Am curious, would it be possible to augment these drivers to provide the raw IR codes on a raw hid device, eg. /dev/hidraw0 etc, so that other RC5 remotes than the ones that actually are sold with the card can be used with the card?

There will be soon either LIRC in kernel, or another solution to send IR codes through the input layer from Jon Smirl.

We should convert all custom remote code once one of the above is merged.

Janne

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#8 lore raw
In reply to Patrick Boettcher
Quoted 1 line · Patrick Boettcher

Committed and ask to be pulled, thanks.

Thanks. However, as a further thought, I did notice that I was able to control my new Nova-TD using the same remote control as my Nova-T, and that the dvb-usb-dib0700 driver also recognised the codes for three other remote controls as well! Aren't we opening the door to "remote control wars" by just concatenating the codes from several different remotes into one big list called dib0700_rc_keys[]? Wouldn't it be better to allow the user to pick just one of the available remotes somehow? Maybe we need an array of dvb_usb_rc_key structures instead?

Mind you, I don't know what kind of selection API would be most appropriate. A module parameter would probably work, but I can imagine that a user might want to switch remotes more easily than by reloading the kernel module.

Cheers,
Chris

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#9 lore raw

[text wrapped to <80 columns]

I demand that Chris Rankin may or may not have written...

[snip]

Quoted 5 lines

Aren't we opening the door to "remote control wars" by just concatenating the codes from several different remotes into one big list called dib0700_rc_keys[]? Wouldn't it be better to allow the user to pick just one of the available remotes somehow? Maybe we need an array of dvb_usb_rc_key structures instead?

It needs to be converted to use the IR input helper code (drivers/media/common/ir-{functions,keymaps}.c & <media/ir-common.h>).

[snip]

Signature · 10 lines
| Darren Salt    | linux or ds at              | nr. Ashington, | Toon
| RISC OS, Linux | youmustbejoking,demon,co,uk | Northumberland | Army
| + Lobby friends, family, business, government.    WE'RE KILLING THE PLANET.

Are you addicted to taglines? Call Tagliners Anonymous *now*!

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb