Fatal signal when initiaize with USB joystick on 2.6.2 kernel

The event input code in SDL is the almost the same as the actual
kernel joydev as they do exactly the same job.

They both take absolute values from the input system on Linux, evdev
simply passes through the absolute values while joydev reads them
directly. Then joydev and SDL (using events) translates them to
the -32767 to 32767 range.

|There is only one irrelevant difference. In joydev, by default coef[2]
|and coef[3] are the same unless calibrated with jscal. You can’t
|calibrate the evdev, so these are amalgamated to just coef[2] in SDL.

Not helpful I know, but using SDL and evdev works fine here and there
have been no other complaints. Please take a look at the code, but this
seems peculiar to Freds system.

Stephane, can you compile SDL with DEBUG_INPUT_EVENTS defined.
Fred, can you then run a program and send any output.

(Sam, do you want us to take this off list until resolved?)On Sat, 2004-03-06 at 15:57, Stephane Marchesin wrote:

Ok, I sent Fred the “latest-latest” CVS .so and here are the results :

  • As before, everything works fine without evdev
  • With evdev, the axis values are garbled (but there is no crash), while
    the “jstest” program gives good axis values

Maybe we should look at the jstest source code to see where it differs
from SDL joystick code ?


Alan.

“One must never be purposelessnessnesslessness.”
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040306/41c7a157/attachment.pgp

Sorry for answering late, I had a bad week…
Stephane sent me a binary debug lib with some patches applied on it (Stephane,
do you remember which?).
It seems to solve the problem of evdev module (no more crashing for floating
point).
So, I think it is in the good direction.

But, a little thing: too much events are sent.
I mean, a lot of events with same values are sent.
For exemple, in my prog
axis[0] value=[0]
is sent many many times (and not only for axis[0]).

It seems like you you do something like that:
for each axis
{
if value.old != value.new
{
create event (axis,value.new / divizor)
value.old=value.new
}
}

get it?
real axis value may vary (a joystick is always moving a little) but event
values are identical.
value.real=0.1, value.real=0.2, … value.event still be 0.
It would be nice to remove duplicate events.

I think you are in the good way!

I still alive to test what you send to me (I hope I’ll be able to be more
reactive next time! :wink:

Fred

Le samedi 6 Mars 2004 18:57, Alan Swanson a ?crit?:> On Sat, 2004-03-06 at 15:57, Stephane Marchesin wrote:

Ok, I sent Fred the “latest-latest” CVS .so and here are the results :

  • As before, everything works fine without evdev
  • With evdev, the axis values are garbled (but there is no crash), while
    the “jstest” program gives good axis values

Maybe we should look at the jstest source code to see where it differs
from SDL joystick code ?

The event input code in SDL is the almost the same as the actual
kernel joydev as they do exactly the same job.

They both take absolute values from the input system on Linux, evdev
simply passes through the absolute values while joydev reads them
directly. Then joydev and SDL (using events) translates them to
the -32767 to 32767 range.

|There is only one irrelevant difference. In joydev, by default coef[2]
|and coef[3] are the same unless calibrated with jscal. You can’t
|calibrate the evdev, so these are amalgamated to just coef[2] in SDL.

Not helpful I know, but using SDL and evdev works fine here and there
have been no other complaints. Please take a look at the code, but this
seems peculiar to Freds system.

Stephane, can you compile SDL with DEBUG_INPUT_EVENTS defined.
Fred, can you then run a program and send any output.

(Sam, do you want us to take this off list until resolved?)

The event device configuration under Linux does not check the returned
ioctl value when reading the axis information. This means extra
undefined axes are returned.

Note, in EV_HandleEvents, the default for case EV_ABS is to return any
axis information which is fine as we have already checked for all valid
absolute axes. No new axes should be returned after opening the device.

(Unless, of course, the evdev allows closing and reassigning a new
device while in use and I can’t believe that happens.)

Stephane Marchesin actually saw that the ioctl wasn’t checked earlier
this month, though I found it independently while investigating Fred
Marmond’s problem. I think that is a different issue though…–
Alan.

“One must never be purposelessnessnesslessness.”
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL-joy-evdev-axis.diff
Type: text/x-patch
Size: 597 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040316/dd77edf5/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20040316/dd77edf5/attachment.pgp

The event device configuration under Linux does not check the returned
ioctl value when reading the axis information. This means extra
undefined axes are returned.

Your patch has been applied to CVS.

Thanks!
-Sam Lantinga, Software Engineer, Blizzard Entertainment