Ryochan7 / DS4Windows

Like those other ds4tools, but sexier
https://ryochan7.github.io/ds4windows-site/
GNU General Public License v3.0
6.95k stars 807 forks source link

[feature request] Linux support #537

Closed tamodolo closed 10 months ago

tamodolo commented 5 years ago

In the rise of Linux as a real option to play games thanks to SteamPlay 2.0 and Lutris that allows Linux to run Windows games (plus the amazing number of ports in recent years that in my tests are running faster and in a more consistent way (frame cadence is very good with no sttuter) than windows version (that suffer from time to time stuttering) like Mad Max and Rise of the Tomb Raider), there is the need of a good software to control DS4 on Linux.

DS4Windows is the best on Windows so why not implementing it on Linux under the name DS4Linux?

Scenario: We have, I think, 2 diferent drivers for DS4 on Linux. 1 of these is in the Kernel. Besides that, it's a real pain to propper config the DS4. I don't know if games use a common API for gamepads on Linux but DS4 differs when using on USB from when using via BT. Also, feedback (vibration) works when it wants to. It's a bit of a mess... Steam offers support for DS4 on Linux but the reasons to not use it is somewhat the same as in Windows.

What to do: Adapt DS4Windows to use the kernel driver and wrap it to a x360 virtual controller or to use the x360 driver directly (it only needs to work with Ubuntu because it's also oficially supported by Valve. Other distros will adapt if the demand rises). If you want to support more than one distro, consider Linux Mint (Ubuntu support means Linux Mint support) and Manjaro as supporting it also means Arch Linux support.

Why do it: I could say that Windows is dangerous but this is a lie at some extent. The true is that Windows don't favor games as it have too many unecessary services running in the background. In this Linux is more straighfoward and do things in a more streamline way. And for those who wants to improve latency there are modified kernels that change the way the kernel scheduler works besides the fact you can use video driver in DRM mode (not the DRM you're thinking hehe. It stands for Direct Rendering Manager). Linux is faster, more reliable and stable than Windows in a similar way of those we see in consoles like PS4 (that actually is Unix based like Linux) making gaming on it more pleasant. Linux also have much much less things that runs side by side and this favors a lot high demanding processes like games. We only need to facilitate things for the average user to access it and DS4Linux would be an great step.

tamodolo commented 1 year ago

huh i was scrolling and found this issue that i thought that it was "dead"

Pretty much. It's still open because I don't know what devs will do in the future as they didn't closed it either.

Ryochan7 commented 1 year ago

Maybe someday but most likely not. At least some work is being done with other mapper experiments although almost all the work has been on the Windows side. My only relevant Linux work has been fixing BLE support in SC Controller and keeping the Python 3 branch going.

I had a small direct DS4 to XInput mapper working on Linux but that is the extent to how far any DS4 experiments have gone in the Linux realm. The last experiments revolved around trying to hide the DS4 from other system processes thanks to SIAPI behavior with the DS4 and forcing a fake disconnect when it opens the DS4; I notice the behavior with the Linux port of Streets of Rage 4. Looks like libusb would likely have to be used to obtain exclusive access to the DS4 but I have not found a way to get it to work for Bluetooth devices.

https://gitlab.com/ryochan7/ds4linuxtest

tamodolo commented 1 year ago

Maybe someday but most likely not. At least some work is being done with other mapper experiments although almost all the work has been on the Windows side. My only relevant Linux work has been fixing BLE support in SC Controller and keeping the Python 3 branch going.

I had a small direct DS4 to XInput mapper working on Linux but that is the extent to how far any DS4 experiments have gone in the Linux realm. The last experiments revolved around trying to hide the DS4 from other system processes thanks to SIAPI behavior with the DS4 and forcing a fake disconnect when it opens the DS4; I notice the behavior with the Linux port of Streets of Rage 4. Looks like libusb would likely have to be used to obtain exclusive access to the DS4 but I have not found a way to get it to work for Bluetooth devices.

https://gitlab.com/ryochan7/ds4linuxtest

I see. Nothing on Linux is remotely as good as DS4win and porting it represent a lot of work indeed. After some research I found that kozec don't update sc controller for 2 years now and the actual latest is yours. So instead of porting DS4win to Linux maybe it'll be easier to implement the missing and more critical features to sc controller (like beying able to control the light bar color and tweak de touchpad and/or remap it. Mostly because it's already in use by a lot of folks for steam controllers outside steam. I'm saying this but I don't know the real state of sc controller and don't know if some of this is already possible as last time with it was a nightmare without any sign of it working at all)

The fact is that DS4 state is far better now than it was in 2019. Mainly because Fedora 36 updated libinput to fix some delays in touchpads and fixed the chronic inputlag problem it had with Linux mainly over bt as a result of that. I don't know if this fix was general to all distros however.

LeaveNhA commented 10 months ago

Hello,

Any MacOS support planned?

Ryochan7 commented 10 months ago

This project is dead. Just waiting for Microsoft to publish the official stable release of .NET 8 and then the last major work on this project will be finished.

Even if that were not the case, MacOS support would likely never be a thing. I have no means to develop for MacOS nor would I want to. I am more anti-Apple than I am anti-Microsoft. Also, I have no idea if there is an gamepad emulation driver for MacOS similar to ViGEmBus.

I had a vested interest in Linux but I never got around to writing a similar mapper for Linux in about 4 years; 2018 was the last year I was really invested in being a Linux and FOSS advocate. AFK issues and DS4Windows have kept me busy enough. I almost have no spare time to work on other projects. I had picked up development of SC Controller (Steam Controller focused mapper for Linux) and even that project has been mostly ignored by me.

This issue can be closed at this point.