Mame emulation speed faster on Retropie than on my PC
-
Hi guys, I'm trying retropie for the first time with my Raspberry Pi model B
I loaded MAME rom (Super Pang - spang.zip) on mame-lr2003 (and also on FB) and it starts fine but the game speed is about 15% faster than on my laptop (which has more powerfull specs). Raspberry Pi is connected to my HDTV.
I'm thinking that it has something to do with my TV refresh rate. The game in question, Super Pang, runs ad 57.245 Hz. If I edit the default game resolution and refresh rate to start with ( holding a button after launching the game) and start it at 1920x1080 at 50Hz
the game then runs slower. So I figured it has something to do with my refresh rate. Is there an option to like sync the refresh rate of my monitor to my game refresh rate so the game runs at correct speed. On the other hand, my laptop is also at 60Hz but the game runs at proper speed.
SNES game,I tested only 2, seem to run fine though.
Any help would be appreciated.
Pi Model or other hardware: 3 B
Power Supply used: 5v 2.1A
RetroPie Version Used (3.6, 3.8.1, 4.01 etc.. - do not write latest):4.1
Built From: (Pre made SD Image on RetroPie website, Berryboot, or on top of existing OS etc..): SD Image on RetroPie
USB Devices connected: Gamepad
Controller used: Generic usb gamepad -
-
@rbaker I've already read that through many times before I've posted here and I know some games might never run at correct speed, being slow is not the problem here. Processing power is also not a problem. The thing is, like I mentioned, refresh rate. I've also played with retroarch.cfg settings mentioned in the thread but they don't seem to work. Is there any option in retropie to alter refresh rate. Would vsync in retroarch.cfg fix the issue?
Also, before I forget, I tried to add video_frame_delay, and at a setting around 10 frames delay, the game starts to run at proper speed (like the ones on PC) but sound starts to be a problem. Anyways, might this be an emulator problem? Don't think raw processing power plays a big role in this basic game. What does alter speed is like I mention, starting the game at 50hz refresh rate, but then the games is generally slower than on the PC emulated counterpart.What comes to my mind is that SNES games run at proper speed because the (US roms) an NTSC are meant to be played at 60hz refresh rate and MAME arcade games are meant to be played at specific resolution and refresh rate which is for a single cab. IF this is a case than no mame game will run at correct speed. What boggs me is how in the world does it run at correcdt speed on a PC laptop...
-
@Floyd setting 'throttle' to 'off' ? This is normally F10, but I have not tried it on a Pi, I used to use it back in my Windows days.
-
@Floyd turn vsync off in your config. 57.x is not a refresh rate your screen will support presumably, so vysnc on would run it at 60hz.
that said i haven't done any testing in this area.
-
@rbaker I'll try to test these when I come back home, but out of experience turning off throttle, at least on pc is going to let the game be on mercy of raw processing power. But I'll give it a shot.
-
@Floyd I reported this problem several days ago, it happens on a lot of games.
https://github.com/libretro/mame2003-libretro/issues/75
Turning off Vsync in the RetroArch menu doesn't make any difference (well not for me anyway). We'll have to play them at the wrong speed and hope people don't notice when they come round to play you're arcade machine !
-
@windale said in Mame emulation speed faster on Retropie than on my PC:
@Floyd I reported this problem several days ago, it happens on a lot of games.
https://github.com/libretro/mame2003-libretro/issues/75
Turning off Vsync in the RetroArch menu doesn't make any difference (well not for me anyway). We'll have to play them at the wrong speed and hope people don't notice when they come round to play you're arcade machine !
I think every game that runs at 57.xx Hz is going to be having this problem. And most of the cab games run around that clock. It's not a big deal if you don't play games where precision is a big factor (but what mame game isn't?). Like you've said, the issue is extremely noticeable if you've played the game on cab or even at windows pc.
Setting video_frame_delay to 5 (which is still a safe setting without getting sound and majoy input lag) might make things a bit better, but still very noticeable. At frame delay around 10 sound looses sync. What is a real head scratches is why this issue doesn't occur on pc when connected to same monitor/TV?
Thanks for the bug report. -
@windale How do you actually turn off vsync ... editing the file in:
/opt/retropie/configs/arcade/retroarch.cfg,
or
/opt/retropie/configs/mame-libretro/retroarch.cfg
? -
@Floyd I tried the Vsync setting in the RetroArch GUI Video menu.
-
I think I've found a fix.
Here is the solution. As it seems, retroarch isn't detecting mame refresh rate properly and instead it automatically forces it to 60hz. Now to fix this, you just need to go to Select + X to call the Retroarch menu and undeo Settings > Video scroll to Refresh rate. It defaults to 60.0000 Hz. Now change that value to game's proper refresh rate (which you can find by running the game in mame on your pc and reading the values right before the game starts).
After changing the refresh rate, in my case Super Pang had a refresh rate of 57.420 save that setting (Overide per game). The setting should be saved in /home/pi/.config/config/mame-2003/spang.txt
Little hint, it takes a long time to change the refresh rate via gamepad in RetroArch Gui. Instead just save it before changing the value and it will create the gamename.txt file. There you can open it (via putty) or file explorer and edit the value. Look for "refresh_rate" and change from 60.00000 to your desired refresh rate.
That should do the trick and the game should run at normal speed. -
@Floyd This is more of a workaround than a fix. This means we will have to keep an eye on the framerate of every game we play and check if it's correct with the Windows etc. version of MAME and then manually edit the refresh rate for all of them ! I hope there is an easier solution, maybe a bug in RetroArch. I don't know if @dankcushions is looking into it ?
-
@windale said in Mame emulation speed faster on Retropie than on my PC:
@Floyd This is more of a workaround than a fix. This means we will have to keep an eye on the framerate of every game we play and check if it's correct with the Windows etc. version of MAME and then manually edit the refresh rate for all of them ! I hope there is an easier solution, maybe a bug in RetroArch. I don't know if @dankcushions is looking into it ?
Well , let's not argue semantics. Call it as you wish, but although a bit tedious, it works in my case. On the other hand, I don't have hundreds of games, and it's not a biggie to change these parameters for my games. After all this workaround can be used for games that are nearly unplayable. Anyways, I also hope the real fix will come eventually.
-
@Floyd Just to rule out something, please can you try this and see if it makes a difference
sudo wget -q http://malus.exotica.org.uk/~buzz/runcommand.sh -O/opt/retropie/supplementary/runcommand/runcommand.sh
This will grab a slightly modified runcommand.sh and install it. Because we default to having threaded video on, retroarch is not able to calculate the video refresh rate, so for the RPI, I set it based on the actual current screen refresh. I'm just wondering if that is possibly affecting it since manually adjusting the refresh seems to fix it as you have mentioned.
-
BTW to revert back to the previous runcommand you can do
sudo ~/RetroPie-Setup/retropie_packages.sh runcommand
-
It's also worth seeing if setting
video_threaded = false
makes a different in/opt/retropie/configs/all/retroarch.cfg
(set to true by default on retropie for performance). -
@BuZz. I'll try to see if this fix helps. Will get back to you. I've already messed with threaded video this morning and it does recognize the refresh rate but I've only tried this on already modified game refreshrate.. Will tryreport it on unmodified game setting.. Will report findings
-
@BuZz
Last night I did some extensive testing.
The results are following. As it seems, the modified runcommand has no impact whatsoever and it even disables pressing "a" button to access the additional settings menu after game launch.
What did make a difference is disabling video threading which then recognized the refresh rate of a monitor and lowered below 60Hz only at some games. This allowed me to just click on the monitor refresh rate setting which then also changed the game refresh rate. But again, this had effect only if you manually click on the monitor refresh rate and did work only at some games.
I really don't know what causing this issue. Maybe an old emulator core? -
According to the reply on the mame2003 Github issues, this fixes it :-
The solution is to go to settings > frame throttle and set 'maximum run speed' to 1.0. This means you can't fast-forward anymore but it will run at the the proper fps.
I haven't had time to check it yet (not at home) but if it does work hopefully @BuZz or someone else can apply it as the default setting. (I don't see the need for fast-forward in MAME).
-
@windale. Nice, will check tonight.. Let's hope this fixes it.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.