[vdr] Key-repeat or release magic in RCU drivers

Darren Salt linux at youmustbejoking.demon.co.uk
Tue Feb 7 02:17:56 CET 2006


I demand that Oliver Endriss may or may not have written...

> Marko Mäkelä wrote:
>> On Wed, Feb 01, 2006 at 09:56:40PM +0000, Darren Salt wrote:
>>> I demand that Marko Mäkelä may or may not have written...
>>>> On Wed, Feb 01, 2006 at 07:51:04PM +0100, Oliver Endriss wrote:
>>> [snip]
>>>>> (1) The repeat timer of the input layer must be turned off, and the
>>>>>     natural repeat rate of the RC5 frames should be used. Anything else
>>>>>     will result in inaccurate operation.

>>>>> (2) The key-up timeout should be set to 280ms or higher (>= 2x repeat
>>>>>     rate). This will allow for one missing RC5 frame which may happen
>>>>>     due to transmission errors.

>>>> Thanks, this sounds exactly what I'm looking for!

>>>> The 280 ms you mention matches the #define UP_TIMEOUT (HZ*7/25) in
>>>> /usr/src/linux-2.6.14.3/drivers/media/dvb/ttpci/av7110_ir.c on my vdr
>>>> box. I'll see if I'm smart enough to port the code to the cx88 driver.

>>> linux/drivers/media/common/ir-functions.c would seem to be the right
>>> place for that code...

>> I guess you meant ir-common.c, after all.

Both, really: it was renamed fairly recently.

>> I made a quick&dirty patch to ir-common.c and cx88-input.c that maps each
>> incoming RC5 frame to a key-press or a key-repeat event. [...]

I've altered ir-functions.c:ir_input_keydown() here to make this easier:
there should no longer any need for other modules to alter ir->keypressed. If
you have a new keypress, call ir_input_nokey() then ir_input_keydown(), else
call ir_input_keydown() only and the patched code will notice that it's for
the same key and cause a repeat event instead.

[snip]
>> The only drawback in my patch is that it is sometimes hard to press a
>> repeating key (e.g., Channel+) quickly enough to only generate a key-press
>> event without any key-repeat.  After all, it might be good to discard the
>> first key-repeat event.

I have logic for that currently in budget-ci, but it really belongs in
ir-common.

>> Do av7110 users have this problem?

> No, this problem is handled by input_repeat_key/delay_timer_finished magic.
> ;-)

> The driver discards all keypresses until the delay timer of the input layer
> has expired. Btw, this delay may be adjusted by user space tools.

Hmm. So the standard repeat code should be used everywhere...?

[snip]
>> It'd be nice if this patch could be polished and submitted to the kernel.
>> Are there any v4l-dvb developers on this list?

> Darren posted a patch on the v4l/dvb lists. Maybe you could join your
> efforts and submit a patch against the current hg repository.

FWIW, my current patch sets are linked from
  <URL:http://www.youmustbejoking.demon.co.uk/progs.linux.html#dvb>

And we need to take this to the v4l list :-)

-- 
| Darren Salt | nr. Ashington, | d youmustbejoking,demon,co,uk
| Debian,     | Northumberland | s zap,tartarus,org
| RISC OS     | Toon Army      | @
|   Kill all extremists!

Don't rewrite bad code; patch it.



More information about the vdr mailing list