[linux-dvb] [PATCH] budget-ci IR handling fixups

Oliver Endriss o.endriss at gmx.de
Tue Feb 13 06:29:09 CET 2007


David Härdeman wrote:
> On Sun, Feb 11, 2007 at 06:48:27AM +0100, Oliver Endriss wrote:
> >David Härdeman wrote:
> >> Changeset 6562d27de0d7 [1] by Oliver Endriss changed the budget-ci 
> >> driver to use interrupt mode for i2c transfers.
> >> 
> >> This also meant that a new bunch of IR bytes that were previously lost 
> >> are now received, which allowed me to better understand how the MSP430
> >> chip works. Unfortunately it also means that the current driver gets 
> >> some assumptions wrong and might generate double keypresses for one IR 
> >> command.
> >> 
> >> The attached patch fixes this by throwing away the repeat bytes and by 
> >> associating the correct command and device bytes. Please apply.
> >
> >Since I am not able to test the patch, I'd like to verify that the
> >patched driver creates correct input events.
> 
> I wrote the old IR handling code that is currently in the unpatched 
> driver (based on the work of Darren Salt). I've already verified on my 
> own MythTV box that the patched driver does the right thing. Without the 
> patch, the IR handling doesn't work at all or creates repeated events at 
> the moment.

Well, it might be better but it is not correct yet. ;-)
See below.

> >Would you please post the output of the evtest tool for
> >- a short key press (no key repeat)
> Input driver version is 1.0.0
> Input device ID: bus 0x1 vendor 0x13c2 product 0x1010 version 0x1
> Input device name: "Budget-CI dvb ir receiver saa7146 (0)"
> Supported events:
>   Event type 0 (Reset)
>     Event code 0 (Reset)
>     Event code 1 (Key)
>   Event type 1 (Key)
>     Event code 0 (Reserved)
>     Event code 1 (Esc)
>     Event code 2 (1)
> <snip>
>     Event code 109 (PageDown)
>     Event code 116 (Power)
> Testing ... (interrupt to exit)
> <short keypress button "right">
> Event: time 1171327747.288858, type 1 (Key), code 106 (Right), value 1
> Event: time 1171327747.288862, type 0 (Reset), code 0 (Reset), value 0
> Event: time 1171327747.288864, type 1 (Key), code 106 (Right), value 0
> Event: time 1171327747.288864, type 0 (Reset), code 0 (Reset), value 0

Ok.

> >- a long key press (key repeat)
> <long keypress button "up">
> Event: time 1171327812.339208, type 1 (Key), code 103 (Up), value 1
> Event: time 1171327812.339213, type 0 (Reset), code 0 (Reset), value 0
> Event: time 1171327812.339214, type 1 (Key), code 103 (Up), value 0
> Event: time 1171327812.339214, type 0 (Reset), code 0 (Reset), value 0
>
> Event: time 1171327812.544223, type 1 (Key), code 103 (Up), value 1
> Event: time 1171327812.544228, type 0 (Reset), code 0 (Reset), value 0
> Event: time 1171327812.544229, type 1 (Key), code 103 (Up), value 0
> Event: time 1171327812.544232, type 0 (Reset), code 0 (Reset), value 0
>
> Event: time 1171327812.760376, type 1 (Key), code 103 (Up), value 1
> Event: time 1171327812.760378, type 0 (Reset), code 0 (Reset), value 0
> Event: time 1171327812.760381, type 1 (Key), code 103 (Up), value 0
> Event: time 1171327812.760382, type 0 (Reset), code 0 (Reset), value 0
>
> Event: time 1171327812.932262, type 1 (Key), code 103 (Up), value 1
> Event: time 1171327812.932264, type 0 (Reset), code 0 (Reset), value 0
> Event: time 1171327812.932268, type 1 (Key), code 103 (Up), value 0
> Event: time 1171327812.932269, type 0 (Reset), code 0 (Reset), value 0
>
> Event: time 1171327813.167067, type 1 (Key), code 103 (Up), value 1
> Event: time 1171327813.167069, type 0 (Reset), code 0 (Reset), value 0
> Event: time 1171327813.167073, type 1 (Key), code 103 (Up), value 0
> Event: time 1171327813.167073, type 0 (Reset), code 0 (Reset), value 0
> ...

Obviously you have very fast fingers. :-)

Sorry, it is not correct. Should look like

> Event: time 1171327812.339208, type 1 (Key), code 103 (Up), value 1
> Event: time 1171327812.339213, type 0 (Reset), code 0 (Reset), value 0
>
> Event: time 1171327812.339214, type 1 (Key), code 103 (Up), value 2
> Event: time 1171327812.339214, type 0 (Reset), code 0 (Reset), value 0
>
> Event: time 1171327812.544223, type 1 (Key), code 103 (Up), value 2
> Event: time 1171327812.544228, type 0 (Reset), code 0 (Reset), value 0
>
> Event: time 1171327812.544229, type 1 (Key), code 103 (Up), value 2
> Event: time 1171327812.544232, type 0 (Reset), code 0 (Reset), value 0
>
> Event: time 1171327812.760376, type 1 (Key), code 103 (Up), value 2
> Event: time 1171327812.760378, type 0 (Reset), code 0 (Reset), value 0
>
> ...
>
> Event: time 1171327813.167067, type 1 (Key), code 103 (Up), value 2
> Event: time 1171327813.167069, type 0 (Reset), code 0 (Reset), value 0
>
> Event: time 1171327813.167073, type 1 (Key), code 103 (Up), value 0
> Event: time 1171327813.167073, type 0 (Reset), code 0 (Reset), value 0

For a long keypress the driver must produce '1-2-2-2-2-...-2-0' Key
events (Reset events omitted).

1-0-1-0-1-0-1-0 means that the key has been pressed 4 times.
Have a look at the output of the linux keyboard driver.

CU

Oliver

-- 
--------------------------------------------------------
VDR Remote Plugin 0.3.9 available at
http://www.escape-edv.de/endriss/vdr/
--------------------------------------------------------




More information about the linux-dvb mailing list