OnePAD + Dualshock 3 on Linux
#11
Ok, I won't bother then. Thanks for the heads up. As a side note, I have to enable the --wx28 flag or build.sh doesn't detect that I have wxWidgets libraries available. It's always been that way I'm assuming because I use the KDE desktop environment. Not sure if that means anything but I figured I'd mention it since we were on the topic of how I compiled.

I had the thought of trying to get the Pokopom plugin compiled for Linux and see if it can detect the key presses better. However it seems that although Pokopom supports Linux, they don't provide a makefile and have only a binary build for Ubuntu. It might take some time, but I'm wondering if it would be worth it to manually create a makefile and try to compile and test it out.
Reply

Sponsored links

#12
According to this You just need to compile it and everything should work, no makefile needed.

I'll have to get back to y'all on that.

Should mention I'm on Fedora 21, using the pcsx2 from the repo, jstest reports full functionality.

EDIT:

Screw it, this thing is just shot, I'm going to fix it on my github Here

I'll post again when I fix Pokopom and verify that it works correctly on Fedora 21.
Reply
#13
Thanks thePalindrome, I appreciate your effort in trying to create a fix. I noticed on the page you referenced:
Quote:No GUI and with PCSX2 doesn't pass key presses so it's buggy there.

I'm assuming this is what you're trying to work on? While trying to do a manual compile of Pokopom using GCC I got a few errors. I found that the code isn't fully C++ standards compliant but the Visual Studio compiler that the author uses allows that code while GCC rejects it. It seems some tweaking is necessary to get the code to compile under GCC.

Also, Fedora 21 uses Wayland by default instead of X11. I'm sure that's probably not going to play any role here but I just wanted to note a potential difference between our setups. And I also tried the pcsx2 package from the RPMFusion Non-Free repo but I get the same results from OnePAD.

In the mean time, I've been looking at the OnePAD code and I'm wondering if the problem might lie with SDL. I'm trying to create a few test programs that will shed some light on exactly what SDL is passing to OnePAD.
Reply
#14
The page that I referenced was incorrect, as the creator switched to github August 2013.

His current setup has some issues with gcc, so I'm currently patching his code on my fork of the project.

I did an in place non-specialized upgrade from 20, so I might be in the clear there.

I do know that SDL2 has issues with rumble controllers, so I think we should stick with SDL 1.
Reply
#15
Good deal, thanks. I haven't taken the plunge yet upgrading my system, perhaps I should. I may just wait until May and start fresh with Fedora 22... haven't made up my mind yet.

I have been messing with the Pokopom code from GitHub but I only messed with it briefly and gave up when I got the compilation errors. I noticed that the RPMFusion package includes it already compiled, but I didn't get any buttons to register at all using it.

I'm using SDL 1 also. Gregory said it's better anyway so it sounds like a good idea to stick to it.
Reply
#16
Fnnnnaaaaa...

I managed to get it to compile and run, but it still doesn't detect my DS3 at /dev/input/js0

For people of the future who wish to work further on this, the github is here and you can use the following script to compile it:
Code:
#!/bin/bash
clear

mkdir -p linux32
cd linux32

