Troubleshooting

Differences between revisions 2 and 3
Revision 2 as of 2008-10-29 19:32:56
Size: 4842
Editor: c-67-168-235-241
Comment:
Revision 3 as of 2008-11-27 16:06:01
Size: 5349
Editor: port-92-198-19-50
Comment: Add references to audio hotkeys
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
Line 22: Line 21:
 * gnome-control-center (gnome-sound-properties, gnome-keybinding-properties)
Line 34: Line 34:
 * '''Key doesn't produce balanced KeyPress/KeyRelease events, or produces multiple events''' - Suggests perhaps a kernel issue.  * '''Key doesn't produce balanced Key-Press/Key-Release events, or produces multiple events''' - Suggests perhaps a kernel issue.
Line 88: Line 88:

 * Check if a proper keyboard shortcut is mapped to the action in gnome-keybinding-properties. A working shortcut looks like ''XF86AudioMute'' or ''Ctrl+Alt+Tab''. An unknown key mapping looks like ''0xed''.

 * For Audio-Hotkey problems see which mixer device and which mixer tracks are set as default in gnome-audio-properties. The volume step can be changed in /apps/gnome_settings_daemon/volume_step with gconf-editor.


NOTE: This document is a work in progress. ACPI is a complex subsystem and impossible for any one person to fully understand. Please take a few minutes to improve this document with the bits you know!


Involved Components

ACPI events cross a lot of different layers, and determining the component that is handling them can take quite a bit of digging. Below is a non-comprehensive list of components which have been known to handle hotkey events:

Most commonly at fault:

  • gnome-power-manager - handles brightness and power hotkeys. Displays a popup 'OCD' display
  • pm-utils
  • hotkey-setup
  • acpi-support
  • xserver-xorg-input-evdev

Less commonly at fault, but sometimes involved:

  • acpid
  • linux kernel
  • gnome-settings-daemon
  • gnome-control-center (gnome-sound-properties, gnome-keybinding-properties)
  • hal
  • xkeyboard-config
  • gdm

Note that the 'acpi' source package is *not* involved in any of this, although many acpi/hotkey issues get (incorrectly) filed against it. 'acpi' is just a command line tool for listing info about acpi devices.

Common Classes of Hotkey Issues

  • Performs no effect - Either the event is not being generated, nothing is listening for the event, or something has grabbed the event but failed to act on it.

  • Fails when performing action - Something is definitely grabbing the event, but either it's the wrong thing to handle it, or is triggering the action in a way that causes a fault somewhere.

  • Key doesn't produce balanced Key-Press/Key-Release events, or produces multiple events - Suggests perhaps a kernel issue.

  • Performs wrong action - Suggests the key is mapped incorrectly. There are several layers where these mappings are done.

Useful Information to Collect in Reports

  • lshal -m > lshal.log

  • dmesg > dmesg.log

  • lsinput > lsinput.log

  • xkbcomp -xkb :0 - > xkbcomp.txt

  • setxkbmap -print > xkbmap.txt

Troubleshooting Tricks and Tips

  • Testing: Before making changes, make a list of all your keys and hit each of them in turn, and record how they work. Repeat this after every change, so you'll know if a change fixed one thing but broke something else.
  • Running acpid in debug mode: acpid -d. This should display output for software events when hitting hotkeys.
  • Disable different suspects. If the issue goes away or changes behavior with one of these turned off, and comes back when it's on, then that strongly points to an issue in that particular component:
    • acpid: /etc/init.d/acpid stop
    • gnome-power-manager: killall gnome-power-manager; gnome-power-manager --verbose --no-daemon > gpm.log

    • hotkey-setup: /etc/init.d/hotkey-setup stop
    • gdm: From console, /etc/init.d/gdm stop; startx
  • Run acpi_listen, strike the hotkey, and see what gets printed out.

  • Run input-events <device-number> (use lsinput to identify what event devices you have and which to look at)

  • Log out of X to the console and run showkey -s to see the low level codes being sent by the keyboard

  • Run gnome-power-manager in verbose mode to get detailed debug info
  • Experiment with the scripts in /etc/acpi/. These come into play only for *some* hardware so may not be relevant for your case.
  • To test sleep modes directly, echo S3 > /proc/acpi/sleep

  • Switch to a virtual terminal and back (e.g. ctrl+alt+F1 ; ctrl+alt+f7) and see if that resets things
  • Switch to the Guest Account and see if the issue can be reproduced.
  • Boot a LiveCD and try reproducing it there. If you can't, it suggests either a modification to your system or a software update not present on the LiveCD.
  • Create a test user account, log out of all sessions and into that one. If you can't reproduce the issue there, then suspect some stored gconf or other settings in your dot files. (This is less likely if you've recently done a fresh install, vs. upgraded from past versions of Ubuntu.)
  • Run xev to view the key codes being seen and processed in X. Here's a command that gives cleaner output:

xev | sed -n 's/^.*state \([0-9].*\), keycode *\([0-9]\+\) *\(.*\), .*$/keycode \2 = \3, state = \1/p'
  • If the kernel is suspected, try booting an older kernel (e.g. 2.6.26 -> 2.6.24). If the hotkey still does not work then this decreases the likelihood that the kernel is at fault.

  • If X is suspected, log out of X and boot into Recovery Mode and get a root shell. If you can reproduce the problem exactly there, then X is not at fault.
  • If the key used to work properly at one time, and you've narrowed the problem to a specific component, then try testing different past versions of that package to try to bracket where the regression first started. This can help narrow down what patch might have caused the problem.
  • Check if a proper keyboard shortcut is mapped to the action in gnome-keybinding-properties. A working shortcut looks like XF86AudioMute or Ctrl+Alt+Tab. An unknown key mapping looks like 0xed.

  • For Audio-Hotkey problems see which mixer device and which mixer tracks are set as default in gnome-audio-properties. The volume step can be changed in /apps/gnome_settings_daemon/volume_step with gconf-editor.

Hotkeys/Troubleshooting (last edited 2016-08-02 09:25:51 by penalvch)