Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Feb 2017 20:01:38 +0000
From:      bugzilla-noreply@freebsd.org
To:        x11@FreeBSD.org
Subject:   maintainer-feedback requested: [Bug 217047] x11-drivers/xf86-input-joystick: driver does not pass PreInit
Message-ID:  <bug-217047-7141-6DfkZ2oMoT@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-217047-7141@https.bugs.freebsd.org/bugzilla/>
References:  <bug-217047-7141@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
Matthias Apitz <guru@unixarea.de> has reassigned Bugzilla Automation
<bugzilla@FreeBSD.org>'s request for maintainer-feedback to x11@FreeBSD.org:
Bug 217047: x11-drivers/xf86-input-joystick: driver does not pass PreInit
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D217047



--- Description ---
My son wants to play games/flightgear on his FreeBSD laptop and I have
installed him a joystick THRUSTMASTER T-FLIGHT STICK X. The used software
stack is:

FreeBSD CURRENT r292778-amd64
Xorg 7.7.2 ...
uhidd-0.2.1_3
xf86-input-joystick-1.6.2_4.
all compiled from ports.

The essential lines of the configuration in xorg.conf are:

Section "ServerLayout"
	Identifier     "X.org Configured"
	Screen	    0  "Screen0" 0 0
	InputDevice    "Mouse0" "CorePointer"
	InputDevice    "Keyboard0" "CoreKeyboard"
	InputDevice    "Joystick0" "SendCoreEvents"
EndSection

Section "InputDevice"
	Identifier  "Mouse0"
	Driver	    "mouse"
	Option	    "Protocol" "auto"
	Option	    "Device" "/dev/sysmouse"
	Option	    "ZAxisMapping" "4 5 6 7"
EndSection

Section "InputDevice"
	Identifier  "Joystick0"
	Driver	    "joystick"
	Option "MatchIsJoystick"   "on"
	Option "Device"  "/dev/uhid0"
	Option "DebugLevel"	   "7"
	Option "StartKeysEnabled"  "True"
	Option "StartMouseEnabled" "True"
	Option "MapButton1"	   "button=3D1"
	Option "MapButton2"	   "button=3D2"
	Option "MapButton3"	   "button=3D3"
	Option "MapButton4"	   "none"
	Option "MapAxis1"	   "mode=3Drelative    axis=3D+1x  deadzone=3D5000"
	Option "MapAxis2"	   "mode=3Drelative    axis=3D+1y  deadzone=3D5000"
	Option "MapAxis3"	   "mode=3Drelative    axis=3D+1zx deadzone=3D5000"
	Option "MapAxis4"	   "mode=3Drelative    axis=3D+1zy deadzone=3D5000"
	Option "MapAxis5"	   "mode=3Daccelerated axis=3D+1x  deadzone=3D5000"
	Option "MapAxis6"	   "mode=3Daccelerated axis=3D+1y  deadzone=3D5000"
	Option "MapAxis7"	   "mode=3Dnone"
EndSection

...

The device /dev/uhid0 is there and gives data on move/buttons:

$ od -tx1 /dev/uhid0
0000000    00  f0  ff  80  3a  80  ff  00  00  00  00  01  02  00  00  00
0000020    00  00  00  00  f0  ff  4f  10  80  ff  00  00  00  00  01  02
0000040    00  00  00  00  00  00  00  f0  ff  42  2e  80  ff  00  00  00
...

But in Xorg.0.log it says about the device:


[  7698.519] (II) LoadModule: "joystick"
[  7698.520] (II) Loading /usr/local/lib/xorg/modules/input/joystick_drv.so
[  7698.520] (II) Module joystick: vendor=3D"X.Org Foundation"
[  7698.520]	compiled for 1.17.4, module version =3D 1.6.2
[  7698.520]	Module class: X.Org XInput Driver
[  7698.520]	ABI class: X.Org XInput driver, version 21.0

...

