Hard Light Productions Forums

General FreeSpace => FreeSpace & FreeSpace Open Support => Topic started by: stevencollison on March 11, 2010, 08:56:34 am

Title: Linux Joystick Issues
Post by: stevencollison on March 11, 2010, 08:56:34 am
Hi Guys,

Loved playing FS/FS2 ages ago and I was really pleased to discover this project.

I followed the Linux Install instructions and have had no problems. I have a fully functional install, that I can play with the mouse no problem.

The issue comes when I try to play with my joystick, (the only way to play imho).

First off a few basics,
FS Open 3.6.10
Ubuntu 9.10
Kernel 2.6.31-20
Saitek Cyborg 3D USB Joystick.

Joystick is fully functional/calibrated with other games, e.g. Vendetta-Online (with it's native Linux Client)
Binding seems to be correct also, (yaw is on X axis, pitch on Y axis and buttons work).

The issue is the calibration seems way off. Centre point seems ok, i.e. the ship doesn't spin when I don't touch it, but the ship only responds when I yaw left and pitch down, I can't yaw right or pitch up.

jscal -c seems to work, and I apply the settings (using jscal -s)but this makes no difference to the behaviour of the joystick within fs2.

So my question, how is the joystick calibration handled by the linux version of fs_open? How can they be modified? I've fiddled around with jscal/jstest for ages, modfying values manually but none of it seems to do anything. Is this a waste of my time? Is there a config file that fs_open will take to set correction values for joystick configuration?

Any help would be kindly appreciated, no other thread I have searched for seems to cover this.

Kind Regards
Steve Collison
Title: Re: Linux Joystick Issues
Post by: stevencollison on March 11, 2010, 10:26:56 am
Alight Guys,

After another hours fiddling it's working!, largely thanks to another thread found here, http://www.hard-light.net/forums/index.php?topic=17364.msg572070#msg572070 (http://www.hard-light.net/forums/index.php?topic=17364.msg572070#msg572070) and another post on a different forum here http://superuser.com/questions/17959/linux-joystick-seems-mis-calibrated-in-an-sdl-game-freespace-2-open (http://superuser.com/questions/17959/linux-joystick-seems-mis-calibrated-in-an-sdl-game-freespace-2-open).

Though to save anyone reading those two threads I'll put it in the way that my limited brain can understand!

It seems to me that jscal wasn't putting the calibration values anywhere that was being noticed because SDL (SimpleDirectmediaLayer) doesn't use /dev/input/js0 to talk to the joystick hardware.

So i followed the instructions on the above thread, added SDL_JOYSTICK_DEVICE=/dev/input/js0 to /etc/environment and rebooted. Then recalibrated (jscal -c /dev/input/js0) and hey presto it worked!

One quick note though, the settings are lost on every reboot, so adding the settings to a startup script will help matters. E-mail me if anyone wants to know how I did this. (though this thread may help ya http://ubuntuforums.org/showthread.php?t=391995 (http://ubuntuforums.org/showthread.php?t=391995).

Also, I did re-compile and reinstall libSDL with the --disable-input-events flag but this seemed to make no difference, maybe it did, so if the above method doesn't work try also recompiling libSDL.

I can now enjoy this lovely game all over again and also enjoy the fantastic work the community has put into the fs_open engine and all of the mods!

Apologies for the wasted post

Regards
Steve


Title: Re: Linux Joystick Issues
Post by: captain-custard on March 11, 2010, 11:20:16 am
wow a self solving support .....;;; do i see Jeff Vader and The E skipping across the meadow hand in hand ?  :D
Title: Re: Linux Joystick Issues
Post by: Jeff Vader on March 12, 2010, 03:37:07 am
do i see Jeff Vader and The E skipping across the meadow hand in hand ?  :D
... perhaps an approving nod from a respectful distance.

Still, I gotta admit. This is pretty cool.
Title: Re: Linux Joystick Issues
Post by: moreginger on December 20, 2010, 05:04:58 pm
Thank goodness for this thread.
For whatever reason (incompetance?) SDL_JOYSTICK_DEVICE didn't seem to work for me on Ubuntu 10.10 (Maverick), but the related hack of killing the /dev/input/event? source for the joystick seems to work for me*. However, it's unpleasant so I wouldn't recommend it unless you are desperate.

Anyway, this is majorly confusing. Is fs2 doing something atypical or is Ubuntu wholly at fault here? I'm kind of suspecting the latter because xserver-xorg-input-joystick displayed the same calibration problems after using jscal.

BTW, it should be possible to store the calibration using jscal-store. I've had mixed success with this so far.


* Something like...
> cd /dev/input/by-id/
> readlink *event-joystick
> sudo rm <the path(s) from the above command>
Now SDL is forced to use /dev/input/js0