OnePAD + Dualshock 3 on Linux
#1
Hi everyone! I'm hoping someone can shed some light on an issue I'm having. First off, here are some system specs:

HP Envy 17 (Laptop)
Fedora 20 x64 (includes systemd and udev)
Linux 3.17.8 Kernel
Intel i7 CPU
NVIDIA GeForce GT 740M
16 GB DDR3 RAM
pcsx2 1.3.0-20150118130847

Ok, I have a Dualshock 3 Playstation Controller that I connect via USB to my laptop. jstest shows that the controller works great but the OnePAD plugin doesn't register any of the pressure sensitive buttons, including cross, square, triangle, and circle. I also have the Mednafen emulator installed and the controller works, but I have to manually define the button mappings in the config file. I'm wondering if the "pressure values" are conflicting with the button on/off events.

I found this post on the forum that suggests that udev may be at fault: http://forums.pcsx2.net/Thread-sixaxis-c...registered

However, I tried the suggestions for changing permissions on event$N files (as well as creating udev rules) and it still doesn't work. I found that the config file is located at bin/inis/OnePAD.ini and saw that there are button mappings in there. Is there any way I can manually map buttons using this file? WIll it even work?

I'm open to other suggestions also. Thank you!
Reply

Sponsored links

#2
Here my onepad configuration:

   

Now, I'm not sure pressure is actually working inside game but detection seems to work.

Pressure is disabled on hat because of strange behavior (kernel bug?), even jstest doesn't detect pressure on left hat button.

Edit:
A quite old configuration file, not sure it is still required.
Quote:% cat /etc/udev/rules.d/99-sixaxis-usb.rules
# do not edit this file, it will be overwritten on update

ACTION=="add", KERNEL=="event*", ATTR{idVendor}=="054c", ATTR{idProduct}=="0268", MODE="0666"
SUBSYSTEM=="usb", ATTR{idVendor}=="054c", ATTR{idProduct}=="0268", MODE="0666"
You can check ID (product and vendor) with this command after your plug the pad.
Quote:% dmesg| tail
[32445.597701] usb 1-12.2: New USB device found, idVendor=054c, idProduct=0268
[32445.597706] usb 1-12.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[32445.597709] usb 1-12.2: Product: PLAYSTATION®3 Controller
[32445.597711] usb 1-12.2: Manufacturer: Sony
[32445.980595] input: Sony PLAYSTATION®3 Controller as /devices/pci0000:00/0000:00:14.0/usb1/1-12/1-12.2/1-12.2:1.0/0003:054C:0268.000F/input/input28
[32445.980822] sony 0003:054C:0268.000F: input,hiddev0,hidraw5: USB HID v1.11 Joystick [Sony PLAYSTATION®3 Controller] on usb-0000:00:14.0-12.2/input0
Reply
#3
Thanks for your reply gregory. I tried to edit my udev rule file (/etc/udev/rules.d/99-sixaxis-usb.rules) to match yours and then reloaded the udev rules (sudo udevadm control --reload-rules) but I'm still seeing the same issue. I even tried to run pcsx2 as root and assign buttons but I saw the same problem. At this point I'm not sure that permissions in udev are the problem. I wonder if this could be a problem with SELinux. Maybe I'll try to disable that and see what happens. And just FYI, my vendor and product ID values are the same as yours for the controller.

I noticed in your screenshot that you have 27 axes detected on your controller but mine only lists 4 axes. Not sure what that's about. Also, when I run xboxdrv --detach-kernel-driver --trigger-as-button --silent before starting pcsx2 everything works great. The only problem is that after a few minutes xboxdrv crashes because of a usb interrupt or something. Otherwise I'd just use it and that would be it. Odd.

