Earliest failing kernel version: 2.6.2* something Distribution: Gentoo Linux Hardware Environment: 64-bit Intel chipset Software Environment: 64-bit 2.6.24 kernel Problem Description: The official Xbox and Xbox360 controllers both seem to exhibit the behavior of reversing the up and down on the Y axis on the left analog stick. It would be nice to get this fixed, as I would like to actually USE my $50 controller. Steps to reproduce: Plug an Xbox controller in. Play a game. Up and down will be reversed.
As far as I can see, the right analog stick has reversed up and down as well (on xbox360 at least). Are you sure this is not the case for you as well?
I haven't tried the right stick yet. Most of my games use 1 stick.
Actually, after viewing the controller information in the KDE Control Center's joystick screen, I realize that the right stick is also reversed on the Y axis! Not only that, but the D pad is also reversed on the Y axis!
You said that the left stick is reversed with both xbox and xbox360 controllers. Does the reversed right stick also apply to both or only xbox360? The fact that Dpad is reversed seems quite strange, as it seems to be correct to other people. How exactly did you determine it is wrong using the KDE Control Center applet? Could you use jstest or evtest and see if up/down is negative/positive as it should be?
I don't have an original xbox controller to test with, although I am sure it exhibits the same problems (I tested it a while back). The 360 controller reports all Y values on all axis backwards. The KDE Control Center's Joystick module showed the same information, and SDLjoytestGL showed the same information as well. My games all also confirm this. All Y values on the xpad drivers are reversed.
How do you know that original xbox controllers also have right stick reversed, if you only tested the left stick? Regarding Dpad: Are you using a vanilla kernel or a patched one? If patched, which one? Could you post the output in kernel log when you plug in your device?
My original xbox controllers seemed to have the same problems in the earlier versions of the kernel, in Gentoo Linux x86. I do remember now that, while I was playing around in the KDE control center a few kernel versions ago, that Y was backwards on both sticks on the original controllers as well. But I had mostly used the driver to use dance mats on my computer, so I wasn't too concerned about it. But now, I have an xbox 360 controller (I might buy an xbox 360 dance mat later, too ;) ) and now I notice that things are screwy. As for kernel patches, the problem was evident in Gentoo Linux both x86 gentoo kernels and x86_64 tuxonice kernels, as well as PCLinuxOS kernels from 2007 and 2008 (but xbox360 controllers aren't working in the PCLinuxOS kernel yet, but I tested the original xbox controller on all of these). The bug seems too widespread to be the fault of any patches... And, my dmesg output when plugging in my controller: usb 4-2: new full speed USB device using uhci_hcd and address 3 usb 4-2: configuration #1 chosen from 1 choice input: Microsoft X-Box 360 pad as /class/input/input9
Okay, so we need to flip the Y axises of the sticks on original xbox as well (I've already sent patches to do it on xbox360). I'm not sure what to do with the DPAD, though, as the current handling works okay for other users. Could you please provide the output of jstest or evtest when pressing the DPAD buttons?
Well, I don't know if it's acting different than what it's supposed to act like. I just noticed the same numbers for the Y axis on the dpad as on the sticks, and the numbers for the sticks were backwards, so... But then again, if people are setting the dpad like buttons, it shouldn't matter, really. But if they want to use it as an axis, they may have problems. I'm not an expert on how joysticks should work, but the same reversed negative numbers I got on the sticks I got on the dpad. I can't print the output until I am back in my room (I'm in class right now ;) )
Oh, and when you're done, where can I get the patches? Or will they be in the next kernel version?
Dpad output for jstest: Axis 7: -32767 when pushing UP Axis 7: 32767 when pushing DOWN Which seems backwards to me.
Also, if you view my original bug (http://bugzilla.kernel.org/show_bug.cgi?id=7193) it looks like someone has submitted a new driver update.
Negative for up is *correct*, positive for down is *correct* for game controllers. Could you confirm whether you have up as negative or positive with the sticks?
With the sticks, I get positive for up and negative for down on both. However, that driver update in my last comment has code to detect whether the right thumbstick needs to be flipped (and they already fixed the left one being inverted), supports the wireless controller, stops blinking xbox light, uses /proc for enabling and disabling mouse and rumble features, and fun stuff like that. It really looks promising, and it also looks like most of the work is done for you. ;)
Created attachment 15478 [details] The new xbox controller driver This driver is the latest one from the xbox linux project, the one I made mention of. Perhaps, every once in a while, you guys could take a peek at their driver page (http://xbox.cvs.sourceforge.net/xbox-linux/kernel-2.6/drivers/usb/input/?hideattic=1) and see if the driver is updated.
I don't see any detection there. It always flips left stick, but leaves to right stick alone (probably wrong). Note that the kernel xpad driver had already it right, but there was apparently some confusion whether up is positive or negative and it got broken when the intention was to "fix" it. There is already a patch for xbox360 wireless controller support, however it has not yet been applied (dunno why, I resent it few feeks ago). Are you sure the blinking xbox light is stopped immediately? With our driver, AFAICS it blinks but stops blinking when you open the device in any application (then the led corresponding to gamepad number is lit up). Also, with our driver one can control the leds oneself (via echoing numbers to /sys/class/leds/something/brightness). With a quick look I don't see the xboxlinux driver doing it differently. I don't think setting any mouse features belongs in the kernel, as this is not a mouse device. If something like it is added to the kernel, it has to be a generic interface applied to all devices. You are correct that xbox rumble is not supported by our driver, however xbox360 rumble is supported. The original xbox rumble is in my TODO list, as the code is available from xbox linux project. Back to the topic now :) Okay, I'll send a patch to input maintainer to reverse stick Y axes on both xbox and xbox360 then. Thanks for the report.
Created attachment 15480 [details] xpad: fix inverted Y and RY axes Here is the patch for reference. Sent to linux-input@ as "[patch 2/7, rev2] xpad: fix inverted Y and RY axes".
Sweet. What about the other changes made in the newer xbox linux xpad driver? Will that be updated any time soon? Not that we need all of the features in the driver; as we are actually using computers, and thus have mice, we don't really need things like mouse emulation. ;)
Well, the xboxlinux version of the driver is quite different from the in-kernel driver, even if they originally were the same. I'm not aware of any other missing features from the in-kernel driver except the original xbox rumble support. I'll be able to implement that in the next few weeks at the earliest, probably a little later.
oops, I read their "todo" section by mistake, thinking that it was the "changes" section :P
Oh, and I tested that patch, and it works perfectly!
The fix has been applied into input subsystem git tree, and will be merged into 2.6.26. Thanks for the report.