chrippa / ds4drv

A Sony DualShock 4 userspace driver for Linux
MIT License
1.05k stars 214 forks source link

Input Lag #42

Open jupham opened 10 years ago

jupham commented 10 years ago

I didn't want to put this as a bug but I am trying to get more info on this issue. I got ds4drv working in steamos but I'm noticing a little bit of input lag. It isn't a ton but it does affect usability when compared with having the controller hooked up through usb. Is this noticeable for others?

I could only get it to work when not in hidraw mode. Would having hidraw mode working improve upon this?

keberos commented 10 years ago

I've been noticing this as well. I'd like to know if there is a proposed solution or if this is a known bug. I'm using the Kinivo BTD-400 adapter on Steam OS 1.0 build 120 (Debian based). I noticed I also get the low signal messages all the time regardless of distance or USB location.

jupham commented 10 years ago

@keberos I'm using the same adapter and have the same low signal messages. I'm setting this up as part of a steamos install and have noticed that if I move away from the adapter it gets worse. If I actually sit on the couch (maybe 10 feet) I get disconnected. It might be an issue with that adapter.

keberos commented 10 years ago

I have a few more adapters. I thought I tried them and had the same results but I'll try again tonight. I'm curious if other people have this lag but don't notice. I didn't notice at first with most games but was playing samurai gunn (fast deathmatch game) and noticed it was slower then USB or BT in windows.

On Mon, Jul 7, 2014 at 12:48 PM, jupham notifications@github.com wrote:

@keberos https://github.com/keberos I'm using the same adapter and have the same low signal messages. I'm setting this up as part of a steamos install and have noticed that if I move away from the adapter it gets worse. If I actually sit on the couch (maybe 10 feet) I get disconnected. It might be an issue with that adapter.

— Reply to this email directly or view it on GitHub https://github.com/chrippa/ds4drv/issues/42#issuecomment-48204738.

jupham commented 10 years ago

After posting this I messed with it more and it seems that if I was right next to the adapter I didn't really have a lag issue. Maybe some but nothing really of note. I have another adapter but I can't get it to work in linux.

keberos commented 10 years ago

I'll do some distance testing as well then. I noticed the low signal message was there regardless but didn't actually test perceived lag. Is there a way to measure input lag in linux that you are using?

jupham commented 10 years ago

No, I don't have a way to measure. I'm going on feel alone. I am running steamos and I see how the menus feel (they seem a little slow on their own) and I have Super Meat Boy installed to see if it is playable.

mtorromeo commented 10 years ago

I also have this problem and I think it's pretty common. The issue is also present on windows using ds4tool.

I think the problem is in the controller itself (maybe the ps4 adapter has some special characteristics). Try searching google for "dualshock 4 lag"...

keberos commented 10 years ago

Thanks for input. The thing is I didn't have it on DS4 tool in windows, however this was with a different adapter (built in laptop on Alienware M17 r4) so I'll have to run more testing to compare with the same adapter to be sure.

On Mon, Jul 7, 2014 at 1:29 PM, Massimiliano Torromeo < notifications@github.com> wrote:

I also have this problem and I think it's pretty common. The issue is also present on windows using ds4tool.

I think the problem is in the controller itself (maybe the ps4 adapter has some special characteristics). Try searching google for "dualshock 4 lag"...

— Reply to this email directly or view it on GitHub https://github.com/chrippa/ds4drv/issues/42#issuecomment-48209778.

keberos commented 10 years ago

Was trying to get HID mode to work but I think my bluez version is too low on steamos. I was trying to follow these instructions update and got to the end but it still said glib wasn't installed. So I rebooted and now the NIC isn't being recognized and it won't let me go into desktop mode. So I'm sufficiently hosed. Can anyone help with upgrading bluez in debian/steamos?

http://easytricksportal.blogspot.com/2013/12/how-to-install-bluez-from-tarball.html#.U7rRmvldU1I

keberos commented 10 years ago

Also for reference it seemed a bit better when testing right up on the bluetooth adapter but there was still a noticable delay and missed inputs.

jupham commented 10 years ago

I went down that road too, trying to install a new bluez. The problem is if you install a news version of dbus you hose the other things that rely on the old version of dbus. I was met with your same result of nothing from the NIC and no desktop mode