Would it be possible for you to post your OnePAD ini config file? Maybe I could use that to configure my buttons. Thanks again!
Reply
#4
Code:
options = 128
mouse_sensibility = 500
joy_pad_map = 3
ff_intensity = 100
[0][0] = 0x2030c
[0][1] = 0x2030d
[0][2] = 0x2030e
[0][3] = 0x2030f
[0][4] = 0x20310
[0][5] = 0x20311
[0][6] = 0x20312
[0][7] = 0x20313
[0][8] = 0x10000
[0][9] = 0x10001
[0][10] = 0x10002
[0][11] = 0x10003
[0][12] = 0x10004
[0][13] = 0x10005
[0][14] = 0x10006
[0][15] = 0x10007
[0][16] = 0x20101
[0][17] = 0x20000
[0][18] = 0x20001
[0][19] = 0x20100
[0][20] = 0x20103
[0][21] = 0x20002
[0][22] = 0x20003
[0][23] = 0x20102

However I'm not sure it will work because you miss axes. Did you install qtsixa? Others driver?
Reply
#5
Thanks a lot for that. I tried manually inputting those values in and regular buttons worked (start, d-pad, etc) but the pressure buttons still were an issue (cross, circle, etc).

As far as your driver question, no I have no other drivers than whatever's loaded in Linux by default. My kernel version includes drivers for the DS 3 and jstest shows the controller works. I also have another emulator using the controller, albeit with manual button mappings in the configuration since it has a problem detecting certain button presses accurately during the built-in calibration process.

I noticed that QtSixA is pretty old. Do you use that on your machine? Who knows, this could also be a Fedora-specific issue. I'm sure most Linux users here are running Ubuntu and using the PPA that you made available.

Anyway, thanks for your help! If you have any other suggestions let me know, otherwise I'll continue looking into it and report any solutions I find. Thanks again for taking time to try and help me, and for creating such an amazing software product!
Reply
#6
No I don't qtsixa but someone already have an issue with it.

Anyway,
Quote:My kernel version includes drivers for the DS 3 and jstest shows the controller works
Which driver? I think mine use standard usb input driver. How many axes report jstest? (mine is 27 + 19 button).

Here the formulae to compute pad value.
Code:
__forceinline int button_to_key(int button_id)
{
    return (0x10000 | button_id);
}

__forceinline int axis_to_key(int full_axis, int sign, int axis_id)
{
    return (0x20000 | (full_axis  << 9) | (sign << 8) | axis_id);
}

__forceinline int hat_to_key(int dir, int axis_id)
{
    return (0x30000 | (dir << 8) | axis_id);
}
Check button id (for example 10) with jstest. Configuration will be 0x1000a
Reply
#7
I'll have to follow up with that code snippet and see if I can put together a quick C++ program to show the hex button ID's but I'm afraid I need to learn a little more about it first.

As for the driver, although my /var/log/messages (and dmesg for that matter) shows USB events when it's loading my controller after I plug it in, the driver is more specifically the hid_sony kernel module, at least in Fedora with connection via USB. I verified that this module was loaded when plugging my controller in after I manually unloaded it with rmmod.

Also, my jstest shows me the same thing as yours, 27 axes and 19 buttons:
Code:
Driver version is 2.1.0.
Joystick (Sony PLAYSTATION(R)3 Controller) has 27 axes (X, Y, Z, Rz, (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null), (null))
and 19 buttons (Trigger, ThumbBtn, ThumbBtn2, TopBtn, TopBtn2, PinkieBtn, BaseBtn, BaseBtn2, BaseBtn3, BaseBtn4, BaseBtn5, BaseBtn6, BtnDead, BtnA, BtnB, BtnC, (null), (null), (null)).
Testing ... (interrupt to exit)

I guess the key here might be to use your code snippet to create a simple program to output the hex value of the pressed button so I can manually add that into the OnePAD.ini file. I found a few resources on how to attach to the joystick events online so I'll see what I can come up with.
Reply
#8
Did you build/use PCSX2 with SDL1 or SDL2 support?
Reply
#9
I built it on a 32 bit Fedora virtual machine in VirtualBox with SDL 1 support. I just installed SDL 2 (with development libraries) and tried a quick pass re-compile using
Code:
./build.sh --release --wx28 --sdl2
but, as you might have guessed, I got an error about wx being linked to SDL 1. I'll work that out and try with SDL 2 as soon as I can. Thanks for the lead!
Reply
#10
Nah, SDL1 works better. It was to be sure you use it (lots of people enable experimental flags).
Reply




Users browsing this thread: 1 Guest(s)