View previous topic :: View next topic |
Author |
Message |
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Fri May 15, 2015 11:30 pm Post subject: PowerA Xbox ONE mini controller |
|
|
I bought this Xbox ONE mini series controller from PowerA because I have small hands, and it's VERY comfortable. But xpad doesn't even register it. Do I have to use xboxdrv? I really don't want to, because it requires configuration whereas xpad just works.
Code: | [27012.519653] usb 3-2: new full-speed USB device number 10 using xhci_hcd
[27012.661778] usb 3-2: New USB device found, idVendor=24c6, idProduct=541a
[27012.661781] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[27012.661782] usb 3-2: Product: Xbox ONE mini
[27012.661783] usb 3-2: Manufacturer: BDA
[27012.661784] usb 3-2: SerialNumber: 0000AEF2CED7967E |
That is what dmesg says when I plug it in. There are no new devices in /dev/input.
Is it possible that xpad won't recognize it because it's a third party controller? If it works on an actual XBOX I'd think the protocol would have to be identical. |
|
Back to top |
|
|
russK l33t
Joined: 27 Jun 2006 Posts: 665
|
Posted: Sat May 16, 2015 1:40 am Post subject: |
|
|
Looks like xpad supports some PowerA controllers, but not 0x24c6, 0x541a.
Read /usr/src/linux/Documentation/input/xpad.txt and /usr/src/linux/drivers/input/joystick/xpad.c
The text file suggests if you email the developers they will add your controller. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Sat May 16, 2015 2:00 am Post subject: |
|
|
Nah, I had to return it to the store, it didn't work in Windows either, and I really need it to. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Sun May 17, 2015 1:51 am Post subject: |
|
|
I figured out how it works, so I bought another one. I'll email the developers of xpad then. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Fri Dec 25, 2015 9:15 pm Post subject: |
|
|
I've emailed two people mentioned in xpad.c and neither of them still work on it. Who should I email? My controller still doesn't work, and adding its USB ID to xpad.c doesn't fix it either. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Fri Dec 25, 2015 9:31 pm Post subject: |
|
|
Silent-Hunter,
Maybe the patch attached to this post is still not in the kernel? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Fri Dec 25, 2015 10:13 pm Post subject: |
|
|
I looked at that, but I was rather afraid to do it, what if the code in xpad.c is newer than that patch?
Sorry for being noobish, I have never patched anything before. Is there a guide for patching Gentoo kernel? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Fri Dec 25, 2015 10:49 pm Post subject: |
|
|
Silent-Hunter,
Well, just attempting to apply the patch is harmless.
In fact, portage may do it for you if the kernel ebuilds call epatch_user.
How to do it that way is documented in the handbook.
The patch applies to /usr/src/linux/drivers/input/joystick/xpad.c
You could look at the file and see if it appears to have been applied.
Attempting to apply it again will fail.
In the patch file, lines prefixed with a - are to be removed
Lines prefixed with a + are to be added.
Lines with no prefix are to provide context to the patch command
Entries like @@ -282,7 +292,11 @@ are line numbers, which patch uses as hints.
Applying the patch here only part works.
cd /usr/src/linux
Put the post into file here, say xbc.patch, then do Code: | # patch -p1 < xbc.patch
patching file drivers/input/joystick/xpad.c
Hunk #1 succeeded at 79 (offset 2 lines).
Hunk #2 succeeded at 101 with fuzz 2 (offset 3 lines).
Hunk #3 FAILED at 292.
Hunk #4 FAILED at 546.
Hunk #5 succeeded at 756 (offset 161 lines).
Hunk #6 succeeded at 801 (offset 159 lines).
Hunk #7 succeeded at 810 with fuzz 2 (offset 159 lines).
Hunk #8 FAILED at 721.
3 out of 8 hunks FAILED -- saving rejects to file drivers/input/joystick/xpad.c.rej |
Only some of it worked. Now it gets more difficult. The you need to determine what to do about the failed hunks.
Its unlikely that leaving them out is an option. Fixing it needs an understanding of the areas of the code that patch was trying to change.
In the first failed hunk
Code: | --- drivers/input/joystick/xpad.c
+++ drivers/input/joystick/xpad.c
@@ -292,7 +302,11 @@ struct usb_xpad {
struct urb *irq_out; /* urb for interrupt out report */
unsigned char *odata; /* output data */
dma_addr_t odata_dma;
- struct mutex odata_mutex;
+
+ struct circ_buf xmit; /* queue for interrupt out transfers */
+ unsigned char xmit_data[XMIT_SIZE];
+ unsigned long xmit_flags[1];
+ spinlock_t xmit_lock;
#endif
#if defined(CONFIG_JOYSTICK_XPAD_LEDS) |
The context has changed.
Code: | - struct mutex odata_mutex; | is further down the function.
It may be as simple as finding the new context and making the change by hand. It may not too.
The trailing context has changed too.
I don't understand the code, I'm just reading the drivers/input/joystick/xpad.c.rej file and the partially patched drivers/input/joystick/xpad.c _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Sat Dec 26, 2015 12:54 am Post subject: |
|
|
It appears as though the patch didn't actually fix it, as the controller initialises, but according to jstest all inputs are frozen. Fiddling the controls does nothing. BUT, with an Xbox 360 controller that works in jstest, Dolphin still doesn't see anything. So I don't know anymore. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Sat Dec 26, 2015 2:28 am Post subject: |
|
|
OK! It took some time, but after adding some rules to udev.d, it recognizes the controllers and all. But all the PowerA controller's inputs are frozen. Even jstest doesn't show anything still. So I guess the patch allows the controller to be seen, but not used. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Sat Dec 26, 2015 11:56 am Post subject: |
|
|
Silent-Hunter,
Post your dmesg with your new patched kernel running and your powerA controller plugged in.
It would make it easier to read if you follow this sequence.
Unplug the controller.
(Re)boot
Plug in the controller
Check that its messages appear at the end of dmesg
Post dmesg.
I have a feeling that the Vendor/Device IDs are not known to the kernel.
That's another one line patch. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Sat Dec 26, 2015 3:22 pm Post subject: |
|
|
Code: | [ 364.955437] usb 3-2: new full-speed USB device number 7 using xhci_hcd
[ 365.097416] usb 3-2: New USB device found, idVendor=24c6, idProduct=541a
[ 365.097419] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 365.097420] usb 3-2: Product: Xbox ONE mini
[ 365.097421] usb 3-2: Manufacturer: BDA
[ 365.097422] usb 3-2: SerialNumber: 000003C415CA950D
[ 365.130602] input: PowerA Xbox One MINI Series Controller as /devices/pci0000:00/0000:00:14.0/usb3/3-2/3-2:1.0/input/input22
[ 365.130693] usbcore: registered new interface driver xpad |
There they are! It seems to know the IDs, but are there maybe something else missing? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Sat Dec 26, 2015 5:03 pm Post subject: |
|
|
Silent-Hunter,
That's encouraging.
[ 364.955437] usb 3-2: new full-speed USB device number 7 using xhci_hcd
Maybe it doesn't like being on a USB3 port? _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Sat Dec 26, 2015 6:32 pm Post subject: |
|
|
I don't have any others, all four are USB3. It does vibrate when I plug it in, or type lsinput, or start Dolphin. Any initialization of it makes it vibrate, but it doesn't actually detect any inputs. It's odd because my boyfriend's XBOX 360 controller works. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Sat Dec 26, 2015 7:58 pm Post subject: |
|
|
Silent-Hunter,
First, I freely admit I'm out of my depth on this now.
Looking at xpad.c in nano, near the top, is a function definition starting
Code: | static const struct xpad_device { |
Your idVendor=24c6, idProduct=541a is not listed in the array.
The first two columns are Vendor and Device ID in hex. Notice that and the end of that array, is a set of entries starting
which match your vendor.
If you add a row starting Code: | { 0x24c6, 0x541a, "PowerA Xbox One MINI Series Controller", |
Now the tricky bit. I have no idea what goes in the last two fields for your device.
I suspect that the next field will be zero from the struct definition and the comment here
Code: | /* xbox d-pads should map to buttons, as is required for DDR pads
but we map them to axes when possible to simplify things */
#define MAP_DPAD_TO_BUTTONS (1 << 0)
#define MAP_TRIGGERS_TO_BUTTONS (1 << 1)
#define MAP_STICKS_TO_NULL (1 << 2)
#define DANCEPAD_MAP_CONFIG (MAP_DPAD_TO_BUTTONS | \
MAP_TRIGGERS_TO_BUTTONS | MAP_STICKS_TO_NULL) |
Your device is a controller, not a dance pad, so this will not apply to you.
Code: | The last field will be one of these values.
#define XTYPE_XBOX 0
#define XTYPE_XBOX360 1
#define XTYPE_XBOX360W 2
#define XTYPE_XBOXONE 3
#define XTYPE_UNKNOWN 4 |
We now have Code: | { 0x24c6, 0x541a, "PowerA Xbox One MINI Series Controller",0,?} |
Where ? is one of the constants above.
That's 5 edits and kernel module builds to try them all. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Sat Dec 26, 2015 9:18 pm Post subject: |
|
|
Well, I added that patch which added in a controller VERY much like mine. That's how I got it to detect the controller. I just changed the product ID and name to my controller. Apparently it works for the other one, which is odd it doesn't work for mine.
How does one rebuild just one module? I looked but I can't find any info on that. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Sat Dec 26, 2015 10:13 pm Post subject: |
|
|
Silent-Hunter,
First, understand that make is lazy. It looks at the timestamps on the output file and if its newer than all the input files, it does nothing for that file.
If some kernel code is configured as a module <M>, you can rebuild and reinstall in without a reboot.
Edit your kernel module then
Code: | make modules
make modules_install |
Make will find almost nothing to do. The kernel in /boot cannot have changed.
Code: | modprobe -r <module_name> | to remove the old module
Code: | modprobe <module_name> | to load the new one.
If the code is built in <*> you have to rebuild and reinstall the kernel. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Sat Dec 26, 2015 10:22 pm Post subject: |
|
|
Thank you! I will try a few things.
I have one more question. Who should I email about this? About fixing xpad.c to support it for everyone? I can't seem to find the developer. |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54232 Location: 56N 3W
|
Posted: Sat Dec 26, 2015 10:35 pm Post subject: |
|
|
Silent-Hunter,
Is there anything on the web about xboxdrv, if that's the right module name?
Someone must be doing care and maintainence to stop bit rot as the rest of the kernel changes. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Silent-Hunter Apprentice
Joined: 07 Jul 2013 Posts: 166
|
Posted: Sat Dec 26, 2015 10:55 pm Post subject: |
|
|
It's actually xpad, xboxdrv is the userspace one, which I've never gotten to work right. There's a multitude of emails in the source file, but emailing the most recent one got me to someone who no longer works on it. |
|
Back to top |
|
|
|