LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   imwheel crashes startx (https://www.linuxquestions.org/questions/slackware-14/imwheel-crashes-startx-557846/)

Nixis 05-30-2007 05:04 PM

imwheel crashes startx
 
I've been trying to get my extra mouse buttons (mx1000) to work in web browsers to no avail. I have a .xinitrc that call imwheel -k -b "89" in order to make the back and forward buttons work on my mouse. When I startx the system returns to CLI with no warnings, but when I remove the .xinitrc the server starts (no back and forward mouse buttons). I also modified the .xiinitrc with a & at the end, but it did not help. When I run the imwheel -k -b "89" in the Konsole while X is running the mouse buttons work as anticipated.

Any suggestions?

H_TeXMeX_H 05-30-2007 06:22 PM

No need for imwheel if you want just the back and forward buttons.

I have the same mouse, this is what works for me so I can go back and fourth in FF.

http://susewiki.org/index.php?title=...itech_MX_Mouse

Basically just add this line to the input device: mouse section of '/etc/X11/xorg.conf'

Code:

Option "ButtonMapping" "1 2 3 6 7"
So for example here is my section:

Code:

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option            "Protocol" "auto"
        Option            "Device" "/dev/mouse"
        Option            "ZAxisMapping" "4 5"
        Option      "ButtonMapping" "1 2 3 6 7"
EndSection

EDIT: There is only one small problem, which I cannot seem to fix ... still trying ... the scroll up button (not the wheel) will act as a back button also. Not sure why. Maybe someone can explain this ?

H_TeXMeX_H 05-30-2007 10:26 PM

One thing that is very strange is that using xev, when I press the scroll up button that is being read as button 4 AND 6 (why both ?). And when I press scroll down it is being read as button 5 AND 1. I think it is misconfigured. I'll keep trying to find the answer, I'll say if I find it.

H_TeXMeX_H 05-30-2007 11:49 PM

I have found another solution.

Here's the steps I took. Now this is specifically for the Logitech MX1000 mouse. And pretty much followed the guide here:
http://gentoo-wiki.com/HOWTO_Advanced_Mouse

Yeah, Gentoo has great HOWTOs ... :)

So,

1) Make sure you plug the mouse in via USB, NOT the funky USB -> PS/2 converter ... it is crap !

2) Next run:
Code:

cat /proc/bus/input/devices
(just like the HOWTO says)

Mine says:
Code:

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=4 2000000 3802078 f840d001 f2ffffdf ffefffff ffffffff fffffffe
B: MSC=10
B: LED=7

I: Bus=0003 Vendor=046d Product=c50e Version=2500
N: Name="Logitech USB Receiver"
P: Phys=usb-0000:00:03.0-2/input0
S: Sysfs=/class/input/input2
H: Handlers=mouse0 event1
B: EV=7
B: KEY=ffff0000 0 0 0 0 0 0 0 0
B: REL=143

Notice that the first one is for the keyboard ... ignore that, but know that one of them will be for the keyboard (and other input devices)

The second one says "Logitech USB Receiver", yeah, that one is the mouse (receiver).

3)Now, I tried Option 2 of that HOWTO, namely:
Code:

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "evdev"
        Option      "Name" "Logitech USB Receiver"
EndSection

