public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Where is the v4l remote howto?  (kworld 110)
@ 2009-04-20 13:46 stuart
  2009-04-20 15:12 ` Dwaine Garden VE3GIF
  0 siblings, 1 reply; 3+ messages in thread
From: stuart @ 2009-04-20 13:46 UTC (permalink / raw)
  To: video4linux-list


Hi...

Remote control for tuner cards appears dicey and a bit confusing.  My 
impression is that it's no were near as rock solid as the efforts here 
(@ v4l) to support the tuner portion of the cards.  So I've always been 
willing to put in some work.  When I used an analog happauge tuner card 
I went to some length to get lirc working.  Now as I switch to digital, 
I find my self wanting to use an old but well supported kworld 110 ATSC 
tuner.  I assume this means I will be using v4l keyboard events instead 
of the lirc kernel modules.  However, I've not found a good source of 
information as to how to go about this.  It's more likely I haven't 
googled properly.  Can anyone point me in the right direction?

...thanks


--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Where is the v4l remote howto?  (kworld 110)
  2009-04-20 13:46 Where is the v4l remote howto? (kworld 110) stuart
@ 2009-04-20 15:12 ` Dwaine Garden VE3GIF
  2009-04-21  3:29   ` stuart
  0 siblings, 1 reply; 3+ messages in thread
From: Dwaine Garden VE3GIF @ 2009-04-20 15:12 UTC (permalink / raw)
  To: stuart, video4linux-list

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

Here is the original patch that I had.  It worked, just the repeat keys did not work.   It has not been compiled against a recent kernel though, so it might need to small patching to compile.






________________________________
From: stuart <stuart@xnet.com>
To: video4linux-list@redhat.com
Sent: Monday, April 20, 2009 9:46:39 AM
Subject: Where is the v4l remote howto?  (kworld 110)


Hi...

Remote control for tuner cards appears dicey and a bit confusing.  My impression is that it's no were near as rock solid as the efforts here (@ v4l) to support the tuner portion of the cards.  So I've always been willing to put in some work.  When I used an analog happauge tuner card I went to some length to get lirc working.  Now as I switch to digital, I find my self wanting to use an old but well supported kworld 110 ATSC tuner.  I assume this means I will be using v4l keyboard events instead of the lirc kernel modules.  However, I've not found a good source of information as to how to go about this.  It's more likely I haven't googled properly.  Can anyone point me in the right direction?

...thanks


--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

[-- Attachment #2: kworld-atsc110-ir-remote.patch --]
[-- Type: application/octet-stream, Size: 6918 bytes --]

diff -U 3 -H -d -r -N -- a/linux/drivers/media/common/ir-keymaps.c b/linux/drivers/media/common/ir-keymaps.c
--- a/linux/drivers/media/common/ir-keymaps.c	2007-01-13 16:59:28.000000000 -0500
+++ b/linux/drivers/media/common/ir-keymaps.c	2007-01-13 17:05:03.000000000 -0500
@@ -1828,3 +1828,57 @@
 };
 
 EXPORT_SYMBOL_GPL(ir_codes_tt_1500);
+
+IR_KEYTAB_TYPE ir_codes_kworld_atsc110[IR_KEYTAB_SIZE] = {
+        [ 0x0 ] = KEY_1,
+        [ 0x1 ] = KEY_2,
+        [ 0x2 ] = KEY_3,
+        [ 0x3 ] = KEY_4,
+        [ 0x4 ] = KEY_5,
+        [ 0x5 ] = KEY_6,
+        [ 0x6 ] = KEY_7,
+        [ 0x7 ] = KEY_8,
+        [ 0x8 ] = KEY_9,
+        [ 0xa ] = KEY_0,
+        [ 0x9 ] = KEY_ESC,              /* UP ARROW */
+        [ 0xc ] = KEY_POWER,            /* POWER */
+        [ 0x0a ] = KEY_MUTE,            /* MUTE */
+        [ 0x0b ] = KEY_SEARCH,		/* SEARCH */
+        [ 0x0d ] = KEY_EPG,             /* GUIDE */
+        [ 0x1b ] = KEY_RECORD,          /* RECORD */
+        [ 0x16 ] = KEY_PAUSE,           /* PAUSE */
+        [ 0x1a ] = KEY_STOP,            /* STOP */
+        [ 0x1d ] = KEY_VOLUMEDOWN,      /* VOLUME- */
+        [ 0x1c ] = KEY_VOLUMEUP,        /* VOLUME+ */
+        [ 0x1f ] = KEY_CHANNELDOWN,     /* CHANNEL/PAGE- */
+        [ 0x1e ] = KEY_CHANNELUP,       /* CHANNEL/PAGE+ */
+        [ 0x10 ] = KEY_UP,              /* KEY_SCROLLUP */
+        [ 0x12 ] = KEY_LEFT,            /* KEY_BACK */
+        [ 0xe  ] = KEY_ENTER,           /* KEY_ENTER */
+        [ 0x13 ] = KEY_RIGHT,           /* KEY_FORWARD */
+        [ 0x11 ] = KEY_DOWN,            /* KEY_SCROLLDOWN */
+        [ 0x14 ] = KEY_MUTE,            /* MUTE */
+        [ 0x15 ] = KEY_AUDIO,           /* STEREO */
+        [ 0x16 ] = KEY_VIDEO,           /* SOURCE */
+        [ 0x17 ] = KEY_ZOOM,            /* ZOOM */
+        [ 0x18 ] = KEY_PRINT,           /* SHUTDOWN */
+        [ 0X19 ] = KEY_T,               /* TIMESHIFT */
+        [ 0x44 ] = KEY_PLAYPAUSE,       /* PAUSE/PLAY */
+        [ 0x45 ] = KEY_STOP,            /* STOP */
+        [ 0x40 ] = KEY_REWIND,          /* REWIND */
+        [ 0x41 ] = KEY_FORWARD,         /* FASTFORWARD */
+        [ 0x42 ] = KEY_PREVIOUSSONG,    /* PREVIOUS */
+        [ 0x43 ] = KEY_NEXTSONG,        /* NEXT */
+
+        // buttons a-h
+        [ 0x48 ] = KEY_A, 
+        [ 0x49 ] = KEY_B,
+        [ 0x4a ] = KEY_C,
+        [ 0x4b ] = KEY_D,
+        [ 0x4c ] = KEY_E,
+        [ 0x4d ] = KEY_F,
+        [ 0x4e ] = KEY_G,
+        [ 0x4f ] = KEY_H
+};
+
+EXPORT_SYMBOL_GPL(ir_codes_kworld_atsc110);
diff -U 3 -H -d -r -N -- a/linux/drivers/media/video/ir-kbd-i2c.c b/linux/drivers/media/video/ir-kbd-i2c.c
--- a/linux/drivers/media/video/ir-kbd-i2c.c	2007-01-13 16:59:28.000000000 -0500
+++ b/linux/drivers/media/video/ir-kbd-i2c.c	2007-01-13 18:27:54.000000000 -0500
@@ -62,6 +62,8 @@
 
 /* ----------------------------------------------------------------------- */
 
+static int kworldatsc110 = 0; /* Both KNC1 and the Kworld ATSC110 cards use the same i2c address */
+
 static int get_key_haup(struct IR_i2c *ir, u32 *ir_key, u32 *ir_raw)
 {
 	unsigned char buf[3];
@@ -144,14 +146,17 @@
 
 	/* it seems that 0xFE indicates that a button is still hold
 	   down, while 0xff indicates that no button is hold
-	   down. 0xfe sequences are sometimes interrupted by 0xFF */
+	   down. 0xfe and 0x80 sequences are sometimes interrupted by 0xFF */
 
 	dprintk(2,"key %02x\n", b);
 
 	if (b == 0xff)
 		return 0;
 
-	if (b == 0xfe)
+        /* KNC1 card            = 0xfe */
+        /* Kworld ATSC110 card  = 0x80 */
+
+	if ((b == 0xfe)||(b & 0x80))
 		/* keep old data */
 		return 1;
 
@@ -364,10 +369,15 @@
 		}
 		break;
 	case 0x30:
-		name        = "KNC One";
 		ir->get_key = get_key_knc1;
 		ir_type     = IR_TYPE_OTHER;
-		ir_codes    = ir_codes_empty;
+		if (kworldatsc110 == 1) {
+			name        = "Kworld ATSC110";
+			ir_codes    = ir_codes_kworld_atsc110;
+		} else {
+			name        = "KNC One";
+			ir_codes    = ir_codes_empty;
+		}  
 		break;
 	case 0x7a:
 	case 0x47:
@@ -469,8 +479,8 @@
 	   That's why we probe 0x1a (~0x34) first. CB
 	*/
 
-	static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1};
-	static const int probe_saa7134[] = { 0x7a, 0x47, 0x71, -1 };
+	static const int probe_bttv[] = { 0x1a, 0x18, 0x4b, 0x64, 0x30, -1 };
+	static const int probe_saa7134[] = { 0x7a, 0x30, 0x47, 0x71, -1 };
 	static const int probe_em28XX[] = { 0x30, 0x47, -1 };
 	const int *probe = NULL;
 	struct i2c_client c;
@@ -499,6 +509,30 @@
 	for (i = 0; -1 != probe[i]; i++) {
 		c.addr = probe[i];
 		rc = i2c_master_recv(&c,&buf,0);
+
+		/* Special case for Kworld ATSC110 remote */
+		if (c.adapter->id == I2C_HW_SAA7134 && probe[i] == 0x30)
+		{
+			struct i2c_client c2;
+			
+			memset (&c2, 0, sizeof(c2));
+			c2.adapter = c.adapter;
+				
+			for (c2.addr=127; c2.addr > 0; c2.addr--) {
+				if (0 == i2c_master_recv(&c2,&buf,0)) {
+					dprintk(1,"Found another device, at addr 0x%02x\n", c2.addr);
+					break;
+				}
+			}
+
+			/* Now do the probe. The controller does not respond
+			   to 0-byte reads, so we use a 1-byte read instead. */
+			rc = i2c_master_recv(&c,&buf,1);
+			rc--;
+			kworldatsc110 = 1;
+		} else {
+			rc = i2c_master_recv(&c,&buf,0);
+		}
 		dprintk(1,"probe 0x%02x @ %s: %s\n",
 			probe[i], adap->name,
 			(0 == rc) ? "yes" : "no");
diff -U 3 -H -d -r -N -- a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c	2007-01-13 16:59:28.000000000 -0500
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c	2007-01-13 17:11:20.000000000 -0500
@@ -4175,6 +4175,9 @@
 	case SAA7134_BOARD_PINNACLE_PCTV_110i:
 	case SAA7134_BOARD_PINNACLE_PCTV_310i:
 	case SAA7134_BOARD_UPMOST_PURPLE_TV:
+	case SAA7134_BOARD_KWORLD_ATSC110:
+		dev->has_remote = SAA7134_REMOTE_I2C;
+		break;
 	case SAA7134_BOARD_HAUPPAUGE_HVR1110:
 		dev->has_remote = SAA7134_REMOTE_I2C;
 		break;
diff -U 3 -H -d -r -N -- a/linux/drivers/media/video/saa7134/saa7134-i2c.c b/linux/drivers/media/video/saa7134/saa7134-i2c.c
--- a/linux/drivers/media/video/saa7134/saa7134-i2c.c	2007-01-13 16:59:28.000000000 -0500
+++ b/linux/drivers/media/video/saa7134/saa7134-i2c.c	2007-01-13 17:12:42.000000000 -0500
@@ -350,6 +350,7 @@
 
 	switch (client->addr) {
 		case 0x7a:
+		case 0x30:
 		case 0x47:
 		case 0x71:
 		{
diff -U 3 -H -d -r -N -- a/linux/include/media/ir-common.h b/linux/include/media/ir-common.h
--- a/linux/include/media/ir-common.h	2007-01-13 16:59:28.000000000 -0500
+++ b/linux/include/media/ir-common.h	2007-01-13 17:03:46.000000000 -0500
@@ -140,6 +140,7 @@
 extern IR_KEYTAB_TYPE ir_codes_asus_pc39[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_encore_enltv[IR_KEYTAB_SIZE];
 extern IR_KEYTAB_TYPE ir_codes_tt_1500[IR_KEYTAB_SIZE];
+extern IR_KEYTAB_TYPE ir_codes_kworld_atsc110[IR_KEYTAB_SIZE];
 
 #endif
 

[-- Attachment #3: Type: text/plain, Size: 164 bytes --]

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Where is the v4l remote howto?  (kworld 110)
  2009-04-20 15:12 ` Dwaine Garden VE3GIF
@ 2009-04-21  3:29   ` stuart
  0 siblings, 0 replies; 3+ messages in thread
From: stuart @ 2009-04-21  3:29 UTC (permalink / raw)
  To: video4linux-list; +Cc: Dwaine Garden VE3GIF


Thank you Dwaine for posting this kworld 110 patch to the v4l software.

So what you are indicating is that this patch, that has been around 
going on 2 years, is still not part of the v4l distribution?  Why?  (I 
have a feeling I should not direct this question to Dwaine as much as 
toward those controlling the v4l project.)

And if v4l is not going to support the IR feature of tuner cards... 
well... is there a way to easily disable the IR part of v4l?  I mean, 
from what I can tell, v4l "gets in the way" of lirc making it impossible 
for lirc to access the IR hardware.

Dwaine, I just tried the patch on a version of v4l I pulled some time 
ago (about 8 months).  It looks like more the half the "hunks" fail. 
Guess I'll have to do some hand merging if I want this to be successful.

I'll work on this a bit more.  But now I'm wondering if this is what 
people actually do?  I mean, is it worth anyone's time to keep fixing 
v4l (patching it) each time the old v4l gets over-written by a system 
update?

I'm guessing - but are most people giving up on their tuner's IR port 
and using dedicated IR / USB dongles instead?

-thanks again Dwaine



Dwaine Garden VE3GIF wrote:
> Here is the original patch that I had.  It worked, just the repeat keys 
> did not work.   It has not been compiled against a recent kernel though, 
> so it might need to small patching to compile.
> 
> 
> 
> ------------------------------------------------------------------------
> *From:* stuart <stuart@xnet.com>
> *To:* video4linux-list@redhat.com
> *Sent:* Monday, April 20, 2009 9:46:39 AM
> *Subject:* Where is the v4l remote howto? (kworld 110)
> 
> 
> Hi...
> 
> Remote control for tuner cards appears dicey and a bit confusing.  My 
> impression is that it's no were near as rock solid as the efforts here 
> (@ v4l) to support the tuner portion of the cards.  So I've always been 
> willing to put in some work.  When I used an analog happauge tuner card 
> I went to some length to get lirc working.  Now as I switch to digital, 
> I find my self wanting to use an old but well supported kworld 110 ATSC 
> tuner.  I assume this means I will be using v4l keyboard events instead 
> of the lirc kernel modules.  However, I've not found a good source of 
> information as to how to go about this.  It's more likely I haven't 
> googled properly.  Can anyone point me in the right direction?
> 
> ...thanks
> 
> 
> --
> video4linux-list mailing list
> Unsubscribe mailto:video4linux-list-request@redhat.com 
> <mailto:video4linux-list-request@redhat.com>?subject=unsubscribe
> https://www.redhat.com/mailman/listinfo/video4linux-list

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-21  3:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-20 13:46 Where is the v4l remote howto? (kworld 110) stuart
2009-04-20 15:12 ` Dwaine Garden VE3GIF
2009-04-21  3:29   ` stuart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox