[patch] Fix ability to modify keyboard repeat rate

Bug #345397 reported by Daniel Hollocher
14
Affects Status Importance Assigned to Milestone
xserver-xorg-input-evdev (Ubuntu)
Fix Released
High
Bryce Harrington
Nominated for Jaunty by Daniel Hollocher

Bug Description

This bug is apparently fixed upstream: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/264196 (Summary, you can't modify your keyboard repeat rate. This bug affects both jaunty and intrepid)

The patch is here: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-input-evdev/+bug/264196/comments/43

Jeff250 was kind enough to backport this fix, and he setup a ppa here: https://launchpad.net/~jeff250/+archive/ppa

I tested it, and can confirm the fix works.

This bug report is a request that said fix be included in jaunty.

[Steps to reproduce:]
1. Use evdev for X keyboard input (on Intrepid, Jaunty should be default, i.e. if you have no xorg.conf file)
2. In gnome keyboard preferences, move repeat delay slider all the way to 'Long'
3. Move repeat rate slider all the way to 'Fast'
4. Test repeat rate at bottom of dialog
Expected results: Very fast repeat rate
Actual results: Normal repeat rate

[My understanding of the problem:]
It appears that the hardware repeat rate is tripping up Xorg's internal software repeat rate. If we set the software delay to be very long, i.e. such that it is longer than the hardware's delay, then the hardware's repeat will be triggered first. Once the hardware begins repeating key events, then the software's delay wait gets perpetually reset, so the software repeat rate will never be triggered.

[Some regression discussion:]
After patching evdev to ignore hardware repeat events, the hardware rate will be overridden by Xorg's software rate. E.g., before using this patch, you could use kbdrate in an rxvt to set the keyboard rate inside of X. After this patch, doing this has no effect. But I believe that this is OK and expected behavior. Any thoughts other concerns from any X gurus?

We tried backporting this patch to intrepid, but we found that this produced a regression: some keys such as the left/down arrow keys no longer repeated. The good news is that no one has produced this regression yet using the patched evdev packages in jaunty, but it is something to look out for.

[Some further justification:]
This could close at least the following bugs:
bug 264196
bug 289951
bug 290050
bug 290674

description: updated
Revision history for this message
Jeffrey Knockel (jeff250) wrote :

Hi, I've attached a first attempt at a proposed debdiff. As original poster indicates, this debdiff essentially includes this upstream patch:
http://cgit.freedesktop.org/xorg/driver/xf86-input-evdev/patch/?id=ece72ce9e97adae23b1932dc1334f63669196d56

Revision history for this message
Daniel Hollocher (chogydan) wrote :

I sent a message to the release team, since jaunty has entered beta freeze. Hopefully, they will take a look.

Revision history for this message
Bryce Harrington (bryce) wrote :

Unfortunately you >just missed< the beta freeze deadline. Now some additional paperwork/approval is required for all changes.

Please provide a more detailed justification for the change, including a test case for reproducing the problem, and a discussion of regression risk. I think there's still a chance of getting it in (maybe post-beta though), but since it's late in the release, we need patch submitters to provide more backup info. Thanks ahead of time.

Changed in xserver-xorg-input-evdev (Ubuntu):
status: New → Incomplete
Revision history for this message
Jeffrey Knockel (jeff250) wrote :

Steps to reproduce:
1. Use evdev for X keyboard input (on Intrepid, Jaunty should be default, i.e. if you have no xorg.conf file)
2. In gnome keyboard preferences, move repeat delay slider all the way to 'Long'
3. Move repeat rate slider all the way to 'Fast'
4. Test repeat rate at bottom of dialog
Expected results: Very fast repeat rate
Actual results: Normal repeat rate

My understanding of the problem:
It appears that the hardware repeat rate is tripping up Xorg's internal software repeat rate. If we set the software delay to be very long, i.e. such that it is longer than the hardware's delay, then the hardware's repeat will be triggered first. Once the hardware begins repeating key events, then the software's delay wait gets perpetually reset, so the software repeat rate will never be triggered.

Some regression discussion:
After patching evdev to ignore hardware repeat events, the hardware rate will be overridden by Xorg's software rate. E.g., before using this patch, you could use kbdrate in an rxvt to set the keyboard rate inside of X. After this patch, doing this has no effect. But I believe that this is OK and expected behavior. Any thoughts other concerns from any X gurus?

Some further justification:
This could close at least the following bugs:
bug 264196
bug 289951
bug 290050
bug 290674

Revision history for this message
Jeffrey Knockel (jeff250) wrote :

Some more regression discussion:
We tried backporting this patch to intrepid, but we found that this produced a regression: some keys such as the left/down arrow keys no longer repeated. The good news is that no one has produced this regression yet using the patched evdev packages in jaunty, but it is something to look out for.

I think I'm going to try to see if I can get some more testers for this by posting some pleading in the Ubuntu Jaunty development forums, since we really need more than just a few people testing this.

Bryce Harrington (bryce)
Changed in xserver-xorg-input-evdev (Ubuntu):
assignee: nobody → bryceharrington
importance: Undecided → High
status: Incomplete → Triaged
summary: - Please include this fix for jaunty
+ [patch] Fix ability to modify keyboard repeat rate
description: updated
Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks, that looks good. I'll stick it in my ppa for now in case people need debs for testing.

Revision history for this message
scimeth (scimeth) wrote :

This fixes it for my logitech elite keyboard, and all the keys seem to work.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package xserver-xorg-input-evdev - 1:2.1.1-1ubuntu4

---------------
xserver-xorg-input-evdev (1:2.1.1-1ubuntu4) jaunty; urgency=low

  [Bryce Harrington]
  * rules: Adding 'patch' to the build task appears to be unnecessary.

  [Jeffrey Knockel]
  * Add 102_filter_kernel_repeat.patch: Allow software to control keyboard
    repeat rate. (LP: #345397, LP: #264196)

 -- Bryce Harrington <email address hidden> Fri, 03 Apr 2009 17:45:01 -0700

Changed in xserver-xorg-input-evdev (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Pär Lindfors (paran) wrote :

> Some more regression discussion:
> We tried backporting this patch to intrepid, but we found that this produced a regression: some keys such as the left/down arrow keys no longer repeated. The good news is that no one has produced this regression yet using the patched evdev packages in jaunty, but it is something to look out for.

Let me be the first to report this then :-(

With evdev 1:2.1.1-1ubuntu4 on Jaunty left,down,end no longer repeats. 1:2.1.1-1ubuntu3 works fine.

Repeat for those keys can be enabled using "xset r 113; xset r 115; xset r 116", as suggested in bug 281546.

Revision history for this message
harmless (potentially) wrote :

I recently upgraded to Jaunty from Intrepid. I had some bizarre keyboard issue where everything repeated thrice with occasional modifiers thrown in that I fixed by removing xserver-xorg-input-kbd that was still floating around, ensuring that evdev was always used.

Now I find that left and down repeat fine on login and while running a few apps, but eventually stop working. I haven't yet isolated what triggers the change, but thought I'd chime in that I'm seeing this with 1:2.1.1-1ubuntu4 too, and that it does manage to work initially.

Also, after a few hours or days, my keyboard will cease to respond entirely. Removing, waiting, and plugging in to another USB port has no effect, but I only need to log out and back in to restore it, not even a full restart of X or the system.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.