But xserver never started :(

BUT, I then tried option 1, which is:
Code:

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "evdev"
        Option      "Device" "/dev/input/event0"
EndSection

EXCEPT, in our case here, check #2 above, it says:
Code:

H: Handlers=mouse0 event1

So our config must be this:


Code:

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "evdev"
        Option      "Device" "/dev/input/event1"
EndSection

I have also tried 'mouse0' thinking it would work ... nope :(

4) Now there is one problem with the above, which is that the event bound to the mouse may change.

Might want to try evdev autodetection (option 3 on the HOWTO), even tho it doesn't work for me :(

Code:

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "evdev"
        Option      "evBits"        "+1-2"
        Option      "keyBits"      "~272-287"
        Option      "relBits"      "~0-2 ~6 ~8"
        Option      "Pass"          "3"
EndSection

Or, I wrote a script to fix xorg.conf on boot to the new event (this hack is the only thing that I could get to work):

Code:

#!/bin/sh
# fixes /etc/X11/xorg.conf for the right mouse event

# event from /proc/bus/input/devices
DEVEVENT=$(grep mouse /proc/bus/input/devices | awk '{ print $3 }')

# event from /etc/X11/xorg.conf
XEVENT=$(grep /dev/input /etc/X11/xorg.conf | awk '{ print $3 }' | sed 's/"//g' | sed 's/\// /g' | awk '{ print $3 }')

# if the events are not equal, fix it
if test $DEVEVENT != $XEVENT
then
  # fix it
  sed "s/$XEVENT/$DEVEVENT/g" /etc/X11/xorg.conf > /etc/X11/xorg.conf-mod
  cat /etc/X11/xorg.conf-mod > /etc/X11/xorg.conf
fi

# success
exit 0

Your choice. You can call this script from rc.local, and I put the script in /etc/rc.d.

5) Last thing is, if your mouse buttons still do not work, do one of the following
from the Gentoo guide here:http://gentoo-wiki.com/HOWTO_Advance...ogitech_MX1000

a) put this line into '~/.Xmodmap' (create it if it doesn't exist):
Code:

pointer = 1 3 2 4 5 8 9 6 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
b) If (a) reverses your middle and right mouse buttons do this instead:
Code:

pointer = 1 2 3 4 5 8 9 6 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
('a' worked for me, but yours may not need any of these, depending on which version of the mouse you bought ... mice have versions ... who knew ?)

There you have it, hope that helps. Again, this is all taken (and interpreted by me) from the above two referenced Gentoo HOWTOs. Again, Gentoo has great howtos, especially on how to customize ...

And if you still wanna use imwheel, there's a section on that in there too:
http://gentoo-wiki.com/HOWTO_Advanced_Mouse#imwheel

BUT,
Quote:

Note:

IMWheel is completely unnecessary for most modern mice including both USB and PS/2 models. X will usually detect that these mice have a scroll wheel or else you'll be able to map it properly with Xmodmap and the axis settings in your xorg.conf file. This program should only be used for extreme cases including very odd or old mice, or if you wish to define custom behaviour (such as trigger your window manager to invoke specific scripts) on mouse events.

H_TeXMeX_H 06-03-2007 12:01 PM

Does anyone have a better solution to this ? The only thing that works for me is the hackish script that I wrote that modifies xorg.conf on boot to the right 'event#'.

And it works pretty well, but sometimes when I exit xserver, it says it segfaults. It doesn't hurt anything I guess, cuz it crashes only when I exit it ...

H_TeXMeX_H 06-04-2007 04:04 PM

I managed to get a log from one of the crashes:

Code:

(**) Option "CorePointer"
(**) Mouse0: Core Pointer
(**) Mouse0: Device: "/dev/input/event0"
(II) Mouse0: Found x and y relative axes
(II) Mouse0: Found mouse buttons
(II) Mouse0: Configuring as mouse
(**) Option "CoreKeyboard"
(**) Keyboard0: Core Keyboard
(**) Option "Protocol" "standard"
(**) Keyboard0: Protocol: standard
(**) Option "AutoRepeat" "500 30"
(**) Option "XkbRules" "xorg"
(**) Keyboard0: XkbRules: "xorg"
(**) Option "XkbModel" "pc101"
(**) Keyboard0: XkbModel: "pc101"
(**) Option "XkbLayout" "us(dvorak)"
(**) Keyboard0: XkbLayout: "us(dvorak)"
(**) Option "CustomKeycodes" "off"
(**) Keyboard0: CustomKeycodes disabled
(II) XINPUT: Adding extended input device "Keyboard0" (type: KEYBOARD)
(II) XINPUT: Adding extended input device "Mouse0" (type: MOUSE)
(II) XINPUT: Adding extended input device "NVIDIA Damage Notification Manager" (type: Other)
(II) XINPUT: Adding extended input device "NVIDIA Kernel RC Handler" (type: Other)
(II) XINPUT: Adding extended input device "NVIDIA Event Handler" (type: Other)
Could not init font path element /usr/X11R6/lib/X11/fonts/CID/, removing from list!
(II) Open ACPI successful (/var/run/acpid.socket)
(II) NVIDIA(0): Setting mode "1024x768"
(II) Mouse0: Close

  *** If unresolved symbols were reported above, they might not
  *** be the reason for the server aborting.

