Hacking Hardware Help: need some data from DualShock 3 and 4, on Linux

  • Thread starter Thread starter mudrik
  • Start date Start date
  • Views Views 629
  • Replies Replies 4
  • Likes Likes 1

mudrik

Well-Known Member
Newcomer
Joined
Nov 18, 2022
Messages
66
Reaction score
120
Trophies
1
Age
33
XP
698
Country
Turkey
Hi all!
I need help from users who have a DualShock 3 or 4 controller and are running Linux on their PC. Basically, I need to see what is the USB HID stream data which is transmitted from these controllers. I've written rather detailed instructions on how to obtain this data [here](https://github.com/mardy/fakemote/blob/contributing/CONTRIBUTING.md), but in short I just need you to connect your controller to your Linux PC and run this command:

Bash:
# xxxx:yyyy are the vendor:product ID of your controller,
# which you can obtain by running "lsusb"
sudo usbhid-dump -d xxxx:yyyy -e stream

If you could paste a couple of lines of output from that command (first without pressing any button, then maybe pressing the circle button), that would help me a lot.

Why do I need this? Well, I want to add support for my game controller to the Nintendo Wii using the Fakemote driver, which currently supports only DS3 and DS4 controllers, and in order to do so I need to understand how to map the stream data from usbhid-dump to the internal structures of the driver. If I see how the data looks like for a DS3/4 I should be able to understand the offset the data is transmitted at, and its endianness, so then it should be easy to apply the same logic to my own controller.

(I just need one example for the DS3 and one for the DS4, so, if you see that a user has already posted this information, there's no need for you to run the test on the same controller model)

Thanks in advance :bow:
 
  • Like
Reactions: Moseii
Hi! First of all sorry if the notification gives you hope when it might be unfounded haha.

I noticed your thread when you first posted and I see that for now there aren't any replies.
So to do a little bump and maybe get the ball rolling: I don't have either of the DS3 or 4 controllers.
But I do have something that might be a bit similar in how it works: a generic wireless SNES joypad from Aliexpress that can present as either a DInput device, an X360 controller or a PS Classic Controller.

When I do the button combo that makes it show as a PS Classic Controller, this is how it appears on lsusb:

Code:
Bus 001 Device 010: ID 054c:0cda Sony Corp. PlayStation Classic controller

You'll notice it has the vendor code of Sony Corp (054c).

Running

Bash:
sudo usbhid-dump -d 054c:0cda -e stream

Gives the following output when no buttons are pressed (this is the beginning of stream):

Code:
Starting dumping interrupt transfer stream
with 1 minute timeout.

001:008:000:STREAM             1745891005.521735
00 14

With A button pressed (which I assume is mapped to Circle, but I'm not sure):

Code:
001:008:000:STREAM             1745891046.154196
02 14

With down on DPad it shows as

Code:
001:008:000:STREAM             1745891074.269290
00 24

(But according to https://hardwaretester.com/gamepad the DPad directions actually seem to be mapped to analog axes, with Axis 1 being up/down, with a value of 1.0 when pressed down.)

If any of this is even remotely useful to you, let me know if you'd like to see any other tests.
 
  • Like
Reactions: Moseii and mudrik
But I do have something that might be a bit similar in how it works: a generic wireless SNES joypad from Aliexpress that can present as either a DInput device, an X360 controller or a PS Classic Controller.
Thanks! While this is not useful for task I'm working on, it may indeed come up to be useful later on, to add support for this specific controller. :-)
 
  • Like
Reactions: splaca and Moseii
Excuse the confusing horrible formatting

(Sony DualShock 3 "Hall Effect")
ID 054c:0268 Sony Corp. Batoh Device / PlayStation 3 Controller
003:005:000:STREAM IDLE DUMP: 01 00 00 00 00 00 7D 7D 7D 7D 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 EF 16 000 00 00 00 33 F4 77 00 40 02 00 01 E2 01 87 00 05 <First two addresses> 01 00 <10=D-Pad Up, 80=D-Pad Left,40=D-Pad Down,20=D-Pad Right> XX XX XX XX XX XX XX XX XX XX XX <D-Pad Up Pressure, 00=NONE,FF=MAX> <D-Pad Right Pressure, 00=NONE,FF=MAX> <D-Pad Down Pressure, 00=NONE,FF=MAX> <D-Pad Left Pressure, 00=NONE,FF=MAX> XX XX XX XX XX XX XX XX XX XX XX XX XX XX <First two addresses> 01 00 00 <10=Triangle,80=Square,20=Circle,40=Cross,F0=T+S+Cir+Cro> XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX <Triangle Pressure, 00=NONE,FF=MAX> <Circle Pressure, 00=NONE,FF=MAX> <Cross Pressure, 00=NONE,FF=MAX> <Square Pressure, 00=NONE, FF=MAX> XX XX XX XX XX XX <First single address> 01 00 01 XX XX XX XX XX XX XX XX XX XX XX XX XX = Select 01 00 08 XX XX XX XX XX XX XX XX XX XX XX XX XX = Start 01 00 09 XX XX XX XX XX XX XX XX XX XX XX XX XX = Select+Start <First single address> 01 00 XX XX 01 XX XX XX XX XX XX XX XX XX XX XX = Home <First two addresses> 01 00 00 <04=L1,08=R2,0C=L1+R1> XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX <L1 Pressure, 00=NONE,FF=MAX> <R1 Pressure, 00=NONE,FF=MAX> XX XX XX XX XX XX XX XX XX XX <First single address> 01 00 00 XX XX <LEFT ANALOG X POS - 00=MAX LEFT, FF=MAX RIGHT, 7D/7E=DEFAULT POS> <LEFT ANALOG Y POS - 00=MAX UP, FF=MAX DOWN, 7D/7E=DEFAULT POS> <RIGHT ANALOG X POS - 00=MAX UP, FF=MAX DOWN, 7D/7E=DEFAULT POS> <RIGHT ANALOG Y POS - 00=MAX UP, FF=MAX DOWN, 7D/7E=DEFAULT POS> XX XX XX XX XX XX XX <First single address> 01 00 02 XX XX XX XX XX XX XX XX XX XX XX XX XX = LEFT ANALOG BUTTON <First single address> 01 00 04 XX XX XX XX XX XX XX XX XX XX XX XX XX = RIGHT ANALOG BUTTON <First single address> 01 00 06 XX XX XX XX XX XX XX XX XX XX XX XX XX = LEFT+RIGHT ANALOG BUTTON <First 3 addresses> 01 XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX AA AA AA AA AA AA XX GG (AA and GG are gyrometer related - GG is nominally 05)

Seems that same digit address buttons are XOR (0x10 XOR 0x80 XOR 0x20 XOR 0x40 = 0xF0)
 
Last edited by master801,

Site & Scene News

Popular threads in this forum