N64 slowdown/stuttering - issue with loading new textures?
-
I recently started working on a Pi4B+ with Retropie. I think I have figured out the basics but I am running into an annoying issue. First off, I know that N64 emulation on the Pi isn't great and I am not expecting wonders. I am not dealing with general low performance - overall performance is quite good, actually. However, I have run into an issue which makes N64 emulation a non-starter.
Some games are worse than others, but every N64 game I have run so far will slow down or stutter on particular points. After experimenting a bit it seems that this is caused by loading/processing new textures. As an example, during the intro when a game logo appears on screen the FPS will momentarily drop down. This stutter also happens in game. The worst example I have found so far is in OoT, in Kokiri Forest. When loading a save state the FPS will be stable at 50 (per RetroArch's internal FPS counter; I'm using a PAL ROM). As soon as I turn the camera around, however, there will be a short freeze / FPS dropping down into the 30s, with the audio briefly freezing up as well. Same if I walk around and new characters pop in, or the green/blue Navi arrow appears for the first time. This does not seem to be a problem with processing power, as this only happens once. After the first stutter I can run around without any stutter and without the FPS counter ever going below 50. That is, until I exit RetroArch: the next time I start a game from EmulationStation, the stutters are back.
The fact that this happens when new textures pop in suggest that this is related to loading and/or caching of textures; however that is as far as my technical knowledge goes.
Settings are essentially default, with overclock. I am running a standard RetroPie build which was flashed using the official Raspberry Pi Imager. The system has been fully updated/upgraded. The Core/GPU are set to 2100/750MHz; the Pi runs cool as it's in an Argon case.
The N64 core I am using is the default lr-mupen64plus-next. Other cores have been tested but perform noticeably worse. Resolution is set to 320x240 and rendering to 1x Native. Most of my testing has been done running the crt-pi shader and 4x MSAA, but the issue is essentially the same with no shaders and/or no MSAA. As said, this doesn't seem to be an issue with processing power: everything works just fine the second time the relevant textures are loaded, until I exit RetroArch. Caching textures is enabled in RetroArch, however this does not seem to make any difference. I have tried toggling various other RetroArch options to no effect.Anyone have any suggestions?
-
@quadrupletorrent have you tested using standalone mupen64plus-gliden64? The overhead of RetroArch makes lr-mupen64plus-next a no go for me on a raspberry pi.
-
@quicksilver I haven't tried it without running it through retroarch. I haven't looked into that at all. I'm sure I could set that up but it would take some time, so I'll report back in a few days.
What I have tried is all of the cores supplied with RetroArch, but those all had serious issues (stuttering audio, no video, etc.). Aside from the stuttering when loading textures, performance on lr-mupen64plus-next is good. It is even passable when rendering at 2x native, so I would think that running at 1x native should not have hiccups like this. And once the textures are loaded it works just fine.
-
@quicksilver Well, that was a wild goose chase. Since RetroPie doesn't come with a GUI I compiled mupen64plus from source and ran it from the command line... It has been years since I did something like that. Here are some instructions for those who would want to try. Results not very good tho.
When using the GlideN64 plugin in this manner it has very fast emulation but unfortunately not very good emulation - e.g. the Zelda OoT logo doesn't show up during the intro. Very interesting to see, but not what I was looking for. Other plugins have problems as well (flickering or not rendering properly) or do not run smoothly even when I set the GPU to 900MHz.
It's odd (and a little frustrating) that OoT runs just fine on lr-mupen64plus-next with the GPU set to 750MHz, and that it makes absolutely no difference to increase it to 900MHz+. If anyone has any further suggestions, I'd be very interested to hear them.
-
@quadrupletorrent you can install mupen64plus standalone directly through retropie setup. In fact I think its installed by default. All you had to do was just change the default emulator and you can run it directly through retropie. I suspect that when you ran it from the commandline you were bypassing some of the settings configs. I get none of the graphics issues you listed when I run directly through retropie.
-
@quicksilver Thanks - I wasn't sure whether you were referring to those other cores. I thought I had tried all of those but I guess I somehow missed mupen64plus-gliden64 (it is at the bottom of the list...), as that seems to work without hiccups and without weird glitches. I have two further questions:
- How do I configure options for this standalone version? RetroArch's quick menu obviously doesn't work. Is there a .cfg or .ini file, and if so where? Is there an overview of which options I can use? I tried Google but I couldn't find a resource that explains this properly.
- Can I use shaders when running mupen64plus this way?
-
@quadrupletorrent said in N64 slowdown/stuttering - issue with loading new textures?:
@quicksilver Thanks - I wasn't sure whether you were referring to those other cores. I thought I had tried all of those but I guess I somehow missed mupen64plus-gliden64 (it is at the bottom of the list...), as that seems to work without hiccups and without weird glitches. I have two further questions:
- How do I configure options for this standalone version? RetroArch's quick menu obviously doesn't work. Is there a .cfg or .ini file, and if so where? Is there an overview of which options I can use? I tried Google but I couldn't find a resource that explains this properly.
/opt/retropie/configs/n64/mupen64plus.cfg
i wouldn't change from default settings, though. they're chosen carefully, and indeed some are overridden by the launch scrpt.
- Can I use shaders when running mupen64plus this way?
no, although there are a variety of scaling/texture/AA/etc effects that can be turned on in the .cfg but again i wouldn't recommend this. the pi can hardly cope with default settings, never mind with enhancements.
-
@dankcushions one of the defaults though is to turn on legacy blending, which unfortunately causes issues with a few games. There used to be a list in the mupen64plus.sh that would disable legacy blending for a few games, however I don't think this is functioning on the pi 4 (also the fix for the crackling sdl audio doesn't seem to work automatically anymore either).
The other setting that may be worth looking at is the backgrounds mode. "Stripped" is the current default but "one piece" offers a large performance boost for some games (StarCraft, magical Tetris, worms etc.), especially so in 2d heavy games and certain menus.
-
@dankcushions I have many games that run full speed with 4x MSAA and a CRT shader when using lr-mupen64plus-next. The issue I have is the temporary freezes when loading new textures/shaders for the first time. Standalone mupen64plus-GlideN64 runs at native resolution for me, i.e. 320x240, which to my eyes is unbearable on a modern screen.
Still, thanks for pointing me in the right way of the .cfg file - I wasn't sure if this was the one that would be used by mupen64plus-GlideN64 :) I will try experimenting a bit and will report back.
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.