mgba-emu / mgba

mGBA Game Boy Advance Emulator
https://mgba.io/
Mozilla Public License 2.0
5.7k stars 787 forks source link

Visual stuttering and frame drops regardless of settings #2199

Open m-orsh opened 3 years ago

m-orsh commented 3 years ago

Lowered audio buffer, tried 60fps, 59.7275fps, different renderers, everything I could attempt.

There is a consistent frame being dropped every second or two. (Yes frame skip is at 0) I have the audio buffer at the lowest setting, and sync to audio enabled.

I recorded a video to try and upload the stuttering, but amusingly enough, the video recorded at 59.7275fps has zero stuttering when I viewed it.

GTX 1080 i7-9700K

clavignejr commented 1 year ago

I just wanted to "chime in," not sure if my comment is going to get removed or not, though, I have the following: i5 13600k RTX 3070 Ti

The monitors I use are NZXT QHD 1440p 27-inch monitors with a refresh rate that goes up to 165Hz.

The latest stable along with the latest nightly both recreate the "stuttering issue" for me. I've tried limiting my monitors refresh rate to 60, same issue. The "sync video" setting fixes it 98%, but stuttering still occurs and the audio crackles no matter the buffer rate. I've tried different display drivers, sample rate, and have messed around with a bunch of random settings, nothing will fix the issue.

What is CRAZY to me, is my work computer that has just an i5 9600K, 16GB DDR4, and an SSD, no dedicated graphics card, runs mGBA better than my gaming setup.

The monitor used at work is a 60Hz 27-inch Dell monitor, and using the default settings within mGBA (sync video disabled, etc.) it runs smooth as butter.

I can't explain it, I know that probably doesn't help, though, it is what I've experienced. I stopped emulating GBA games on computer as a whole due to not really getting a satisfying emulation.

EDIT: I want to add onto this. I noticed my MacBook Pro with ProMotion sorta did the same thing. I remembered RetroArch, and decided to download that on my MacBook, install the mGBA core, and load FireRed. I quickly noticed that walking around seemed much smoother and that the stutter about 99% disappeared.

With hope of the same outcome, I downloaded RetroArch on the same PC with the specs listed at the top, and the same thing happens. Utilizing the mGBA core through RetroArch essentially eliminates most of the stutter. It is nothing like it was using the mGBA app. It's actually enjoyable to play now. I had to set my monitor to 60Hz on my MacBook & Desktop to get this experience with RetroArch, but changing the refresh rate never changed the outcome when using the mGBA app itself.

Nonetheless, RetroArch has fixed the issue for now, cheers to finding a true fix down the line!

PCBscanner commented 1 year ago

I had stuttering, but only with vertical scrolling e.g. moving up and down in Pokémon Emerald. Dropping the audio buffer to 512 samples significantly improved this and is now not noticeable. All other settings are default. Version 0.10.1, last updated today (11/3/23). I tried changing my display from 144 Hz to lower refresh rates but this did not work. I'm back to using 144 Hz without issue. Windows 11.

I'm not sure why this worked, but hopefully it can provide some guidance. Keep up the great work!

Kiyuja commented 1 year ago

I solved this issue by using the latest dev build and switching to the built-in software solution in "enhancements" and using SDL as "audio driver" with 44.1Khz and 4096 buffer size using both audio and video sync. This however introduces some slight audio crackling, but its minimized. This might occur bec of some sync issues on the current build. Framerate caps dont seem to work properly. Its a little sad as we now cant take much advantage of better hardware but since emulation is done mostly by the cpu anyways its good to have that working atleast. Hope this helps you out for the time being!

endrift commented 1 year ago

4096 audio buffers will lead to a noticeable lag, either audio lag if you have sync to video on or video lag (effectively input lag) if you have sync to audio on.

Kiyuja commented 1 year ago

You are correct. I kinda tinkered around with the latest build for the entire evening and you made me look into it again. I got the best results regarding audio and stable framerate by going for QT audio 2048 buffer and 44.1Khz sample rate. Display driver is OpenGL and Enhancements are done in software (OpenGL introduced tearing of some sorts). Native refresh with sync to audio only. This however introduced a bug for some reason. Both speed up and autofire seem to behave as toggles now, no matter which option is selected and I cannot deactivate them by using my controller. This might be because I'm using a controller with analog triggers as using Tab or Shift+Tab fixes the speed up behavior and works as intended. Is there a workaround? It properly worked this afternoon and now has issues, turning on speed up AFTER I release the trigger and only goes back to normal speed when I hold the trigger down again, which is the wrong way round. Maybe its relating to the + and - values it gets from the analog trigger idk, but it worked normally some hours ago

xXRaptorSc0pezXx commented 1 year ago

My 2 cents on this issue: I just downloaded this emulator and was disappointed it had this issue because it is otherwise great so hopefully my findings can help to solve it. PC Specs: RTX 3080 12GB, Intel i7-12700k, using a 165hz monitor. I used Stable release 0.10.1 for this testing.

This stuttering bug occurs:

So, if anyone reading this is having this issue, a good temporary fix until the stuttering bug is fully fixed is to change the Display driver to "OpenGL (force version 1.x)" since for some reason that completely gets rid of the stuttering.

Hope this helps! :D

Trademarkpolicyy commented 1 year ago

0.9.1 version works fine here, after this version all the subsequent versions have this same problem

endrift commented 1 year ago

Chiming in "me too" is not useful. It's a known issue, one I can reproduce, and one which I've yet to be able to fix despite attempts. Further replies that don't give any new information will be removed.

This is still the case. I will be locking the issue until it's fixed.