Joystick mapping "wrong"

Questions about Wine on Linux
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Joystick mapping "wrong"

Post by faelmc »

Greetings

I have a great experience with games in wine 8)

I have a joystick (DragonRise Inc. Generic USB Joystick)
everything works smoothly, but a problem with the axes.
It is a Joystick PS2 style, very popular where I live, the problem is:

The action left and right analog 2, is on the left and right analog number 1, which is normal but the left and right are two actions,
The analog number two, does nothing to the left and right. The rest is normal.

I create a bug for this (http://bugs.winehq.org/show_bug.cgi?id=29985), Vitaliy Margolen helped me, What is the wine picks the wrong mapping for my joystick. The solution to this is to change the mapping via regedit.

http://wiki.winehq.org/UsefulRegistryKeys
Here explains how to do, but I still could not get any results, create and modify multiple keys, but nothing changed.

I ask for help to friends of wine, to change the mapping.

My joystick is / dev/input/js0
is the driver is DragonRise Inc. Generic USB Joystick


http://bugs.winehq.org/attachment.cgi?id=39035
Here a file (tar.gz) with two photos, the first is the joystick, the other is a drawing I made to show the problem.
Thanks! and sorry for bad English
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Re: Joystick mapping "wrong"

Post by vitamin »

What does output of this command say?

Code: Select all

WINEDEBUG=+dinput wine game.exe 2>&1 | grep joydev_enum_device
And what have you entered into registry under [HKEY_CURRENT_USER\Software\Wine\DirectInput]?
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

thank you friend
winedebug the command returns:

hiphop hiphop @: ~ / .local / share / wineprefixes / gta_sa / drive_c / Program Files / Rockstar Games / GTA San Andreas $ env WINEPREFIX = "/ home / hiphop / .local / share / wineprefixes / gta_sa" WINEDEBUG = + dinput wine gta_sa.exe 2> & 1 | grep joydev_enum_device

trace: dinput: joydev_enum_deviceA Enumerating the linux Joystick device: / dev/input/js0 (DragonRise Inc. Generic USB Joystick)

test to start playing and kept playing, but the log was only this

about the key, so I created this way
[HKEY_CURRENT_USER \ Software \ Wine \ DirectInput]
I created the key:
DragonRise Inc. Generic USB Joystick

with the data:

X, Y, Z, Rx, Ry, Rz, Slider1, Slider2, POV1, POV2, POV3, POV4

I made several changes in the data but nothing has changed during the tests.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

faelmc wrote:X, Y, Z, Rx, Ry, Rz, Slider1, Slider2, POV1, POV2, POV3, POV4
This is not correct for your joystick. It doesn't have that many axis. Keep in mind POV "consumes" 2 axis.

The part that doesn't work for you is "Rx". "X,Y" are you left stick. "Z,Rx" are your right stick.
Try this mapping: "X,Y,Z,Rx,POV1". If it doesn't work, play with "Z,Rx" part.
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

I experimented with the possibilities:

X,Y,Z,Rx,POV1
X,Y,POV1
Z,Rx,POV1

but nothing changed, maybe something could be wrong with the key, the intention of helping'll send a screenshoot

http://postimage.org/image/m4k1huia9/
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

faelmc wrote:I experimented with the possibilities:

X,Y,POV1
Z,Rx,POV1

but nothing changed,
Of course not, all of those are invalid. Re-read what I said. If your left stick is working - you don't touch first "X,Y" part. Change "Z,Rx" part with other axis. Ex: "Rx,Ry","Slider1,Slider2" or even "POV2".
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

sorry

from what I understood with POV1's all right. so I made new tests.

X,Y,Z,Rx,POV2
X,Y,POV2
Z,Rx,POV2
Rx,Ry,POV2
Rx,Ry,Slider1,Slider2,POV2

but still nothing has changed
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

faelmc wrote:but still nothing has changed
Can you try native dinput (install with winetricks)? You game might not be using dinput. With native dinput they shouldn't work at all.
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

The game I most like, to solve this problem is GTA San Andreas.

A great game.
Dinput with winetricks, the game does not open. crash
Reopens with dinput built
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

faelmc wrote:Dinput with winetricks, the game does not open. crash
Check that winetricks installed both dinput.dll & dinput8.dll. And that both are set to native.
faelmc wrote:so I made new tests.

X,Y,Z,Rx,POV2
X,Y,POV2
Z,Rx,POV2
Rx,Ry,POV2
Rx,Ry,Slider1,Slider2,POV2

but still nothing has changed
When you say "nothing changed" you mean joystick still work exactly the same as before? Or doesn't work at all?

Please generate log with WINEDEBUG=+dinput wine game.exe &> file.log and upload somewhere.
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

I installed winetricks and Dinput.dll dinput8.dll, the two became as natives, opened the game with no errors, but the joystick does not work, only keyboard and mouse.

And yes, when I say nothing has changed, I mean that the joystick works just as before the registry entries, no change at all the buttons.

Log WINEDEBUG = + dinput here (zipped in tar.gz)
http://k003.kiwi6.com/hotlink/5w8wa93v5 ... log_tar.gz
or http://kiwi6.com/file/5w8wa93v58
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

faelmc wrote:Log WINEDEBUG = + dinput here (zipped in tar.gz)
I see what's going on. The full joystick name is

Code: Select all

"DragonRise Inc.   Generic   USB  Joystick  "
You have to use that exactly, including trailing spaces but not including quotes of course.
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

Yes, now works with the right name in regedit, the changes happened, but still could not solve the problem.

I realized that for all axes, work, you need to map multiple buttons, with entries such as:

X,Y,Z,Rx,POV2
X,Y,POV2
Z,Rx,POV2
Rx,Ry,POV2

only works, an axis, just for one direction, the closest I could get was this:

X,Y,Z,Rx,Rz,Ry

with this entry, the joystick works as before the registry entries. The problem of analog 2, left and right continues.
I made several attempts I changed the order of entries.
But still I could not.

I ask for more guidance to proceed

Thanks!
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

Test joystick with 'jstest' and tell me which axis are which. By default you should have:

Axis 0 in jstest (left stick horizontal) maps to X in Wine
Axis 1 in jstest (left stick vertical) maps to Y in Wine
Axis 2 in jstest (right stick horizontal) maps to Z in Wine
Axis 3 in jstest (right stick vertical) maps to Rx in Wine
Axis 4 in jstest (directional pad left-right) maps to POV1 in Wine
Axis 5 in jstest (directional pad top-bottom) part of POV1 above
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

Jstest installed, I now have more information about the joystick

DragonRise Inc. Generic USB Joystick
Device: / dev/input/js0
Axes: 7
Buttons: 12

I want to map the axis is the axis 3, which is without action in wine, is only one axis, it only changes the values (left negative and right positive value)

Left and right analog one, the axis is 0 and 2 are equal, the numbers are the same when moving to the left or right.

Axis 0 and 2 is what makes CJ, and also move the camera left and right on San Andreas.

Axis 3 is the analog number 2, to the left and right.
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

Here's the complete information jstest, sorry for not posting this before.

Axis 0 - left stick horizontal
Axis 1 - left stick vertical
Axis 2 - left stick horizontal
Axis 3 - right stick horizontal
Axis 4 - right stick vertical
Axis 5 - directional pad left-right
Axis 6 - directional pad top-bottom

Yes, the axis 0 and 2 are equal.
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

friend how to proceed?
Thanks
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

faelmc wrote:Here's the complete information jstest, sorry for not posting this before.

Axis 0 - left stick horizontal
Axis 1 - left stick vertical
Axis 2 - left stick horizontal
Axis 3 - right stick horizontal
Axis 4 - right stick vertical
Axis 5 - directional pad left-right
Axis 6 - directional pad top-bottom

Yes, the axis 0 and 2 are equal.
Try this: "X,Y,-,Z,Rx,POV1". If that won't work you can try other axis in place of "Z,Rx". Like "Rx,Rz" or "Slider1,Slider2".
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

we are reaching a solution, but has not been solved

with these entries:

X,Y,-,Z,Rx,POV1
X,Y,-,Rx,Rz,POV1
X,Y,-,Slider1,Slider2,POV1

the result is the same, I changed to test for POV1 POV2 or POV3, but nothing changed.
the number one analog and directional work correctly, but the analog number two, does nothing to either side.

I made several attempts but still did not get any better than this mapping you passed. When I can make it work right and left analog number two, the rest does not work as expected.

Thanks again, and ask for more help.
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

Sorry, I told you all I know. It now up to you to play with different variants of that registry setting to get what you need.
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

Ok friend, and you've helped me a lot, thank you for that.

I've made several attempts and registry changes, sometimes even I can solve the particular problem of a directional, but have several other problems with other axes.

I thought a different possibility, I was trying to use the USB patch for wine, for use with my phone as I said here: http://forum.winehq.org/viewtopic.php?p=73192#73192
The project seems very interesting, I have not had success with my phone for other reasons, but consigui native alternative for this.
Is it possible to use this patch with a joystick?, I believe so, but peop your opinion and guidance if possible.

The joystick on the driver used by windows is the "hidusb.sys".
The command "winedump -j import hidusb.sys" I say that you need only "offset 00001f4c ntoskrnl.exe" according to the explanations of http://wiki.winehq.org/USB
should work, follow the step as in the wiki, but could not, I installed everest in wine, to see the USBs but have not had success, you may need to disable joystick support in the compilation I think. Finally, I would like your opinion and help on this

thank you very much
vitamin
Moderator
Moderator
Posts: 6605
Joined: Sat Feb 23, 2008 2:29 pm

Post by vitamin »

faelmc wrote:Is it possible to use this patch with a joystick?
No.
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

ok, thanks for the help friend.
ze_dascove
Newbie
Newbie
Posts: 2
Joined: Thu May 31, 2012 11:36 am

Post by ze_dascove »

Hey faelmc,

Just to let you know. I manage to get my joystick to work exactly as it did in Windows, using the following:

X,Y,Rx,Z,Rz,POV1

I am using the same joystick as you, which is very commun in Brasil, as you know. I hope it works for you too.

Thank you vitimin, as well. This thread helped me to figure how to solve this out.
faelmc
Level 2
Level 2
Posts: 36
Joined: Wed Feb 29, 2012 7:35 pm

Post by faelmc »

ze_dascove wrote:Hey faelmc,

Just to let you know. I manage to get my joystick to work exactly as it did in Windows, using the following:

X,Y,Rx,Z,Rz,POV1

I am using the same joystick as you, which is very commun in Brasil, as you know. I hope it works for you too.

Thank you vitimin, as well. This thread helped me to figure how to solve this out.


Thank you very much, ze_dascove. I am also Brazilian.
the entrance works, the analog number 2, it all works.

I had only one small problem, the number one analog, did not work right and left, this also happened to you?

br:

Muito obrigado ze_dascove. também sou brasileiro.
a entrada que você passou funciona, o analógico número 2, funciona tudo.

Tive apenas um pequeno problema, o analógico número 1, não funcionou esquerda e direita, isso também aconteceu com você?
Locked