TASEmulators / TASEmulators/desmume
High mouse report rate / polling rate causes severe lag / slow down
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.6k
- Forks
- 646
- PR merge metrics
- No merged PRs in 30d
Description
Related: #521
Creating a new issue regarding this as I can recreate this 100% of the time.
I spent a few hours trying to work out why my PC couldn't handle running desmume, but it turns out it was because of this issue.
My specs:
CPU: AMD Ryzen 5900x
GPU: Nvidia 3070ti
Memory: 32gb
OS: Windows 11 10.0.22631 Build 22631
Can recreate this yourself by simply adjusting the polling rate of your mouse to 1000 or something high and then click + dragging for input (i.e. running in Phantom Hourglass)
Please see:
Console:
DeSmuME 0.9.14 git#25cbcd2 x64-JIT SSE2
- compiled: Sep 3 2023 10:07:49
DirectX Input:
- gamecontrol successfully inited: Bluetooth XINPUT-compatible input device
Microphone successfully inited.
DeSmuME 0.9.14 git#25cbcd2 x64-JIT SSE2
Attempting change to 3d core to: SoftRasterizer
SoftRasterizer: Running using 24 additional threads. (Multithreading enabled.)
ROM game code: AZEE
ROM crc: 8B431C41
ROM serial: NTR-AZEE-USA
ROM chipID: 00003FC2
ROM internal name: ZELDA_DS:PH
ROM developer: Nintendo
Slot1 auto-selected device type: Retail MC+ROM
Slot2 auto-selected device type: None (0xFF)
BackupDevice: size = 4 Mbit
CPU mode: JIT
JIT: max block size 100 instruction(s)
Already decrypted.
WIFI: MAC Address = 00:09:BF:12:34:56
WIFI: Emulation level is OFF.
Loading [snip] was successful
Emulation unpaused
snddx: emergency cleared sound buffer. (-11028, 0, 11270)
I also tested the same issue against older nightly releases (2022) and against the last two releases, finding the same behaviour. Also worth noting I experience the same behaviour with stock settings on a fresh install / run.
the mouse input needs to be throttled / denounced, here, perhaps?
Contributor guide
No contributing guide indexed for this repository
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 desmume/src/frontend/windows/main.cpp around line 4392 and reproduce the slowdown with a mouse polling rate of 1000 or higher while click-dragging in Phantom Hourglass. Investigate the reported mouse-input path; done means high polling rates no longer cause severe lag or slowdown, including on the reported Windows setup.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100