[  7698.925] (II) Using input driver 'joystick' for 'Joystick0'
[  7698.925]	Option "MatchIsJoystick" "on"
[  7698.925]	Option "Device" "/dev/uhid0"
[  7698.925]	Option "DebugLevel" "7"
[  7698.925]	Option "StartKeysEnabled" "True"
[  7698.925]	Option "StartMouseEnabled" "True"
[  7698.925]	Option "MapButton1" "button=3D1"
[  7698.925]	Option "MapButton2" "button=3D2"
[  7698.925]	Option "MapButton3" "button=3D3"
[  7698.925]	Option "MapButton4" "none"
[  7698.925]	Option "MapAxis1" "mode=3Drelative    axis=3D+1x  deadzone=3D5=
000"
[  7698.925]	Option "MapAxis2" "mode=3Drelative    axis=3D+1y  deadzone=3D5=
000"
[  7698.925]	Option "MapAxis3" "mode=3Drelative    axis=3D+1zx deadzone=3D5=
000"
[  7698.925]	Option "MapAxis4" "mode=3Drelative    axis=3D+1zy deadzone=3D5=
000"
[  7698.925]	Option "MapAxis5" "mode=3Daccelerated axis=3D+1x  deadzone=3D5=
000"
[  7698.925]	Option "MapAxis6" "mode=3Daccelerated axis=3D+1y  deadzone=3D5=
000"
[  7698.925]	Option "MapAxis7" "mode=3Dnone"
[  7698.925]	Option "SendCoreEvents"
[  7698.925]	Option "driver" "joystick"
[  7698.925]	Option "identifier" "Joystick0"
[  7698.925] (**) Option "SendCoreEvents"
[  7698.925] (**) Joystick0: always reports core events
[  7698.926] (EE) PreInit returned 11 for "Joystick0"
[  7698.926] (II) UnloadModule: "joystick"

I re-compiled x11-drivers/xf86-input-joystick with additional logging=20
statements in

jstk.c
jstk_key.c

and it turned out that this initial sequence is not passed with success
resulting
in jstk.c the return value of 11 (BadAlloc):=20


    ...
    xf86Msg(X_CONFIG, "debug: doing jstkKeyboardHotplug() \n");

    while(opts)
    {
	xf86Msg(X_CONFIG, "debug: %s %s \n", xf86OptionName(opts),
xf86OptionValue(opts));
	iopts =3D input_option_new(iopts,
				 xf86OptionName(opts),
				 xf86OptionValue(opts));
	opts =3D xf86NextOption(opts);
    }

    /* duplicate attribute list */
    attrs =3D DuplicateInputAttributes(pInfo->attrs);

    rc =3D NewInputDeviceRequest(iopts, attrs, &dev);

    input_option_free_list(&iopts);

    FreeInputAttributes(attrs);

    xf86Msg(X_CONFIG, "debug: jstkKeyboardHotplug() end with rc =3D %d\n", =
rc);
    return (rc =3D=3D Success) ? dev->public.devicePrivate : NULL;
}

The resulting additional "debug: ..." lines in Xorg.0.log are:

[  7698.925] (**) debug: doing jstkKeyboardHotplug()=20
[  7698.925] (**) debug: MatchIsJoystick on=20
[  7698.926] (**) debug: Device /dev/uhid0=20
[  7698.926] (**) debug: DebugLevel 7=20
[  7698.926] (**) debug: StartKeysEnabled True=20
[  7698.926] (**) debug: StartMouseEnabled True=20
[  7698.926] (**) debug: MapButton1 button=3D1=20
[  7698.926] (**) debug: MapButton2 button=3D2=20
[  7698.926] (**) debug: MapButton3 button=3D3=20
[  7698.926] (**) debug: MapButton4 none=20
[  7698.926] (**) debug: MapAxis1 mode=3Drelative    axis=3D+1x  deadzone=
=3D5000=20
[  7698.926] (**) debug: MapAxis2 mode=3Drelative    axis=3D+1y  deadzone=
=3D5000=20
[  7698.926] (**) debug: MapAxis3 mode=3Drelative    axis=3D+1zx deadzone=
=3D5000=20
[  7698.926] (**) debug: MapAxis4 mode=3Drelative    axis=3D+1zy deadzone=
=3D5000=20
[  7698.926] (**) debug: MapAxis5 mode=3Daccelerated axis=3D+1x  deadzone=
=3D5000=20
[  7698.926] (**) debug: MapAxis6 mode=3Daccelerated axis=3D+1y  deadzone=
=3D5000=20
[  7698.926] (**) debug: MapAxis7 mode=3Dnone=20
[  7698.926] (**) debug: SendCoreEvents (null)=20
[  7698.926] (**) debug: Driver joystick=20
[  7698.926] (**) debug: identifier Joystick0=20
[  7698.926] (**) debug: Name Joystick0 (keys)=20
[  7698.926] (**) debug: _source _driver/joystick=20
[  7698.926] (**) debug: jstkKeyboardHotplug() end with rc =3D 1
[  7698.926] (**) debug: jstkCorePreInit(): return BadAlloc


In general, the port of xf86-input-joystick-1.6.2_4 is not well adopted
to FreeBSD, at least not its man page, which says: ...

 The evdev(4) driver will suffice for those in most cases.

Do we have any evdev(4) driver in FreeBSD?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-217047-7141-6DfkZ2oMoT>