Bug 7086

Summary: Joystick driver fails to load
Product: xorg Reporter: Bob Hepple <bhepple>
Component: Input/joystickAssignee: Xorg Project Team <xorg-team>
Status: RESOLVED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: normal    
Priority: high CC: bugs.freedesktop
Version: 7.0.99.902 (7.1RC2)   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
big patch for xf86Jstk.c file to make module work none

Description Bob Hepple 2006-05-31 16:42:50 UTC
The log says:

(EE) Failed to load module "joystick" (out of memory, 701)

So I fixed the obvious bug in src/xf86Jstk.c:

static pointer
xf86JstkPlug(pointer	module,
	     pointer	options,
	     int	*errmaj,
	     int	*errmin )
{
    LocalDevicePtr	local = NULL;
    JoystickDevPtr	priv = NULL;
    char		*s;

    local = xf86JstkAllocate();

    if (!local || !priv) {
	*errmaj = LDR_NOMEM;
	goto SetupProc_fail;
    }

to:
    if (!local || !local->private) {

but I now get:

(II) LoadModule: "joystick"
(II) Loading /usr/lib/xorg/modules/input/joystick_drv.so
(II) Module joystick: vendor="X.Org Foundation"
        compiled for 7.0.0, module version = 1.0.0
        Module class: X.Org XInput Driver
        ABI class: X.Org XInput driver, version 0.5
(EE) WACOM: No Device specified.
(II) UnloadModule: "joystick"
(II) Unloading /usr/lib/xorg/modules/input/joystick_drv.so
(EE) Failed to load module "joystick" (invalid argument(s) to LoadModule(), 701)

... but my xorg.conf file says:

Section "InputDevice"
     Identifier "Joystick"
     Driver     "joystick"
     Option     "Device"        "/dev/input/js0"
EndSection

I am on gentoo using virtual/x11-7.0-r2 and the joystick source contains this tag:

/* $XFree86: xc/programs/Xserver/hw/xfree86/input/joystick/xf86Jstk.c,v 1.5
2001/11/26 16:25:53 dawes Exp $ */


Thanks


Bob
Comment 1 Bob Hepple 2006-05-31 16:55:20 UTC
I should add that my /dev/input/js0 works fine and responds to movement on the
(USB) logitech ATTACK3 joystick eg:

# od </dev/input/js0
0000000 037314 000127 000000 000201 037314 000127 000000 000601
0000020 037314 000127 000000 001201 037314 000127 000000 001601
0000040 037314 000127 000000 002201 037314 000127 000000 002601
0000060 037314 000127 000000 003201 037314 000127 000000 003601
0000100 037314 000127 000000 004201 037314 000127 000000 004601
0000120 037314 000127 000000 005201 037314 000127 000000 000202
0000140 037314 000127 000000 000602 037314 000127 000000 001202
0000160 045120 000127 176534 000402 045130 000127 174546 000402
0000200 045140 000127 173303 000402 045150 000127 172037 000402
0000220 045200 000127 170574 000402 045220 000127 166606 000402
0000240 045350 000127 173303 000402 045360 000127 174546 000402
0000260 045400 000127 176534 000402 045410 000127 000000 000402
Comment 2 Adam Jackson 2006-06-05 08:12:15 UTC
the joystick driver hasn't really worked in a while, iirc.  it probably needs
more fixed than just this.
Comment 3 Daniel Stone 2007-02-27 01:32:20 UTC
Sorry about the phenomenal bug spam, guys.  Adding xorg-team@ to the QA contact so bugs don't get lost in future.
Comment 4 Fabien Wernli 2007-03-02 08:36:27 UTC
more or less same problem here:

| (II) LoadModule: "joystick"
| (II) Loading /usr/lib/xorg/modules/input/joystick_drv.so
| (II) Module joystick: vendor="X.Org Foundation"
|         compiled for 7.1.1, module version = 1.1.0
|         Module class: X.Org XInput Driver
|         ABI class: X.Org XInput driver, version 0.6
| (II) UnloadModule: "joystick"
| (II) Unloading /usr/lib/xorg/modules/input/joystick_drv.so
| (EE) Failed to load module "joystick" (out of memory, 7056224)
[...]
| (EE) No Input driver matching `joystick'

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18.3
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Package: xserver-xorg-input-joystick
Version: 1:1.1.0-1
Severity: important

Versions of packages xserver-xorg-input-joystick depends on:
ii  libc6                       2.3.6.ds1-11 GNU C Library: Shared libraries
ii  xserver-xorg-core           2:1.1.1-18   X.Org X server -- core server

Comment 5 Sascha Hlusiak 2007-03-11 17:00:22 UTC
I put some work on the driver and got it to work again. See attached patch below, against version 1.1.0. Used parameters in xorg.conf:

Section "InputDevice"
    Identifier  "Joystick1"
    Driver      "joystick"
    Option      "Device"        "/dev/input/js0"
    Option      "CenterX"       "128"
    Option      "CenterY"       "128"
    Option      "MinX"          "0"
    Option      "MaxX"          "255"
    Option      "MinY"          "0"
    Option      "MaxY"          "255"
    Option      "Delta"         "8"
    Option      "Timeout"       "20"
    Option      "DebugLevel"    "0"
EndSection

I know that the xf86-input-joystick module is currently unmaintained. Herewith I'd like to REQUEST MAINTAINERSHIP of the module, to keep on improving it and adding more features.
Comment 6 Sascha Hlusiak 2007-03-11 17:01:35 UTC
Created attachment 9097 [details] [review]
big patch for xf86Jstk.c file to make module work

Changed quite a lot. I hope it's fine now.
Comment 7 Sascha Hlusiak 2007-03-13 07:10:44 UTC
Committed own patch to git repository. 

Prerelease can be found here: http://people.freedesktop.org/~saschahlusiak/xf86-input-joystick-1.1.1-rc1.tar.bz2

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.