Author Topic: Joystick in the Linux version  (Read 2850 times)

0 Members and 1 Guest are viewing this topic.

Joystick in the Linux version
Does anyone use a joystick with the Linux version of Diaspora? I have a Saitek X36 USB with the throttle controller that I have had for about 11 or 12 years. Never had a chance to get it working under Linux. Back in BtRL days, I thought about it, but never found time. It looks like I'm going to be spending a *lot* of time with Diaspora, so it would be nice to get the stick (and throttle) working, and ideally, be able to program a true HOTAS (hands on throttle and stick) setup.

I looked on the web for some ideas on whether this stick would work on Linux, but didn't find much of anything.

Has anyone had any luck getting this working with Diaspora in Linux?

Thanks,
--vr

 

Offline niffiwan

  • 211
  • Eluder Class
Re: Joystick in the Linux version
I've used a Logitech Extreme Pro 3D without problems.  As you're having problems with compiling wxlauncher, you might need to setup a config file manually to properly select your joystick.  Try creating the following file, you'll need to change your resolution appropriately and maybe your audio devices.  The pilot file may also need to change, but it'll probably sort itself out when you start Diaspora. 

Code: (~/.fs2_open/fs2_open.ini) [Select]
[Default]
VideocardFs2open=OGL -(1680x1050)x32 bit
TextureFilter=1
OGL_AnisotropicFilter=0
OGL_AntiAliasSamples=0
SoundDeviceOAL=PulseAudio Default
CurrentJoystick=0
EnableJoystickFF=0
EnableHitEffect=0
NetworkConnection=None
ConnectionSpeed=None
LastPlayer=diasporaS

[Sound]
PlaybackDevice=PulseAudio Default
CaptureDevice=PulseAudio Default

Lastly, if you've got multiple joysticks (or similar "event" devices) you may need to set "CurrentJoystick" to a value other than zero. i.e. if the following command on your computer produces something other than "js0" for your joystick, then set "CurrentJoystick" to the value of X in jsX (hope that makes sense)

Code: [Select]
$ ls -l /dev/input/by-id/
total 0
lrwxrwxrwx 1 root root 9 Sep 17 08:19 usb-Logitech_Logitech_Extreme_3D-event-joystick -> ../event3
lrwxrwxrwx 1 root root 6 Sep 17 08:19 usb-Logitech_Logitech_Extreme_3D-joystick -> ../js0
lrwxrwxrwx 1 root root 9 Sep 17 08:19 usb-Razer_Razer_DeathAdder-event-mouse -> ../event4
lrwxrwxrwx 1 root root 9 Sep 17 08:19 usb-Razer_Razer_DeathAdder-mouse -> ../mouse0
Creating a fs2_open.log | Red Alert Bug = Hex Edit | MediaVPs 2014: Bigger HUD gauges | 32bit libs for 64bit Ubuntu
----
Debian Packages (testing/unstable): Freespace2 | wxLauncher
----
m|m: I think I'm suffering from Stockholm syndrome. Bmpman is starting to make sense and it's actually written reasonably well...

 
Re: Joystick in the Linux version
I have a Saitek Cyborg Evo Force, worked perfectly fine on Ubuntu 12.04 - just plug and play. The only thing that didn't work was force feedback, but that's not too bad.

If the stick is not working, the first thing to check is if you actually selected your joystick in the launcher. Silly yes, but I forgot it so many times...

 
Re: Joystick in the Linux version
I've used a Logitech Extreme Pro 3D without problems.  As you're having problems with compiling wxlauncher, you might need to setup a config file manually to properly select your joystick.  Try creating the following file, you'll need to change your resolution appropriately and maybe your audio devices.  The pilot file may also need to change, but it'll probably sort itself out when you start Diaspora.

I managed to get wxlauncher compiled. The problem would up being an old version of  wx in /usr/local/lib that was breaking things. Everything compiled fine...

However, my joystick is still not working. I have it plugged in, and it is being detected by Debian. My fs2_open.ini looks more or less like yours (I did have to edit CurrentJoystick, as it was 99999. I changed to 0).

Quote
Lastly, if you've got multiple joysticks (or similar "event" devices) you may need to set "CurrentJoystick" to a value other than zero. i.e. if the following command on your computer produces something other than "js0" for your joystick, then set "CurrentJoystick" to the value of X in jsX (hope that makes sense)

I did this and restarted the launcher, and still no soup. Here is what I have in /dev/input/by-id:

Code: [Select]
lrwxrwxrwx 1 root root  9 Sep 18 15:58 usb-BTC_USB_Multimedia_Keyboard-event-if01 -> ../event2
lrwxrwxrwx 1 root root  9 Sep 18 15:58 usb-BTC_USB_Multimedia_Keyboard-event-kbd -> ../event1
lrwxrwxrwx 1 root root  9 Sep 18 15:58 usb-Logitech_USB-PS_2_Optical_Mouse-event-mouse -> ../event0
lrwxrwxrwx 1 root root  9 Sep 18 15:58 usb-Logitech_USB-PS_2_Optical_Mouse-mouse -> ../mouse0
lrwxrwxrwx 1 root root 10 Sep 23 12:42 usb-Saitek_Saitek_X36_00109106-event-joystick -> ../event11
lrwxrwxrwx 1 root root  6 Sep 23 12:42 usb-Saitek_Saitek_X36_00109106-joystick -> ../js0

