Freeze issues with "ultrapolling" mouse
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 25.4k
- Forks
- 6.5k
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 5
Description
Issue details
Some of the gaming mouses have "ultrapolling" feature, with 1ms response time.
Apparently, with this feature enabled, Libgdx experiences 200-500ms freezes over time, if the mouse gets moved.
In order to find out why, I did some profiling

In the images below, the first number in max delta time (600ms freeze), the second one is the average (100ms).
But after detailed research, I found the problem is not really in the game itself. I put following profiling code in the mainLoop (at this line):
while (running) {
...
_profiling.start();
Display.processMessages();
_profiling.end();
...
}
And got this:

As you can see here, messages graph is almost equal to the dt. In this example, messages is Display.processMessages() and dt is just delta time.
I understand that processMessages is lwjgl zone, but I was simply unable to google anything like this. Taking into account that first lwjgl is dead, I decided to discuss this issue here instead.
Also, I understand that you simple may not have such mouse, but yet any information regarding this issue would be highly appreciated!
Thoughts
Probably, that's because lwjgl Mouse readBuffer gets quickly overflowed.
Reproduction steps/code
The issue is reproducible on Windows/lwjgl using ultrapolling mouse (for example, "Razer mouse abyssus") with ultrapolling mode enabled (1000hz).
Version of LibGDX and/or relevant dependencies
1.9.6
Please select the affected platforms
- Android
- iOS (robovm)
- iOS (MOE)
- HTML/GWT
- Windows
- Linux
- MacOS
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at gdx-backend-lwjgl/src/com/badlogic/gdx/backends/lwjgl/LwjglApplication.java around line 158, focusing on the main loop and Display.processMessages(). Reproduce on Windows with an ultrapolling mouse at 1000Hz and profile message-processing time. Done means the source of the 200–500ms freezes is identified and the issue has a verified resolution or documented limitation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100