* budget_ci / rc-hauppauge / inputlirc /Linux 3.0+ broken
@ 2011-12-17 6:33 Brian May
2011-12-17 11:16 ` Mauro Carvalho Chehab
0 siblings, 1 reply; 3+ messages in thread
From: Brian May @ 2011-12-17 6:33 UTC (permalink / raw)
To: linux-media
Hello,
Have noticed this combination is broken.
Upgrading to a 3.1.2 kernel doesn't help, but downgrading to 2.6.28
and it works fine.
RAW DATA:
root@oncilla:~# ir-keytable
Found /sys/class/rc/rc0/ (/dev/input/event5) with:
Driver budget_ci, table rc-hauppauge
Supported protocols:
Enabled protocols:
Repeat delay = 500 ms, repeat period = 125 ms
root@oncilla:~# ir-keytable -r
scancode 0x0000 = KEY_0 (0x0b)
scancode 0x0001 = KEY_1 (0x02)
scancode 0x0002 = KEY_2 (0x03)
scancode 0x0003 = KEY_3 (0x04)
scancode 0x0004 = KEY_4 (0x05)
scancode 0x0005 = KEY_5 (0x06)
scancode 0x0006 = KEY_6 (0x07)
scancode 0x0007 = KEY_7 (0x08)
scancode 0x0008 = KEY_8 (0x09)
scancode 0x0009 = KEY_9 (0x0a)
scancode 0x000a = KEY_TEXT (0x184)
scancode 0x000b = KEY_RED (0x18e)
scancode 0x000c = KEY_RADIO (0x181)
scancode 0x000d = KEY_MUTE (0x71)
scancode 0x000e = KEY_SUBTITLE (0x172)
scancode 0x000f = KEY_MUTE (0x71)
scancode 0x0010 = KEY_VOLUMEUP (0x73)
scancode 0x0011 = KEY_VOLUMEDOWN (0x72)
scancode 0x0012 = KEY_PREVIOUS (0x19c)
scancode 0x0014 = KEY_UP (0x67)
scancode 0x0015 = KEY_DOWN (0x6c)
scancode 0x0016 = KEY_LEFT (0x69)
scancode 0x0017 = KEY_RIGHT (0x6a)
scancode 0x0018 = KEY_VIDEO (0x189)
scancode 0x0019 = KEY_AUDIO (0x188)
scancode 0x001a = KEY_CAMERA (0xd4)
scancode 0x001b = KEY_EPG (0x16d)
scancode 0x001c = KEY_TV (0x179)
scancode 0x001e = KEY_RED (0x18e)
scancode 0x001f = KEY_TV (0x179)
scancode 0x0020 = KEY_CHANNELUP (0x192)
scancode 0x0021 = KEY_CHANNELDOWN (0x193)
scancode 0x0022 = KEY_VIDEO (0x189)
scancode 0x0024 = KEY_LAST (0x195)
scancode 0x0025 = KEY_OK (0x160)
scancode 0x0026 = KEY_SLEEP (0x8e)
scancode 0x0029 = KEY_BLUE (0x191)
scancode 0x002e = KEY_ZOOM (0x174)
scancode 0x0030 = KEY_PAUSE (0x77)
scancode 0x0032 = KEY_REWIND (0xa8)
scancode 0x0034 = KEY_FASTFORWARD (0xd0)
scancode 0x0035 = KEY_PLAY (0xcf)
scancode 0x0036 = KEY_STOP (0x80)
scancode 0x0037 = KEY_RECORD (0xa7)
scancode 0x0038 = KEY_YELLOW (0x190)
scancode 0x003b = KEY_GOTO (0x162)
scancode 0x003c = KEY_ZOOM (0x174)
scancode 0x003d = KEY_POWER (0x74)
scancode 0x003f = KEY_HOME (0x66)
Enabled protocols:
root@oncilla:~# ir-keytable -t
Testing events. Please, press CTRL-C to abort.
1324089674.313994: event MSC: scancode = 1f21
1324089674.313995: event sync
1324089674.689301: event MSC: scancode = 1f21
1324089674.689303: event sync
1324089674.948084: event MSC: scancode = 1f21
1324089674.948085: event sync
1324089675.230977: event MSC: scancode = 1f21
1324089675.230978: event sync
1324089675.489673: event MSC: scancode = 1f21
1324089675.489674: event sync
1324089675.806055: event MSC: scancode = 1f21
1324089675.806057: event sync
SUMMARY OF WHAT I THINK I HAPPENING:
budget_ci sets dev->scanmask to 0xff, this means the scancodes in the
tables have the upper 8 bits of the 16 bit code set to 0.
However for my card, it sets full_rc5 to True and rc_device to 0x1f.
This means the following new code gets executed:
if (budget_ci->ir.full_rc5) {
rc_keydown(dev,
budget_ci->ir.rc5_device <<8 | budget_ci->ir.ir_key,
(command & 0x20) ? 1 : 0);
return;
}
Where as before this code would get executed:
rc_keydown(dev, budget_ci->ir.ir_key, (command & 0x20) ? 1 : 0);
The result is that it tries to lookup (in this case) 0x1f21 in the
scancode table, which is a copy of rc-hauppauge but with the upper 8
bits of the scan code set to 0; the result is it can't find a match.
Does this sound right?
Maybe scanmask shouldn't be set to 0xff if full_rc5 is set to true?
LATER:
I deleted the line that sets dev->scanmask to 0xff in budget_ci,
recompiled, and now everything works.
Now all the table entries in rc-hauppauge.c appear in the output of
"ir-keytable -r" with the scan codes intact, and the kernel gives the
button presses correctly to inputlirc.
Please CC responses to me, thanks.
--
Brian May <brian@microcomaustralia.com.au>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: budget_ci / rc-hauppauge / inputlirc /Linux 3.0+ broken
2011-12-17 6:33 budget_ci / rc-hauppauge / inputlirc /Linux 3.0+ broken Brian May
@ 2011-12-17 11:16 ` Mauro Carvalho Chehab
2011-12-17 23:45 ` Brian May
0 siblings, 1 reply; 3+ messages in thread
From: Mauro Carvalho Chehab @ 2011-12-17 11:16 UTC (permalink / raw)
To: Brian May; +Cc: linux-media
Hi Brian,
Em 17-12-2011 04:33, Brian May escreveu:
> SUMMARY OF WHAT I THINK I HAPPENING:
>
> budget_ci sets dev->scanmask to 0xff, this means the scancodes in the
> tables have the upper 8 bits of the 16 bit code set to 0.
>
> However for my card, it sets full_rc5 to True and rc_device to 0x1f.
> This means the following new code gets executed:
>
> if (budget_ci->ir.full_rc5) {
> rc_keydown(dev,
> budget_ci->ir.rc5_device <<8 | budget_ci->ir.ir_key,
> (command & 0x20) ? 1 : 0);
> return;
> }
>
>
> Where as before this code would get executed:
>
> rc_keydown(dev, budget_ci->ir.ir_key, (command & 0x20) ? 1 : 0);
>
> The result is that it tries to lookup (in this case) 0x1f21 in the
> scancode table, which is a copy of rc-hauppauge but with the upper 8
> bits of the scan code set to 0; the result is it can't find a match.
>
> Does this sound right?
>
> Maybe scanmask shouldn't be set to 0xff if full_rc5 is set to true?
Yes.
could you please try the enclosed patch?
Thanks!
Mauro
-
[PATCH] [media] budget-ci: Fix Hauppauge RC-5 IR support
Hauppauge RC-5 tables require the full scancodes. The code at budget-ci
handles it right, however, it request the rc-code to mask them with 0xff,
breaking support for some remote controllers.
Fix it by not selecting a scancode mask when the driver is on full_rc5 mode.
Reported-by: Brian May <brian@microcomaustralia.com.au>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
diff --git a/drivers/media/dvb/ttpci/budget-ci.c
b/drivers/media/dvb/ttpci/budget-ci.c
index ca02e97..ab180f9 100644
--- a/drivers/media/dvb/ttpci/budget-ci.c
+++ b/drivers/media/dvb/ttpci/budget-ci.c
@@ -193,7 +193,6 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
dev->input_phys = budget_ci->ir.phys;
dev->input_id.bustype = BUS_PCI;
dev->input_id.version = 1;
- dev->scanmask = 0xff;
if (saa->pci->subsystem_vendor) {
dev->input_id.vendor = saa->pci->subsystem_vendor;
dev->input_id.product = saa->pci->subsystem_device;
@@ -234,6 +233,8 @@ static int msp430_ir_init(struct budget_ci *budget_ci)
dev->map_name = RC_MAP_BUDGET_CI_OLD;
break;
}
+ if (!budget_ci->ir.full_rc5)
+ dev->scanmask = 0xff;
error = rc_register_device(dev);
if (error) {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: budget_ci / rc-hauppauge / inputlirc /Linux 3.0+ broken
2011-12-17 11:16 ` Mauro Carvalho Chehab
@ 2011-12-17 23:45 ` Brian May
0 siblings, 0 replies; 3+ messages in thread
From: Brian May @ 2011-12-17 23:45 UTC (permalink / raw)
To: Mauro Carvalho Chehab; +Cc: linux-media
On 17 December 2011 22:16, Mauro Carvalho Chehab <mchehab@redhat.com> wrote:
> could you please try the enclosed patch?
Yes, it seems to work fine for me.
Thanks.
--
Brian May <brian@microcomaustralia.com.au>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-12-17 23:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-12-17 6:33 budget_ci / rc-hauppauge / inputlirc /Linux 3.0+ broken Brian May
2011-12-17 11:16 ` Mauro Carvalho Chehab
2011-12-17 23:45 ` Brian May
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.