Sorting out lagging arcade game issue...
-
Hello, all. I've been working on a little handheld thing for a while. This isn't the first time I've posted about it -not that long ago I had to get help with a button mapping issue that I still don't quite how it resolved itself- but I find my back agaisnt a wall again, and I'm wondering if there's even anything that can be done.
Ultimately, the issue is that I may be pushing my Pi to it's limits on this. I've never quite understood just how much you can do on these systems, so I don't know if anything can even be done about this, but better to ask the experienced than to assume and end up wasting money or giving up.
It's taken me a while to get arcade games running on this(the problems were numerous, starting with how I don't completely understand MAME, up to my romset not actually being the set it claimed to be), but most of them now run smoothly. Save for a few games of the 1990s
These games all get very laggy and skip a lot quite frequently, but sometimes they work without issue. I don't know what kind of setting I can adjust to try and fix it, or if the Pi hardware just can't quite handle them. It happens a lot with games like Mortal Kombat and Metamorphic Force(a Konami beat 'em up built on the Mystic Warriors hardware). I use these two games as examples because they get buggy the most easily - both usually lag within seconds of being started.
Now, I only have a Pi 3 Model B, NOT a B+, and while I'm aware the only real difference is a mere 0.2 GHz in the CPU, I know if something's bumping up against the limits of some hardware even a slight boost can make the difference. I just don't know if that's what's happening here - I know the Pi is more powerful than the arcade hardware that ran the original games, but I'm fully aware of finicky emulation can be.
Are there settings I can adjust to try and fix this? Is upgrading to a B+ a potential fix? Any and all help is appreciated.
Build info:
Main hardware: Raspberry Pi 3 B connected to WaveShare Game Hat
Power supply: 5000mAH Li-ion battery
Retropie version: 4.4 provided by WaveShare - https://www.waveshare.com/wiki/Game_HAT (Game-HAT-retropie-4.4-rpi2_rpi3-180713.img) -
@FormulaFox mortal kombat 1 should be smooth on a pi3 at stock settings, but i don't know about metamorphic force. i can think of a few things we could check:
can you please post your /boot/config.txt file?
what mame emulator are you using?
do you ever see the 'lightning bolt' symbol on screen?
-
The lightning bolt icon is showing most of the time as I often have a power bank plugged into the microUSB port for extra juice.
My MAME set requires usage of the mame2003 emulator.
How do I export the config.txt file? I've never quite understood this part of dealing with Retropie.
(I need to get some sleep right after I post this, so don't wait by the keyboard for a reply - I'll get it posted ASAP when I get up)
-
@FormulaFox said in Sorting out lagging arcade game issue...:
The lightning bolt icon is showing most of the time as I often have a power bank plugged into the microUSB port for extra juice.
the lightning bolt means that you pi isn't receiving enough power. this means your pi's CPU/GPU/etc speed halves, which explains the performance issues.
are you able to test this by plugging your pi into a proper pi PSU rather than the battery? that could prove the theory.
-
I can confirm that Mortal Kombat 1 as well as Metamorphic Force are perfect playable on a RPI3B (even without +) in general.
(using AdvanceMame 3.9) -
I was under the impression that the lightning bolt meant full charge of the onboard battery, as it's on even when I'm using a proper Pi power supply as long as the li-ion battery is fully charged, but not anytime I'm running off the li-ion battery(which only lasts me about 90 minutes so is down from full power immediately when I turn on the device).
A quick test running only off the li-ion battery, and a second test with my Pi power supply, generated the same results: The lagging did NOT start from the moment the ROMs loaded, but when gameplay began. It was noticeably less severe, as well.
No lightning bolt icon with either, though. Possible that the battery and power supply are still insufficient?
Also, complete idiot moment on my part, I forgot that when I corrected my MAME ROMset, the Metamorphic Force ROM did not work. I replaced it with an FBA-compatible ROM. MK is still MAME2003, though.
@sirhenrythe5th said in Sorting out lagging arcade game issue...:
I can confirm that Mortal Kombat 1 as well as Metamorphic Force are perfect playable on a RPI3B (even without +) in general.
(using AdvanceMame 3.9)I don't have AdvanceMame on this thing. I have to use the Retropie image that WaveShare provides because this setup uses the GPIO pins for the gamepad, and I couldn't get the drivers to work using the official images. The WaveShare version only includes FBA-NeoCD, FBA, MAME2000 and 2003, MAME-4all, and PiFBA.
And, being the idiot I am, I've never understood how to install other emulators on this thing. ROMs are pretty simple, but I never quite wrapped my head around adding emulators.
-
@FormulaFox can you ssh into your pi? If so try running this command from the terminal (while a game is running) and then post the output here
vcgencmd measure_clock arm
-
@quicksilver said in Sorting out lagging arcade game issue...:
@FormulaFox can you ssh into your pi? If so try running this command from the terminal (while a game is running) and then post the output here
vcgencmd measure_clock arm
I sadly have no idea what any of that means. Like I said before, I'm an idiot. May be harsh to refer to myself so lowly, but I don't do it for no reason. (despite this, I'm the second most knowledgeable tech guy in my family - this level of micromanagement just makes my brain ooze out of my ears)
I might as well ask this while I'm here - do power banks with sufficient output to keep the Pi from being underpowered exist? What specs should I be looking for if they do? The onboard battery doesn't really last long(I'm lucky if I get 90 minutes) and you can't exactly find 18650 batteries higher than 5,000MAh. (or at least I've never seen them)
-
@FormulaFox said in Sorting out lagging arcade game issue...:
I sadly have no idea what any of that means. Like I said before, I'm an idiot. May be harsh to refer to myself so lowly, but I don't do it for no reason. (despite this, I'm the second most knowledgeable tech guy in my family - this level of micromanagement just makes my brain ooze out of my ears)
Enable SSH on your RetroPie installation, then use Putty to connect to the Pi over network. You'll be able to run commands directly from the command line, like the one @quicksilver mentioned, without exiting Emulationstation.
-
The Pi won't connect to my network. It can SEE the network, but after I punch in my security key it won't connect. I've tried three times and triple-checked to ensure I put they key in correctly each time. :\ It's not showing on my network either either when I connect via ethernet(though it IS getting internet connection that way). I'll check on some network stuff tomorrow(leaving for work soon, will be going to bed shortly after I get home, though I'll have time to check for more info here in between), but if anybody knows of something to check on the Pi itself to figure this out, let me know so I can try it as soon as I'm able to.
I'll be getting a B+ soon because we're going to build an arcade cabinet(for older games with which I have had no performance issues), and since Microcenter's selling the B and B+ for the same price I might as well grab the upgrade anyway, but I think it's fair to say if I intend to keep using this for ANYTHING we should try to figure this out. But we've got time before the trip to Microcenter is convenient to make(Sunday) so I hope we can figure this out before then and I can just apply whatever we figure out.
Still wondering about the power bank thing. It'd be nice to be able to make this thing last longer without interruption.
-
Checked everything I could on the network to see if it was rejecting new connections or had some other issue, and I can't find anything. I'm thinking some setting on the Pi is interfering with it's ability to connect. Any suggestions?
-
@FormulaFox The default keyboard layout on Raspbian is UK, so if you have some funky character in the password, you might be typing something else. Try to configure the Wifi using this method, it should work and you'll be sure your network key is the correct one.
-
Is there no way to just reset the keyboard to US? Or is it just harder to do that?
-
@FormulaFox yes you can set keyboard localisation in raspi-config
-
Okay, there must be something wrong with the wifi hardware on here because this thing absolutely WILL NOT connect to my network wirelessly(either that or I'm too dumb to not screw up the alternate method mitu directed me to), and I cannot connect via ssh to it when connected through ethernet.
Is there any way to dump the data I need to provide onto the flash drive? I run my ROMs off a thumb drive instead of off the SD card because my card is too small to import them all, so if there's a way to dump the output on there I could probably make that work.
It just hit me, though, is it possible for the lagging to be the result of using the flash drive instead of the SD card? That doesn't make much sense to me given the size of the ROM(I have Playstation ROMs that are bigger but don't lag, after all), but I've certainly seen technology do weirder things.
Quick little side note - how do you open the terminal while a game is running? I've been searching for that in the online documentation but haven't found it....
-
@FormulaFox said in Sorting out lagging arcade game issue...:
Quick little side note - how do you open the terminal while a game is running? I've been searching for that in the online documentation but haven't found it....
You use SSH.
-
Well, that's a problem since I can't get this thing to behave properly on the network...
-
@FormulaFox Are you sure you don't have some MAC filtering or other restrictions on your AP ? Also, the PI3B (non +) only knows about 2.4Ghz (i.e. no 5Ghz) so make sure you're connecting to the right SSID.
When creating thewpa_supplicant.conf
file on the sd card - the alternate Wifi configuration method - make sure that the file doesn't get created aswpa_supplicant.conf.txt
. You should be able to check if the file was imported by re-examining the sd card after booting, if it was processed then the file is removed. -
Believe me, no worries on the 2.4GHz. I have only one device in the house that can see 5GHz, so I haven't bothered even setting up a 5GHz network.
I'm not aware of any MAC filtering on my network - I certainly never set any up. The config file DID disappear from the boot sector when I was done - I've made the mistake of not removing the .txt from files before, so I was triple-checking that before I plugged the card back in.
BUT.... I just tried on ethernet again and... IT'S WORKING THIS TIME! As soon as I get the chance, I will play the game until it starts lagging again and get the needed info. I will post ASAP.
-
frequency(45)=1200000000
If I understand this number correctly, that's Hz? And if I've counted the zeroes correctly, that comes out to 1.2GHz. So.... Unless there is an error in my understanding, Metamorphic Force and Mortal Kombat are indeed maxing out the CPU.
I have also run the command while it was NOT lagging and got the same number(which doesn't surprise me - if the CPU being just that little bit short is the issue it'd be close even when it's not lagging).
For due diligence I tested a couple of other powerful games that I've NOT had lagging issues with(Marvel vs Capcom arcade, Bloody Roar II PSX), as well as some older less powerful games(Joust, Galaga, etc). Older games consistently give a number of 600000000 - exactly half the more powerful stuff.
I rebooted and double checked these numbers a couple of times as well, they stayed consistent.
This brings another question to my mind - With the CPU being pushed like this, how worried should I be about heat? This setup I have can't fit any form of active cooling. I do have simple heat sinks on it, but that's all I can do - it's open-sided, so there's as much airflow as you can get without fans(short of disassembling the unit, that is). At least, that's so far as I know - I've never seen a cooling system that would fit with a WaveShare Game Hat.
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.