Did I miss something?

Another question: Is it possible to program the buttons and switches in-game? Several maneuvering and shooting options would be nice to be able to program on the buttons on the stick and the throttle...

Thanks,
--vr

 
Re: Joystick in the Linux version
I just wanted to add an observation, if I might. I changed my ~/.fs2_open/fs2_open.ini to read

Code: [Select]
CurrentJoystick=0
But whenever I start Diaspora, it changes the setting back to

Code: [Select]
CurrentJoystick=99999
What does this indicate? I can still see it in /dev/input/by-id, does this mean that Diaspora does not detect it?

Thanks,
--vr

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Joystick in the Linux version
By "start Diaspora", do you mean by pressing Play in the launcher or by running the fs2_open binary directly?

99999 is used by the launcher to mean "no joystick selected".

wxLauncher writes the profile values to fs2_open.ini (and cmdline_fso.cfg) when you press the Play button, so if you have "No joystick" selected in the launcher, then "99999" will get written to CurrentJoystick in fs2_open.ini when you press Play.

You may want to manually set CurrentJoystick to 0 in ~/.fs2_open/fs2_open.ini and then run the fs2_open binary directly (no arguments needed) to see if Diaspora detects your joystick, in which case the issue is likely with the launcher.

Could you post a wxLauncher log? That'll say whether the launcher is detecting your joystick. The log can be found at

Code: [Select]
~/.wxlauncher/wxLauncher.log

Just to make sure you know, you need to plug in your joystick before you start the launcher.

As for configuring the joystick in-game once the game detects it, you can, although there's a limit on how many buttons and axes the game will recognize. I don't know what the limit is offhand.

 
Re: Joystick in the Linux version
By "start Diaspora", do you mean by pressing Play in the launcher or by running the fs2_open binary directly?

I was restarting the launcher each time, figuring that the config file was rewritten each time you started the launcher.

Quote
99999 is used by the launcher to mean "no joystick selected".

This was the key. When I first started the launcher (without the joystick connected), and was exploring, I didn't see the field for the joystick. Now that I started it with the stick connected, I get a pull-down menu where I can select it, and the stick works.

Quote
As for configuring the joystick in-game once the game detects it, you can, although there's a limit on how many buttons and axes the game will recognize. I don't know what the limit is offhand.

I was going to try first from the Linux side. But I will be exploring the in-game settings as well. I notice that out of the box, the throttle doesn't work, so I may need to see if I can program it to issue + and = for up/down movements. But at least the stick works. :)

Thanks again, jg18.

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Joystick in the Linux version
This was the key. When I first started the launcher (without the joystick connected), and was exploring, I didn't see the field for the joystick. Now that I started it with the stick connected, I get a pull-down menu where I can select it, and the stick works.

Glad to hear it's now working. :)

I was going to try first from the Linux side. But I will be exploring the in-game settings as well. I notice that out of the box, the throttle doesn't work, so I may need to see if I can program it to issue + and = for up/down movements. But at least the stick works. :)

You need to bind the throttle manually in-game for it to work. Check the in-game control config menu. As I remember, there are two options in the ship section: "absolute throttle axis" and "relative throttle axis". "Absolute throttle axis" is probably more intuitive; I'm not entirely sure how the other throttle axis option works.

Thanks again, jg18.

No problem.

 
Re: Joystick in the Linux version
Okay, hopefully this is the last question. I mapped the keys on my joystick and throttle last night, and programmed the buttons. I clicked accept and ran through one mission with a test pilot. The next time I fired it up, the keybindings were gone. Is there a way to make them persistent across restarts?

Note that I did not get out of wxlauncher, I only got out of Diaspora.

Thanks,
--vr

 

Offline jg18

  • A very happy zod
  • 210
  • can do more than spellcheck
Re: Joystick in the Linux version
Strange. As far as I know, keybindings should automatically save, although I don't know offhand if they're saved after you exit the control config menu, or if they're not saved until you actually exit the game. In any case, I'm not entirely sure what to tell you. :blah: Maybe someone more familiar with the engine can comment.

You were using the same pilot throughout, right? Keybindings are associated with a pilot, so if you create a new pilot, it will just have the default keybindings, although you can clone an existing pilot, which will create a new pilot but copy over the existing pilot's keybindings.

 

Offline Iss Mneur

  • 210
  • TODO:
Re: Joystick in the Linux version
Control bindings are saved when you click accept in the editing menu.

Binding disappearing over restarts normally means a pilot file corruption issue of somekind. Though it is also possible that the problem is the engine is unable to save your pilot file (to <game root>/data/players/single/inferno) because of a permission issue.
"I love deadlines. I like the whooshing sound they make as they fly by." -Douglas Adams
wxLauncher 0.9.4 public beta (now with no config file editing for FRED) | wxLauncher 2.0 Request for Comments