View previous topic :: View next topic |
Author |
Message |
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Wed Dec 26, 2012 5:28 pm Post subject: Joystick not detected in games |
|
|
Hello,
Santa gave an Saitek ST90 USB Stick to kids
It seems it is working because when plugged, in can see in system's log :
Quote: | Dec 26 18:18:49 dual kernel: [14764.615242] usb 8-1: new low-speed USB device number 5 using uhci_hcd
Dec 26 18:18:49 dual kernel: [14764.808190] input: Saitek ST90 USB Stick as /devices/pci0000:00/0000:00:1d.2/usb8/8-1/8-1:1.0/input/input11
Dec 26 18:18:49 dual kernel: [14764.808365] hid-generic 0003:06A3:0422.0005: input,hidraw2: USB HID v1.00 Joystick [Saitek ST90 USB Stick] on usb-0000:00:1d.2-1/input0
|
And I can move the mice cursor using it.
The problem is this joystick is not detected in SuperTuxKart (joystick not proposed) or in ExtremeTuxRacer (even checked, no action from joystick).
Any tips ?
Thanks
Laurent |
|
Back to top |
|
|
lxg Veteran
Joined: 12 Nov 2005 Posts: 1019 Location: Aachen, Germany
|
Posted: Thu Dec 27, 2012 10:01 pm Post subject: |
|
|
Do you have joystick support in your kernel? If so, do you see any /dev/input/js* devices?
Is it possible that the device is not supported on Linux (yet)? _________________ lxg.de – codebits and tech talk |
|
Back to top |
|
|
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Fri Dec 28, 2012 5:36 pm Post subject: |
|
|
lxg wrote: | Do you have joystick support in your kernel? |
I have
Code: | CONFIG_INPUT_JOYSTICK=y |
All the others are unset.
lxg wrote: | If so, do you see any /dev/input/js* devices? |
No
lxg wrote: | Is it possible that the device is not supported on Linux (yet)? |
I think it is, as the system's log, and as I can move the pointer with it.
I'm continuing to search ... |
|
Back to top |
|
|
hephooey n00b
Joined: 24 Feb 2003 Posts: 74
|
Posted: Tue Jan 01, 2013 1:04 am Post subject: |
|
|
It looks like your device was detected as a mouse, try evtest and see if there is something looks like your joystick and the properities of it looks similar to your mouse. |
|
Back to top |
|
|
na641 Apprentice
Joined: 27 Jun 2002 Posts: 169 Location: Eugene, OR
|
Posted: Tue Jan 01, 2013 7:12 pm Post subject: |
|
|
My gamepad works fine and i have no /dev/input/js* devices. They are all listed as /dev/input/event* devices.
destroyedlolo, is your user a member of the usb group? When you run those games as root does the gamepad work? |
|
Back to top |
|
|
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Mon Jan 07, 2013 3:49 pm Post subject: |
|
|
Sorry for this late reply (busy by kids and I have to build a new PC )
hephooey wrote: | It looks like your device was detected as a mouse, try evtest and see if there is something looks like your joystick and the properities of it looks similar to your mouse. |
I'm not sure how to read the output but the result looks similar.
Code: | dual laurent # evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Sleep Button
/dev/input/event1: Lid Switch
/dev/input/event2: Power Button
/dev/input/event3: Video Bus
/dev/input/event4: AT Translated Set 2 keyboard
/dev/input/event5: SynPS/2 Synaptics TouchPad
/dev/input/event6: Logitech USB Optical Mouse
/dev/input/event7: PS/2 Generic Mouse
/dev/input/event8: Saitek ST90 USB Stick
Select the device event number [0-8]: 8
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x6a3 product 0x422 version 0x100
Input device name: "Saitek ST90 USB Stick"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 288 (BTN_TRIGGER)
Event code 289 (BTN_THUMB)
Event code 290 (BTN_THUMB2)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 655
Min 0
Max 1023
Fuzz 3
Flat 63
Event code 1 (ABS_Y)
Value 907
Min 0
Max 1023
Fuzz 3
Flat 63
Event code 2 (ABS_Z)
Value 255
Min 0
Max 255
Flat 15
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Testing ... (interrupt to exit)
Event: time 1357572678.373149, type 3 (EV_ABS), code 0 (ABS_X), value 654
Event: time 1357572678.373166, -------------- SYN_REPORT ------------
dual laurent # evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Sleep Button
/dev/input/event1: Lid Switch
/dev/input/event2: Power Button
/dev/input/event3: Video Bus
/dev/input/event4: AT Translated Set 2 keyboard
/dev/input/event5: SynPS/2 Synaptics TouchPad
/dev/input/event6: Logitech USB Optical Mouse
/dev/input/event7: PS/2 Generic Mouse
Select the device event number [0-7]: 6
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x46d product 0xc018 version 0x111
Input device name: "Logitech USB Optical Mouse"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 272 (BTN_LEFT)
Event code 273 (BTN_RIGHT)
Event code 274 (BTN_MIDDLE)
Event type 2 (EV_REL)
Event code 0 (REL_X)
Event code 1 (REL_Y)
Event code 8 (REL_WHEEL)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Testing ... (interrupt to exit)
Event: time 1357572920.850067, type 2 (EV_REL), code 0 (REL_X), value -1
Event: time 1357572920.850076, -------------- SYN_REPORT ------------
|
In addition, I can control the mouse cursor with this joystick ... But how can I tell I need it only as a joystick ?
na641 wrote: | My gamepad works fine and i have no /dev/input/js* devices. They are all listed as /dev/input/event* devices.
destroyedlolo, is your user a member of the usb group? |
Yes
Code: | id laurent
uid=1000(laurent) gid=1000(laurent) groupes=1000(laurent),10(wheel),18(audio),19(cdrom),27(video),85(usb),100(users),250(portage),16(cron),35(games)
|
na641 wrote: | When you run those games as root does the gamepad work? |
Same result
Last edited by destroyedlolo on Mon Jan 07, 2013 4:21 pm; edited 1 time in total |
|
Back to top |
|
|
fr3eatlast n00b
Joined: 21 Jul 2012 Posts: 41 Location: Marquette, MI
|
Posted: Fri Jan 11, 2013 2:42 am Post subject: |
|
|
Do you have Code: | INPUT_DEVICES="joystick" | in your make.conf because since I added that I haven't had any problems with games recognizing my joystick. |
|
Back to top |
|
|
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Fri Jan 11, 2013 10:24 pm Post subject: |
|
|
You're right, I have only
Code: | INPUT_DEVICES="evdev" |
but I understood it's right as evdev manages HID by itself. Am I wrong ? |
|
Back to top |
|
|
fr3eatlast n00b
Joined: 21 Jul 2012 Posts: 41 Location: Marquette, MI
|
Posted: Sat Jan 12, 2013 12:40 am Post subject: |
|
|
You are right in that evdev does manage HID devices by itself. I put in my make.conf Code: | INPUT_DEVICES="evdev synaptics joystick" | because I was having problems getting my joystick to work as a joystick instead of it being registered as a mouse. I'm not sure if this is the correct way to get it to work but it helped me. Maybe someone with more knowledge than me can help explain this because I'll be the first to admit that I don't really know all that much about gentoo after being away for about 5 years lol. |
|
Back to top |
|
|
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Sat Jan 12, 2013 7:05 pm Post subject: |
|
|
ok let's try.
At least it causes rebuild of Xorg and addition of x11-drivers/xf86-input-joystick and have a dependance on xf86driproto. |
|
Back to top |
|
|
fr3eatlast n00b
Joined: 21 Jul 2012 Posts: 41 Location: Marquette, MI
|
Posted: Sun Jan 13, 2013 6:31 pm Post subject: |
|
|
If that doesn't help you, you can always see if the games that you are trying to get the joystick to work with have a joystick USE flag that you can enable. |
|
Back to top |
|
|
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Sun Jan 13, 2013 10:02 pm Post subject: |
|
|
Well, I rebuilt my system with "joystick" included in both INPUT_DEVICES and USE ... but the result is the same |
|
Back to top |
|
|
hephooey n00b
Joined: 24 Feb 2003 Posts: 74
|
Posted: Mon Jan 14, 2013 6:22 am Post subject: |
|
|
destroyedlolo wrote: |
I'm not sure how to read the output but the result looks similar.
Code: | dual laurent # evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: Sleep Button
/dev/input/event1: Lid Switch
/dev/input/event2: Power Button
/dev/input/event3: Video Bus
/dev/input/event4: AT Translated Set 2 keyboard
/dev/input/event5: SynPS/2 Synaptics TouchPad
/dev/input/event6: Logitech USB Optical Mouse
/dev/input/event7: PS/2 Generic Mouse
/dev/input/event8: Saitek ST90 USB Stick
Select the device event number [0-8]: 8
Input driver version is 1.0.1
Input device ID: bus 0x3 vendor 0x6a3 product 0x422 version 0x100
Input device name: "Saitek ST90 USB Stick"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 288 (BTN_TRIGGER)
Event code 289 (BTN_THUMB)
Event code 290 (BTN_THUMB2)
Event type 3 (EV_ABS)
Event code 0 (ABS_X)
Value 655
Min 0
Max 1023
Fuzz 3
Flat 63
Event code 1 (ABS_Y)
Value 907
Min 0
Max 1023
Fuzz 3
Flat 63
Event code 2 (ABS_Z)
Value 255
Min 0
Max 255
Flat 15
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Testing ... (interrupt to exit)
Event: time 1357572678.373149, type 3 (EV_ABS), code 0 (ABS_X), value 654
Event: time 1357572678.373166, -------------- SYN_REPORT ------------
|
|
I can only say it is rather peculiar this device does not generate a jsX device under /dev/input, according to the joydev.c from kernel (3.6.11 is the one I am currently using):
Code: |
static const struct input_device_id joydev_ids[] = {
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT_MASK(EV_ABS) },
.absbit = { BIT_MASK(ABS_X) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT_MASK(EV_ABS) },
.absbit = { BIT_MASK(ABS_WHEEL) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_ABSBIT,
.evbit = { BIT_MASK(EV_ABS) },
.absbit = { BIT_MASK(ABS_THROTTLE) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT_MASK(EV_KEY) },
.keybit = {[BIT_WORD(BTN_JOYSTICK)] = BIT_MASK(BTN_JOYSTICK) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT_MASK(EV_KEY) },
.keybit = { [BIT_WORD(BTN_GAMEPAD)] = BIT_MASK(BTN_GAMEPAD) },
},
{
.flags = INPUT_DEVICE_ID_MATCH_EVBIT |
INPUT_DEVICE_ID_MATCH_KEYBIT,
.evbit = { BIT_MASK(EV_KEY) },
.keybit = { [BIT_WORD(BTN_TRIGGER_HAPPY)] = BIT_MASK(BTN_TRIGGER_HAPPY) },
},
{ } /* Terminating entry */
};
|
The first condition basically means as long as your device support ABS_X (there are of course some trivial condition in joydev_match() to exclude touchpads) the kernel will register it to an joystick device. I guess you can try to unload other modules like mouse.ko to make sure the problem is in the joystick detection part. If it is still not solved I guess depends on how strong is your motivation, you might want to add some debug code to the kernel to figure out why, it is going to be pretty straightforward but quite tedius. Also since your event8 looks healthy enough for a joystick, some newer version of your game might just use the evdev interface, as long as the permission allows (on my computer it seems all the eventX devices can only be read by root by default).
BTW, event7 the so called "PS2 generic mouse" sounds fishy, I doubt you use a logitech mouse, a touchpad and a ps2 mouse at the same time, you might want to figure out why it is there, it could be related to your trouble with joystick. |
|
Back to top |
|
|
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Fri Jan 18, 2013 8:57 pm Post subject: |
|
|
I'll do some test.
Is it possible to load/unload kernel module on the fly or does it need a reboot every time ? |
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Fri Jan 18, 2013 10:35 pm Post subject: |
|
|
try
Code: | mknod /dev/input/js0 c 13 0 |
|
|
Back to top |
|
|
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Fri Mar 08, 2013 10:08 am Post subject: |
|
|
krinn wrote: | try
Code: | mknod /dev/input/js0 c 13 0 |
|
Thanks Krinn, it's working
The only (minor) problem is this stick is recognized as both a Joystick and a mouse, so I have to unplug it when I leave the game otherwise the point become crazy.
I think it is also attached as "input0". Any way to backlist it or to make X ignore it ? |
|
Back to top |
|
|
destroyedlolo l33t
Joined: 17 Jun 2011 Posts: 846 Location: Close to Annecy (France)
|
Posted: Thu Mar 28, 2013 12:16 pm Post subject: |
|
|
I spent some time to remove Joystick and mouse interaction.
I tried to create a configuration file as per http://www.x.org/archive/X11R7.5/doc/man/man4/joystick.4.html :
Code: | Section "InputDevice"
Identifier "Saitek ST90 USB Stick"
Driver "joystick"
Option "Device" "/dev/input/event8"
Option "StartMouseEnabled" "disabled"
EndSection |
but it didn't changed anything.
Xorg.0.log contains
Code: | [ 8625.031] (II) config/udev: Adding input device Saitek ST90 USB Stick (/dev/input/event8)
[ 8625.031] (**) Saitek ST90 USB Stick: Applying InputClass "keyboard-all"
[ 8625.031] (II) Using input driver 'evdev' for 'Saitek ST90 USB Stick'
[ 8625.032] (**) Saitek ST90 USB Stick: always reports core events
[ 8625.032] (**) evdev: Saitek ST90 USB Stick: Device: "/dev/input/event8"
[ 8625.032] (--) evdev: Saitek ST90 USB Stick: Vendor 0x6a3 Product 0x422
[ 8625.032] (--) evdev: Saitek ST90 USB Stick: Found absolute axes
[ 8625.032] (--) evdev: Saitek ST90 USB Stick: Found x and y absolute axes
[ 8625.032] (II) evdev: Saitek ST90 USB Stick: Forcing relative x/y axes to exist.
[ 8625.032] (II) evdev: Saitek ST90 USB Stick: Configuring as mouse
[ 8625.032] (**) Option "config_info" "udev:/sys/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.2/1-1.2:1.0/input/input11/event8"
[ 8625.032] (II) XINPUT: Adding extended input device "Saitek ST90 USB Stick" (type: MOUSE, id 14)
[ 8625.032] (II) evdev: Saitek ST90 USB Stick: initialized for absolute axes.
[ 8625.032] (**) Saitek ST90 USB Stick: (accel) keeping acceleration scheme 1
[ 8625.032] (**) Saitek ST90 USB Stick: (accel) acceleration profile 0
[ 8625.032] (**) Saitek ST90 USB Stick: (accel) acceleration factor: 2.000
[ 8625.032] (**) Saitek ST90 USB Stick: (accel) acceleration threshold: 4
[ 8625.035] (II) config/udev: Adding input device Saitek ST90 USB Stick (/dev/input/js0)
[ 8625.035] (**) Saitek ST90 USB Stick: Applying InputClass "keyboard-all"
[ 8625.035] (II) Using input driver 'evdev' for 'Saitek ST90 USB Stick'
[ 8625.035] (**) Saitek ST90 USB Stick: always reports core events
[ 8625.035] (**) evdev: Saitek ST90 USB Stick: Device: "/dev/input/js0"
[ 8625.035] (EE) Saitek ST90 USB Stick: Couldn't open mtdev device
[ 8625.096] (EE) evdev: Saitek ST90 USB Stick: ioctl EVIOCGID failed: Bad file descriptor
[ 8625.096] (EE) PreInit returned 8 for "Saitek ST90 USB Stick"
|
I tried also to change the device to /dev/input/js0 again w/o changes.
Any clue ? |
|
Back to top |
|
|
|