I have an XPS 13 Developer Edition Dell Laptop running Debian GNU/Linux Jessie (testing).

When the laptop starts up on battery power, the keyboard is so unresponsive that it is a real struggle to type in my password (key presses are delayed, ignored or stick and repeat many times).

It's OK if it's running off the mains, even if I boot with the battery and then plug it in.

I've not customised the default service configs (except trivial changes unrelated to this) and I keep my full list of debfoster keepers on github if you'd like to see the services I have running.

How can I set the default laptop battery mode to be something usable?

As requested, systemd-analyze blame shows

       1.084s kbd.service
       394ms exim4.service
       303ms NetworkManager.service
       190ms ModemManager.service
       179ms loadcpufreq.service
       163ms laptop-mode.service
       147ms accounts-daemon.service
       129ms console-setup.service
       117ms networking.service
       100ms lightdm.service
        98ms bluetooth.service
        97ms systemd-logind.service
        93ms keyboard-setup.service
        89ms avahi-daemon.service
        85ms systemd-fsck-root.service
        73ms gpm.service

and systemd-analyze critical-chain

The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.
graphical.target @2.434s
??multi-user.target @2.434s
  ??exim4.service @2.074s +358ms
    ??basic.target @2.070s
      ??timers.target @2.069s
        ??systemd-tmpfiles-clean.timer @2.069s
          ??sysinit.target @2.069s
            ??console-setup.service @1.936s +132ms
              ??kbd.service @531ms +1.403s
                ??remote-fs.target @531ms
                  ??local-fs.target @530ms
                    ??tmp.mount @524ms +5ms
                      ??systemd-fsck@dev-disk-by\x2duuid-a2cf7f78\x2d691b\x2d4c01\x2da80c\x2d1bc6228230a5.service @466ms +57ms
                        ??dev-disk-by\x2duuid-a2cf7f78\x2d691b\x2d4c01\x2da80c\x2d1bc6228230a5.device @465ms

but this seems consistent with and without the mains power supply.

Some more info:

  • I don't experience the keyboard lag if I drop to a TTY.
  • I have performed a cpufreg-aperf both with and without mains and the results are similar when the machine is idle or I'm just typing in the terminal.
  • some people have claimed that disabling USB autosuspend helps, but I have the same problem even after disabling it entirely and rebooting.
  • once I plug in the mains and then unplug it, the problem goes away.
  • forcing the performance cpu scaler (even on battery) doesn't help
  • external USB keyboards are unaffected

Some hardware info:

Bus 001 Device 002: ID 8087:8000 Intel Corp. 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 004: ID 8087:07dc Intel Corp. 
Bus 002 Device 003: ID 0bda:5604 Realtek Semiconductor Corp. 
Bus 002 Device 002: ID 06cb:0af8 Synaptics, Inc. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

? Virtual core pointer                      id=2    [master pointer  (3)]
?   ? Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
?   ? SYNAPTICS Synaptics Large Touch Screen    id=9    [slave  pointer  (2)]
?   ? SynPS/2 Synaptics TouchPad                id=12   [slave  pointer  (2)]
? Virtual core keyboard                     id=3    [master keyboard (2)]
    ? Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ? Power Button                              id=6    [slave  keyboard (3)]
    ? Video Bus                                 id=7    [slave  keyboard (3)]
    ? Power Button                              id=8    [slave  keyboard (3)]
    ? Integrated Webcam                         id=10   [slave  keyboard (3)]
    ? AT Translated Set 2 keyboard              id=11   [slave  keyboard (3)]
    ? Dell WMI hotkeys                          id=13   [slave  keyboard (3)]
  • 2
    You first have to diagnose the cause of the lag; what does systemd-analyze {blame,critical-chain} show? – jasonwryan Sep 12 '14 at 21:53
  • I've updated as requested, but I'm not sure how this can help. The startup time itself is not the problem, it's that the response of a key press to the key being interpreted is so slow that the keys overlap and typing anything coherent is very difficult. – fommil Sep 12 '14 at 22:35
  • 2
    They are two separate commands... In any event, does your issue exist only in X, or in the TTY as well? – jasonwryan Sep 12 '14 at 22:48
  • 1
    @fommil - Jason wrote the commands in a compact form (I believe). It's actually 2 commands: systemd-analyze blame and systemd-analyze critical-chain. The notation {blame,critical-chain} is meant to denote that you'd provide arg1 to the command and arg2 to the command. – slm Sep 13 '14 at 1:34
  • 1
    What happens if you use an external keyboard, e.g. usb and try logging in with that. This is for diagnosis not an answer. – Michael Durrant Sep 13 '14 at 16:14

UPDATE the below didn't make the problem go away, but upgrading to linux kernel 3.16 has had a dramatic improvement!

I solved this while figuring out a related problem! why is my laptop-mode configuration being ignored?

It turns out that the default "min CPU freq" is set to 0% for Intel pstate devices. I bumped it to 5% and the key lag went away.

Thanks all for your helpful suggestions! This has actually been bugging me ever since I got the laptop nearly 6 months ago.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.