• 6
Badsector

KSP 1.4 Joystick not found under linux

Question

The joystick is correctly installed and work fine in KSP 1.3.1

Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 002: ID 0079:0006 DragonRise Inc. PC TWIN SHOCK Gamepad
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 003: ID 04f2:0841 Chicony Electronics Co., Ltd HP Multimedia Keyboard
Bus 003 Device 002: ID 1bcf:0005 Sunplus Innovation Technology Inc. Optical Mouse
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

But in configuration the gamepad don't work like it is not installed

Edit

Bug Report

Edited by Badsector

Share this post


Link to post
Share on other sites

Recommended Posts

  • 0

The team is currently investigating this issue and we'll inform you when a definitive solution is found. 

Thanks for bringing this up :) 

Share this post


Link to post
Share on other sites
  • 0

Same problem i really hope they fix this my joystick won't work with 1.4 using fedora linux. works fine on all previous versions.

Share this post


Link to post
Share on other sites
  • 0
On 4/19/2018 at 4:06 AM, Badsector said:

Please help with informations about your system https://bugs.kerbalspaceprogram.com/issues/17984 for solve this issue.

I have done this, because Squelch asks for more info, and I keep the following out of the bugtracker because it doesn't really belong there...

My joystick is not a gamepad. SDL is correctly identifying the device and assigning it an ID, and it is correctly determining that it is not a gamepad. The comment re. "helping the effort" by adding your device to the GameControllerDB, complete with mappings to inputs like "leftshoulder" "start", "x" and "y" that do not exist on this device, is utterly ridiculous. As is the implication that these mappings not existing for a majority of devices is a problem the "Open Source Community" needs to fix.

My device is a generic USB-HID joystick, not a bloody xbox controller. SDL is working as intended. The problem here is that the game engine doesn't support anything but console-controllers, and things that pretend to be console-controllers.
Additionally, even when a device does pretend to be a console-controller, most of the time the game still doesn't identify axes properly.
None of this stupidity has anything to do with SDL, it's a bug that Unity introduced by switching to SDL2 input exclusively, then failing to implement it properly on their side.


How about let's stop faffing about with client-side workarounds and fix the real problem.

Edited by steve_v

Share this post


Link to post
Share on other sites
  • 0

@steve_v When you speak of "console controllers", these things are usually different, because they talk MS-only "XInput".

This "Xinput"  is not related to neither "libinput", nor "xorg", its a relatively new protocol that was introduced by MS to replace classic joystick API.
The classic joystick API in MS world is called "DirectInput" and in Linux world - classic joystick API [ link ].

Both APIs talk through USB, however they return different values.
Typically in Linux, if a classic joystick (Joystick that talks classic protocol) is attached to software that listens for newer "Xinput", then software will not be able to detect it.
And if "Xinput" joystick is attached to software that listens to classic API, then software will incorrectly map keys.

Some joysticks allow to switch between the API, like can be seen [ here ] but also joysticks with classic API-only and "Xinput" API-only are sold and produced today, adding to the confusion.
This is a big headache today. In my humble opinion there is no advantage from "Xinput", its just a different language.
I guess its just another "  ' 'thanks' ', Microsoft " thing.

Unfortunately I am not a software developer, but in Windows there is software piece that allows to emulate (emit) classic joystick events to Xinput events, that is then detected by software.
It looks like Unity is using Xinput now and abadoned DirectInput, and this is a big problem for Linux until similar emulation layer is implemented ... or there is an option to add classic interface + switch in the settings.

The workaround I see at start of the page, that uses Fly-By-Wire mod basically uses a mod that can listen to classic API, you are effectively bypassing the "Xinput".

More information: [1], [2]

Share this post


Link to post
Share on other sites
  • 0
1 hour ago, Kerbal101 said:

@steve_v When you speak of "console controllers", these things are usually different, because they talk MS-only "XInput"...

This is all well-and-good (and also very M$ specific), but the thing is, my device is not a game-controller, it doesn't use XInput GameController*, and it works perfectly well like that. Except in KSP.
SDL2 (which uses the new evdev driver) is reporting perfectly usable joystick events. So is SDL1, which uses the old joydev driver. I can hack together a little moving whatsit that uses SDL2 to access my joystick in about 10 minutes.
So either the Unity build KSP uses isn't actually using SDL at all, or it's only using part of the API (i.e. ignoring devices that don't use GameController). If Unity is insisting on using some new M$ specific API and ignoring everything else, this is still Unity's problem, and we shouldn't have to work around it.
And mapping the buttons ids to xbox-specific names is still ridiculous.

 

1 hour ago, Kerbal101 said:

Typically in Linux, if a classic joystick (Joystick that talks classic protocol) is attached to software that listens for newer "Xinput", then software will not be able to detect it.

Sure. Again, this is Unity's problem. If a ~20KB test application can detect and use my device, so can Unity.

 

1 hour ago, Kerbal101 said:

It looks like Unity is using Xinput now and abadoned DirectInput, and this is a big problem for Linux until similar emulation layer is implemented

It's a big problem for Unity, if they want to support joystick devices on GNU/Linux. It's not the job of the OS or the input abstraction layers to pander to the vagaries of one game engine.
If Squad has decided to use a game engine that lacks support for the most common joystick protocol on the market, and wants joysticks to work, then it becomes Squads problem too.
I still don't see this being up to "the open source community" or Linux to fix in any way. It's not broken. DInput works fine. SDL works fine. Evdev and joydev work fine. If you don't want to use them, you get to provide the emulation layer.

 

1 hour ago, Kerbal101 said:

or there is an option to add classic interface + switch in the settings.

Much better. :)

* Thanks Voidi, that's actually more accurate terminology WRT SDL2.

Edited by steve_v

Share this post


Link to post
Share on other sites
  • 0

The problem coming up with 1.4 has nothing to do with Xinput or similar, as this is a Windows-only Part.
The problem is very good described here https://www.reddit.com/r/linux_gaming/comments/5xics8/a_big_problem_with_joysticks_in_linux_right_now/ (although there answering a different question)

TL, DR: with some update of the unity engine they moved from doing the input stuff for linux in Unity itself to a (crossplatform) libary named SDL2, but use only the higher-level, more abstract part of it (GameController API). Which requires that there is mapping specific for used joystick modell.
I suppose only Unity can solving this problem.

EDIT:
Somewhere the i read the GameController API have problems with Joysticks with a lot of buttons. This makes this part of Unity even more problematic for KSP

Edited by Voidi

Share this post


Link to post
Share on other sites
  • 0
38 minutes ago, Voidi said:

with some update of the unity engine they moved from doing the input stuff for linux in Unity itself to a (crossplatform) libary named SDL2, but use only the higher-level, more abstract part of it (GameController API).

Indeed. To wit: "only using part of the API".

 

38 minutes ago, Voidi said:

I suppose only Unity can solving this problem.

I suppose this too.

Frankly, I find the "open source needs to fix this" attitude I saw in the bug report to be somewhat pathetic.

This entire situation is insane. @Unity3D: "Using the GameController API exclusively" is a moronic thing to do if you want anything other than (some) gamepads and steam controllers to work. Everyone else has figured this out already.

 

38 minutes ago, Voidi said:

EDIT:
Somewhere the i read the GameController API have problems with Joysticks with a lot of buttons.

The GameController API has problems with a lot of things that aren't gamepads, because it wasn't designed for things that aren't gamepads. Right now it's only viable purpose is to provide an easy way to make all the zillions of xbox controller clones work like xbox controllers. Using it for generic joysticks is madness.

 

Edited by steve_v
Edit to the edit.

Share this post


Link to post
Share on other sites
  • 0
48 minutes ago, AlexO said:

Same under KSP 1.5.1

What is the status?

Tiny grain of hope this gets fixed in 1.6.

 

If the unity version persists the chance is near zero I believe.

Edited by Dafni

Share this post


Link to post
Share on other sites
  • 0

Reviving for status update: Still no fix as of 1.7.3, no news from SQUAD on progress, priority, or ETA.

As of ~11 months ago: "We are unable to provide a date as to when that task may be prioritized at this stage."
Translation: "We're not going to do anything about it."

 

On 3/27/2018 at 7:15 AM, UomoCapra said:

The team is currently investigating this issue and we'll inform you when a definitive solution is found.

The team is currently doing nothing whatsoever about this, since all potential solutions would require coding effort from SQUAD. As such you will never be informed of any solution as nobody is actually working on one, the PR team is fully occupied hyping DLC anyway.
There, FTFY.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.