libretro / RetroArch

Cross-platform, sophisticated frontend for the libretro API. Licensed GPLv3.
http://www.libretro.com
GNU General Public License v3.0
10.39k stars 1.84k forks source link

Inconsistent results from polling RETRO_DEVICE_MOUSE #17028

Open barbudreadmon opened 2 months ago

barbudreadmon commented 2 months ago

Description

The values returned from polling RETRO_DEVICE_MOUSE are inconsistent :

Expected behavior

2 setups with the same core options and the same controls should have the same mouse speed.

Actual behavior

Multiple factors are causing the speed to vary greatly.

Steps to reproduce the bug

  1. Boot a game with mouse support (ex. centiped in FBNeo, using one of the mouse device types)
  2. Position yourself ingame on a border
  3. Start moving your mouse until you reach the opposite border
  4. Measure how much distance you moved your mouse physically (the difference is so obvious that you don't need something very precise, i simply used my mouse mat as a sort of unit for this)
  5. Change OS, change input driver, or press F to switch between windowed and fullscreen (tested on linux+udev)
  6. Repeat from 1
  7. Compare measured distances

Bisect Results

I don't know if it's a regression

Version

RetroArch 1.19.1

Environment information

Tested on linux+udev and windows+dinput

Additional note

While that might have been a somewhat acceptable workaround for this, it doesn't seem RA has any setting to increase/decrease mouse speed (Analog Sensitivity only works on controller analog sticks).

barbudreadmon commented 3 weeks ago

I'll probably try to add a hard-coded 3x multiplier to udev's mouse polling sometime soon.

@sonninnos @mahoneyt944 Can you confirm you have a similar experience on your side with mame & mame2003-plus ?

mahoneyt944 commented 3 weeks ago

Unfortunately I cannot, as I only use android (mobile) . Wouldn't be surprised though if there's inconsistency between input drivers though. Is there differences in the poll rate between drivers?

barbudreadmon commented 3 weeks ago

Actually i suppose it would be interesting to get some feedbacks about this on android.

Is there differences in the poll rate between drivers?

That's a good question, i'll try playing around with poll rate on linux, it seems there is a module param i can use for this : https://www.quakeworld.nu/wiki/Howto_customise_mouse_polling_rate

barbudreadmon commented 3 weeks ago

It seems the situation on linux got a lot worse than it used to be. At this point it's just plain unusable. I'm not entirely sure if it was a retroarch update or an OS update though.

I didn't notice a difference from setting the module's polling rate.

mahoneyt944 commented 3 weeks ago

Well I don't use the mouse input, I generally turn off XY devices in core options and just use the dpad to override games that use it (touch screen overlay). However, if I enable "mouse" or "pointer" as my XY device I don't notice any abnormal speed in the movement. Though mame also uses it's internal analog restraints so that may buffer any abnormality from the frontend? Are you able to try mame2003+ on your platform and compare?

barbudreadmon commented 3 weeks ago

Ok, it turns out the situation was a lot worse due to runahead being enabled (i have a feeling it might be sort of related to the fact retroarch also doesn't transmit analog in netplay session, maybe i'll look into this someday).

After disabling runahead, and still using centiped as a reference, i confirm i have consistent slowness between MAME and FBNeo on linux. As for MAME2003+ i'll need to find a compatible romset before comparing.