Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Input Lag #200

Open
Zalphos opened this issue Mar 9, 2018 · 21 comments
Open

Input Lag #200

Zalphos opened this issue Mar 9, 2018 · 21 comments

Comments

@Zalphos
Copy link

Zalphos commented Mar 9, 2018

Expected behavior

Games should should respond instantly to inputs.

Actual behavior

There is a very brief delay between you pressing a button and the game responding. It's so small it's hard to see, but it's large enough to disrupt gameplay.

Steps to reproduce the behavior

Watch your character closely as you press buttons. I recommend jumping around with Samus and comparing to the original VisualBoyAdvance.

ROM details

I tested this in Metroid: Zero Mission, Mario & Luigi: Superstar Saga, and Super Mario Advance 4: Super Mario Bros 3.

Option details

I tried every video and sound option that I could, and they are all affected.

Build details

Windows 7.

The issue is present in 2.0.1. It works normally in 1.8.0-SVN.

@supadoom
Copy link

I would like to add to this that when you spam click a button it will ignore those inputs. Its not input lag but rather just not accepting input for certain frames. For example if you quickly tap the B button in Pokemon Emerald while moving your character will only sprint for 1/5 of the button presses. On 1.8 your character will sprint after every button press.

@RyabDev
Copy link

RyabDev commented May 23, 2018

Yeah I was noticing this in Metroid Zero Mission aswell

@ghost
Copy link

ghost commented Jun 7, 2018

expect great things, including fixing input delay in next release or so...

@ghost
Copy link

ghost commented Jul 7, 2018

guys kindly test this test build if it helps your lag issues. take note that it would also help if you reduce as low as possible without causing stuttering

https://github.com/retro-wertz/vba-m-unofficial/blob/master/visualboyadvance-m_v2.1.0_input_timing_fix.zip.zip

@Zalphos
Copy link
Author

Zalphos commented Jul 12, 2018

retro-wertz, I tried the build you provided, but I'm getting skipped frames and can't tell if the input lag is gone. The skipped frames ignore inputs (like supadoom's comment) and also do not render.

@ghost
Copy link

ghost commented Jul 12, 2018

to be honest, 1.8.0 and 2.0.1 has no difference as to when inputs are read. so if you are getting weird input-related issues with 2.0.1 or higher, probably something to do with current config, there shouldnt be much performance issues in windows compared to other issues in linux.

anyways find where vbam.conf is saved and delete this (or rename this file) so a new config is created. im on linux though so you have to find where this is on windows.

@Zalphos
Copy link
Author

Zalphos commented Jul 12, 2018

I tried deleting the config, but I'm still getting skipped frames, possibly like issue 86. Did the build you provided include the fix for 86?

@ghost
Copy link

ghost commented Jul 12, 2018

the test build i posted is not based on latest commit, but on windows, there's really no major performance difference between those versions.

can you try using the latest official release? also decreasing audio buffers as low as possible without causing stuttering (may need to close and launch vbam again). try also if different audio driver has difference. xaudio2 seems to work mostly in my case.

@Zalphos
Copy link
Author

Zalphos commented Jul 12, 2018

OK, so the skipped frames issue I was having was due to me having vsync turned off on my graphics card. This did not affect 1.8.0, but it made later versions choppy.

I compared 1.8.0, 2.0.1, and 2.1.0-fix. It's really hard to tell, but it seems like 2.1.0-fix may have less input lag than 2.0.1. However, it does not have zero input lag like 1.8.0. You may have got the issue halfway fixed but not all the way.

@ghost
Copy link

ghost commented Jul 13, 2018

upload the separate vbam.conf for both 1.8.0 and 2.0.x making sure that each .conf is deleted and created fresh between each version so we can compare (im assusing both are running on the same video and audio drivers, and the same audio latency)

you may also link the 1.8.0 version you are using so i can do a live test. from what i know input-related code for these versions hasn't change since (unless this is a modified 1.8.0 from retroarch which i added reduced input lag too) so something else is causing these input delays in your system.

@Zalphos
Copy link
Author

Zalphos commented Jul 13, 2018

@ghost
Copy link

ghost commented Jul 13, 2018

ok thanks for the link. im not on windows so i wont be able to do a live test this using these configs you provided till later.

also, may try to test by disabling Sound Interpolation if this helps. try also if using SImple display driver works better as far as input reaction goes(yeah it has slower framerates).
are you using nvida gpu and a wireless gamepad?

@Zalphos
Copy link
Author

Zalphos commented Jul 15, 2018

Neither disabling sound interpolation nor using simple display appears to make a difference. I'm using an Nvidia GTX 970 and a wired gamepad.

@ghost
Copy link

ghost commented Jul 15, 2018

apparently, its very hard to distinguish the input lag on this, as i have said as i have said the input related-code is the same. the modified version of vbam i linked above adjusts this input reading so that input are read before the start of the frame instead of what it used be (read input and render video during vblank).

i tried to duplicate as much as what vbam1.8.0 was configured and i cant get to see these skip frames you are talking about, and this is running both vbam180 and vbam210 at the same time using an onboard gpu.

im keeping this thread open for more possible scenario that this can be properly tested and duplicated easily.

@Zalphos
Copy link
Author

Zalphos commented Jul 15, 2018

Here is a short clip comparing 1.8.0 and 2.1.0-fix on my computer. Have you tried a side-by-side comparison like this on your computer?

@sparkplug12
Copy link

Hey I think I found your issue. Load up VBA M and go to options<video<configure then make sure you're on the "Basic tab" and then switch the output module to simple.

@Zalphos
Copy link
Author

Zalphos commented Nov 2, 2018

Input lag is still present in simple output mode.

@ZachBacon
Copy link
Contributor

there's some changes in the main libretro code of vba-m that I'll see about eventually implementing in the main app that should help reduce input lag.

@Tatsuya79
Copy link

Tatsuya79 commented Dec 3, 2018

That commit is here for reference:
libretro/vbam-libretro@3031dc5

@ZachBacon
Copy link
Contributor

@Tatsuya79 I know where it is, it's a matter of finding time and get it done globally and not just libretro specific

@Rings4
Copy link

Rings4 commented Jan 11, 2022

2.1.4 still has input delay. It's about 12-15 frames of delay. Tested on 2 machines, both with minimum audio buffer. Game tested: Sonic Advance 3, both trimmed and untrimmed.

Desktop: Ryzen 1800X, GTX 1080TI, 16GB 3000MHz RAM, Windows 10
Laptop: Ryzen 5600H, GTX 1650, 8GB 3200MHz RAM, Windows 10

Laptop also has severe audio stuttering at minimum audio buffer settings, meaning I have to increase the buffer, thus causing more input delay.

Tested my DS (GBA slot) just to make sure, and it has exactly 1 frame of input delay, assuming I'm counting frames correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants