[Solved] Joystick Range Issues

For discussion of ports to POSIX based systems, especially using GNUStep.

Moderators: winston, another_commander, Getafix

Post Reply
Category
Mostly Harmless
Mostly Harmless
Posts: 3
Joined: Fri Sep 25, 2015 10:11 pm

[Solved] Joystick Range Issues

Post 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
Last edited by Getafix on Thu Oct 01, 2015 7:24 am, edited 2 times in total.
Reason: Updated the 'Solved' tag format
User avatar
Cody
Sharp Shooter Spam Assassin
Sharp Shooter Spam Assassin
Posts: 16081
Joined: Sat Jul 04, 2009 9:31 pm
Location: The Lizard's Claw
Contact:

Re: Joystick Range Issues

Post by Cody »

Welcome aboard, Commander - hopefully, a joystick-aware penguinista will be along at some time.
I would advise stilts for the quagmires, and camels for the snowy hills
And any survivors, their debts I will certainly pay. There's always a way!
User avatar
Smivs
Retired Assassin
Retired Assassin
Posts: 8408
Joined: Tue Feb 09, 2010 11:31 am
Location: Lost in space
Contact:

Re: Joystick Range Issues

Post 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.
Commander Smivs, the friendliest Gourd this side of Riedquat.
User avatar
kanthoney
Commodore
Commodore
Posts: 281
Joined: Thu Nov 07, 2013 10:21 pm

Re: Joystick Range Issues

Post 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?
Category
Mostly Harmless
Mostly Harmless
Posts: 3
Joined: Fri Sep 25, 2015 10:11 pm

Re: Joystick Range Issues

Post 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?
Category
Mostly Harmless
Mostly Harmless
Posts: 3
Joined: Fri Sep 25, 2015 10:11 pm

Re: Joystick Range Issues

Post 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!
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: Joystick Range Issues

Post 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.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: [SOLVED]Joystick Range Issues

Post 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.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
User avatar
Lone_Wolf
---- E L I T E ----
---- E L I T E ----
Posts: 546
Joined: Wed Aug 08, 2007 10:59 pm
Location: Netherlands

Re: [SOLVED]Joystick Range Issues

Post by Lone_Wolf »

Added a note to Discusssion for that wiki page.
OS : Arch Linux 64-bit - rolling release

OXPs : My user page

Retired, reachable at [email protected]
User avatar
Diziet Sma
---- E L I T E ----
---- E L I T E ----
Posts: 6312
Joined: Mon Apr 06, 2009 12:20 pm
Location: Aboard the Pitviper S.E. "Blackwidow"

Re: [SOLVED]Joystick Range Issues

Post 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.
Most games have some sort of paddling-pool-and-water-wings beginning to ease you in: Oolite takes the rather more Darwinian approach of heaving you straight into the ocean, often with a brick or two in your pockets for luck. ~ Disembodied
Post Reply