flyinghead / flycast

Flycast is a multiplatform Sega Dreamcast, Naomi, Naomi 2 and Atomiswave emulator
GNU General Public License v2.0
1.51k stars 176 forks source link

Quake 3 Arena - Mouse Input is Laggy (Retail version only) #949

Open Matsilagi opened 1 year ago

Matsilagi commented 1 year ago

Please Note: This form is the minimum required information for submitting bugs.
Removing this form may lead to your issue being closed until it is completed.

Platform / OS / Hardware: Windows 11 X64 / AMD Ryzen 5 2600 / 16GB RAM Kingston / nVidia GeForce RTX 3060Ti

Github hash: a970a12

Hardware: Windows PC , Logitech G Pro Wireless and Generic USB Mouse.

Description of the Issue

Mouse input lags a lot and / or gets stuck very often. Seems to be an issue specific to of Quake 3 Arena. Prototype versions or the old E3 Alpha have the issues but less often, also seems to run at a higher framerate than this one for some reason.

EDIT:Corrected a few stuff in my report, bug happens in other Q3A versions, but its much less often than the retail version.

Debugging Steps Tested

Logs Gathered


--Not Applicable / None

Screenshots

--Not Applicable.

flyinghead commented 1 year ago

Very laggy indeed. It seems related to how often mouse input is polled. Using single-threaded emulation or full framebuffer emulation helps significantly but performance is impacted.

flyinghead commented 1 year ago

should be fixed in the latest dev build

bslenul commented 10 months ago

Hey!

Just encountered this issue while testing stuff on latest dev version (2add951f7000dd8de5b70546f5b0771866ac86dd atm), is it supposed to be fixed with single-threaded mode only? This is what I get with multi-threaded (Windows 10):

https://github.com/flyinghead/flycast/assets/33353403/d57e6b26-7742-4369-86ae-97765a2f1f4b

I have no idea if it helps but out of curiosity I bisected with the Libretro core (I'm getting errors while trying to build old commits for standalone) and it started with 1dc01314a15a08f26a84dd760f5ebc93f75c22f1:

https://github.com/flyinghead/flycast/assets/33353403/7df39666-bddd-43c5-a659-f839c4c5349d

with the previous commit (fb40bb22dfe66e9dccdef84e01248ef2f5d5f791) it worked flawlessly:

https://github.com/flyinghead/flycast/assets/33353403/3bc3c2f1-cde7-4b28-83e4-b9cff2afed47

flyinghead commented 10 months ago

Polling inputs on the emu thread is nice but it's a big no no on some platforms (MacOS) and it also breaks on Windows. So this cannot be reverted. But yes, it doesn't work fine on linux either so more work needed.