keberos commented 10 years ago

Ugh. Messy business! So we seem to have no way to get DS4 wireless on a steambox without issues. I had other problems like menus being funny as well.

keberos commented 10 years ago

I posted on steam U for help too FYI

http://steamcommunity.com/groups/steamuniverse/discussions/1/46476145723100010/

jupham commented 10 years ago

It seems to work not in hidraw mode. I'm not convinced it isn't the Kinivo adapter. I'm not sure if the range is an issue of the adapter or controller.

keberos commented 10 years ago

So you got hidraw mode to work? I can't get it to find my controller, I'm assuming because we are stuck with bluez 4.99.

jupham commented 10 years ago

No, I'm saying not in hidraw mode

keberos commented 10 years ago

Yeah I can get it to work and function without hidraw mode but there's that latency. Since DS4 works fine in windows with an HID based tool (inhexter DS4tool) I figured HID would eliminate the lag in linux as well.

jupham commented 10 years ago

Yeah, I guess we'll really have to wait until valve updates steamos

keberos commented 10 years ago

Well good but annoying news. It's totally the adapter. Found an iogear adapter and tested. No latency. No low signal warnings. I'm returning this stupid BTD-400. But YAY I can use this with Steam OS!

jupham commented 10 years ago

Ok, I'll do that too. Thanks for the info

jupham commented 10 years ago

Does this look like the adapter you have? I want to get one that at least one person has working. http://www.amazon.com/Bluetooth-Multi-Language-Version-Adapter-GBU521W6/dp/B007ZT2AXE/ref=sr_1_3?ie=UTF8&qid=1404824902&sr=8-3&keywords=iogear+bluetooth

keberos commented 10 years ago

Just checked, mine is the GBU421 which is the previous version of that but is BT 2.1 not BT 4.0. So I'd say it's a good pickup. One thing I'm curious about, I noticed BT 4.0 introduced low power mode, although almost all the devices including the kinivo claim they also can do classic mode. I'm wondering if the lower power mode is causing the low signal issue. Let me know what you find out. I don't have another 4.0 adapter to test. I see other people saying they don't have the issue using 4.0 devices for wnidows but I'm wondering if the "raw mode" ds4drv is not calling the classic mode into action. I honestly don't know enough about these things so it's all theory but I'd love to know for sure if you end up buying the GBU521.

jupham commented 10 years ago

Yeah, a low power mode would make sense for lower signal strength. I wonder if I there is a toggle or something somewhere in the bluetooth settings

jupham commented 10 years ago

Reading around, it looks like bluetooth LE support is added in bluez 5 but steamos is running 4. I'm wondering if I might not be better off getting an older bluetooth adapter at this point

keberos commented 10 years ago

Could be. Post back what you find though please :)

jupham commented 10 years ago

I will. I ordered the 3.0 version of the Kinivo from amazon and should have it tomorrow.

keberos commented 10 years ago

That's probably the best test other than a 2.1 adapter. Should be exactly the same except for the 4.0 low power feature. Good call.

mtorromeo commented 10 years ago

My adapter is 4.0 and I also wanted to do some tests with its power modes. I recently discovered the new btmgmt tool to enable/disable ble mode: http://urbanjack.wordpress.com/2014/06/05/how-to-set-bluez-into-ble-or-le-only-mode-ibeacon/

I'm going to try it and let you know about the outcome.

keberos commented 10 years ago

New problem with the iogear gbu421. I can't do more than 2 controllers. See error below.

desktop@steamos:~/Downloads/ds4drv/ds4drv$ sudo ds4drv [info][controller 1] Created devices /dev/input/js0 (joystick) /dev/input/event4 (evdev) [info][bluetooth] Scanning for devices [info][bluetooth] Found device A4:15:66:67:59:D3 [info][controller 1] Connected to Bluetooth Controller (A4:15:66:67:59:D3) [info][bluetooth] Scanning for devices [info][controller 1] Battery: 62% [info][bluetooth] Found device A4:15:66:DC:08:91 [info][controller 2] Created devices /dev/input/js1 (joystick) /dev/input/event16 (evdev) [info][controller 2] Connected to Bluetooth Controller (A4:15:66:DC:08:91) [info][bluetooth] Scanning for devices [info][controller 2] Battery: 75% [info][bluetooth] Found device A4:15:66:67:57:92 [error][bluetooth] Unable to connect to detected device: Failed to set operational mode: [Errno 107] Transport endpoint is not connected [info][bluetooth] Scanning for devices [error][bluetooth] Error while scanning for devices: 'hcitool scan' returned error. Make sure your bluetooth device is powered up with 'hciconfig hciX up'. desktop@steamos:~/Downloads/ds4drv/ds4drv$

keberos commented 10 years ago

Well I made a new issue not to hijack this one. Either way, someone please report back with an adapter they are using that has no lag AND can do 4 controllers. I'm ready to just spend another 10-15$ to get this working.

jupham commented 10 years ago

So I got my BTD-300 and I think I may still be having the signal strength issue I haven't tested the range/lag yet because I still have trouble getting the controller to work in steamos after I connect it in desktop mode. What do you do to get ds4drv to startup when steamos starts? Ideally, I would be able to start the machine, put the controller in pairing mode and be good to go.

keberos commented 10 years ago

Add sudo ds4drv to /etc/rc.local.

Otherwise just log off and back on to restart steam os and detect the controller if you start ds4drv manually. On Jul 9, 2014 8:31 PM, "jupham" notifications@github.com wrote:

So I got my BTD-300 and I think I may still be having the signal strength issue I haven't tested the range/lag yet because I still have trouble getting the controller to work in steamos after I connect it in desktop mode. What do you do to get ds4drv to startup when steamos starts? Ideally, I would be able to start the machine, put the controller in pairing mode and be good to go.

— Reply to this email directly or view it on GitHub https://github.com/chrippa/ds4drv/issues/42#issuecomment-48552510.

jupham commented 10 years ago

Alright, I did that and the BTD-300 acts just like the BTD-400. It is not strictly a 4.0 device issue and may be related to Kinivo devices. Time to return those and try something else.

keberos commented 10 years ago

Ok good to know. I just ordered 3 new USB adapters to test them out. I want this fixed and I now have two adapters that combined would do the job if they didn't each have their own unique issue (lag one one, only 2 controllers on the other). So I'll let you know how these go when I test them tomorrow.

Azio BTD-V201 USB Micro Bluetooth Adapter, Class 1, V2.1 + EDR IOGEAR Bluetooth 4.0 USB Micro Adapter (GBU521) TRENDnet Micro-Bluetooth USB 3.0 Adapter TBW-106UB

On Wed, Jul 9, 2014 at 10:04 PM, jupham notifications@github.com wrote:

Alright, I did that and the BTD-300 acts just like the BTD-400. It is not strictly a 4.0 device issue and may be related to Kinivo devices. Time to return those and try something else.

— Reply to this email directly or view it on GitHub https://github.com/chrippa/ds4drv/issues/42#issuecomment-48557571.

jupham commented 10 years ago

Looks like we doubled up. I ordered the iogear one. Hopefully that one works. I only have 2 controllers so that is all I can test. This will be my fourth adapter that I've tried.

aleho commented 10 years ago

I'm using a LogiLink BT0015 and couldn't notice an input lag. Going to try today, but everything below 100ms will be hard to spot for me I guess.

I'll also report on the range.

keberos commented 10 years ago

Are you getting any low signal warnings when running ds4drv manually? That seemed to be consistent when there was lag for me. Also do you have more than 2 controllers to test? When we are done all this we should update the compatibility page with our findings. On Jul 10, 2014 5:20 AM, "Alexander Hofbauer" notifications@github.com wrote:

I'm using a LogiLink BT0015 and couldn't notice an input lag. Going to try today, but everything below 100ms will be hard to stop for me I guess.

I'll also report on the range.

— Reply to this email directly or view it on GitHub https://github.com/chrippa/ds4drv/issues/42#issuecomment-48582438.

keberos commented 10 years ago

Nothing but fail.

Azio BTD-V201 USB Micro Bluetooth Adapter, Class 1, V2.1 + EDR - Pairs all but with low signal IOGEAR Bluetooth 4.0 USB Micro Adapter (GBU521) - Pairs all but with low signal TRENDnet Micro-Bluetooth USB 3.0 Adapter TBW-106UB - Pairs ONLY one controller, no more, but no signal warnings.

