js0 Being Ignored by Some Emulators
-
I don't think
js0
and how Linux works with it is your problem. The problem is that Playstation and Xbox controllers don't respect standards. They need their own little drivers and they were not meant to be used w/ anything else then a PS or an Xbox. -
@Meneer-Jansen well and windows. There often is better support for windows as I odnt know of any controller that was actually designed for use with linux
-
@herb_fargus said in js0 Being Ignored by Some Emulators:
@Meneer-Jansen well and windows. There often is better support for windows as I odnt know of any controller that was actually designed for use with linux
You're right, but I do not know for sure if a Playstation controller works "out of the box" on Windows (I don't own a PS). Sony is Microsofts biggest concurrent. Maybe Sony has a Windows driver for download on its site. I'm surprised though that this MS and Sony equipment works at all on Linux/RetroPie.
-
We are actually fortunate that the input received in Linux from just about any controller is a lot more standardized than we might imagine. Once you have a controller registering input to an event/joystick device entry, button presses are nothing more than a binary state of on/off and axis input simply increases or decreases incrementally from a resting location. Where you run into problems is when you deal with a controller that doesn't register this input into joystick device entry for Linux to make use of. This is where xboxdrv comes in. Once an XBox controller is properly registering itself as an HID-compliant controller, Linux makes no distinction that it be any different than any other controller. It is simply the sum of it's parts at this stage and all buttons, axis and hat switch input is read indiscriminately. The only truly unique properties that an XBox controller has is the order of the axis and button data and the device identification information, both of which can be artificially given to absolutely any controller using the
--mimic-xpad
argument in xboxdrv.The issue I have been dealing with in this thread has to do with how certain emulators found in RetroPie identify and grab any controller. It just so happens that it also effects my particular use case of xboxdrv. These emulators try to find the first available joystick they can without any intelligent discovery or manual selection. This limitation adds insult to injury when compounded with a dependance on SDL2 which only makes use of event input, where it can become impossible to rearrange the order. At this point it is impossible for your chosen controller to ever be discovered by the software. There are quite a few forums discussing this issue with various software. In every case I've come across, controller input was simply not prioritized during the project's creation and each time this revelation came from the project leader. The good news is that this situation is isolated to only a few emulators found in RetroPie. Even then, if it ever becomes an issue, most setups can simply unplug and replug their controllers so that their desired gamepad will register as the first controller event. However, for those without this option, keyboard and mouse mapping to a controller is still a viable alternative.
-
Sorry. Read your top post again. Indeed, it is very, very strange that Daphne (Dragons Lair) and ScummVM do not accept
js0
for input. That would mean that they can not be played by somebody who has only one controller. Is that true? -
It is odd, but the jsX device designation is apparently only used to obtain the input codes through jstest. When launched, the software actually grabs hold of the first controller event through evdev. So, any circumstance where it becomes impossible for your desired controller to fill that first event slot will prohibit the use of that controller.
Edit: I guess I really shouldn't say that it's odd at all. Starting with SDL2, it turns out that the jsX slots are universally ignored by all software that rely on SDL for input. It's just that other software seems to have made the transition more or less seamlessly by either allowing manual selection of controller events or at least utilize a more intelligent auto selection of some kind.
-
@mediamogul said in js0 Being Ignored by Some Emulators:
It is odd, but the jsX device designation is apparently only used to obtain the input codes through jstest. When launched, the software actually grabs hold of the first controller event through evdev. So, any circumstance where it becomes impossible for your desired controller to fill that first event slot will prohibit the use of that controller.
Edit: I guess I really shouldn't say that it's odd at all. Starting with SDL2, it turns out that the jsX slots are universally ignored by all software that rely on SDL for input. It's just that other software seems to have made the transition more or less seamlessly by either allowing manual selection of controller events or at least utilize a more intelligent auto selection of some kind.
Thanks for the explanation. Have you any idea how evdev determines which is controller number one? I have problems using my favorite controller too sometimes...
-
It's based on the order that the device is discovered. I believe this is determined by the order in which the system checks the USB slots. Supposedly the order can still vary sometimes, but in most situations you can just unplug all controllers and make sure to plug the desired controller in first. It is then listed numerically as the earliest joystick event. If you have a look at the config file for Muppen64Plus, you'll see a great example of how to better handle controller preference, whereas the specific emulators I've had issue with here won't bother to look past the first viable joystick event.
Edit: It should be noted that whatever frustration I have here takes no enjoyment away from using these amazing emulators and the distribution as a whole. With all the combined man hours from so many sources, it truly is an amazing achievement and a lot of fun.
-
Is another device interfering with ScummVM or taking js0? I always have to change ScummVM when using an I-PAC as it's always treated as js0. It's always been consistent on how it works but unfortunately not dynamic. I can also just unplug the I-PAC and the XBOX controller works fine as js0 with no issues.
- Modify /home/pi/RetroPie/roms/scummvm/+Start ScummVM.sh
- Change "--joystick=0" to "--joystick=1" or whatever one you're using
-
Sorry, your post got by me somehow. That is very helpful information it's great to have it documented here. I've found that a few of these type quirks regarding specific js numbers are indeed configurable, but in the case ScummVM, the method has escaped me until your post. Since my last comments here, I've taken to mapping a virtual mouse to my controller's left analog thumbstick and have found that it operates more smoothly than if ScummVM tries to utilize the joystick itself. I've also since keymapped my controller with ColecoVision & Intellivision in mind and put the same technique to good use in working around the event order issue with Daphne. In doing so, I can even invert the controls if necessary, which is another known limitation with Daphne's native joystick support.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.