Linux issues with setting axes in zsnes 1.42

Gamepad acting up? Keyboard not responding properly? Can't get that other user to work? Read and post about it here.

Moderator: ZSNES Mods

Post Reply
utopian

Linux issues with setting axes in zsnes 1.42

Post by utopian »

just upgraded to 1.42 from 1.36 under gentoo linux 2.6.8.1
I've got my Gravis Xterminator Digital gamepad (8 axis, 12 buttons. Decadent, I know.) and my crappy Logitech Wingman Precision gamepad (2 axis, 4 buttons).
I've loaded the necessary drivers (joydev, evdev) and tested them under a calibration utility (jscalibrator, a gtk app) and zsnes seems to recognize the axes:
bash-2.05b$ zsnes

ZSNES v1.42 (c) 1997-2005, ZSNES Team
---- CLIP ----
MMX support found and enabled.

Device 0 Analog 2-axis 4-button joystick
2 axis, 4 buttons, 0 hats, 0 balls
Device 1 Gravis Xterminator Digital Gamepad
8 axis, 12 buttons, 0 hats, 0 balls
However, when setting keys in input config, zsnes will accept buttons, but not axes. Meaning, if I press button q, J1Q will pop up, but if I hit axis FOO up, zsnes pretends like I did nothing and goes and eats a donut with coffee. Help, anyone?
utopian

Post by utopian »

sorry, I'm guilty of wasting forum space:
solution:
bash# lsmod
(make sure both joydev and evdev are listed here)
bash# modprobe evdev
I was missing the event interface, evdev. :/
lethalfalcon

Post by lethalfalcon »

I'm having this exact same problem with both a Microsoft Sidewinder Pro USB gamepad and a Green Asia gamepad (hey, it works). I've made sure that evdev is loaded (hotplug does this automatically), and running jscalibrator and jstest both show valid axes movements. I went in and uncommented the printf for the SDL_JOYAXISMOTION case in sdllink.c and noticed something strange. No matter what axis I turn (The green asia has three, though one of them should be a hat), the offset never moves outside of 256-258. I don't know if this is expected behavior, but it won't register my axes movements when I calibrate inputs. Does zsnes ever look at joystick calibration settings? I have a ~/.joystick file that jscalibrator creates, which also is what defines axes as hats, or flipped. Hopefully someone can help with this.
gard

Post by gard »

I'm having the same problem when trying to run the latest wip version (nov 9) with an original snes controller connected with a usb adapter. When ZSNES loads, it recognizes the correct numbers of axes and buttons, but ZSNES does not register the axes during configuration.

Code: Select all

Device 0 Smartjoy Family Super Smartjoy 2
  2 axis, 8 buttons, 0 hats, 0 balls
I uncommented the printf debug commands in linux/sdllink.c, and added an aditional debug command on line 366:

Code: Select all

printf("DEBUG event.jaxis.value: %d\n", event.jaxis.value);
This is the output after pressing up, down, left, right:

Code: Select all

DEBUG axis offset: 258
DEBUG event.jaxis.value: 0
DEBUG axis offset: 258
DEBUG event.jaxis.value: 128
DEBUG axis offset: 258
DEBUG event.jaxis.value: 255
DEBUG axis offset: 258
DEBUG event.jaxis.value: 128
DEBUG axis offset: 256
DEBUG event.jaxis.value: 0
DEBUG axis offset: 256
DEBUG event.jaxis.value: 128
DEBUG axis offset: 256
DEBUG event.jaxis.value: 255
DEBUG axis offset: 256
DEBUG event.jaxis.value: 128
The event.jaxis.value values are not what I expected them to be at all. I then changed the event.jaxis.axis threshold values from

Code: Select all

if (event.jaxis.value < -16384)
...
else if (event.jaxis.value > 16384)
to

Code: Select all

if (event.jaxis.value < 128)
...
else if (event.jaxis.value > 128)
and the controller is working as expected. At least I found a workaround, but I wonder why my event.jaxis.value values are as far off as they are.
pagefault
ZSNES Developer
ZSNES Developer
Posts: 812
Joined: Tue Aug 17, 2004 5:24 am
Location: In your garden

Post by pagefault »

Ok could some of you guys get the latest CVS code and tell me if this has been fixed, if not we can go from there and work this out.
gard

Post by gard »

pagefault wrote:Ok could some of you guys get the latest CVS code and tell me if this has been fixed, if not we can go from there and work this out.
Sorry for the late reply. My joystick usually works now, even with the latest release, but sometimes I experience the behaviour and event.jaxis.value values I described above.

The bottom line is that I don't think zsnes is the problem, but rather something in my setup (modules, udev or something like that). I'm sorry I don't have more usefull information, but at the moment I don't have the time to play a lot with zsnes. If I find out more about this issue I'll report back.
quad
New Member
Posts: 6
Joined: Sun Mar 06, 2005 6:34 pm

Post by quad »

I have the same misbehavior here, though I'm not sure where is the problem.

However I found that the problem only happens to me after I have calibrated my gamepad. So if I boot my computer then start zsnes right away, my axises are recognized by zsnes, but are way too sensible and games are unplayable. Then if I fire up jscalibrator, calibrate the axises appropriately, save the config, then restart zsnes, axises are now ignored. (Haven't checked with the debug statements in sdllink.c as suggested previously yet, but will do so in a moment.)

My configuration:
ZSNES: fresh checkout of r4052
OS: Gentoo Linux 2.6.17-gentoo-r8
Gamepad: Gravis Xterminator Digital, 9 axises, 11 buttons recognized by zsnes
Modules: grip (module), gameport (module), evdev (built into the kernel)

Code: Select all

quad@omexis ~ $ ls -l /dev/input/
total 0
crw-r--r-- 1 root root 13, 64 Nov 18 15:33 event0
crw-r--r-- 1 root root 13, 65 Nov 18 15:33 event1
crw-r--r-- 1 root root 13, 66 Nov 18 15:33 event2
crw-rw-r-- 1 root root 13,  0 Nov 18 15:33 js0
crw-r--r-- 1 root root 13, 63 Nov 18 15:33 mice
crw-r--r-- 1 root root 13, 32 Nov 18 15:33 mouse0
(I had to chmod a+r on /dev/input/event* to make them readable.)

Edit: Well I tried to recompile my Gentoo kernel to use evdev as a module and now it works pretty fine. No calibration needed now, for some reason, and axises are recognized immediately in ZSNES. I also did not have to make /dev/input/event* readable by everyone (though ZSNES complains when it starts, but it doesn't make a difference). If all problems could solve themselves that fast... ;P
~
~
:wq!
Post Reply