在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):chrippa/ds4drv开源软件地址(OpenSource Url):https://github.com/chrippa/ds4drv开源编程语言(OpenSource Language):Python 100.0%开源软件介绍(OpenSource Introduction):ds4drvds4drv is a Sony DualShock 4 userspace driver for Linux.
Features
InstallingDependencies
These packages will normally be installed automatically by the setup script, but you may want to use your distro's packages if available:
Stable releaseInstalling the latest release is simple by using pip: $ sudo pip install ds4drv Development versionIf you want to try out latest development code check out the source from Github and install it with: $ git clone https://github.com/chrippa/ds4drv.git
$ cd ds4drv
$ sudo python setup.py install Usingds4drv has two different modes to find DS4 devices, decide which one to use depending on your use case. Raw bluetooth modeSupported protocols: Bluetooth Unless your system is using BlueZ 5.14 (which was released recently) or higher it is not possible to pair with the DS4. Therefore this workaround exists, which connects directly to the DS4 when it has been started in pairing mode (by holding Share + the PS button until the LED starts blinking rapidly). This is the default mode when running without any options: $ ds4drv Hidraw modeSupported protocols: Bluetooth and USB This mode uses the Linux kernel feature hidraw to talk to already existing devices on the system. $ ds4drv --hidraw To use the DS4 via bluetooth in this mode you must pair it first. This requires BlueZ 5.14+ as there was a bug preventing pairing in earlier verions. How you actually pair the DS4 with your computer depends on how your system is setup, suggested googling: <distro name> bluetooth pairing To use the DS4 via USB in this mode, simply connect your DS4 to your computer via a micro USB cable. PermissionsIf you want to use ds4drv as a normal user, you need to make sure ds4drv has permissions to use certain features on your system. ds4drv uses the kernel module uinput to create input devices in user land and
the module hidraw to communicate with DualShock 4 controllers (when using
You may have to reload your udev rules after this with: $ sudo udevadm control --reload-rules
$ sudo udevadm trigger ConfiguringConfiguration fileThe preferred way of configuring ds4drv is via a config file. Take a look at ds4drv.conf for example usage. ds4drv will look for the config file in the following paths:
... or you can specify your own location with Command line optionsYou can also configure using command line options, this will set the LED to a bright red: $ ds4drv --led ff0000 See Multiple controllersds4drv does in theory support multiple controllers (I only have one controller myself, so this is untested). You can give each controller different options like this: $ ds4drv --led ff0000 --next-controller --led 00ff00 This will set the LED color to red on the first controller connected and green on the second. Known issues/limitations
TroubleshootingCheck here for frequently encountered issues. Failed to create input device: "/dev/uinput" cannot be opened for writingThis could be because the uinput kernel module is not running on your
computer. Doing To have the uinput module load on startup, you can add a file
to # in file /etc/modules-load.d/uinput.conf
# Load uinput module at boot
uinput ReferencesThe DualShock 4 report format is not open and had to be reverse engineered. These resources have been very helpful when creating ds4drv:
DCbQgDa4aEbm9QNm4ix6zYV9vMirUDQLNj |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论