LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 06-13-2011, 07:56 PM   #1
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Rep: Reputation: 154Reputation: 154
Exclamation Keyboard kbd driver and evdev driver on same keyboard


I was getting strange extra keycodes for some keys. The PGUP key would include a "/", the PGDN would open a menu, and up and right arrow did similar. After a year of fighting this (it made 2.6 unusable, so I kept running 2.4) I finally found the cause. Both kbd driver and evdev are responding to the same keyboard. Only discovered this after reading all of the xorg Changelog and getting a clue (they have known about this for years), and then grepping all the keycodes to find all possible sources for the keycodes that xev was reporting.
Because evdev also gets used for two power buttons and the mouse, it shows up in the logs anyway.

When xorg.conf specifies using "kbd" as the keyboard driver.
The kbd driver will be loaded, and the mapping will be set to the xfree86 keycode symbols.

Then HAL will discover the keyboard and load evdev as a keyboard driver. It does not notice that there already is a keyboard driver.

For every keypress, both evdev and kbd respond with keyboard events. Most evdev keycodes are not understood because the keyboard mapping is setup by kbd. A few of the keycodes happen to look valid, and those give extraneous responses.

There are four bugs here.
1. HAL starts a new driver for a device that already has one. Perhaps kbd needs to grab the device.
2. evdev does not check that the device is already in use
3. kbd has no way (that I know of) to fend off evdev, such as grabbing the device.
4. When HAL starts evdev for the keyboard, it does not change the keyboard mapping.

I would like to use kbd driver again, because evdev is not reporting keycodes for my internet buttons (Logitech Internet keyboard).

Questions:
Are there any known solutions for the four bugs listed?
I have not found any by internet search.

Are there docs for configuring HAL ?
How do you stop it from loading the evdev keyboard driver? (aside from blind mangling the config files).

Is there something special (or a known bug) concerning getting Logitech Internet keyboard to respond with usable keycodes (at least to xev)?

I have tried Option "Model" "logiik"
and it is being ignored, as far as I can tell. There is no difference in the keycodes reported to xev from using
Option "Model" "pc104".

I have no idea what using evdev as a keyboard model is "supposed" to do. I have not found any docs that describe this.
Option "Model" "evdev".

I could use general solutions because there are two machines, with differing hardware, and I am only giving details for the easy one.

Last edited by selfprogrammed; 06-13-2011 at 08:05 PM.
 
Old 06-14-2011, 01:00 PM   #2
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 997
Blog Entries: 15

Rep: Reputation: 136Reputation: 136
Hi,

One option would be to completely disable hal for X. You can achieve this by adding
Quote:
Option "AutoAddDevices" "false"
to the ServerFlags section. Another is to mess with HAL files; I can't help you there, as HAL is dropped from Getnoo, so I got no way to test.
As for your evdev related problem, a quick google search found this, could it help?

Serafean
 
1 members found this post helpful.
Old 06-25-2011, 03:27 PM   #3
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Original Poster
Rep: Reputation: 154Reputation: 154
Thank You. Maybe not directly applicable because it is different keyboard. But it has some links to check out. Cannot flag this as solved. There will be a long pause while I look through all the links.

Do not want to totally lose HAL, because it does some other things too, like auto-mount cdrom and memory sticks.

Is there really no way to specifically tell HAL to leave the keyboard alone.
 
Old 06-28-2011, 08:38 AM   #4
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 997
Blog Entries: 15

Rep: Reputation: 136Reputation: 136
Quote:
Is there really no way to specifically tell HAL to leave the keyboard alone.
The AutoAddDevices option in Xorg.conf is supposed to do that.
 
Old 06-29-2011, 10:17 PM   #5
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Original Poster
Rep: Reputation: 154Reputation: 154
I can not consider this question answered unless the answer can specifically stop the keyboard driver being loaded by HAL, without stopping other devices like usb memory sticks, and cdrom mounts.
That is what I mean by specific, how to tell HAL that the keyboard driver is not its concern, and not how to kill HAL altogether.

Last edited by selfprogrammed; 06-29-2011 at 10:19 PM.
 
Old 06-30-2011, 11:13 AM   #6
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 997
Blog Entries: 15

Rep: Reputation: 136Reputation: 136
Hi,

HAL takes care of any hardware that changes while the system is running.
X takes care of catching input events and passing them along to clients, then rendering changes on screen.

From the X manual :
Quote:
Option "AutoAddDevices" "boolean"
If this option is disabled, then no devices will be added from HAL events. Enabled by default.
This means that HAL will still be running, taking care of CDROMS and memory cards, but X will ignore any input devices reported by HAL. Instead you will have to specify a keyboard and mouse InputDevice section, and that will be used. Which means that HAL will detect the keyboard, and tell X about, but X will ignore anything HAL tells it, using its own configuration file.
This option will NOT kill HAL.
 
1 members found this post helpful.
Old 07-01-2011, 03:18 PM   #7
selfprogrammed
Member
 
Registered: Jan 2010
Location: Minnesota, USA
Distribution: Slackware 13.37, 14.2, 15.0
Posts: 635

Original Poster
Rep: Reputation: 154Reputation: 154
Thank you for that information. That is a little clearer stated that way. Thank You.
I may get a chance to try that later next week. It will only work if none of the other devices used by X are installed by HAL discover-and-report (camera, etc.), and it will take some testing to verify.

However, there are four questions/bugs, and I want to keep this thread open.
I especially am interested in configuring HAL itself, not messing with X to work around it.
It seems there is no public knowledge on how to configure it or control HAL.

Update 7/5/2011:
Tried disabling "AutoAddDevices", and it also refused to load evdev for two power buttons that HAL had found.
No other bad effects so far. Would have to figure out how to setup Xorg.conf to load evdev for power buttons. I do not know which is worse, right now. Both ways I have devices and keys that do not work.

Last edited by selfprogrammed; 07-06-2011 at 09:57 PM. Reason: Update:
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
keyboard configuration in Xorg: deadkeys, hal, evdev, what? quiescere Slackware 2 12-18-2010 09:07 PM
One question on keyboard driver Richard.Yang Linux - Kernel 1 12-13-2010 02:14 AM
How to write a keyboard driver? sunr2007 Linux - Kernel 4 01-15-2009 12:40 AM
Mandriva 2008.0 evdev with usb keyboard for multiseat config darion Mandriva 1 08-02-2008 07:40 AM
Keyboard Driver Roy-Svork Linux - Hardware 1 02-25-2003 06:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 08:00 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration