Bug 9637 - "Sluggish" behaviour with cx88 remote control
Summary: "Sluggish" behaviour with cx88 remote control
Status: RESOLVED CODE_FIX
Alias: None
Product: v4l-dvb
Classification: Unclassified
Component: cx88 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: v4l-dvb_cx88
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-26 11:16 UTC by Adrian Roman
Modified: 2010-03-31 10:45 UTC (History)
4 users (show)

See Also:
Kernel Version: 2.6.27
Subsystem:
Regression: No
Bisected commit-id:


Attachments
High resolution timer for Remote Controls (2.09 KB, patch)
2009-05-28 17:32 UTC, Andrzej Hajda
Details | Diff
cx88: High resolution timer for Remote Controls (2.21 KB, patch)
2009-05-30 13:44 UTC, Andrzej Hajda
Details | Diff

Description Adrian Roman 2007-12-26 11:16:17 UTC
Most recent kernel where this bug did not occur: unknown
Distribution: Xubuntu
Hardware Environment: x86 system, Leadtek TV2000 XP Expert TV tuner card
Software Environment: Xubuntu default + lirc
Problem Description:

I'm using an Winfast TV2000XP Expert tuner card. I configured the remote control to work with lirc, with the dev/input driver. And although it does work, I sometimes have to press a key on the remote control 7 times before it actually does what it was supposed to do. Usually it will do what it's supposed to do after 2 or 3 key presses, but that's still too much.

I used to use Slackware, and recompile the kernel myself. I found that there was a problem in the cx88-input.c file, where if a key release event was received without a prior key press event, nothing would happen. That would typically be ok, except that quite a significant percentage of the events were key release events without a matching key press event. So I patched the file to treat that as a key press and release event, at the same time. Details of the patch can be found here: http://lists-archives.org/video4linux/16875-fwd-cx88-ir-issue.html - that made the remote control work ok, as long as you didn't repeatedly press the same button. That still didn't work ok, and I didn't figure that out yet.

But because I no longer have time to compile stuff from source and troubleshoot little things I am considering switching to Ubuntu or Fedora. Interestingly enough, in Fedora 7, with kernel 2.6.22-65.fc7, the remote control works perfectly fine (as it did in every version of Windows I ever used). I suspect one of the kernel patches they incorporate into the kernel gets the job done, and although I looked through them, I didn't manage to identify exactly which one is responsible for fixing this problem.


Steps to reproduce:

Just install Ubuntu and lirc and start lirc with the devinput driver. Then start irw, and press remote control buttons.
Comment 1 Natalie Protasevich 2008-02-05 00:46:36 UTC
It would be best if you tried current kernel such as recent git, this way you get most upstream patches, especially if you know that it's been fixed upstream. 
Comment 2 Adrian Roman 2008-02-05 00:54:52 UTC
I tried the latest kernel a couple of times, most recently in December 2007. I'll try it again now, and post the results asap - most likely in a couple of days.
Comment 3 Adrian Roman 2008-02-10 03:54:20 UTC
Just tried the kernel that is shipped with Ubuntu 8.04 Alpha, it's no good.

~# uname -r
2.6.24-7-generic

I'll get the latest git version as soon as posssible and post the results here.

Adrian
Comment 4 Adrian Roman 2008-02-10 11:25:04 UTC
Kernel 2.6.24.1 released 2 days ago has the same issue.

~# uname -r
2.6.24.1

Should I still try the git version?
Comment 5 Adrian Roman 2008-06-23 03:57:27 UTC
As of yesterday, June 22nd 2008, with kernels 2.6.24-19-generic (shipped with Ubuntu) and 2.6.25.7 (vanilla), the problem is still present.
Comment 6 Adrian Roman 2008-10-10 00:46:36 UTC
I bumped up the kernel version number as this has been confirmed also on 2.6.26 and 2.6.27.
Comment 7 Jean Delvare 2009-02-15 12:39:48 UTC
FWIW, I seem to recall that the value of HZ matters, namely, at HZ=1000 the remote control works OK but with lower values of HZ it doesn't. Which doesn't make it a non-bug, it really should work regardless of the value of HZ, but it may explain the difference between tested kernels, and help reproduce the bug.
Comment 8 Andrzej Hajda 2009-05-23 12:58:11 UTC
I have solved this problem using high resolution timers, I have submitted the patch to http://www.mail-archive.com/linux-media@vger.kernel.org/msg05636.html .
Comment 9 Adrian Roman 2009-05-23 14:26:15 UTC
Will this be included in the final version of 2.6.30? I am very interested in testing it.
Comment 10 Adrian Roman 2009-05-24 12:21:41 UTC
Ok, I have patched the cx88-input.c file manually for 2.6.30-rc7 and I can confirm it works flawlessly. It took a couple of years, but it's finally done. :)

As far as I am concerned, the bug can be closed if the patch makes it into the mainline kernel.
Comment 11 Jean Delvare 2009-05-28 10:01:29 UTC
Andrzej, can you please attach your patch to this bug? I would like to test it but copy-and-pasting from web archives never works.
Comment 12 Andrzej Hajda 2009-05-28 17:32:19 UTC
Created attachment 21604 [details]
High resolution timer for Remote Controls
Comment 13 Andrzej Hajda 2009-05-28 17:35:41 UTC
Comment on attachment 21604 [details]
High resolution timer for Remote Controls

Patch against changeset 315bc4b65b4f of http://linuxtv.org/hg/v4l-dvb mercurial repo.
Comment 14 Jean Delvare 2009-05-29 07:10:14 UTC
Patch tested successfully on top of kernel 2.6.30-rc7. I've also reviewed it and it looks OK to me, except for two long lines which should be folded. Then you can add:

Acked-by: Jean Delvare <khali@linux-fr.org>

Let's push this upstream quickly.
Comment 15 Andrzej Hajda 2009-05-30 13:44:34 UTC
Created attachment 21632 [details]
cx88: High resolution timer for Remote Controls

Patch against changeset 315bc4b65b4f of http://linuxtv.org/hg/v4l-dvb mercurial
repo.
Signed-off-by: Andrzej Hajda <andrzej.hajda@wp.pl>
Acked-by: Jean Delvare <khali@linux-fr.org>
Comment 16 Jean Delvare 2009-06-04 11:47:27 UTC
Did you resend this patch to the V4L/DVB maintainers? I would like to have this fix in kernel 2.6.31, which doesn't leave us much time.
Comment 17 Andrzej Hajda 2009-06-04 16:50:41 UTC
I did not know it should be resend. But I have just sent it on the list.
Comment 18 Jean Delvare 2009-08-29 10:46:35 UTC
For reference: the patch has been committed to the v4l-dvb tree.
Comment 19 Jean Delvare 2010-03-31 10:45:09 UTC
Fixed in kernel 2.6.32.

Note You need to log in before you can comment on or make changes to this bug.