LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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
 
LinkBack Search this Thread
Old 07-08-2008, 12:44 PM   #1
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
Question evdev/xorg help? USB mouse/kbd: 2.6.24="just works">2.6.25="unplug/replug to work".


"Find Similar Threads" found 2 nice threads 4-5 years old with 4 replies between them, and no conclusion.

This is Xorg 6.9 (Slackware 11 default) and current kernel is 2.6.25.1.
The USB mouse/kbd thingy is a PS2 Wireless job made by GE, with its base-station connected to USB thru a PS2->USB adapter.
My motherboards USB controller identifies at startup as a 8-port HUB as you will see below in /log/messages.
NOTE that regardless which kbd/mouse set I have connected to the adapter (the wireless OR my usual one), this thread applies equally.

Here goes:

Previously, on 2.6.24.4, the USB mouse and keyboard just worked, all the time, in VT console (kbd only because of GPM) or on the desktop. I had not configured either of them in xorg.conf, I just connected them and away I went. Right from boot/login, they just worked.

Now, I have lately spent significant time trying to configure the silly things (wireless USB mouse & kbd) in xorg.conf because they are no longer working since 2.6.25.x, and one day I decide what the heck, unplug them and plug them back in.. And voila, stupid things work as they used to, still with no xorg.configuration of them.

1st question: WHY is this?

Now, AFAIK, my kernel build has the same USB config options going on, as I don't generally change anything there when rebuilding.

On to part 2:

Let's say I want to configure the mouse & kbd explicitly in xorg.conf. How to go about it?
For the most part, I have discovered that whatever I put into xorg.conf in reference to this mouse & kbd either does nothing at all, OR it hangs X &/or the desktop &/or the machine. None of the usual friendly ways of killing the hang (or X) works, but I can usually get out by hitting the power button (which IS set up via acpid to shut off the machine, and it works cleanly to shut down-- unlike the da*ned reset button).

This hang/lockup happens primarily if I try to use the "evdev" driver on what I believe is the second mouse device (/dev/input/something), combined with the "AlwaysCore" option.
Without this magic combination of options that hangs the machine, there is simply no change in either detection or function of the mouse/kbd, except that when it doesn't work (which is usually), I see in the xorg.0.log that the second mouse was detected/identified as a keyboard. Grr..

For help, I have mostly consulted what is often a very helpful www place for stuff like this: The Gentoo Wiki's Advanced Mouse Configuration. Unfortunately, the description there of how to go about what I want to do is not really intuitive, particularly when it came to the EVDEV configuration.

The reason I want to use EVDEV is, AFAIK, it would allow for seamlessly operating the USB mouse (and kbd I guess) in cases when it happens to be/get connected to a different port some day, without me having to go through this rubbish of figuring out where the heck it is in /dev.

THEIR FIRST EXAMPLE showed how to use EVDEV the "old" way, by telling the X server to use Driver "evdev" and Device "/dev/<you-need-the-right-device-here>" which is not working for me for two reasons:
1) experimenting with evdev is hanging my machine leaving me nowhere;
and
2) I am not sure what the correct /dev node IS for this mouse and kbd (yes, the mouse and keyboard appear as ONE device with two pieces, AFAICT, yet they seem to work properly when they do work.)

2nd question: Incidentally, what is the /dev node for the FIRST keyboard on the PS2 port? Anyone know? Is there one?

THEIR SECOND EXAMPLE told me how to use evdev the "way evdev was indended to be used" which I suppose is supposed to be dynamic?? As before in their FIRST EXAMPLE above, they used Driver "evdev" but then went on to include a bunch of cryptic Options with no explanation, and stated that it would work.
I did not try the 'cryptic options method', because whether they work or not, I would like to know what they mean, where they got them, and WHY they work. Surely the cryptic options are not the exact same on everyones machine??

OK, I think that's enough questioning for now.. Here's some reference material:

First, some stuff from /proc when the USB devices are connected (this stuff is identical whether the USB stuff is connected but NOT working, or if I have unplugged it and reconnected it):
Code:

cat /proc/bus/usb/devices:

<-- snip -->

T:  Bus=02 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=13ba ProdID=0017 Rev= 0.01
S:  Product=Generic USB K/B
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=01 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=24ms
I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
E:  Ad=82(I) Atr=03(Int.) MxPS=   5 Ivl=10ms

,-- snip -->

cat /proc/bus/input/devices:

I: Bus=0003 Vendor=13ba Product=0017 Version=0110
N: Name="Generic USB K/B"
P: Phys=usb-0000:00:0b.0-2/input0
S: Sysfs=/class/input/input4
U: Uniq=
H: Handlers=kbd event4
B: EV=120013
B: KEY=10000 7 ff9f207a c14057ff febeffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=1f

