Package: ds4drv
ds4drv is a Sony DualShock 4 userspace driver for Linux.Discussions:https://groups.google.com/forum/#!forum/ds4drvGitHub:https://github.com/chrippa/ds4drvPyPI:https://pypi.python.org/pypi/ds4drvFeaturesOption to emulate the Xbox 360 controller for compatibility with Steam gamesSetting the LED colorReminding you about low battery by flashing the LEDUsing the trackpad as a mouseCustom mappings, map buttons and sticks to whatever mouse, key or joystick
action you wantSettings profiles that can be cycled through with a button bindingInstallingDependenciesPython2.7 or 3.3+ (for Debian/Ubuntu you need to
install thepython2.7-devorpython3.3-devpackage)python-setuptoolshcitool (usually available in thebluez-utilsor equivalent package)These packages will normally be installed automatically by the setup script,
but you may want to use your distro’s packages if available:pyudev0.16 or higherpython-evdev0.3.0 or higherStable releaseInstalling the latest release is simple by usingpip:$sudopipinstallds4drvDevelopment versionIf you want to try out latest development code check out the source from
Github and install it with:$gitclonehttps://github.com/chrippa/ds4drv.git$cdds4drv$sudopythonsetup.pyinstallUsingds4drv has two different modes to find DS4 devices, decide which one to use
depending on your use case.Raw bluetooth modeSupported protocols:BluetoothUnless 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 holdingShare + the PS buttonuntil the LED starts blinking rapidly).This is the default mode when running without any options:$ds4drvHidraw modeSupported protocols:BluetoothandUSBThis mode uses the Linux kernel featurehidrawto talk to already existing
devices on the system.$ds4drv--hidrawTo use the DS4 via bluetooth in this mode you must pair it first. This requiresBlueZ 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 pairingTo use the DS4 via USB in this mode, simply connect your DS4 to your computer via
a micro USB cable.Note:Unfortunately due to a kernel bug it is currently not possible to use
any LED functionality when using bluetooth devices in this mode.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 moduleuinputto create input devices in user land and
the modulehidrawto communicate with DualShock 4 controllers (when using--hidraw), but this usually requires root permissions. You can change the
permissions by copying theudev rules fileto/etc/udev/rules.d/.You may have to reload your udev rules after this with:$sudoudevadmcontrol--reload-rules$sudoudevadmtriggerConfiguringConfiguration fileThe preferred way of configuring ds4drv is via a config file.
Take a look atds4drv.conffor example usage.ds4drv will look for the config file in the following paths:~/.config/ds4drv.conf/etc/ds4drv.conf… or you can specify your own location with--config.Command line optionsYou can also configure using command line options, this will set the LED
to a bright red:$ds4drv--ledff0000Seeds4drv--helpfor a list of all the options.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--ledff0000--next-controller--led00ff00This will set the LED color to red on the first controller connected and
green on the second.Known issues/limitationsBluetooth 2.0 dongles are known to have issues, 2.1+ is recommended.The controller will never be shut off, you need to do this manually by
holding the PS button until the controller shuts offNo rumble supportReferencesThe DualShock 4 report format is not open and had to be reverse engineered.
These resources have been very helpful when creating ds4drv:http://www.psdevwiki.com/ps4/DualShock_4http://eleccelerator.com/wiki/index.php?title=DualShock_4https://gist.github.com/johndrinkwater/7708901https://github.com/ehd/node-ds4http://forums.pcsx2.net/Thread-DS4-To-XInput-WrapperDCbQgDa4aEbm9QNm4ix6zYV9vMirUDQLNjRelease history0.5.1 (2016-04-30)Fixed compatibility with python-evdev 0.6.0 (#70)Fixed spurious input from unconnected devices (#59)0.5.0 (2014-03-07)Added a--ignored-buttonsoption.Added signal strength warnings to the log output.Changed deadzone to 5 (down from 15).Switched to event loop based report reading and timers.Mouse movement should now be smoother since it is now based on a timer
instead of relying on reports arriving at a constant rate.Fixed issue where keys and buttons where not released on disconnect.Fixed crash when hcitool returns non-ascii data.0.4.3 (2014-02-21)A few performance improvements.Fixed prev-profile action.0.4.2 (2014-02-15)Fixed regressions in controller options handling causing issues
with device creation and using joystick layouts in profiles.0.4.1 (2014-02-14)Daemon mode was accidentally left on by default in ds4drv.conf.0.4.0 (2014-02-14)Added--dump-reportsoption, patch by Lauri Niskanen.Added support for binding buttons combos to special actions.Fixed crash when multiple controllers where used.Fixed python-evdev version requirement.Fixed pyudev version requirement.Fixed duplicate devices when connecting a USB cable to a already
connected Bluetooth device in hidraw mode.Improved mouse movement and configuration, patch by Lauri Niskanen.Changed button combo behaviour slightly. Now triggers when the
last button of a combo is released instead of waiting for the
whole combo to be released.0.3.0 (2014-02-08)Added hidraw mode, patch by Lauri Niskanen.Added config file support.Added custom button mapping.Added profiles.Fixed crash when using Python <2.7.40.2.1 (2014-01-26)Updated ds4drv.service to read a config file, patch by George Gibbs.--lednow accepts colors in the “#ffffff” format aswell.Added status updates in the log, patch by Lauri Niskanen.0.2.0 (2014-01-24)Added systemd service file, patch by George Gibbs.Added options:--emulate-xboxdrvand--emulate-xpad-wireless.Fixed--emulate-xpadissues.0.1.1 (2014-01-12)Fixed incorrect dpad parsing.Handle uinput errors instead of printing exception.0.1.0 (2014-01-07)First release.