[TriLUG] Mouse not working with 3.12 kernel

Phil Smith mazphil57 at yahoo.com
Tue Nov 26 00:35:24 EST 2013


Perhaps 2-3 years ago the standard /dev/input/mice driver stopped working for me on a Debian system with a custom kernel.
I built the 'evdev' event driver into the kernel (not as a module) and access (even PS/2) keyboards and mice through that alternative interface.

With the standard /dev/input/mice, X will work with a mouse hotplugged after X starts, but X will not poll for new evdev devices,
so you have to restart X to use the mouse.  A USB keyboard that is unplugged from one USB port and plugged into another USB port
 may jump from /dev/input/event3 to /dev/input/event6, for example, and stop working.  You will have more configurability with 
evdev on a laptop where the touchpad and USB mouse are in separate mouse sections (different eventN for each) rather than have
the input from both devices appear from /dev/input/mice and try to set options for two devices in one xorg.conf section.  Yes, there
is /dev/input/{Mouse0,1} to get unmerged mouse data.  The data format from these is different from the evdev device.  The Wikipedia
 article on 'evdev' details the advantages of evdev and states it is the default for recent distros, so /dev/input/mice with new kernel/distro is a less-tested path.

You should also take a look at /var/log/Xorg.0.log to see how X is handling the keyboard and mouse.  If the mouse and keyboard 
sections in /etc/X11/xorg.conf are reversed (as from auto-generated xorg.conf), X will ignore the config file (based on what it
 tells you in /var/log/Xorg.0.log) and may try to read keyboard input from the mouse device and vice versa.  You want to make
 sure this log file is 'clean' and does not indicate X is struggling with devices or video modes.  X also frequently ignores your
 video mode selections and tells you why it is going to do things its own way in this log file.  This log file contains a complete
list of native video modes (which may change if commented out options in xorg.conf are changed) for the video adapter(s).

The config file /etc/X11/xorg.conf is generated usually only once after OS
install and becomes dated after xorg is upgraded repeatedly.  A fresh xorg.conf is generated with 'X -configure' -- review/edit it
 and then replace the dated version in /etc/X11.  You may want to enable the SysRq magic hotkeys (in kernel config) to allow clean
 rebooting because X may start with errors in xorg.conf yet you may not be able to use either the keyboard or mouse.  
Ctrl+Alt+F2 MAY get you to a VT to reboot in this case but the magic keys Alt+SysRq+{r,e,i,s,u,b} will always allow you to
 sync, unmount, and reboot (assuming the kernel sees your USB keyboard).  Most BIOS setups allow emulating a PS/2 keyboard with 
a USB keyboard but try to stay away from that option.

# dmesg | grep 'input:'
input: AT Translated Set 2 keyboard as /devices/platform/i8042/serio0/input/input2
input: ImExPS/2 Generic Explorer Mouse as /devices/platform/i8042/serio1/input/input3
# if your mouse is not found in dmesg it is not going to work
# grep -2 -i evdev /etc/X11/xorg.conf
Section "InputDevice"
Identifier  "Keyboard0"
Driver      "evdev"
Option      "XkbLayout" "us"
Option    "Device" "/dev/input/event2" # note event2 corresponds with input2
--
Section "InputDevice"
Identifier  "Mouse0"
Driver      "evdev"
Option    "Protocol" "auto"
Option    "Device" "/dev/input/event3"  # instead of default /dev/input/mice

# the crude way to find the mouse is "cat /dev/input/event{0,1,2,3,4,5,6}" and move the mouse until data is returned instead of dmesg


More information about the TriLUG mailing list