Hi,
I apologize if this question has come up before, I could not find a search feature in the mailing list archives and google didn't give me much on the subject.
I am interested in getting the Xbox 360 controller working in wine. Currently, I can use the controller, but it is recognized only as a generic controller. This is acceptable (although annoying) for games that allow me to freely configure the controller, but others seem to specifically look for an Xbox 360 controller, and when they can't find it, drop to keyboard controls.
Firstly, I am not even sure this is something that should or can be handled in wine. Maybe this needs to be handled in the xpad kernel module, or maybe both. But my guess is that wine would need to detect an Xbox 360 controller and then explicitly present it as such to any games. I guess the first step would be to find out how exactly games detect the Xbox 360 controller under Windows and try to emulate that. Any other previous attempts that anyone knows of? I would appreciate it if anybody out there who has any knowledge in this area, can point me in the right direction.
Thanks.
On 03/20/2011 08:20 AM, Alesh Slovak wrote:
I am interested in getting the Xbox 360 controller working in wine.
You'll need to implement xinput*.dll which is an empty stub in Wine.
Vitaliy.
On 21 March 2011 00:21, Vitaliy Margolen wine-devel@kievinfo.com wrote:
On 03/20/2011 08:20 AM, Alesh Slovak wrote:
I am interested in getting the Xbox 360 controller working in wine.
You'll need to implement xinput*.dll which is an empty stub in Wine.
Do you know if there has been any previous effort that I can take a look at/use as a starting point? I found lots of references to such efforts, but they all seemed to fizzle out and there was never any code.
On Sun, Mar 20, 2011 at 1:26 PM, Alesh Slovak aleshslovak@gmail.com wrote:
On 21 March 2011 00:21, Vitaliy Margolen wine-devel@kievinfo.com wrote:
On 03/20/2011 08:20 AM, Alesh Slovak wrote:
I am interested in getting the Xbox 360 controller working in wine.
You'll need to implement xinput*.dll which is an empty stub in Wine.
Do you know if there has been any previous effort that I can take a look at/use as a starting point? I found lots of references to such efforts, but they all seemed to fizzle out and there was never any code.
There are some patches still around (would have to look them up) and they work. The xinput API is very trivial. Essentially there is only one real call there and that's to poll the device. The API is not so nice though, because xinput was written in such a way that you can add a controller whenever you want throughout the lifetime of the game. The also 'nice' thing is that when you plug in a second controller, it may actually become the 'first' controller (there is no guarantee) and the first would become the second. A correct implementation would 're-probe' for joysticks every 'poll' command :(
Roderick
On Sun, Mar 20, 2011 at 15:40, Roderick Colenbrander thunderbird2k@gmail.com wrote:
On Sun, Mar 20, 2011 at 1:26 PM, Alesh Slovak aleshslovak@gmail.com wrote:
On 21 March 2011 00:21, Vitaliy Margolen wine-devel@kievinfo.com wrote:
On 03/20/2011 08:20 AM, Alesh Slovak wrote:
I am interested in getting the Xbox 360 controller working in wine.
You'll need to implement xinput*.dll which is an empty stub in Wine.
Do you know if there has been any previous effort that I can take a look at/use as a starting point? I found lots of references to such efforts, but they all seemed to fizzle out and there was never any code.
There are some patches still around (would have to look them up) and they work. The xinput API is very trivial. Essentially there is only one real call there and that's to poll the device. The API is not so nice though, because xinput was written in such a way that you can add a controller whenever you want throughout the lifetime of the game. The also 'nice' thing is that when you plug in a second controller, it may actually become the 'first' controller (there is no guarantee) and the first would become the second. A correct implementation would 're-probe' for joysticks every 'poll' command :(
http://www.winehq.org/pipermail/wine-patches/2008-November/064302.html http://www.winehq.org/pipermail/wine-patches/2008-November/064304.html http://www.winehq.org/pipermail/wine-patches/2008-November/064305.html
On Sunday 20 March 2011 21:46:34 Austin English wrote:
There are some patches still around (would have to look them up) and they work.
<warn reason="clueless"> I think the main problem with implementing xinput.dll isn't xinput itself, it is the lack of a proper joystick infrastructure in wine. Currently dinput.dll reads the /dev/js* devices directly, but preferably joystick input should be done over the X server and winex11.drv. This needs some tricky adjustments, winex11.drv isn't a place where you can just add some hacky code and hope Alexandre doesn't notice. </warn>
On 03/20/2011 04:48 PM, Stefan Dösinger wrote:
but preferably joystick input should be done over the X server and winex11.drv.
This sounds good in theory but completely useless in practice.
The X11 interface does not support force feedback, so you'll need to talk to the device directly for that. And mixing different access methods to the same device isn't good.
Vitaliy
Thanks all for the info and insight.
On 21 March 2011 07:48, Stefan Dösinger stefandoesinger@gmx.at wrote:
On Sunday 20 March 2011 21:46:34 Austin English wrote:
There are some patches still around (would have to look them up) and they work.
<warn reason="clueless"> I think the main problem with implementing xinput.dll isn't xinput itself, it is the lack of a proper joystick infrastructure in wine. Currently dinput.dll reads the /dev/js* devices directly, but preferably joystick input should be done over the X server and winex11.drv. This needs some tricky adjustments, winex11.drv isn't a place where you can just add some hacky code and hope Alexandre doesn't notice. </warn>
If dinput is currently implemented this way, what's the problem with implementing xinput in the same way, at least for now? It can always be refactored later if needed. Is this the only reason why the patches didn't make it in before?
On Sun, Mar 20, 2011 at 3:48 PM, Stefan Dösinger stefandoesinger@gmx.at wrote:
On Sunday 20 March 2011 21:46:34 Austin English wrote:
There are some patches still around (would have to look them up) and they work.
<warn reason="clueless"> I think the main problem with implementing xinput.dll isn't xinput itself, it is the lack of a proper joystick infrastructure in wine. Currently dinput.dll reads the /dev/js* devices directly, but preferably joystick input should be done over the X server and winex11.drv. This needs some tricky adjustments, winex11.drv isn't a place where you can just add some hacky code and hope Alexandre doesn't notice. </warn>
Yeah, that was indeed part of the discussion we had last year when this came up. With the direction X11 is taking, I doubt there will ever be proper joystick support in X11. I fear the only way is /dev/evdev (not that portable)... which was what the patches were using.
Roderick
On 21 March 2011 05:46, Austin English austinenglish@gmail.com wrote:
http://www.winehq.org/pipermail/wine-patches/2008-November/064302.html http://www.winehq.org/pipermail/wine-patches/2008-November/064304.html http://www.winehq.org/pipermail/wine-patches/2008-November/064305.html
These patches appear to only add a stub and implement test cases. As far as I can tell, it seems the stub and test cases in current git are based on these patches.
I've also found a set of patches by Michael Gruber from 2009 that appear to actually implement xinput: http://marc.info/?l=wine-patches&m=124710119700598&w=4 http://marc.info/?l=wine-patches&m=124710124200662&w=4 http://marc.info/?l=wine-patches&m=124710129100718&w=4 http://marc.info/?l=wine-patches&m=124710132300760&w=4
What do people think of these?
On 03/21/2011 01:36 AM, Alesh Slovak wrote:
I've also found a set of patches by Michael Gruber from 2009 that appear to actually implement xinput: http://marc.info/?l=wine-patches&m=124710119700598&w=4 http://marc.info/?l=wine-patches&m=124710119700598&w=4 http://marc.info/?l=wine-patches&m=124710124200662&w=4 http://marc.info/?l=wine-patches&m=124710124200662&w=4 http://marc.info/?l=wine-patches&m=124710129100718&w=4 http://marc.info/?l=wine-patches&m=124710129100718&w=4 http://marc.info/?l=wine-patches&m=124710132300760&w=4 http://marc.info/?l=wine-patches&m=124710132300760&w=4
What do people think of these?
Looks more-less complete. Needs some cleanup. The main hurdle would be convincing AJ that this the best and only way to talk to x360 controller.
Of course will need some extra infrastructure to add drivers for other O/Ses.
Vitaliy.
On 03/20/2011 02:46 PM, Austin English wrote:
http://www.winehq.org/pipermail/wine-patches/2008-November/064302.html http://www.winehq.org/pipermail/wine-patches/2008-November/064304.html http://www.winehq.org/pipermail/wine-patches/2008-November/064305.html
These are stubs more-less. No actual implementation of the interface. This part already in Wine.
Vitaliy