weihuoya / citra

A Nintendo 3DS Emulator
https://citra-emu.org
GNU General Public License v2.0
2.05k stars 192 forks source link

(Android) So, this must be the main issue with citra atm #241

Open RaduNastase opened 3 years ago

RaduNastase commented 3 years ago

I'm playing Street Fighter 4 smooth and enjoyable at 2 x (OnePlus7).

But regardless of other settings, after about 3 stages, the next level (random) has strange frame drops, from constant 60 to 53, 49, 55, but WITHOUT audio stutters, just video drops. The next level is again 60 fps no issues, thn after 15 minutes, again the same isssue.

This is annoying and i'm asking if there's a fix for it. Setting 1x or other settings has no effect, it's the same and it's random.

It's not thermal throttling from phone's CPU either, as i'm monitoring the CPU frequencies and temperature constantly as i play.

This would make a wod of difference if fixed. It'd make the games very close to perfect.

ghost commented 3 years ago

It happens because new shaders are generated on disk.

On subsequent passes, there should no longer be the drop in frames. (Once shaders are generated, they are loaded directly into memory for each game you start).

RaduNastase commented 3 years ago

Hey man, thanks for answering!

What i am talking about is not the stuttering caused by new shaders. I already have Street Fighter 4 playing very smoothly in terms of shaders, with a big shader cache file :)

The issue is, as i said, that every 10 minutes or so (there isn't a fixed level, it's random), the frames become unstable for about 1 minute (i repeat, NOT the stuttering kind), from totally smooth 59 - 60 fps, to drops of 50, 53, 55 etc. Sound stays perfect though, unlike in shader building stutters.

RaduNastase commented 3 years ago

I've been testing this issue of Street Fighter 4 extensively in the past few hours. It seems that with Audio Stretching activated, it is less frequent, but i can't be 100% sure.

What i can say for certain is that it is related indeed to loading different assets. Not shaders, but level assets. What i observed is that the low/fluctuating framerate persists exactly one fight/map, then even if i replay the exact same map (or a different next one) everything is fine again, full speed.

Another notable fact is that it doesn't matter how long i stay on the fight that has issues in that moment (i emphasize this because it's not a certain map, could be any map, it's random), the next fight is smooth. So if i win quickly, in 20 seconds, next fight is perfect, or if i stay in that fight for 2 minutes, it fluctuates in framerate untill next fight/map (or the same map.replayed).

So it's not a time issue, it's a map assets issue as far as i can tell.

ghost commented 3 years ago

I tested it too and as I told you in the other thread you opened, this problem is not present on my hardware/software.

What I can think of, could be that you have the audio stretch buffer turned on, which consumes resources anyway, in that case I also notice oscillations in frames and uneven sound, but this is a known thing. (I always keep it turned off)

Other that comes to mind, is that the problem could be inherent in the way the thermal.config of your smartphone, manages the frequencies of the gpu, it seems strange (yet it would also make sense) or in the management of memory resources. (maybe too aggressive)

My tests, I always run them at 3x, FXAA shader and Linear Filter activated.

The thing then, makes me think that despite having the same SoC (SD855), we have a different management software (Rom) on the two smartphones (OnePlus7 and RedMi K20 Pro/Mi 9T Pro)

RaduNastase commented 3 years ago

So what is the fastest most reliable citra version you tested so far? What worked best for you?

I have to mention i also tested on Xiaomi mi 10t pro, and it behaves the same. The issue could be not as noticeable to some, as the fluctuations happen in the 10% range, so it's not a significant drop. Also, as far as i know, Audio Stretching frees resources not consumes..

ghost commented 3 years ago

The latest 20210305 build.

Edit: the problem could also be inherent to the drivers (about the problem you report in the other thread), mine are the native Android 10/Default Rom ones, so stable.

RaduNastase commented 3 years ago

I am not rooted, on either phone, nor Oneplus or Mit Pro. Both stock.

No other game (Donkey Kong, Dead or Alive) i played this past few days has this particularity. I will test some more and maybe isolate it better. Thanks for the feedback.man!

ghost commented 3 years ago

You are welcome man. If you're interested, I just created a gameplay video that's over two minutes long

https://streamable.com/7cvnww

RaduNastase commented 3 years ago

Wow, thanks so much! Great gameplay :)

You know what would really help, if you'd record 6 consecutive matches 1 round per battle walkthrough. I tested again and even in the demo mode (thecone that automatically kicks in on logo screen), after 3 or 4 different maps, it shows this behaviour for exactly one map, then full speed again.

Thanks.man.

ghost commented 3 years ago

This is the last 2:33 minutes of gameplay, of an entire game with the character Ken.

Resolution 3x (1200x720), Shader FXAA, Linear Filter.

https://streamable.com/ih3yx6

Enjoy the character's ending, because that's what I like best.

Note: the stage and the new opponent at the end of the level (Bonus, the Sensei), do not yet have the shader-disk, so there are some moments in which it appears a slight stutter (due to the reading in memory and writing of new assets in cache), but nothing transcendental.

Again, I reconfirm that on my device, I do not have the problem, so I think in the end, that is not a problem of the build, but probably of the thermal-throttling software (which manage frequencies, perhaps too aggressively and in powersave) inside the devices you tested.

Also, it seems very strange to me, that in 2x and without any filter, you have these problems.

So I propose again the idea of memory management, that of the drivers and that of the forced reduction of frequencies and sensors too sensitive to temperature variations. (some devices do not go into thermal-throttling, simply because they are already calibrated at the factory, to run at a certain frequency, but not the maximum frequency, when you have high loads)

The maximum frequency you get only in stupid benchmarks (moreover all the manufacturers, do not make a mystery of it) and for short periods.

The Real Benchmarks instead, are these, example, Citra.

RaduNastase commented 3 years ago

I found a quick fix.

When the issue happends, usually once in a full playthrough (2 rounds per character), i pause the game for a split second then quickly unpause it (doesn't need to be quick, but a split second of pause screen does it). I mean i pause the game, not the emulation, and the framerate is perfectly constant again. So this rules out thermal throttling (Oneplus 7 at least is a monster in terms of sustained performance, Xiaomi not so much, but it shouldn't happen anyway).

I will record a clip when it happends.

RaduNastase commented 3 years ago

Btw, in 3x you don't have stutters and frame drops in between fights? At the VS screen (with the flames in the background).

2x is perfect, but in 3x it drops noticeably.

ghost commented 3 years ago

In my case, it doesn't drop even with all effects turned on. (As I have already explained, the slight stuttering occurs the first time the textures are loaded into memory, the next time, the shaders will be loaded automatically into memory and there will be no more micro-stuttering (time or lag of the textures to load in memory), it is the exact same situation of the other emulators based on shader-disk; Dolphin, RPCS3, Cemu, Yuzu, RyuJinx, etc.)

So, I repeat, it seems very strange to me that at 2x (800x480) you have such problems on an SD855/865.

Unless, it is a config problem, you could try to delete the file /citra-emu/config/ and have it regenerated at the new emulator start, probably due to a wrong manual configuration.