g++ -O3 -m32 --std=c++11 -march=i686 -mtune=native -Wall -fPIC -DUNICODE -D_UNICODE -c ../Pokopom/*.cpp
g++ -O3 -m32 --std=c++11 -march=i686 -mtune=i686 -shared -DUNICODE -D_UNICODE -Wl,-soname,libPokopom.so -o libPokopom.so *.o
rm *.o

cd ..

The .so goes in /usr/lib/pcsx2/ and the configuration (after you click configure, no window pops up, but instead it generates a .ini) is contained in ~/.config/pcsx2/inis/

I could use some help with this.
Reply
#17
Thanks for your effort thePalindrome. I'll give it a shot with your changes too. This is the same behavior that I've seen with the RPMFusion-packaged version of this plugin too... no input recognized and no GUI. Perhaps the plugin isn't really Linux compatible.

Either way, thanks for looking at it. I'll check into it also.
Reply
#18
I ran into the same problem and fixed it by removing a dualshock 3 hack in the onepad implementation. I don't believe the hack is needed any more as it prevents buttons with ids greater than 7 from being used. The linux 3.8.1 kernel assigns the following ids to the following buttons and axes when plugged in via usb.

Code:
Axes:
0  LeftStick LeftRight
1  LeftStick UpDown

2  RightStick LeftRight
3  RightStick UpDown

8  Dpad Up
9  Dpad Right
10 Dpad Down
11 Dpad Left? (this axis didn't work with jstest)

12 L2
13 R2
14 L1
15 R1

16 Triangle
17 Circle
18 X
19 Square

Buttons:
0  Select
1  L3
2  R3
3  Select
4  Dpad Up
5  Dpad Right
6  Dpad Down
7  Dpad Left
8  L2
9  R2
10 L1
11 R1
12 Triangle
13 Circle
14 X
15 Square
16 PS

I used the following patch to fix the problem:
Code:
--- plugins/onepad/joystick.original    2015-07-21 16:35:59.919844680 -0500
+++ plugins/onepad/joystick.cpp 2015-07-21 16:36:15.435844135 -0500
@@ -212,19 +212,6 @@
        vbuttonstate.resize(numbuttons);
        vhatstate.resize(numhats);

-       // Sixaxis, dualshock3 hack
-       // Most buttons are actually axes due to analog pressure support. Only the first 4 buttons
-       // are digital (select, start, l3, r3). To avoid conflict just forget the others.
-       // Keep the 4 hat buttons too (usb driver). (left pressure does not work with recent kernel). Moreover the pressure
-       // work sometime on half axis neg others time in fulll axis. So better keep them as button for the moment
-       u32 found_hack = devname.find(string("PLAYSTATION(R)3"));
-       if (found_hack != string::npos) {
-               numbuttons = 4; // (select, start, l3, r3)
-               // Enable this hack in bluetooth too. It avoid to restart the onepad gui
-               numbuttons += 4; // the 4 hat buttons
-       }
-
#if SDL_MAJOR_VERSION >= 2
        if ( haptic == NULL ) {
                if (!SDL_JoystickIsHaptic(joy)) {

I also had a problem with my left stick left and right not working. You didn't mention this problem but I tracked it down to an issue with sdl, which exists in 1.2 and 2.0. I'll be submitting this patch to the sdl project as well, but this may help anyone doing a google search in the meantime.

Code:
--- src/joystick/linux/SDL_sysjoystick.original 2015-07-21 16:28:02.939861444 -0500
+++ src/joystick/linux/SDL_sysjoystick.c        2015-07-21 16:26:43.162864247 -0500
@@ -826,6 +826,7 @@
                return(-1);
        }
        SDL_memset(joystick->hwdata, 0, sizeof(*joystick->hwdata));
+       SDL_memset(joystick->hwdata->abs_map, ABS_MAX, sizeof(*joystick->hwdata->abs_map)*ABS_MAX);
        joystick->hwdata->fd = fd;

        /* Set the joystick to non-blocking read mode */
@@ -1120,15 +1121,17 @@
                                                        events[i].value);
                                        break;
                                    default:
-                                       events[i].value = EV_AxisCorrect(joystick, code, events[i].value);
+                                       if (joystick->hwdata->abs_map[code] != ABS_MAX ) {
+                                               events[i].value = EV_AxisCorrect(joystick, code, events[i].value);
#ifndef NO_LOGICAL_JOYSTICKS
-                                       if (!LogicalJoystickAxis(joystick,
-                                          joystick->hwdata->abs_map[code],
-                                          events[i].value))
+                                               if (!LogicalJoystickAxis(joystick,
+                                                  joystick->hwdata->abs_map[code],
+                                                  events[i].value))
#endif
-                                       SDL_PrivateJoystickAxis(joystick,
-                                          joystick->hwdata->abs_map[code],
-                                          events[i].value);
+                                               SDL_PrivateJoystickAxis(joystick,
+                                                  joystick->hwdata->abs_map[code],
+                                                  events[i].value);
+                                       }
                                        break;
                                }
                                break;

Edit:

It occurs to me after reading the removed comment in the onepad patch, that this is perhaps not the best way to solve the problem as you would not get the pressure value this way. I will take a second look and see if I can get the axis for the pressure buttons working. Perhaps its another sdl bug.

Edit2:

Further research shows that linux's evdev reports only 4 axes to sdl, two for each stick. Since the games I'm interested in don't use the pressure feature of the dualshock, i don't have the desire to trace through the evdev code to find out why the axes for the buttons aren't reported. My original patch stands; maybe it can be toggled with a check box like the current dpad hack.
Reply
#19
Maxxus,

I confirm that this works! Thank you so much because it was still a problem for me. I didn't need to change SDL, probably because I'm still using 1.2. Also, the pressure sensitivity isn't an issue for me either so this is a great workaround! Thanks again!
Reply
#20
good jobs. It would be nice if you could open a pull request on github (easier for me to track it)
Reply




Users browsing this thread: 1 Guest(s)