Backtrace:
0: /usr/X11R6/bin/X(xf86SigHandler+0x8a) [0x8088b2a]
1: [0xffffe420]
2: /usr/X11R6/lib/modules/input/evdev_drv.so [0xb7cf9dd4]
3: /usr/X11R6/bin/X [0x80889ec]
4: /usr/X11R6/bin/X [0x80a3834]
5: [0xffffe420]
6: /usr/X11R6/bin/X(ddxGiveUp+0x60) [0x8070750]
7: /usr/X11R6/bin/X(main+0x628) [0x80d4898]
8: /lib/tls/libc.so.6(__libc_start_main+0xd4) [0xb7e31e14]
9: /usr/X11R6/bin/X [0x806ff61]

Fatal server error:
Caught signal 11.  Server aborting


Please consult the The X.Org Foundation support
        at http://wiki.X.Org
 for help.
Please also check the log file at "/var/log/Xorg.0.log" for additional information.

(WW) xf86CloseConsole: VT_GETSTATE failed: Bad file descriptor
(WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor
(WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor

This sometimes happens upon exiting / killing xserver.

Quakeboy02 06-04-2007 04:29 PM

The problem is generally that your .xinitrc doesn't have the right contents to actually start X. There is a file somewhere that you can copy to get a working .xinitrc, but I'll be danged if I can remember where it is. (Sorry) I generally follow the path of least resistance and found that you can just use the default startup and make the following mods:

BTW: I don't have the same mouse, but here is how I did my MS Intellimouse on Etch:

NOTE: For each major revision of Sarge and going from Sarge to Etch I have had to bang on xorg.conf at random with a large heavy object to make it work. I can't say that this will work for anyone else:

From xorg.conf:
Code:

Section "InputDevice"
        Identifier      "Configured Mouse"
        Driver          "mouse"
        Option          "CorePointer"
        Option          "Device"                "/dev/input/mice"
        Option          "Protocol"              "ExplorerPS/2"
        Option          "Emulate3Buttons"      "true"
EndSection

I use Gnome, and in Desktop->Preferences->Sessions->Startup Programs I have added the line:
Code:

/home/myuserid/.xmodmap.sh
The contents of /home/myuserid/.xmodmap.sh is:
Code:

#/bin/sh
/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7"


Quakeboy02 06-04-2007 04:40 PM

I found an old .xinitrc file that I used until I figured out the way I put above. Notice that it has the xmodmap command in it. I had just copied this file verbatim from /etc/X11/xinit/xinitrc, I guess before adding the xmodmap stuff.

Code:

#!/bin/sh
# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $

# /etc/X11/xinit/xinitrc
#
# global xinitrc file, used by all X sessions started by xinit (startx)

# fix the mouse side buttons
/usr/X11R6/bin/xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7"

# invoke global X session script
. /etc/X11/Xsession

I hope that one of my posts helps.

H_TeXMeX_H 06-04-2007 09:50 PM

Well, I looked around a bit, it seems that '/etc/X11/xinit' contains a script 'xinitrc' (actually a symlink to 'xinitrc.fluxbox'), that gets run when I start xserver.

So, what should I do ? How do I stop xserver from crashing when I exit xserver ?

If I use the 'mouse' driver, the buttons on my mouse do not work properly. Basically, I'd have to disable most of them so things don't go wrong.

Quakeboy02 06-04-2007 10:25 PM

Sorry TexMex, I was only trying to address Nixis' problem with .xinitrc and remapping the buttons and wheels. I remember going through hell trying to figure out why a simple .xinitrc wouldn't start X. I don't have any suggestions for you if the event is changing from boot to boot. But you might want to open a new thread for your problem.

H_TeXMeX_H 06-14-2007 07:49 PM

If you want an update on this ... there have been no further crashes. All crashes seem to have originated from a source other than the evdev driver. So, I think the best solution is using the startup script that I proposed. You get a fully functional mouse, even tho the solution is kind of hackish ... I can't find a better solution. Nothing else works.


All times are GMT -5. The time now is 08:10 AM.