-
Notifications
You must be signed in to change notification settings - Fork 130
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
[Feature Request] Support for the Dualsense #624
Comments
First of all, try skipping Then it's hopefully just about changing |
@kozec , how to use I don't see the BUTTON_MAP being different for DualSense when looking at Ot does go wonky when you start it - pressing the right trigger to the max looks as if pressing multiple buttons on the UI: Update 1: Without SC-Controller running things are looking as expected in DualSense Left Trigger evtest output
With SC-Controller running using Xbox Controller setup with the DualSense controller hooked up, SC-Controller running - evtest output from DualSense Left Trigger pulled to maximum
Update 2: DualSense evtest capabilities
Update 3:
|
Sounds like it actually sends button event when trigger is pulled. 312 is "share" button on DS4. Can't that be reason for virtual buttons getting pressed? |
Thank you for the reply, @kozec ! It does spawn a button event when the trigger is pulled. Unlike the Steam Controller with its two-stage triggers (defined click when fully pressed), on DualSense these events are spawned when the trigger is pulled and released regardless of the amount. It could be part of the adaptive trigger system? 🤔 The naming confuses me a bit 😄 Which is the "share" button on DS4? Both DS4 and DualSense use Here is a video of SCC misbehaving with DualSense when only the product id change is made: When I mess with the hardcoded HID values, the behaviour changes in terms of what buttons are being triggered through scc 🤔 How were the values for the DS4 here derived? This looks to be the most promising place where adjustments for DualSense would have to be made. Note: |
Small update - I've made a bit of progress with hardcoding new values for the Currently being stuck on the touchpad. I take it that I should figure out how this commit got to be made: 9a05d1d Update: |
This is very promising information for the touchpad but I can't really process it at the moment: |
Ehh.... I'm still fighting with the Touchpad. On the bright side, the Gyro is working. Interestingly, it can detect touchpad button press but dealing with the X/Y touch proves to be a bit difficult for me so far. |
@kozec how did you reach to this commit? I'm not sure if DualSense will require changes to If I can figure out how to see any |
Found the touchpad print of values:
Printing the results from However trying to use the touchpad through sc-controller is very janky - quite a few jumps left and right. Will push another commit later. |
I can't say whether it is proper method, but I've just ran loop printing out packets converted to hex and guessed which one is which from how they were changing.
That may be expected. Smoothing is applied much later in mapper, using smooth modifier. |
Thanks, @kozec ! I wouldn't use the touchpad as a touchpad without further changes for now. It looks as if the jump occurs when lifting and then pressing down (could be re-using the old value as a comparison causing the spike). That would be a task for the future, I guess. Is there rumble/ haptics support for DS4? Not sure if this will require entirely new pieces of code for DualSense or if I'm missing something while looking at the DS4 config. And then there is the GUI - I should check #595 Something simpler for tonight - checking if it works through Bluetooth. PS:
|
Well, the Bluetooth evdev config is all over the place. But it looks like as if only the Dpad and right stick will need some helping hand there. Or is a separate HID driver for Bluetooth preferable? |
Curious - fftest result with DualSense
|
No, but it should be possible for both DS4 and DSS. It would require only handler like this, but with values DS4/DSS expects.
I'd say only if it allows for cleaner code. |
Thank you for the explanation, @kozec ! Now this is both great and a bit weird at the same time - touchpad in Bluetooth mode. My previous check was on one of the SBC devices I have and Bluetooth worked well enough. What I didn't notice is the older kernel the device was running explaining the jankier setup. Meanwhile on the tower, I finally figured out that I had to enable the bluetooth service (cough), DualSense is detected immediately just like the wired connection. Tomorrow, I will play a bit with the GUI and maybe touchpad in wired mode. |
I think so far things are looking good. I've figured out which piece was missing for the erratic touchpad behaviour in USB mode (missed the override earlier).Stil far slower cursor movement while in USB mode compared to Bluetooth but it's smooth - no random spikes. USB HID mode does highjack the audio portion from the controller (headphones/mic don't work while emulation is on). @kozec , is there something that you would like to see changed in the merge request? I don't know if it's good but at least some basic support is present. @yoyossef , it would be great if you can try the changes I've made so far. |
@psstoyanov do i just build and install your dualsense branch? i want to start testing this as i dont have any other controller i only have a dualsense |
@lemonxah , yup, that should be enough 👍 |
@lemonxah , as a note - you can build and run directly instead of installing. I found this to be a better way and would recommend it as it won't affect your system in case you don't like it. To run just use the |
@psstoyanov is your controller working via bluetooth or only usb? |
@lemonxah - both. However I am running on kernel 5.13 - if you are on kernel older than 5.12, then I don't know how it will react. |
@psstoyanov i am on 5.13 manjaro with the sony hid driver installed, but mine isn't workoing with bluetooth, is there any extra steps that you have taken to make it work over blue tooth? the controller connects to my pc fine it works on steam with bluetooth, but i shut down steam before i was running this shoudl steam be running? |
For Bluetooth, I just pair the controller from the settings and then it gets picked up sc-controller automatically from what I can see. No idea if hooking it up through USB first makes a difference. |
weird same setup, but did't it up and then i plugged it in and it works right away .. ok cool let me debug some more thanks, at least i can play lutris games now thanks |
@lemonxah , maybe I have system side sdl2 config for DualSense present as well that is affecting the Bluetooth connection (I haven't updated the sdl2 config in sc-controller to include it). |
@lemonxah , ahh, I've just rebuilt the branch cleanly. I didn't commit my sdl2 configs and might've remained there when I was running it previously. Update: Starting with Bluetooth mode not being recognised -> disable DualSense support and restart emulation -> re-enable and restart emulation again got it recognised. Not sure why that is 🤔 |
i have followed those steps mulitple times and its still not recognised in bluetooth, |
@lemonxah , I can replicate it with my Pinebook Pro running Manjaro ARM.
|
Weird, on the PBP the touchpad isn't detected in BT mode as well. Not sure if it's related or if you observe the same. I did miss a line here specifically for Bluetooth (it doesn't solve the issue for me):
Will add it in a bit. |
@lemonxah , made a couple of changes. Give them a try and lets see if it will resolve it at least for you. |
Update - on the PBP, DualSense is displayed just as generic controller through evdev whereas on the PC tower it's listed as 3 devices in BT mode as well as USB mode 😕 |
Thanks for the log! Will try to see if something stands out |
Great work on the PR @psstoyanov , I pulled your branch and tried in on my machine. Wired works without a problem, Bluetooth doesn't work at all for me. Seems like the controller is not being detected when paired over Bluetooth.
I'm using |
Thanks, @tonibgd , I know BT is... at best dodgy for now. I need to spend some time figuring it out. Not sure if that will happen this month. |
@psstoyanov I managed to make it work over Bluetooth. Going through the code i saw that if HAVE_EVDEV and config["drivers"].get("evdevdrv"):
daemon.get_device_monitor().add_callback("bluetooth",
VENDOR_ID, PRODUCT_ID, make_evdev_device, None) |
So... the goal would be to figure out a method to notify the user about the presence (or lack of) @kozec , is there already per-existing function that is similar or that can be expanded for this purpose? |
Is this still something that's being worked on? Having Dualsense support would be great. |
@DominikNovosel , take a look at #648 For me, the base is working okey-ish as long as you have that Please, check the comments from other people as well and the forks of my brach - iirc there were a couple that were more feature complete than mine but I haven't even got the time to properly take a look at them. In particular take a look at: |
Thanks. Clearly, there's been progress, but it's still not super user-friendly and I'm nowhere near being a full-blown developer that could try and figure this out. |
Ended up combining the efforts put out by theY4Kman and psstoyanov and made a branch for DualSense support in the Python 3 fork. Works with USB and Bluetooth. Going to experiment with it some more before I think about putting the code in the python3 branch. https://github.com/Ryochan7/sc-controller/tree/theY4Kman-dualsense |
Going to make an attempt to handle Bluetooth via hidraw rather than evdev like it is now. Finally got the DualSense to accept an output packet with the slightly different calls required in Python to generate valid crc32. Got some of the input report parsed and most standard controls are mappable; it is still lacking dpad, touchpad, and gyro parsing. |
Current shenanigans. It is in a mostly working state. DPad and Touchpad support now work correctly. Feedback support now seems to work; I carried over the method from DS5Controller.feedback and made some small modifications to the code (crc32 computation and changed min duration). The main portion that does not work is Gyro Tilt; Gyro Mouse should work fine but I have not tested it. Confused about how to compute a quaternion based on the available IMU data provided by the controller. The Steam Controller provides that data in its input data packets. |
Was wrong before about gyro working. I didn't have the proper method established so the mapper would use the gyro data. Also, the gyro rotation data was not interpreted as int16 values like they should have. Now Gyro Mouse works and has been tested. Still working on the quaternion problem for some gyro actions in the mapper. Got a somewhat functional routine but it seems unstable so it is commented out. |
Hi,
I was wondering if the new DualSense controller could be supported? Official drivers are already on the way to be merged for Linux 5.12 ( https://www.phoronix.com/scan.php?page=news_item&px=Sony-PS5-DualSense-Linux-5.12 ) and it is already available on the AUR to install ( https://aur.archlinux.org/packages/hid-playstation-dkms/ ).
SDL and Steam Input already supports it but it would be nice to at least be able to emulate it as a Xbox 360 controller on non-steam games (for example I can't get it to work on some lutris games as is, or even with Steam Input as an overlay).
The drivers are really similar to the DS4 one, the controller is recognized as multiples devices, a controller, a gyroscope, a touchpad etc.
It would be great to have support for the basic DualSense features for now, to be on par with the DualShock 4 support at least because they are so similar.
I tried to get it working through
scc/drivers/ds4drv.py
by substituting the product id to0ce6
instead of09cc
but I couldn't get it to work properly when executingscc/drivers/ds4drv.py
as a script, the controller gets recognized but the inputs are wrongly read or something.I would be glad to help (since I have both a DualSense and a DualShock 4 controller) with a little bit of guidance.
The text was updated successfully, but these errors were encountered: