Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DualSense Support? #182

Open
cow-killer opened this issue Nov 17, 2020 · 11 comments
Open

DualSense Support? #182

cow-killer opened this issue Nov 17, 2020 · 11 comments

Comments

@cow-killer
Copy link

cow-killer commented Nov 17, 2020

Hey there, I don't suppose there's any way we could reverse-engineer the DualSense controller's connectivity and get this working within ds4drv?

Edit: posting the output of running ds4drv in the event it might help:

Traceback (most recent call last):
  File "/home/cowkiller/miniconda3/bin/ds4drv", line 8, in <module>
    sys.exit(main())
  File "/home/cowkiller/miniconda3/lib/python3.8/site-packages/ds4drv/__main__.py", line 154, in main
    for device in backend.devices:
  File "/home/cowkiller/miniconda3/lib/python3.8/site-packages/ds4drv/backends/bluetooth.py", line 132, in devices
    device = self.find_device()
  File "/home/cowkiller/miniconda3/lib/python3.8/site-packages/ds4drv/backends/bluetooth.py", line 121, in find_device
    return BluetoothDS4Device.connect(bdaddr)
  File "/home/cowkiller/miniconda3/lib/python3.8/site-packages/ds4drv/backends/bluetooth.py", line 23, in connect
    ctl_socket = socket.socket(socket.AF_BLUETOOTH, socket.SOCK_SEQPACKET,
AttributeError: module 'socket' has no attribute 'AF_BLUETOOTH'
@AurelienKun
Copy link

I second this demand. Ive tried a kernel 5.12 that enable the driver but somehow the mapping is still wrong and the gamepad does not work at all on some emulators like dolphin.

The driver implemented by steam (whatever the kernel version) seems to work very well though (but only for steam games).
It might be great to look at their implementation.

@QuixoticGitHub
Copy link

Status?

@albfan
Copy link

albfan commented Dec 16, 2021

If naoki-mizuno/ds4_driver#16 was closed, what's the point of this issue?

this is ds4 (dualshock), why would it support dualsense (ds5)?

@barkovv
Copy link

barkovv commented Jan 5, 2022

Dualsense (ds5) is supported out of box by hid-playstation module from linux kernel (starting from version 5.12, here are the patches for it ).

Both bluetooth and USB mode are supported by Sony. I don't see any reason for opensource community driver.

I've tested it with Hotline Miami (steam version), it works pretty fine.

@QuixoticGitHub
Copy link

QuixoticGitHub commented Jan 5, 2022 via email

@AurelienKun
Copy link

@barkovv try something outside Steam plateform and you'll see the issue (whatever you're using BT or USB).

@QuixoticGitHub
Copy link

QuixoticGitHub commented Jan 5, 2022 via email

@barkovv
Copy link

barkovv commented Jan 6, 2022

Yeah, you're right now I see the problem in the NonSteam environment (in Cyberpunk 2077 via Geforce Now).

I found a workaround for it using xboxdrv (from here)
Consider that you have dualsense.xboxdrv (this is mine example, I've just modified evdev value):

[xboxdrv]

#evdev = /dev/input/by-id/usb-Sony_Interactive_Entertainment_Wireless_Controller-if03-event-joystick
evdev = /dev/input/event15
evdev-grab = true
evdev-debug = true
mimic-xpad = true
silent = true
quiet = true
#deadzone = 5%
#deadzone-trigger = 10%

[axismap]

-Y1 = Y1
-Y2 = Y2

[evdev-absmap]

ABS_HAT0X = dpad_x
ABS_HAT0Y = dpad_y
ABS_X     = X1
ABS_Y     = Y1
ABS_RX    = X2
ABS_RY    = Y2
ABS_Z     = LT
ABS_RZ   = RT

[evdev-keymap]

BTN_SOUTH    = A
BTN_EAST     = B
BTN_NORTH    = Y
BTN_WEST     = X
BTN_START    = start
BTN_MODE     = guide
BTN_SELECT   = back
BTN_TL       = LB
BTN_TR       = RB
BTN_TL2      = LT
BTN_TR2      = RT
BTN_THUMBL   = TL
BTN_THUMBR   = TR

# EOF #

evdev value was found in /proc/bus/input/devices (here is part of mine for Bluetooth connection)

I: Bus=0005 Vendor=054c Product=0ce6 Version=8100
N: Name="Wireless Controller"
P: Phys=
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-7/1-7:1.0/bluetooth/hci0/hci0:256/0005:054C:0CE6.0003/input/input24
U: Uniq=d0:bc:c1:98:17:63
H: Handlers=event15 js0
B: PROP=0
B: EV=20000b
B: KEY=7fdb000000000000 0 0 0 0
B: ABS=3003f
B: FF=107030000 0

For my case it's /dev/input/event15 (replace with yours if needed)
Then you should just do:

sudo xboxdrv -c dualsense.xboxdrv

It should fix the problem (works for me). In case it's not just try to delete /dev/input/js0 file (js0 is taken from above, replace with yours one if needed).

Hope it helps.
https://wiki.archlinux.org/title/Gamepad#Playstation_5_(Dualsense)_controller

@QuixoticGitHub
Copy link

QuixoticGitHub commented Jan 6, 2022 via email

@QuixoticGitHub
Copy link

Did anyone else manage to confirm/fix this?

Do we push this information to someone else?

@loveisfoss
Copy link

loveisfoss commented Feb 18, 2022

If naoki-mizuno/ds4_driver#16 was closed, what's the point of this issue?

this is ds4 (dualshock), why would it support dualsense (ds5)?

The point would be to create a dsu server in order to use motion controls with cemu (which I personally run with wine/lutris) that runs a dsu client (cemuhook).

By the way, l run Debian bookworm with kernel 5.16 and I don't see any module containing the word "PlayStation" loaded, when doing lsmod. On lsusb, I see the DualSense controller entry normally. But for example, evdevhook cannot see it, so I don't know if the driver is loaded properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants