ToadKing / wii-u-gc-adapter

Tool for using the Wii U GameCube Adapter on Linux
MIT License
239 stars 41 forks source link

Joysticks don't zero right with evdev back-end #20

Open rexroni opened 8 years ago

rexroni commented 8 years ago

Dolphin emulator recently changed from the old SDL backend to the new evdev backend (see https://dolphin-emu.org/download/dev/8a50dc857bbfc86c41706a6f48770a6f78285628/?nocr=true).

Now our joysticks won't zero reliably. It seems like every time I set the joystick inputs in dolphin, it comes up with a different (incorrect) zero point. It is as if there's some sort of noise in what the dolphin is reading from the controller or something.

Installing an older build of dolphin returns functionality to our controllers, but is not compatible with the Dolphin Netplay for Project M.

rexroni commented 8 years ago

We found a solution to the problem, which was to rebuild dolphin with ENABLE_EVDEV=OFF and ENABLE_SDL=ON.

francesca64 commented 6 years ago

I experienced the same issue, and did some investigating. Believe it or not, this was caused by a subtle oversight in how Dolphin's evdev module calculated axis ranges. I submitted a PR to resolve it, which has now been merged, so this should no longer be an issue.

This driver makes the uncommon choice of using an axis range of (20, 235), as opposed to something more typical, i.e. (0, 255). Dolphin didn't handle that case correctly, and I've found one of the libraries I use has a similar problem. I'd say there are likely more libraries and applications out there with this edgecase, so to avoid potential headaches, you can simply run this program using the --raw flag, enabling "raw mode". In raw mode, there's only one difference: it uses the conventional (0, 255) range. As far as I can tell, there's no downside to doing that; I assume that the intention behind the (20, 235) range was to handle deadzones at a low level, though no clamping happens, so I doubt you gain anything by not using raw mode.