I'm very frustrated as this point. I can only get this to work with 1-2 controllers or suffer game ruining latency for 4 controllers on Steam OS.

jupham commented 10 years ago

I'd say this is probably more a problem with the version of bluez on steamos and not ds4drv. I don't have a different linux box to test that though.

mtorromeo commented 10 years ago

Definitely not a steamos related issue. Also BLE did not make any difference in my tests.

mtorromeo commented 10 years ago

I may also try something like this as a week-end project: http://www.mike-worth.com/2012/05/21/improving-the-aerial-on-a-mini-bluetooth-dongle/

keberos commented 10 years ago

I'd agree it's not steam os related as much as a bluez and ds4 problem. We need newer bluez in the steamos repositories as manually updating bluez and it's dependancies breaks steam os. Adding range is an interesting idea to try and boost the signal. It's just very curious to me that we get low signal warnings with the controller touching the dongle. So how will more range help? Could also be a DS4 related issue as some people even report issues on their ps4s. Mine works fine though so I don't know. On Jul 11, 2014 3:56 AM, "Massimiliano Torromeo" notifications@github.com wrote:

I may also try somthing like this as a week-end project: http://www.mike-worth.com/2012/05/21/improving-the-aerial-on-a-mini-bluetooth-dongle/

— Reply to this email directly or view it on GitHub https://github.com/chrippa/ds4drv/issues/42#issuecomment-48703804.

mtorromeo commented 10 years ago

Not even a bluez problem. I'm not even using SteamOS. I'm on Arch and my bluez is as up-to-date as it could possibly be.

keberos commented 10 years ago

Oh great. What I was referencing was the inability to use HID mode with bluez 4.99. Does HID mode show any improvement over RAW? On Jul 11, 2014 7:31 AM, "Massimiliano Torromeo" notifications@github.com wrote:

Not even a bluez problem. I'm not even using SteamOS. I'm on Arch and my bluez is as up-to-date as it could possibly be.

— Reply to this email directly or view it on GitHub https://github.com/chrippa/ds4drv/issues/42#issuecomment-48720287.

mtorromeo commented 10 years ago

No noticeable improvement. Consider that the message about the weak signal is hardly addressable by ds4drv itself wether you use hid or raw. I think a good antenna may help (and most micro dongles are crap). It'a not just about range but also about being able to capture weaker signals.

keberos commented 10 years ago

That's a good call. Let me know what you find out. Curious does anyone know if laptop cards connect to desktop PCI-E slots? They already support antennas from what I've seen.

On Fri, Jul 11, 2014 at 7:54 AM, Massimiliano Torromeo < notifications@github.com> wrote:

No noticeable improvement. Consider that the message about the weak signal is hardly addressable by ds4drv itself wether you use hid or raw. I think a good antenna may help (and most micro dongles are crap). It'a not just about range but also about being able to capture weaker signals.

— Reply to this email directly or view it on GitHub https://github.com/chrippa/ds4drv/issues/42#issuecomment-48721863.

jupham commented 10 years ago

Well, we are doing a good job of figuring out what doesn't work. Is there a readily available bluetooth adapter that does work? I'd even be good if it just supports two controllers.

keberos commented 10 years ago

From what I can tell the GBU421 works well for two controllers but it's not in production. The only other one I could get to pair without signal warnings was the TRENDnet Micro-Bluetooth USB 3.0 Adapter TBW-106UB. It may be worth trying to find one that's atleast 2.1 but not a nano. Should have a bit more on the antenna.

jupham commented 10 years ago

This may be overkill but hopefully it works (http://www.newegg.com/Product/Product.aspx?Item=N82E16833106190). I'm running steamos on an intel nuc and have the expansion space. Having wifi on the box might be nice but hopefully this will get me the signal strength needed. It should be in Saturday but probably won't be able to try it until Sunday.

jupham commented 10 years ago

Well I installed the wifi/bluetooth card and still have the same issue. I can pair the controller right next to it but it still says low signal. If I walk a couple feet away it lags really bad or disconnects altogether.

I'm using an intel nuc which uses the chassis as an antenna but I'm still not getting a better signal. Maybe it is the controllers? I have 2 but they both exhibit the issue.