I: Bus=0003 Vendor=13ba Product=0017 Version=0110
N: Name="Generic USB K/B"
P: Phys=usb-0000:00:0b.0-2/input1
S: Sysfs=/class/input/input5
U: Uniq=
H: Handlers=kbd mouse1 event5
B: EV=17
B: KEY=7001f 0 0 0 c000 100000 0 0 0
B: REL=103
B: MSC=10

cat /proc/bus/input/handlers:

N: Number=0 Name=kbd
N: Number=1 Name=mousedev Minor=32
N: Number=2 Name=evdev Minor=64
Here's snippets of /var/log/messages (with my comments added), showing bootup messages, and later, me unplugging and reconnecting the USB thingy:
Code:
# Bootup USB stuff:

Jul  8 13:07:48 darkstarssi kernel: ACPI: PCI Interrupt 0000:00:0b.1[B] -> Link [LUB2] -> GSI 20 (level, low) -> IRQ 20
Jul  8 13:07:48 darkstarssi kernel: ehci_hcd 0000:00:0b.1: EHCI Host Controller
Jul  8 13:07:48 darkstarssi kernel: ehci_hcd 0000:00:0b.1: new USB bus registered, assigned bus number 1
Jul  8 13:07:48 darkstarssi kernel: ehci_hcd 0000:00:0b.1: debug port 1
Jul  8 13:07:48 darkstarssi kernel: ehci_hcd 0000:00:0b.1: irq 20, io mem 0xf9efec00
Jul  8 13:07:48 darkstarssi kernel: ehci_hcd 0000:00:0b.1: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004
Jul  8 13:07:48 darkstarssi kernel: usb usb1: configuration #1 chosen from 1 choice
Jul  8 13:07:48 darkstarssi kernel: hub 1-0:1.0: USB hub found
Jul  8 13:07:48 darkstarssi kernel: hub 1-0:1.0: 8 ports detected
Jul  8 13:07:48 darkstarssi kernel: usbcore: registered new interface driver libusual

# Here's the standard PS2 mouse/kbd ports:

Jul  8 13:07:48 darkstarssi kernel: PNP: PS/2 Controller [PNP0303:PS2K,PNP0f03:PS2M] at 0x60,0x64 irq 1,12
Jul  8 13:07:48 darkstarssi kernel: serio: i8042 KBD port at 0x60,0x64 irq 1
Jul  8 13:07:48 darkstarssi kernel: serio: i8042 AUX port at 0x60,0x64 irq 12
Jul  8 13:07:48 darkstarssi kernel: mice: PS/2 mouse device common for all mice
Jul  8 13:07:48 darkstarssi kernel: input: AT Translated Set 2 keyboard as /class/input/input2

<-- snip -->

Jul  8 13:07:48 darkstarssi kernel: input: ImPS/2 Logitech Wheel Mouse as /class/input/input3

<-- snip -->

# continued USB detection leading to the USB mouse/kbd identification:

Jul  8 13:07:48 darkstarssi kernel: ACPI: PCI Interrupt 0000:00:0b.0[A] -> Link [LUB0] -> GSI 22 (level, low) -> IRQ 22
Jul  8 13:07:48 darkstarssi kernel: ohci_hcd 0000:00:0b.0: OHCI Host Controller
Jul  8 13:07:48 darkstarssi kernel: ohci_hcd 0000:00:0b.0: new USB bus registered, assigned bus number 2
Jul  8 13:07:48 darkstarssi kernel: ohci_hcd 0000:00:0b.0: irq 22, io mem 0xf9eff000
Jul  8 13:07:48 darkstarssi kernel: usb usb2: configuration #1 chosen from 1 choice
Jul  8 13:07:48 darkstarssi kernel: hub 2-0:1.0: USB hub found
Jul  8 13:07:48 darkstarssi kernel: hub 2-0:1.0: 8 ports detected

<-- snip out some video card stuff -->

Jul  8 13:07:48 darkstarssi kernel: usb 2-2: new low speed USB device using ohci_hcd and address 2
Jul  8 13:07:48 darkstarssi kernel: usb 2-2: configuration #1 chosen from 1 choice
Jul  8 13:07:48 darkstarssi kernel: usbcore: registered new interface driver hiddev
Jul  8 13:07:48 darkstarssi kernel: input: Generic USB K/B as /class/input/input4
Jul  8 13:07:48 darkstarssi kernel: input,hidraw0: USB HID v1.10 Keyboard [Generic USB K/B] on usb-0000:00:0b.0-2
Jul  8 13:07:48 darkstarssi kernel: input: Generic USB K/B as /class/input/input5
Jul  8 13:07:48 darkstarssi kernel: input,hidraw1: USB HID v1.10 Mouse [Generic USB K/B] on usb-0000:00:0b.0-2
Jul  8 13:07:48 darkstarssi kernel: usbcore: registered new interface driver usbhid
Jul  8 13:07:48 darkstarssi kernel: drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver

<-- snip out irrelevant boot messages -->

# Here's the gpm latching onto the PS2 mouse:

Jul  8 13:07:59 darkstarssi /usr/sbin/gpm[1821]: *** info [startup.c(95)]: 
Jul  8 13:07:59 darkstarssi /usr/sbin/gpm[1821]: Started gpm successfully. Entered daemon mode.
Jul  8 13:07:59 darkstarssi /usr/sbin/gpm[1821]: *** info [mice.c(1766)]: 
Jul  8 13:07:59 darkstarssi /usr/sbin/gpm[1821]: imps2: Auto-detected intellimouse PS/2

<-- snip -->

# and here is me unplugging and reconnecting the USB adapter with the wireless mouse/kbd, after which it works perfectly (note the different class/input# numbers):

Jul  8 13:19:48 darkstarssi kernel: usb 2-2: USB disconnect, address 2
Jul  8 13:19:52 darkstarssi kernel: usb 2-2: new low speed USB device using ohci_hcd and address 3
Jul  8 13:19:52 darkstarssi kernel: usb 2-2: configuration #1 chosen from 1 choice
Jul  8 13:19:52 darkstarssi kernel: input: Generic USB K/B as /class/input/input6
Jul  8 13:19:52 darkstarssi kernel: input,hidraw0: USB HID v1.10 Keyboard [Generic USB K/B] on usb-0000:00:0b.0-2
Jul  8 13:19:52 darkstarssi kernel: input: Generic USB K/B as /class/input/input7
Jul  8 13:19:52 darkstarssi kernel: input,hidraw1: USB HID v1.10 Mouse [Generic USB K/B] on usb-0000:00:0b.0-2

<-- snip -->
Here's the Gentoo Wiki pages I referred to earlier:

http://www.gentoo-wiki.com/HOWTO_Evdev_Input
http://www.gentoo-wiki.com/HOWTO_Advanced_Mouse
http://www.gentoo-wiki.com/HOWTO_Second_Mouse

If anyone wants more info, of if there's something I missed or should try, please feel free!

Sasha
 
Old 07-08-2008, 02:30 PM   #2
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Original Poster
Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
UPDATE:

OK, by following the instructions at the Gentoo Static Mouse config page, as well as at Writing UDEV Rules page here I have managed to get udev to latch onto the mouse by some unique identifier, as shown in the rules file included below.
I used UDEVTEST and UDEVMONITOR to identify the mouse when it got plugged in, and after about 10 tries, got the rule worked out.

SO.. I now have my symlink for the mouse at /dev/input/usbwirelessmouse and when I use that in my DEVICE line in xorg.conf, X starts, and the mouse is actually (FINALLY) identified as a mouse in the xorg.0.log file.

CORRECTION: The mouse is not identified at all.

HOWEVER!! Though the USB keyboard still works (without an explicit config in xorg.conf) the mouse itself seems to be going a million pixels-per-hour!! The cursor flies all over the place so fast that it cannot be seen, and there are menus and files and stuff opening and closing all over the place !! But X didn't crash, I was able to use the PS2 mouse to right-click and logout.

NOTE: Testing is pretty quick and convenient when it doesn't crash, as I am using a second X session for testing, on VT6.


Look at this from the xorg log file:
Code:
<-- snip -->

