# USB Keyboard and udev / sysfs {SOLVED}

## faceman

{EDIT} I fixed this by upgrading the kernel to linux-2.6.16-gentoo-r8{/SOLVED}

I just got a new HP keyboard with a usb hub built in.  Hub works fine, usb mouse works fine plugged into the hub.

Keyboard doesn't work.

It works after reboot of the computer right up until the point that the kernel starts to load, then nothing.

My ps/2 keyboard works fine.  USB has been and continues to work fine.

I plugged this keyboard into my other computer (this one), works fine as soon as it was plugged in.

Here's from dmesg:

 *Quote:*   

> 
> 
> usbcore: registered new driver usbfs
> 
> usbcore: registered new driver hub
> ...

 

and lsusb:

 *Quote:*   

> 
> 
> Bus 004 Device 003: ID 03f0:020c Hewlett-Packard Multimedia Keyboard
> 
> Bus 004 Device 002: ID 03f0:010c Hewlett-Packard Multimedia Keyboard Hub
> ...

 

I enabled all 3 hids in the kernel.  Nothing.

Any help?

----------

## faceman

Still can't figure anything out.  It also doesn't work on my laptop - same behavior.

----------

## faceman

Bump

----------

## faceman

Ok, figured something interesting out.

I tried another older PC, didn't work there either.

On all the PCs where it doesn't work, I don't get symlinks for sysfs under /sys/class/input.  However, when I plug the keyboard in and out, the 2 dirs for the events show up and disappear as they should.  On these same PCs, I also don't get a sysfs listing with  "cat /proc/bus/input/devices".

On the PC where the keyboard works, I get symlinks and sysfs listings in the /proc/bus/input/devices listing.

Hmmmmmmm...........

So I booted up a live CD (Kororaa xgl, actually) to see if that made a difference.  It did.  The live cd did the same thing as the non-working PCs - do symlinks and no sysfs entry for the keyboard listing in /proc/bus/input/devices.

I'll show you what I mean:

works:

```

basilio facemyer # ls /sys/class/input -l

total 0

lrwxrwxrwx  1 root root 0 Sep 20 18:18 event0 -> ../../class/input/input0/event0

lrwxrwxrwx  1 root root 0 Sep 20 18:18 event1 -> ../../class/input/input1/event1

lrwxrwxrwx  1 root root 0 Sep 20 18:18 event2 -> ../../class/input/input2/event2

lrwxrwxrwx  1 root root 0 Sep 20 18:18 event3 -> ../../class/input/input3/event3

lrwxrwxrwx  1 root root 0 Sep 20 18:18 event4 -> ../../class/input/input4/event4

drwxr-xr-x  5 root root 0 Sep 20 18:18 input0

drwxr-xr-x  6 root root 0 Sep 20 18:18 input1

drwxr-xr-x  5 root root 0 Sep 20 18:18 input2

drwxr-xr-x  5 root root 0 Sep 20 18:18 input3

drwxr-xr-x  6 root root 0 Sep 20 18:18 input4

drwxr-xr-x  2 root root 0 Sep 20 18:18 mice

lrwxrwxrwx  1 root root 0 Sep 20 18:18 mouse0 -> ../../class/input/input1/mouse0

lrwxrwxrwx  1 root root 0 Sep 20 18:18 mouse1 -> ../../class/input/input4/mouse1

```

and

```

basilio facemyer # cat /proc/bus/input/devices

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41

N: Name="AT Translated Set 2 keyboard"

P: Phys=isa0060/serio0/input0

S: Sysfs=/class/input/input0

H: Handlers=kbd event0

B: EV=120013

B: KEY=402000000 3802078f840d001 f2ffffdfffefffff fffffffffffffffe

B: MSC=10

B: LED=7

I: Bus=0011 Vendor=0002 Product=0005 Version=0000

N: Name="ImPS/2 Logitech Wheel Mouse"

P: Phys=isa0060/serio1/input0

S: Sysfs=/class/input/input1

H: Handlers=mouse0 event1

B: EV=7

B: KEY=70000 0 0 0 0

B: REL=103

I: Bus=0003 Vendor=03f0 Product=020c Version=0001

N: Name="HP Multimedia Keyboard Hub"

P: Phys=usb-0000:00:0f.0-1.1/input0

S: Sysfs=/class/input/input2

H: Handlers=kbd event2

B: EV=120003

B: KEY=1000000000007 ff87207ac14057ff febeffdfffefffff fffffffffffffffe

B: LED=1f

I: Bus=0003 Vendor=03f0 Product=020c Version=0001

N: Name="HP Multimedia Keyboard Hub"

P: Phys=usb-0000:00:0f.0-1.1/input1

S: Sysfs=/class/input/input3

H: Handlers=kbd event3

B: EV=10000b

B: KEY=3ffc0000 7a0000c000 12000000000000 0

B: ABS=100000000

I: Bus=0003 Vendor=056a Product=00b1 Version=0102

N: Name="Wacom Intuos3 6x8"

P: Phys=

S: Sysfs=/class/input/input4

H: Handlers=mouse1 event4

B: EV=1f

B: KEY=1cff 1f00ff 0 0 0 0

B: REL=100

B: ABS=1000f00017b

B: MSC=1

```

doesn't work:

```

antonius facemyer # ls /sys/class/input -l

total 0

drwxr-xr-x  2 root root 0 Sep 20 17:16 event0

drwxr-xr-x  2 root root 0 Sep 20 17:16 event1

drwxr-xr-x  2 root root 0 Sep 20 17:16 event2

drwxr-xr-x  2 root root 0 Sep 20 17:28 event3

drwxr-xr-x  2 root root 0 Sep 20 17:28 event4

drwxr-xr-x  2 root root 0 Sep 20 17:16 mice

drwxr-xr-x  2 root root 0 Sep 20 17:16 mouse0

drwxr-xr-x  2 root root 0 Sep 20 17:16 mouse1

```

```

antonius facemyer # cat /proc/bus/input/devices

I: Bus=0011 Vendor=0001 Product=0001 Version=ab41

N: Name="AT Translated Set 2 keyboard"

P: Phys=isa0060/serio0/input0

H: Handlers=kbd event0

B: EV=120013

B: KEY=402000000 3802078f840d001 f2ffffdfffefffff fffffffffffffffe

B: MSC=10

B: LED=7

I: Bus=0011 Vendor=0002 Product=0006 Version=0056

N: Name="ImExPS/2 Logitech Wheel Mouse"

P: Phys=isa0060/serio1/input0

H: Handlers=mouse0 event1

B: EV=7

B: KEY=1f0000 0 0 0 0

B: REL=103

I: Bus=0003 Vendor=15ca Product=00c3 Version=0512

N: Name="USB Optical Mouse"

P: Phys=usb-0000:00:10.2-2/input0

H: Handlers=mouse1 event2

B: EV=7

B: KEY=70000 0 0 0 0

B: REL=103

I: Bus=0003 Vendor=03f0 Product=020c Version=0001

N: Name="HP Multimedia Keyboard Hub"

P: Phys=usb-0000:00:10.2-1.1/input0

H: Handlers=kbd event3

B: EV=120003

B: KEY=1000000000007 ff87207ac14057ff febeffdfffefffff fffffffffffffffe

B: LED=1f

I: Bus=0003 Vendor=03f0 Product=020c Version=0001

N: Name="HP Multimedia Keyboard Hub"

P: Phys=usb-0000:00:10.2-1.1/input1

H: Handlers=kbd event4

B: EV=10000b

B: KEY=3ffc0000 7a0000c000 12000000000000 0

B: ABS=100000000

```

I have evdev enabled in both kernels.

That's all I know.  How do I get the non-working PCs to act the same as the working PC with this keyboard?

I'd really like some help on this one.

----------

## faceman

Another interesting thing:

The special keys device seems to be working, since it interrupts the screensaver and gives a response to "cat /dev/input/event4".  However, the other one (event3) doesn't respond when I hit keys (either the screensaver or the cat test).

So how do I get the keyboard part to work??!

----------

## faceman

Will nobody help me?

----------

## Eldrin

May seem like a stupid question, but you haven't given any indication of the answer...Does it work in console mode and just not in X or does it not work at all?

----------

## faceman

From the first post:

 *Quote:*   

> It works after reboot of the computer right up until the point that the kernel starts to load, then nothing. 

 

No usb keyboard at all in Linux.

Thanks for some response, though!

----------

## Eldrin

What's the output of:

```

zcat /proc/config.gz | grep USB_HID

```

I'm still thinking what else this could be...just want to check the obvious first.

Eldrin

EDIT:  In fact, just post the output of:

```

zcat /proc/config.gz | grep USB

```

----------

## faceman

Thanks.  Here it is:

```

# USB devices

# CONFIG_SND_USB_AUDIO is not set

# CONFIG_SND_USB_USX2Y is not set

# USB support

CONFIG_USB_ARCH_HAS_HCD=y

CONFIG_USB_ARCH_HAS_OHCI=y

CONFIG_USB=y

# CONFIG_USB_DEBUG is not set

# Miscellaneous USB options

CONFIG_USB_DEVICEFS=y

# CONFIG_USB_BANDWIDTH is not set

# CONFIG_USB_DYNAMIC_MINORS is not set

# CONFIG_USB_SUSPEND is not set

# CONFIG_USB_OTG is not set

# USB Host Controller Drivers

CONFIG_USB_EHCI_HCD=y

# CONFIG_USB_EHCI_SPLIT_ISO is not set

# CONFIG_USB_EHCI_ROOT_HUB_TT is not set

# CONFIG_USB_ISP116X_HCD is not set

CONFIG_USB_OHCI_HCD=y

# CONFIG_USB_OHCI_BIG_ENDIAN is not set

CONFIG_USB_OHCI_LITTLE_ENDIAN=y

CONFIG_USB_UHCI_HCD=y

# CONFIG_USB_SL811_HCD is not set

# USB Device Class drivers

# CONFIG_OBSOLETE_OSS_USB_DRIVER is not set

# CONFIG_USB_BLUETOOTH_TTY is not set

CONFIG_USB_ACM=y

CONFIG_USB_PRINTER=y

# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information

CONFIG_USB_STORAGE=y

# CONFIG_USB_STORAGE_DEBUG is not set

# CONFIG_USB_STORAGE_DATAFAB is not set

# CONFIG_USB_STORAGE_FREECOM is not set

# CONFIG_USB_STORAGE_ISD200 is not set

# CONFIG_USB_STORAGE_DPCM is not set

# CONFIG_USB_STORAGE_USBAT is not set

# CONFIG_USB_STORAGE_SDDR09 is not set

# CONFIG_USB_STORAGE_SDDR55 is not set

# CONFIG_USB_STORAGE_JUMPSHOT is not set

# CONFIG_USB_STORAGE_ONETOUCH is not set

# USB Input Devices

CONFIG_USB_HID=y

CONFIG_USB_HIDINPUT=y

# CONFIG_USB_HIDDEV is not set

# CONFIG_USB_AIPTEK is not set

# CONFIG_USB_WACOM is not set

# CONFIG_USB_ACECAD is not set

# CONFIG_USB_KBTAB is not set

# CONFIG_USB_POWERMATE is not set

# CONFIG_USB_MTOUCH is not set

# CONFIG_USB_ITMTOUCH is not set

# CONFIG_USB_EGALAX is not set

# CONFIG_USB_YEALINK is not set

# CONFIG_USB_XPAD is not set

# CONFIG_USB_ATI_REMOTE is not set

# CONFIG_USB_KEYSPAN_REMOTE is not set

# CONFIG_USB_APPLETOUCH is not set

# USB Imaging devices

# CONFIG_USB_MDC800 is not set

# CONFIG_USB_MICROTEK is not set

# USB Multimedia devices

# CONFIG_USB_DABUSB is not set

# Video4Linux support is needed for USB Multimedia device support

# USB Network Adapters

# CONFIG_USB_CATC is not set

# CONFIG_USB_KAWETH is not set

# CONFIG_USB_PEGASUS is not set

# CONFIG_USB_RTL8150 is not set

# CONFIG_USB_USBNET is not set

# CONFIG_USB_MON is not set

# USB port drivers

# CONFIG_USB_USS720 is not set

# USB Serial Converter support

# CONFIG_USB_SERIAL is not set

# USB Miscellaneous drivers

# CONFIG_USB_EMI62 is not set

# CONFIG_USB_EMI26 is not set

# CONFIG_USB_AUERSWALD is not set

# CONFIG_USB_RIO500 is not set

# CONFIG_USB_LEGOTOWER is not set

# CONFIG_USB_LCD is not set

# CONFIG_USB_LED is not set

# CONFIG_USB_CYTHERM is not set

# CONFIG_USB_PHIDGETKIT is not set

# CONFIG_USB_PHIDGETSERVO is not set

# CONFIG_USB_IDMOUSE is not set

# CONFIG_USB_SISUSBVGA is not set

# CONFIG_USB_LD is not set

# CONFIG_USB_TEST is not set

# USB DSL modem support

# USB Gadget Support

# CONFIG_USB_GADGET is not set

```

----------

## Eldrin

Well, that blows that theory out of the water...I was thinking it might be a module thing...

Same kernel version on the machine that works as opposed to the ones that don't?  Also you might want to compare udev versions.

Eldrin

----------

## purplerhino

