Skip to content
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

[Linux] Middle-click camera grip is sometimes not released #1342

Closed
anko opened this issue Nov 7, 2017 · 20 comments
Closed

[Linux] Middle-click camera grip is sometimes not released #1342

anko opened this issue Nov 7, 2017 · 20 comments
Assignees
Labels

Comments

@anko
Copy link

anko commented Nov 7, 2017

Description

The game sometimes doesn't recognise middle mouse button releases. It gets stuck in the camera grip state, moving the camera as the mouse is moved. This happens constantly during gameplay, and is very frustrating.

Steps to reproduce

With the Camera Grip option set to MOUSE3 (middle mouse button), the following steps in demo mode (as any hero) cause the problem to manifest:

  1. hold down the middle mouse button and right mouse button,
  2. release both buttons at the same time (small timing window!),
  3. move the mouse around without touching the buttons.

Result: the camera pans as though camera grip were active.

Expected result: the cursor moves; the camera doesn't.

Additional observations

The issue only happens when Camera Grip is set to a mouse button. It does not happen when set to a keyboard key.

Today is the first time I have seen this issue. This issue was definitely not present yesterday. The Settings → About page in-game shows I am using client version 2,518.

My system information from Steam's HelpSystem Information is in this gist.

Restarting the game does not fix the problem. The only work-around I've found is to reset the camera grip state by clicking the middle mouse button when the issue appears.

My Left-Click Activates Camera Grip option is off.

As I was trying to find steps to reproduce this, I found that the same issue can also happen when releasing the left and middle buttons simultaneously. This is rarer during gameplay, but could happen.

@kisak-valve
Copy link
Member

Hello @anko, please copy your system information from steam (Steam -> Help -> System Information) and put it in a gist, then include a link to the gist in this issue report.

@anko
Copy link
Author

anko commented Nov 7, 2017

@kisak-valve OK. I created a gist and edited the above post with a link too.

I'm using a custom Linux kernel. I'll test with the default kernel soon just in case.

@anko
Copy link
Author

anko commented Nov 7, 2017

Just confirming: Linux-ck kernel has no effect. The issue persists on the default Linux kernel. Here's a Gist with the steam system info of that setup in case it's helpful.

@gdrewb-valve
Copy link
Contributor

I was unable to repro this on my Linux system. We'll see if we can pin it down somehow.

@anko
Copy link
Author

anko commented Nov 8, 2017

@gdrewb-valve OK. Let me know if there's anything I can do to help.

@anko
Copy link
Author

anko commented Nov 8, 2017

The 2017-11-07 update to version 2,525 with patch notes that mention "Fixed a case where player input would not be registered" did not fix this issue.

The update says that any further cases observed should provide matchid and time. In case it's helpful, the match in which I first noticed this was 3548440175 as Gyrocopter. The issue happened 4 times while blocking creeps mid at the start of the game (at 0:08, 0:13, 0:15, and 0:18). It continued to happen constantly throughout the game. Minimap camera panning would also sometimes get stuck this way (e.g. at 14:05).

@anko
Copy link
Author

anko commented Nov 9, 2017

Alternative repro steps, perhaps closer to the source:

  1. Launch the game with -console -input_message_spew
  2. Enter demo mode as any hero
  3. Open the console
  4. Hold down any two mouse buttons, then release them at the same time
  5. Repeat step 4; observe console logs

Expected output: Mouse down and mouse up logging corresponds with reality.

Actual output: Usually as expected, but sometimes shows a sequence like mouse 2 down, mouse 3 down, mouse 3 up (with no mouse 2 up, despite having released it).

I got this to happen with every combination of mouse buttons I tried.

@gdrewb-valve gdrewb-valve assigned icculus and unassigned ghost Nov 9, 2017
@gdrewb-valve
Copy link
Contributor

Missing a mouse up is presumably the cause of the problem, but it's unclear if that's an issue in Dota, SDL or Linux mouse handling itself (or even your mouse hardware). I'll pass this on to the SDL dev for now.

@admshao
Copy link

admshao commented Nov 9, 2017 via email

@anko
Copy link
Author

anko commented Nov 9, 2017

or even your mouse hardware

That made a lightbulb turn on in my head: I did a similar event-logging experiment as that one at a desktop level using xev, and the same problem appeared there! So the problem is clearly at a level deeper than Dota, or even SDL.

Sure enough, I just tested a different mouse on the otherwise exact same setup, and everything worked. Time to throw out some hardware!

Thanks for your help!

@anko anko closed this as completed Nov 9, 2017
@kisak-valve
Copy link
Member

Hello @anko, for the sake of completeness, what was the model of the mouse?

@anko
Copy link
Author

anko commented Nov 9, 2017

@kisak-valve It's an ASUS ROG Gladius. (Model P501, marketing site here.)

/sys/kernel/debug/usb/devices section:

T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#= 14 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12cf ProdID=0272 Rev=29.01
S:  Manufacturer=ASUS
S:  Product=GLADIUS
C:* #Ifs= 2 Cfg#= 1 Atr=a0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid
E:  Ad=81(I) Atr=03(Int.) MxPS=  64 Ivl=1ms
I:* If#= 1 Alt= 0 #EPs= 1 Cls=03(HID  ) Sub=00 Prot=01 Driver=usbhid
E:  Ad=82(I) Atr=03(Int.) MxPS=  64 Ivl=1ms

@anko
Copy link
Author

anko commented Nov 11, 2017

I did some more digging. The issue is not actually with my mouse hardware, but with the newest release of libinput (1.9.1). I've filed this bug report with libinput, which contains all the technical details.

In summary, I suspect the problem is libinput's new button debounce feature in this commit handling button releases in such a way that gaming mice (with switches that are made to be light to press: i.e. prone to contact bouncing) break in this way.

For anyone else affected, downgrading to libinput 1.8.3 is a workaround.

@glubsy
Copy link

glubsy commented Nov 16, 2017

I've been having this issue since my latest system upgrade on Arch Linux yesterday.
The game has become absolutely unplayable for me. :(
Thank you @anko for the info AND bug reports on libinput. Hope to see a proper fix eventually (apparently libinput will be patched very soon?)

@glubsy
Copy link

glubsy commented Nov 17, 2017

Holy spaghetti batman! I just updated to libinput 1.9.2 (from 1.9.1) and the problem is indeed fixed! actually nope, not fixed (yet).

Note: I had to log out of my X session for the library to be effectively used, couldn't find a proper way to preload the older libinput.so with LD_PRELOAD but I was in a rush so I could have messed up somewhere...

Thank you very much @anko and of course, thank you to the developers of libinput! ❤️

@glubsy
Copy link

glubsy commented Nov 17, 2017

Ok, I got a bit over excited. The problem still occurs, less often sure, but it's still there. 😞

Starting dota2 with these as parameters breaks font rendering in game:
LD_PRELOAD="/path/to/libinput-1.8.3-1-x86_64/usr/lib/libinput.so.10.13.0" %command%

screenshot

Guess there is no other way but to downgrade the entire libinput package then?

It also breaks more than just dota2 apparently. In my i3 window manager, when switching away from dota2, I can't use my left or right click anymore after this glitch happens (except in dota2, where mouse buttons still work). Quitting dota2 fixes the issue (after clicking a few times though, which seems to be related to this debouncing new thing).

Having a look at libinput-debug-events --verbose while in game doesn't output the "debouncing" event messages for some reason, outside of the game, it does.

I'll downgrade back to 1.8.3 for now. Should we ask the libinput developers for a way to disable this new "debounce" feature?

@anko
Copy link
Author

anko commented Nov 17, 2017

@glubsy The fix isn't in 1.9.2 yet: the diff is mostly documentation. Try Peter Hutterer's wip/button-debouncing-v3 branch if you want to test the fix, though you'll have to compile it yourself.

I don't think LD_PRELOAD is a good way to test libinput. According to the Wikipedia article on evdev, the libinput library fits in lower down the stack than even the X server, so I'd expect breakage unless you install it properly and restart X11.

@glubsy
Copy link

glubsy commented Nov 18, 2017

@anko thanks, didn't realize that branch wasn't merged, I feel dumb. :)

@hinrek
Copy link

hinrek commented Nov 21, 2017

Same problem here. Im on Arch linux and zowie ec1-a, i opened my mouse to check the middle click button for no reason it seems.

@glubsy
Copy link

glubsy commented Jan 19, 2018

I believe this problem is now fully resolved. I have not experienced any issue and using libinput 1.9.4-1.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants