Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Problem with av7110_ir module
I am already playing arround since two days, and I do not know what else to do.
I have a Hauppauge WinTV Nexus-S installed here, and I can't get the remote
control to work properly:
- Kernel 2.6.8.1 (with activated event-interface)
- lirc-0.7.0_pre7 (with LIRC_OPTS=--with-driver=devinput)
- The silver-grey Hauppauge remote control with the color buttons
- Remote receiver connected to the Nexus-S
- Reading from AV7110 & event-interface
To not have the event-interface forward the signals from the remote control
unit through the keyboard-driver to the console, I have patched the
kernel's keyboard.c:
-----
+ if (dev->name[0]=='D' && dev->name[1]=='V' && dev->name[2] == 'B')
+ return NULL;
+
if (!(handle = kmalloc(sizeof(struct input_handle), GFP_KERNEL)))
return NULL;
memset(handle, 0, sizeof(struct input_handle));[/code]
-----
This results in kbd not showing up as event-handler at the input-device:
-----
root # cat /proc/bus/input/devices
I: Bus=0000 Vendor=0000 Product=0000 Version=0000
N: Name="DVB on-card IR receiver"
P: Phys=
H: Handlers=event2
B: EV=100003
B: KEY=3883c000 2045 0 0 0 0 0 4180 801 921680 0 0 ffc
-----
/proc/av7100_ir has been loaded with hauppauge_grey.rc5 and lircd was
started with LIRCD_OPTS="-d /dev/input/event2".
Generally it is working, but I have that nasty key-double-hit-problem. If
pressing a button carefully and really only for a very short time, irw is
showing the event as single key-press, but as soon as I hit a button
normally (as you usually do), the key-event gets registered twice, which
results in the typical key-double-hit.
The following shows the problem with irw:
-----
root # irw
000000008001006c 00 Ch- hauppauge_pvr
000000008001006c 00 Ch- hauppauge_pvr
-----
The button Ch- was pressed only once, but shows up twice. The "00" normally
should show a repeated event in such a case, but it does not, what makes me
believe, that the event does not get registered correctly, because the
follow output shows this experiment in the system-log:
-----
0.7.0pre7[26004]: accepted new client on /dev/lircd
0.7.0pre7[26004]: initializing '/dev/input/event2'
0.7.0pre7[26004]: devinput_rec
0.7.0pre7[26004]: time 1095776329.495043 type 1 code 108 value 1
0.7.0pre7[26004]: code 8001006c
0.7.0pre7[26004]: devinput_decode
0.7.0pre7[26004]: devinput_rec
0.7.0pre7[26004]: time 1095776329.607626 type 1 code 108 value 2
0.7.0pre7[26004]: code 8001006c
0.7.0pre7[26004]: devinput_decode
0.7.0pre7[26004]: devinput_rec
0.7.0pre7[26004]: time 1095776329.857182 type 1 code 108 value 0
0.7.0pre7[26004]: code 0001006c
0.7.0pre7[26004]: devinput_decode
0.7.0pre7[26004]: removed client
0.7.0pre7[26004]: closing '/dev/input/event2'
-----
I have the feeling, that the sensibility is to high, because also the
button was pressed only for a short time, the event gets registered with
"value 2", which is causing the event showing up twice in irw.
Strangely the output of lirc in the system-log at least shows up correctly,
concerning the status of the button (so value 0 for release, value 1 for
press, value 2 for hold), but not the output of irw, because there it
always shows "00", even if the button is hold for a longer time. I can't
tell if this is a bug, but I remember, that I have seen a message on the
lirc-mailinglist mentioning this before.
I really have no idea, what to do now. With the RCU acting this way, it can
not be used in a usefull way, because most of the time a button press
results in a double-key-hit.
Can this problem somehow be solved with configuration in /etc/lircd.conf???
My lircd.conf is like this (it's the well known standard file for the
hauppauge_grey):
-----
begin remote
name hauppauge_pvr
bits 13
flags RC5|CONST_LENGTH
eps 30
aeps 100
one 969 811
zero 969 811
plead 1097
gap 114605
toggle_bit 2
begin codes
Power 0x80010074
Go 0x80010162
1 0x80010002
2 0x80010003
3 0x80010004
4 0x80010005
5 0x80010006
6 0x80010007
7 0x80010008
8 0x80010009
9 0x8001000a
Back/Exit 0x800100ae
0 0x8001000b
Menu 0x8001008b
Red 0x8001018e
Green 0x8001018f
Yellow 0x80010190
Blue 0x80010191
Ch+ 0x80010067
Ch- 0x8001006c
Vol- 0x80010069
Vol+ 0x8001006a
Ok 0x80010160
Mute 0x80010071
Blank 0x80010166
Full 0x8001016d
Rewind 0x800100a8
Play 0x80010197
Forward 0x8001019b
Record 0x800100a7
Stop 0x80010080
Pause 0x80010077
Replay 0x8001019c
Skip 0x8001019d
end codes
end remote
-----
Unfortunately I have no idea, which options I could test with which values.
I have read about something with "repeat" and "delay", but that was of no
success as far as I can remember.
In the meantime someone told me, that it may have something to do with the
av7110_ir module. I tried the DVB drivers, that came with kernel 2.6.8.1,
but as I saw a message during boot, telling me that I should update the
driver to have something corrected concerning sysfs, I swapped over to the
actual cvs-version. I found the following patch on the internet, but that
one even made it worse, increasing the sensibilty even more, so that every
keypress is registered up to 4 times at once (that patch was not tested by
the creator, so it was just worth a try):
-----
--- 2.6.8.1/drivers/media/dvb/ttpci/av7110_ir.c 2004-08-18
15:12:15.834124800 -0500
+++ linux-2.6.8.1/drivers/media/dvb/ttpci/av7110_ir.c 2004-09-23
12:25:02.135598400 -0500
@@ -45,7 +45,7 @@
if (!data || !test_bit(data, input_dev.key))
return;
- input_event(&input_dev, EV_KEY, data, !!0);
+ input_event(&input_dev, EV_KEY, data, 0);
}
@@ -59,6 +59,7 @@
static u16 old_toggle = 0;
u16 new_toggle;
u16 keycode;
+ static unsigned long button_down;
/* extract device address and data */
if (ir_config & 0x0001) {
@@ -94,17 +95,22 @@
if (timer_pending(&keyup_timer)) {
del_timer(&keyup_timer);
if (keyup_timer.data != keycode || new_toggle !=
old_toggle) {
- input_event(&input_dev, EV_KEY, keyup_timer.data,
!!0);
- input_event(&input_dev, EV_KEY, keycode, !0);
- } else
- input_event(&input_dev, EV_KEY, keycode, 2);
-
- } else
- input_event(&input_dev, EV_KEY, keycode, !0);
+ input_event(&input_dev, EV_KEY, keyup_timer.data, 0);
+ input_event(&input_dev, EV_KEY, keycode, 1);
+ button_down = jiffies;
+ } else {
+ if (time_before(jiffies, button_down +
msecs_to_jiffies(input_dev.rep[REP_DELAY]) / 2))
+ input_event(&input_dev, EV_KEY, keycode, 1);
+ else
+ input_event(&input_dev, EV_KEY, keycode, 2);
+ }
+ } else {
+ input_event(&input_dev, EV_KEY, keycode, 1);
+ button_down = jiffies;
+ }
keyup_timer.expires = jiffies + UP_TIMEOUT;
keyup_timer.data = keycode;
-
add_timer(&keyup_timer);
old_toggle = new_toggle;
@@ -125,12 +131,6 @@
}
-static void input_repeat_key(unsigned long data)
-{
- /* dummy routine to disable autorepeat in the input driver */
-}
-
-
static int av7110_ir_write_proc(struct file *file, const char __user
*buffer,
unsigned long count, void *data)
{
@@ -174,9 +174,8 @@
set_bit(EV_REP, input_dev.evbit);
input_register_keys();
input_register_device(&input_dev);
- input_dev.timer.function = input_repeat_key;
av7110_setup_irc_config(NULL, 0x0001);
av7110_register_irc_handler(av7110_emit_key);
-----
But due to these tests I came to the conclusion, that the problem itself is
not related to lirc, so it should be able to be solved by "correcting"
av7110_ir.c with a patch, to finally be able to use my RCU in a usefull way.
Any input is welcome, maybe someone can come up with the right way to fix
that issue, and it also may get into the official development.
BTW I am really wondering, that noone else seems to have such a problem.
--
Sincerely,
Master One
Home |
Main Index |
Thread Index