wish i had the answer, but all i got is a me too bump.

i just upgraded my server from kernel 2.4 to 2.6.  the keyboard worked fine in 2.4, does not now in 2.6.  the keyboard works fine in my main computer running 2.6 if i plug it into that.

this is an annoying problem because usually when something don't work, there's some sort of error for clues... but this acts like it's totally working, dmesg

```
input: Itron Presenter as /class/input/input5

input: USB HID v1.00 Keyboard [Itron Presenter] on usb-0000:00:07.2-2
```

however, it lies...

it just doesn't like this keyboard though, because i have another usb keyboard that i can plug into this computer and it works fine.  but the not working one worked fine in kernel 2.4, and works fine on my other computer!  i just don't get it.

----------

## jschellhaass

I see you have both OHCI and UHCI set.  You should have one or the other, depends on your chipset.

jeff

----------

## purplerhino

i've read it was usually ok to have both enabled in kernel, though i always try to do one or the other.  anyhow, i do not have both, it's an old bp6 so i just have uhci enabled, ohci and ehci are both off.

I recompiled my kernel with SMP off to see if that helped, didn't fix it.  I also tried the tips at http://www.linux-usb.org/FAQ.html#ts3 but that didn't help.  I am using hardened sources so I might try the gentoo sources next.

----------

## faceman

Both enabled poses no problem.

I actually had only one, and enabled the other in hopes that that would cure it - faulty logic, but you never know.

Still no luck.

----------

## trantorvega

The extended keyboards are built so that they behave like two devices in one: the part controlling the standard keys implements a Boot interface, a restricted protocol necessary to be recognized by the BIOS and interact with it. The additional keys respond to a different "part", each corresponding to one of the two input and event devices you should see. You reported before that the device responsible for the extended keys works , but not the other.

However you have not mentioned if the keyboard interacts with the BIOS correctly, even if I think it should. It would be nice to know also the kernel versions of your not-/functioning PCs. In theory if the BIOS interacts regularly with the keyboard so should do usbkbd, which implements the Boot Protocol and does not employ the usbhid module, just usbcore. (See /usr/src/linux/Documentation/input/input.txt ) In order to try to load or unload modules to see if they have nothing to do with it, it might be helpful to configure the usb support and related components as modules and not as built-in.

By the way from your CONFIG you seem not to have built usbkbd ( CONFIG_USB_KBD ), which is under USB HID Boot Protocol Drivers int the USB section of the kernel configuration.

I hope I can be of some help.   :Confused: 

----------

## Eldrin

You probably don't want to enable CONFIG_USB_KBD.  The help in the kernel is pretty clear that the CONFIG_USB_KDB HID Boot Protocol Driver is almost NEVER what you want.

FYI, from the kernel help for USB_HID, which is the full HID driver that SHOULD support your keyboard:

```

Say Y here if you want full HID support to connect keyboards,

mice, joysticks, graphic tablets, or any other HID based devices

to your computer via USB. You can't use this driver and the

HIDBP (Boot Protocol) keyboard and mouse drivers at the same time.

More information is available: Documentation/usb/input.txt.

```

From the above mentioned CONFIG_USE_KBD:

```

Say Y here if you don't want to use the generic HID driver for your

USB keyboard and prefer to use the keyboard in its limited Boot

Protocol mode instead. This driver is much smaller than the HID one.

```

Notice that you can't use both at the same time.

That being said, if you want to give it a shot and see if it works, go for it.  Just be aware that if you have a USB mouse you're probably going to break it in the short term.

Trantorvega makes a good point about the modules though.  It's worth a try.

Eldrin

----------

## faceman

The keyboard works fine, as I said, until I boot the kernel - it works fine through the post and in the bios menu and in the grub menu, but as soon as I hit a grub option, it stops.

I'm remiss to try the usbkbd because it's not what I want, as I have a usb mouse, and it won't really solve the problem.  However, if there's a way to use it and keep my other usb input devices working, I'll be happy to.

Anyway, it doesn't appear to be the problem because it isn't enabled on the computer that works with the keyboard.

----------

## trantorvega

Do your computers have all the same kernel versions and patchsets?

----------

## faceman

Interestingly, I upgraded my kernel from 2.6.14 on the non-working box to linux-2.6.16-gentoo-r8 (which is what the working one has) and it works now.  What would have changed between these kernel versions that usb keyboards work differently?

----------

## purplerhino

glad you're working faceman.  i found a solution to my problem at http://www.mail-archive.com/linux-usb-users@lists.sourceforge.net/msg16184.html

----------

