flyinghead / flycast

Flycast is a multiplatform Sega Dreamcast, Naomi, Naomi 2 and Atomiswave emulator
GNU General Public License v2.0
1.41k stars 170 forks source link

Most controllers do not work #23

Closed BigheadSMZ closed 4 years ago

BigheadSMZ commented 4 years ago

Please Note: This form is the minimum required information for submitting bugs.
Removing this form may lead to your issue being closed until it is completed.

| Platform | Branch | Hash | CIDL | This affects all builds using Windows 10 x64. I tried multiple builds with random dates from random branches.

Description of the Issue

Most controllers don't work. 8Bitdo in xinput mode fails, official xbox 360 controller fails, and any directinput controller fails. The xbox one controller does work and shows up in the list.

Debugging Steps Tested

Logs Gathered


Please paste the contents of the log / logs here
You may leave this field blank if you have none.

Screenshots

(Replace this line with any issue screenshots) image

mohsinous commented 4 years ago

i had this problem too!! i just change usb port and booom, worked!!

flyinghead commented 4 years ago

Flycast uses XInput to manage controllers so DirectInput controllers are not supported. Other than that I don't know why some XInput controllers aren't working. All XInput devices that return some state should appear in the UI.

BigheadSMZ commented 4 years ago

To work around this, I decided to bite the bullet and use RetroArch. Maybe "unofficial" Microsoft controllers are doing something different. I thought my xb360 controller was official but it's not. The only two controllers that use XInput that I can test are the 8BitDo SF30 and an XBox 360 controller by some company called "PowerA". Official XBox One controller does work, but it's not the controller that I want to use.

image

Edit: I forgot to mention, the screenshot shows that even the Guitar Hero Xplorer guitar is being picked up, but not the other controllers mentioned. Weird. Also wanted to mention that ALL of these controllers work in other XInput applications (PC games, emulators, etc).

flyinghead commented 4 years ago

It's possible that these controllers don't work with XInput but do work with DirectInput. Applications can support both XInput and DirectInput at the same time (but Flycast currently doesn't).

Is your test with RetroArch consistent with what you see in Flycast? (I believe RA has separate DirectInput and XInput drivers)

BigheadSMZ commented 4 years ago

I've done some pretty extensive testing now, and it seems Flycast is the only program having issues detecting the controllers. RetroArch is working fine with XInput as the joypad driver with both xb360 controllers. DInput works as well as XInput, but for the SF30 Pro I have to put the controller itself in DInput mode to use DInput as a driver. I can use Flycast through RetroArch without having to force the input to DInput.

image

I've tested multiple PC games and all correctly detect the xb360 controllers as valid input, including: Fallout IV, Killer is Dead, Bloodstained: RoTN, etc. I've tried other emulators such as Dolphin (which correctly detects them as XInput and allows me to configure buttons for them). I can only assume the problem is somehow on my end if nobody else is having this issue.

flyinghead commented 4 years ago

I'll have a look at RA's source to see if they do anything differently regarding XInput. Thanks for your testing and feedback.

barolo commented 4 years ago

On the other hand I have no issues under RA [ Linux ] with DualShock v2 whatsoever, but standalone is a mess, controller is detected but buttons are detected as being pressed repeatedly, can't map d-pad [ doesn't detect input ], after mapping stick, it goes crazy

Which is extremely frustrating as core crashes with some games but has perfect input, standalone deals with the same games perfectly but has borked input...

Edit. Solved it by editing config manually, using one found on the web and modifying it slightly For those in need:

this goes into ./reicast/emu.cfg

[input] MouseSensitivity = 100 VirtualGamepadVibration = 20 device1 = 0 device1.1 = 1 device1.2 = 3 device2 = 10 device2.1 = 10 device2.2 = 10 device3 = 10 device3.1 = 10 device3.2 = 10 device4 = 10 device4.1 = 10 device4.2 = 10 evdev_device_id_1 = 0 evdev_device_id_2 = -1 evdev_device_id_3 = -1 evdev_device_id4 = -1 maple/dev/input/event15 = 0 maple_x11_keyboard = -1 maple_x11_mouse = -1

and this into ..reicast/mappings/evdev_Sony Interactive Entertainment Wireless Controller.cfg

[compat] axis_dpad1_x = 16 axis_dpad1_x_inverted = no axis_dpad1_y = 17 axis_dpad1_y_inverted = no axis_x_inverted = no axis_y_inverted = no btn_trigger_left = 309 btn_trigger_right = 311

[dreamcast] axis_x = 0 axis_y = 1 btn_a = 304 btn_b = 305 btn_start = 315 btn_x = 308 btn_y = 307

[emulator] btn_escape = 314 btn_menu = 316 mapping_name = Sony Interactive Entertainment Wireless Controller

flyinghead commented 4 years ago

What about using SDL for input on windows? That would probably take care of these issues.

Any objection?

flyinghead commented 4 years ago

We are now using SDL on Windows and XInput and DirectInput controllers should work fine.

flyinghead commented 4 years ago

I believe this is resolved. Re-open if needed.