-
Notifications
You must be signed in to change notification settings - Fork 72
Dualshock 4 High Latency over Bluetooth #274
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
Comments
The Dualshock 4 has two modes under Bluetooth: a basic mode that is quite barebones (buttons and sticks only and a full mode that sends all of the controller data (tilt, battery, touch etc...). The trigger to go into full mode is basically any outgoing communication with the controller (ie. using rumble or setting the LEDs) so the HID descriptor had to be reworked so the underlying Linux HID system knows what to do with the incoming data once the controller reporting state changes (and add support for the gyros and accelerometers that isn't there by default). That's what that comment block is referring to. The hid_sony module knows nothing about the USB or Bluetooth transport systems aside from which way the controller is currently connected for the purposes of initialization. It has no control over the latency or processing speed of the underlying protocol. Also note that in Bluetooth mode the controller itself won't actually send a data packet unless some state changed, probably to conserve the battery. If it's sitting perfectly still and no buttons are pressed then it just won't send any data. |
I tried pairing the controller while spinning the sticks, in order to try and force the controller to send as much data as possible, but I'm still getting low signal errors. Do you think it's an issue with BlueZ? |
What kind of Bluetooth adapter are you using? If you are getting low signal warnings it may just be that you actually have a weak signal. In my own experience I found that those little thumbnail sized adapters just don't work well with the DS4, especially if you plug them into a port on the back of the case. I was getting a terrible connection with lots of dropped traffic from less than 1 meter away. Once I bought an Intel Wifi+Bluetooth card and a PCI-E adapter with actual antennas my connection became rock solid. |
I'm using an Intel 7260 AC Mini PCIE Half card. I'm sitting under 2 feet away from the adapter, so I doubt that there's a signal strength issue. |
I believe I found the problem. The hid-sony module initialized the controller with some incorrect values. |
On 7/28/2015 03:50, Rostislav Pehlivanov wrote:
Nice fix. The original value wasn't a mistake though. It either came http://eleccelerator.com/wiki/index.php?title=DualShock_4#0x11_2 Out of curiosity, do you know how the reporting rate is calculated from Regards, |
@frank: 0xD0 and 0xE0 are the only values which hint that the values are probably At best, I can only say that the 1st offset has something to do with the 0xC0 and 0x80 seem identical for all intents and purposes though and the On 28 July 2015 at 15:41, Frank Praznik [email protected] wrote:
|
Not to derail this nice technical discussion I am enjoying, but is the previous method I used, sixad/qtsixa, not applicable to using the Dual Shock 4 anymore? |
Hi there guys. How do I apply that Patch/change that value to 0x80? |
The Sony Dualshock 4 (DS4) controller has a very low polling rate when connected to any Linux system over bluetooth. This issue is highlighted by the userspace ds4drv DS4 driver. When connected to the system via USB, the controller performs excellently with no issue whatsoever. However, over bluetooth, the controller reports at 20-21 reports per second (accoding to the ds4drv program) when connected as a standard bluetooth controller through Bluez. An interesting note, however, is that when the controller is connected through the ds4drv driver using its native mode (not the --hidraw mode), the reports up to around 32-38 reports a second, varying between the two numbers. I have done some troubleshooting, and the issue persists whether or not ds4drv is installed at all. Here is a wiki of devices with this issue, it is unknown at this time what exactly causes it. I am reporting this to the SteamOS github because it is not entirely certain whether the issue arises from the hid_sony kernel module or the Bluez5 userspace kernel driver. I would normally assume it to be the Bluez5 stack, as it has historically been terribly buggy, but there was an interesting note by the author of the hid-sony module:
397 /*
398 * The default behavior of the Dualshock 4 is to send reports using report
399 * type 1 when running over Bluetooth. However, when feature report 2 is
400 * requested during the controller initialization it starts sending input
401 * reports in report 17. Since report 17 is undefined in the default HID
402 * descriptor the button and axis definitions must be moved to report 17 or
403 * the HID layer won't process the received input.
404 */
I am happy to provide any more information that may help track down the bug and solve it, as I am essentially tied to a USB cord while playing controller based SteamOS games.
uname -a
: Linux mark-arch 3.18.5-1-ARCH #1 SMP PREEMPT Fri Jan 30 07:31:50 CET 2015 x86_64 GNU/Linuxbluez 5.28-1
The text was updated successfully, but these errors were encountered: