mgba-emu / mgba

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

Pokemon Red has slowdowns for some configurations #1730

Closed kinder-bueno closed 4 years ago

kinder-bueno commented 4 years ago

My configuration:

Arch Linux CPU: Intel i5-480M GPU: Intel integrated GPU (Intel HD Graphic Ironlake) mGBA: 0.8.1 Video: OpenGL 1.1 forced, synced to Audio (SDL)

It can be easily observed during main screen, where slideshow of Pokemons happens, nearly every change of Pokemon sprite slows done emulation from 60 to circa about 55 fps which is accompanied by sound lag. Changing audio buffer doesn't help. The same issue happens most often while wild Pokemon appears/my Pokemon comes from Pokeball.

Every time that lag is preceeded by GB memory savedata sync log.

RafaelTrepaUnCarballo commented 4 years ago

I recall having a similar problem.

Try to disable video Sync Video.

kinder-bueno commented 4 years ago

@RafaelTrepaUnCarballo I have sync video disabled, only sync audio is enabled

kinder-bueno commented 4 years ago

Every time that lag is preceeded by GB memory savedata sync log.

kinder-bueno commented 4 years ago

What's more gba games don't have that issue, Pokemon Fire Red works nearly flawless

RafaelTrepaUnCarballo commented 4 years ago

Every time that lag is preceeded by GB memory savedata sync log.

That might be your hard disk. Is it mechanical? (not SSD) Is it in a laptop?

Sometimes, specially in laptops, the OS or HDD firmware try to reduce power consumption and noise by "parking" the hard drive head, disabling it, and that may cause a brief lag and noise when the system tries to read or write something.

If you were using Windows I would tell you to install quietHDD, which modify APM/AAM values to prevent that behavior. I think there are commands in Linux to do the same.

kinder-bueno commented 4 years ago

@RafaelTrepaUnCarballo I have two almost identical laptops (because my wife-to-be has identical one), one has SSD and the second one HDD (old and slow one), and the issue is happening in both of them.

kkngs commented 4 years ago

I have also observed strange laggy behavior with Pokemon FireRed that sounds similar to this. Turning on video sync seems to help, but as I play for a while the problem gets worse and the game suffers from stuttering or even freezing for up to a second. Restarting clears it up, for a short while. I was using the latest build 6161-0a06af1. I reverted to version 0.73 and it runs smoothly. I'm unsure of the 0.8* versions as I was running into an issue with controller support.

endrift commented 4 years ago

So I've been able to reproduce this on Windows, but my fix for the Windows version (still uncommitted; was looking to close this bug but now I see it's not just Windows...) doesn't affect the Linux version. I'm not sure what I can do to fix it on Linux, but I'll continue to look into it.

kinder-bueno commented 3 years ago

It seems that current 0.9.0 revision c134c6c doesn't have these issues on linux