[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4280: ob_start(): output handler 'ob_gzhandler' conflicts with 'zlib output compression'
Oolite Bulletins • [Solved] Joystick Range Issues
Page 1 of 1

[Solved] Joystick Range Issues

Posted: Fri Sep 25, 2015 10:28 pm
by Category
I have sussed this issue out, it all comes down to SDL, and the quick fix is:-
I added the following line to my /etc/environment:-

Code: Select all

SDL_JOYSTICK_DEVICE="/dev/input/js0"
and everything now works as expected.
Original thread below
####################################

Hi all, first post here as I'm having issues with my joystick.

When I push my joystick hard left, the roll indicator on the HUD only shows it as halfway to the left. When I push right, it shows full right.

Likewise, when going full back, the pitch indicator only shows it as halfway back, but going fully forward shows it as full.


I've tried using both jscal & jstest-gtk to calibrate the stick, and jstest-gtk shows it going full range on all axis' (axises?) - however when I go into Oolite I'm not getting the same response.


Has anyone else had this issue? Is there something I'm missing?

Only way to escape anyone is diving to the right at the moment!

I've had a look through these forums but can't see anybody having the same problems...

Thanks in advance,
Category

Re: Joystick Range Issues

Posted: Sat Sep 26, 2015 1:28 pm
by Cody
Welcome aboard, Commander - hopefully, a joystick-aware penguinista will be along at some time.

Re: Joystick Range Issues

Posted: Sat Sep 26, 2015 5:03 pm
by Smivs
<grabs joystick and puts penguin suit on...>
Not much help here I'm afraid, other than 'old age' effects my joystick is working fine on Mint 17.1. I hope somebody more helpful comes along soon.

Re: Joystick Range Issues

Posted: Sun Sep 27, 2015 9:37 am
by kanthoney
Working fine here, too. I did wonder if precision mode was borked and only working on half of each axis, but that's working as well.

You haven't got anything weird set up in your joystick profiles, have you?

Re: Joystick Range Issues

Posted: Mon Sep 28, 2015 8:11 pm
by Category
Well, I can't seem to find the issue. Before calibrating my joystick in jstest-gtk, it does seem to have the same dead areas as in game... Which leads me to believe that Oolite is paying no attention to calibration settings at all, and just taking the raw values.

As a workaround though, I've done some editing of the splines in Oolite to get something approximating this:-

Image
(Apologies for dodgy picture, can't upload from the PC at the moment)

This workaround allows me to get full range on the stick, however going right or diving now hits full range at around 60% movement on the stick. Not perfect, but at least I can pull up and roll left fully!

So if Oolite does just use raw joystick input, is there an internal calibration tool anywhere?

Or is there a different linux calibration app I should be using for Oolite to pick up the changes?

Re: Joystick Range Issues

Posted: Tue Sep 29, 2015 8:50 pm
by Category
I've done a lot more digging now, as my dirty hack of a workaround generally sucked. However, after lots of digging I found the culprit - SDL.

Where jscal and the kernel usb joystick drivers calibrated, and gave me proper response, SDL itself was still getting raw input from the evdev device drivers. With one environment variable (either in /etc/environment file, or .bashrc startup script), you can force SDL to use the "real" joystick driver for input.

I added the following line to my /etc/environment:-

Code: Select all

SDL_JOYSTICK_DEVICE="/dev/input/js0"
and everything now works as expected.

This single line has solved all my issues - might be worth adding to the wiki?

I suggest anyone having similar calibration issues to do the same!

Re: Joystick Range Issues

Posted: Wed Sep 30, 2015 1:50 am
by Diziet Sma
Congratulations on the fix!
Category wrote:after lots of digging I found the culprit - SDL.
Ahh.. now that I check, yes, SDL has been implicated in a number of Linux joystick issues..
Category wrote:This single line has solved all my issues - might be worth adding to the wiki?
Good idea.. I'll see about making up an entry for it.

Re: [SOLVED]Joystick Range Issues

Posted: Wed Sep 30, 2015 5:38 am
by Diziet Sma
I've made a Wiki page on the subject.. borrowing from your description of the probable cause. See what you think:

http://wiki.alioth.net/index.php/Joysti ... ms_(Linux)

I've also added a link to it on the Wiki's [EliteWiki] Oolite Instruction Manual page.

Re: [SOLVED]Joystick Range Issues

Posted: Thu Oct 01, 2015 1:50 am
by Lone_Wolf
Added a note to Discusssion for that wiki page.

Re: [SOLVED]Joystick Range Issues

Posted: Thu Oct 01, 2015 3:11 am
by Diziet Sma
Lone_Wolf wrote:Added a note to Discusssion for that wiki page.
Thanks, Lone_Wolf. I've added an entry for that case now.