(**) Option "CoreKeyboard"
(**) Keyboard0: Core Keyboard
(**) Option "Protocol" "standard"
(**) Keyboard0: Protocol: standard
(**) Option "AutoRepeat" "500 30"
(**) Option "XkbRules" "xorg"
(**) Keyboard0: XkbRules: "xorg"
(**) Option "XkbModel" "pc104"
(**) Keyboard0: XkbModel: "pc104"
(**) Option "XkbLayout" "us"
(**) Keyboard0: XkbLayout: "us"
(**) Option "CustomKeycodes" "off"
(**) Keyboard0: CustomKeycodes disabled
(**) Option "Protocol" "IMPS/2"
(**) Mouse0: Device: "/dev/psaux"
(**) Mouse0: Protocol: "IMPS/2"
(**) Option "CorePointer"
(**) Mouse0: Core Pointer
(**) Option "Device" "/dev/psaux"
(**) Option "Buttons" "5"
(==) Mouse0: Emulate3Buttons, Emulate3Timeout: 50
(**) Option "ZAxisMapping" "4 5"
(**) Mouse0: ZAxisMapping: buttons 4 and 5
(**) Mouse0: Buttons: 9
(II) XINPUT: Adding extended input device "Mouse0" (type: MOUSE)
(II) XINPUT: Adding extended input device "Keyboard0" (type: KEYBOARD)
(II) Mouse0: ps2EnableDataReporting: succeeded
(II) 3rd Button detected: disabling emulate3Button
AUDIT: Tue Jul  8 13:22:42 2008: 1983 X: client 25 rejected from local host
AUDIT: Tue Jul  8 13:22:42 2008: 1983 X: client 25 rejected from local host
AUDIT: Tue Jul  8 13:23:52 2008: 1983 X: client 24 rejected from local host
AUDIT: Tue Jul  8 13:23:52 2008: 1983 X: client 24 rejected from local host
AUDIT: Tue Jul  8 13:23:52 2008: 1983 X: client 24 rejected from local host
AUDIT: Tue Jul  8 13:23:52 2008: 1983 X: client 24 rejected from local host
AUDIT: Tue Jul  8 13:23:52 2008: 1983 X: client 24 rejected from local host
AUDIT: Tue Jul  8 13:23:54 2008: 1983 X: client 24 rejected from local host
AUDIT: Tue Jul  8 13:23:54 2008: 1983 X: client 24 rejected from local host
AUDIT: Tue Jul  8 13:23:54 2008: 1983 X: client 24 rejected from local host

<--snip -->
.. it appears that something was rejected, in the AUDIT lines above.. I don't know FOR SURE that client 24 and client 25 are the USB mouse & kbd, but it looks that way, especially as there is not a similar bunch of friendly information there about mouse1 (and kbd1) like there is for mouse0 and keyboard0.

Also, in xorg.conf, I am using Driver="mouse" but should I maybe try another driver?

UDEV RULES file I made:
Code:
 
SUBSYSTEM=="input", SUBSYSTEMS=="usb",ATTRS{modalias}=="usb:v13BAp0017d0001dc00dsc00dp00ic03isc01ip02", SYMLINK+="input/usbwirelessmouse"
S

Last edited by GrapefruiTgirl; 07-08-2008 at 02:50 PM. Reason: UPDATED info. & correction!!
 
1 members found this post helpful.
Old 07-08-2008, 02:57 PM   #3
GrapefruiTgirl
Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Original Poster
Rep: Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542Reputation: 542
UPDATE: getting rid of the Option "mouse1" "AlwaysCore" has eliminated the rapid zooming of the pointer all over the place, and the mouse works, however the log xorg.0.log still shows that bunch of AUDIT..Relected lines, and there is still no mention in the log of anything for "mouse1" configured..

It should be noted at this point that I have NOT YET tried booting the machine with the mouse/kbd connected, to see if it works off the bat. I would prefer to see in xorg.log that the devices (s) have been configured properly first..
 
Old 07-08-2008, 02:58 PM   #4
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266Reputation: 1266
Well, I know I had similar problems in SW 11.0, and I never really found a clean way around the problem, heck I'm not all too sure exactly what the problem was. I ended up implementing some sort of hack or workaround much like you did. I made a script that handled all of this nonsense in a quasi-intelligent manner. I seem to have misplaced it tho
 
Old 12-13-2012, 02:23 PM   #5
NikoSauer
LQ Newbie
 
Registered: Dec 2012
Posts: 1

Rep: Reputation: Disabled
mouse/keyboard fails at startx

This works for me (xorg-7.7; Xorg-server-1.12.4; Linux-3.3.7; udev-182).

Line in my .xinitrc script:

sudo /sbin/udevadm trigger --action=add &

This comes before the window manager (FVWM in my case) is called.

In /etc/sudoers provision is made for udevadm to be accessible to "sudo-ing".

Apparently the X-Server loses whatever udev did at boot.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Having an issue with "evdev" in lenny/sid, no errors, but unable to use mouse danlee Debian 2 02-18-2008 04:44 PM
evdev creates mouse "jaggies" enigma_0Z Linux - Hardware 0 11-14-2006 09:05 AM
Problems configuring "xorg.conf" with "ATI FGLRX" BlueSpirit Slackware 3 09-16-2006 02:01 PM
Any way to get "Alice"; "Call of Duty" series and "Descent 3" to work? JBailey742 Linux - Games 13 06-23-2006 01:34 PM
what are the other "config's" like "mouse/xorg/xwmconfig ??? b0nd Slackware 2 01-10-2006 01:51 AM


All times are GMT -5. The time now is 04:26 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration