Page 1 of 1

Mouse lag in debian testing

PostPosted: Friday, 3rd June 2016, 12:54
by nerdy
Hi everyone,
I just built latest stable release on debian testing and everything works fine except the mouse. It's lagging (like 1-2s delay). I believe it is the same issue as the one in this bug report https://crawl.develz.org/mantis/view.php?id=10278 Is there any more info on that?

Thanks

Re: Mouse lag in debian testing

PostPosted: Tuesday, 14th June 2016, 19:14
by nerdy
No workaround please? This bug is really annoying :oops:

Re: Mouse lag in debian testing

PostPosted: Thursday, 16th June 2016, 03:10
by gammafunk
This is a bug I've wanted to work on for some time, but have a hard time duplicating. In my testing (on ubuntu 15.10) I see rare lag sometimes occur where the targeting reticule lags between where the mouse is by maybe a second tops, but I can't really seem to trigger it in any reliable way.

Are you seeing this behavior at all times, from the beginning of the game, or is it something that pops up eventually, or under certain conditions?

Re: Mouse lag in debian testing

PostPosted: Thursday, 16th June 2016, 20:04
by nerdy
gammafunk wrote:This is a bug I've wanted to work on for some time, but have a hard time duplicating. In my testing (on ubuntu 15.10) I see rare lag sometimes occur where the targeting reticule lags between where the mouse is by maybe a second tops, but I can't really seem to trigger it in any reliable way.

Are you seeing this behavior at all times, from the beginning of the game, or is it something that pops up eventually, or under certain conditions?

Hi thanks for answering, no it does happen all the time, as soon as the game is launched. I recently moved to testing and used to play the game on stable and I didn't have the issue. I'm using legacy drivers that are the same as when I was on stable so it can't be that... any ideas?

Re: Mouse lag in debian testing

PostPosted: Thursday, 16th June 2016, 20:08
by gammafunk
Thanks for replying. I'll try it on a debian testing VM when I have a chance. Hopefully I can at least recreate it. It doesn't happen on my system, again debian-based but actually ubuntu. I'd hope it's not anything related to drivers. My suspicion is that we're doing something bad with our SDL loop wrt mouse movement processing, and it just happens to rarely trigger based on some system factor, maybe Xorg version or the version of SDL2 itself. No promises as to the timeline of the fix, but I'll try to look into tracking that down now that I know how I might be able to see the problem reliably.

Re: Mouse lag in debian testing

PostPosted: Saturday, 18th June 2016, 13:10
by nerdy
Hey, I updated my system and rebuilt the game from source today. It seems the mouse lag is not the only issue: in the beginning the game is playable barring the mouse delay (not as fast as I remember it from a few months ago though), and after a while the game seems to lag more and more to a point where movement is noticeably laggy. Restarting the game fixes the lag. I am using nvidia legacy 340.93 (used to run dcss fine some months ago on stable) and SDL from the testing repo.
Has there been a significant change in the rendering recently?
edit: not sure if it has to do with the problem, but the game seems to struggle with movement when I press a direction key and stay pressed (the character "jumps" to the tile rather than walk there tile by tile)

Re: Mouse lag in debian testing

PostPosted: Monday, 20th June 2016, 10:19
by gammafunk
There's been no direct changes to the rendering, but it's possible the updates to your system bring it more in line with what I saw on my system. The fact that it builds up over time for you is a good clue, and that's something I can hopefully reproduce.

I'm not sure if that laggy rendering for repeated keyboard commands movement is directly related to the mouse issue. Those commands will happen at a fixed rate when you hold down the key, but will happen rapidly. I think we have some general issue(s) with our SDL loop that's causing problems, and it's possible that we can find and fix them all together, so thanks for these details.

Re: Mouse lag in debian testing

PostPosted: Monday, 20th June 2016, 22:47
by Siegurt
gammafunk wrote:There's been no direct changes to the rendering, but it's possible the updates to your system bring it more in line with what I saw on my system. The fact that it builds up over time for you is a good clue, and that's something I can hopefully reproduce.

I'm not sure if that laggy rendering for repeated keyboard commands movement is directly related to the mouse issue. Those commands will happen at a fixed rate when you hold down the key, but will happen rapidly. I think we have some general issue(s) with our SDL loop that's causing problems, and it's possible that we can find and fix them all together, so thanks for these details.


I could be misremembering, but doesn't crawl use the systems sdl by default? could it be as simple as needing to update it?

Re: Mouse lag in debian testing

PostPosted: Wednesday, 22nd June 2016, 20:04
by nerdy
Siegurt wrote:
gammafunk wrote:There's been no direct changes to the rendering, but it's possible the updates to your system bring it more in line with what I saw on my system. The fact that it builds up over time for you is a good clue, and that's something I can hopefully reproduce.

I'm not sure if that laggy rendering for repeated keyboard commands movement is directly related to the mouse issue. Those commands will happen at a fixed rate when you hold down the key, but will happen rapidly. I think we have some general issue(s) with our SDL loop that's causing problems, and it's possible that we can find and fix them all together, so thanks for these details.


I could be misremembering, but doesn't crawl use the systems sdl by default? could it be as simple as needing to update it?

Well im using latest from testing which is 2.0.4 aka latest stable release so it can't be that

Re: Mouse lag in debian testing

PostPosted: Saturday, 16th July 2016, 20:05
by MrNewb
I get mouse lag as well on both 1.8 and trunk. It consistently lags for about 1 second and occasionally lags for around 2 seconds or more. There's very little lag upon starting the game but after just a couple minutes of playing it starts to lag. If there's any info I can give you that might help then let me know what you need.

Re: Mouse lag in debian testing

PostPosted: Saturday, 17th December 2016, 18:31
by mrob
I had the same problem on Debian unstable. I bisected it to commit 9e6f58dcabc7f47398c9806e4c80f93efbd0d4d2: "Fix resizing of the Tiles window". This reverts cleanly on trunk, and doing so fixes the problem with no obvious side effects.

Re: Mouse lag in debian testing

PostPosted: Thursday, 19th January 2017, 09:46
by gammafunk
For anyone following this, I pushed a fix in 0.20-a0-502-g555d78b. Hopefully this fixes the mouse lag issue due those event loop changes way back in 0.16. If anyone can test this version on their system, either by compiling it or using the windows trunk build when that updates tomorrow, that would be appreciated. You have to make sure your version is at or later than 0.20-a0-502-g555d78b; any earlier trunk version won't have the fix. Thanks!