stepmania / stepmania

Advanced rhythm game for Windows, Linux and OS X. Designed for both home and arcade use.
https://www.stepmania.com/
1.85k stars 443 forks source link

Cobalt Flux dance pad not working on Linux #1993

Open s3phy opened 4 years ago

s3phy commented 4 years ago

Hi, I'm using Arch (up to date) and Stepmania I just built from git (problem was the same with 5.0.12, just tested git, same issue). I'm using a Cobalt Flux DDR pad with their "V5.0" control box. I see the pad in /dev/input:

/dev/input/by-id/usb-054c_Cobalt_Flux_Controller-event-if00 /dev/input/by-id/usb-054c_Cobalt_Flux_Controller-event-joystick

The pad works perfectly with MAME For some reason I do not have a /dev/input/js0, I'm wondering if that was dropped from the recent kernels maybe? Within Stepmania the pad is completely unrecognized (no action on any key in the Input test screen, it's not even on the list of inputs there) When stepmania boots, I can see this:

Input device: /dev/input/event20: USB device, ID 054c:0268, version 8111: Cobalt Flux Controller Not a joystick; ignored

Full Stepmania start log: Stepmania-start-log-2020-05-07.txt dmesg output when plugging the pad: dmesg-plugging-cobalt-flux.txt

Thanks.

geefr commented 4 years ago

Can't quite remember the logic (Wasn't this changed recently? swear I saw a PR about it) but I think stepmania ignores anything that doesn't have an axis - So if it's just a controller with 12+ buttons it's 'not a joystick'

File to check would be inputHandler_Event.cpp I think, might be able to switch to the 'joystick' input handler in the config file.

coderjo commented 4 years ago

I'm not sure why the check was added. I did find that message, though. Indeed, it appears to be looking for an analog axis to determine it as a joystick.

https://github.com/stepmania/stepmania/blob/5_1-new/src/arch/InputHandler/InputHandler_Linux_Event.cpp#L133

coderjo commented 4 years ago

Just did a blame on it and it has been there since the Event driver was added. :-/

s3phy commented 4 years ago

Thank you for answering so fast! I just removed the whole if statement & recompiled in order to try, and yes now the pad is properly recognized. Along with every other thing evdev supports on my system of course :D That doesn't appear to be a problem on my setup, apart from making the list of devices in the top of the joy mapping screen so long it's unreadable :) I'm guessing the check was here to prevent that maybe?

Thanks again!

geefr commented 4 years ago

It's possible it's because of that - Think you get things like the power button and all sorts of other magical things without the check.

I think that bit has access to the usb IDs and such, so could read in a list of approved 'non joystick' devices

Or was there an alternate driver for joysticks? Maybe something through X11/SDL, it's really been a while since I touched the input stuff :D

shakesoda commented 4 years ago

it's probably just so you don't get bad input on the mapping screen... probably safe to remove the check (or make it a preference, if someone actually turns out to need this)