Dolphin, the GameCube and Wii emulator - Forums

Full Version: 30FPS micro stuttering, frame pacing problems investigation - Ubershaders at last
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Hi,
first of all I’d like to thank all the Dolphin Team for their majestic work. I love Dolphin emulator and I’m grateful to all you guys and gals for your commitment.
A brief history of my experience: I started using Dolphin on October 2016 and one of the games I play most often is Wave Race Blue Storm. I immediately noticed subtle frame pacing, micro stuttering problems, but searching on the forum all posts indicated shader cache compiling as the origin of all stuttering problems. The more I used Dolphin (testing various builds/configs), the more I learned to know shader cache compiling stutters, but the frame pacing issues I encountered in Wave Race and other 30FPS games always resembled to me something different (60FPS games are butter smooth). I encountered these micro stutters using all development builds since October 2016, using all graphical backends and even using Ishiiruka Dolphin. I see these stutters even in scenes where I’m sure the shader cache is prepared i.e. running Zelda Twilight Princess intro multiple times.
Now that, with a great effort by developers, the Ubershaders are here to free Dolphin from the “original sin” of shader cache compilation, I think that it’s time to investigate this issue with peace of mind.

In this video you can see the Zelda Twilight Princess intro running on my system with Exclusive Ubershaders

Here’s the details of the test:

SYSTEM
CPU: i5-6600K 4.7GHz
RAM: 16(8+8)GB DDR4 2500GHz 15-15-15-36
GPU NVidia GTX1080 core slightly over 2GHz, RAM 11GHz
System Drive: Samsung SSD 850 EVO 500GB
ROM Drive: Seagate/Maxtor M3 2.5" 4TB on USB3
Windows 10 Pro x64 1703
Video Drivers: 384.94
Windows Power Management Mode: High Performance
NVidia Power Management Mode: Prefer Maximum Performance
Dolphin: 5.0-4956
ROM: The Legend of Zelda: Twilight Princess USA GZ2E01 GCZ

DOLPHIN SETTINGS
Enable Dual Core: on
Speed Limit: 100%
JIT Recompiler
DSP HLE emulation
Audio Backend: XAudio2
Enable Audio Stretching: off
Enable CPU Clock Override: off
Backend: Direct3D 11
Fullscreen Resolution: 1920x1080
Aspect Ratio: Auto
V-Sync: on
Use Fullscreen: on
Internal Resolution: 3x Native
Anti Aliasing: 4x MSAA
Anisptropic Filtering: 16x
Ubershaders: Exclusive
Scaled EFB Copy: on
Per Pixel Lightning: off
Force Texture Filtering: off
Widescreen Hack: off
Disable Fog: off
Force 24 bit Color: on



As you can see the CPU/GPU load is always low, there’s no shader cache compilation at all (Exclusive Ubershaders), but you can see frequent frame pacing issues (i.e. when Link approaches the fences, 35s-40s, or near the end, 55s-1m:05s).
In my humble opinion, it could be something related to synchronization problems between what Gamecube software believes to be CRT timing in order to maintain 30FPS vsync and the virtual environment offered by Dolphin that tries to maintain vsync with the real display. This is a pure speculation not supported by any study of source code; it’s based on black-box testing and leaves things as they are. But now we have the facts: 30FPS vsync micro stutters are real and they are not caused by shader cache compilation. I hope this helps.

Many many thanks to all of you
Best regards
Locutus73
If I had to guess this is either a dual core issue or exclusive fullscreen isn't working.
(08-03-2017, 02:00 AM)Craftyawesome Wrote: [ -> ]If I had to guess this is either a dual core issue or exclusive fullscreen isn't working.

Hi, thanks for the reply.

1) I tried to disable dual core several times (even now with Dolphin 5.0-4988) with no success in reducing stuttering.
2) Why should not exclusive fullscreen be working? I had the same issue with all development builds, all backends and all NVidia drivers since October 2016, first using a GTX1060 and now using a GTX1080.

Is there any log I can produce in order to further investigate this issue?

Many thanks in advance.
Best regards.
Locutus73
It could just be CPU emulation stuff. Record a giant fifolog over hte areas that stutter, play it back with no cache and see if it stutters.
Also, just as a verification, do you have a Dolphin profile setup in the Nvidia Control Panel to prefer maximum power? Dolphin is funky in that sometimes a GPU thinks it doesn't need to use the full power to run a game. Also, does this happen in the OpenGL backend or the Vulkan backend? Have you tried using Hybrid Ubershaders?
Hold on has anyone actually tested hardware for frame pacing? How do we know dolphin's behavior isn't just really accurate?
A lot of games lag on console too. You could try overclocking the emulated CPU to see if it's smoother.
Many thanks for all the replies; I’ll try to consolidate my answers here.

(08-03-2017, 03:52 AM)JMC47 Wrote: [ -> ]It could just be CPU emulation stuff.  Record a giant fifolog over hte areas that stutter, play it back with no cache and see if it stutters.
I did what you suggested with the following results: during the recording session the Zelda’s intro dropped to around 25FPS with audio stuttering; Dolphin replayed the fifo buffer at 60FPS without any evident stutter. This seems consistent with what I found later [see the end of the post].


(08-03-2017, 07:01 AM)KHg8m3r Wrote: [ -> ]Also, just as a verification, do you have a Dolphin profile setup in the Nvidia Control Panel to prefer maximum power? Dolphin is funky in that sometimes a GPU thinks it doesn't need to use the full power to run a game. Also, does this happen in the OpenGL backend or the Vulkan backend? Have you tried using Hybrid Ubershaders?
Yes, I made a Dolphin profile (maximum power) with NVidia Control Panel as I do for every game and emulator, and yes this happen in D3D11, OpenGL and Vulkan with hybrid, exclusive and no ubershaders (same results with Ishiiruka).
I tried to disable VSync in Dolphin and tested all combinations of VSync and triple buffering in NVidia Control Panel with no success.


(08-03-2017, 08:30 AM)Nintonito Wrote: [ -> ]Hold on has anyone actually tested hardware for frame pacing?  How do we know dolphin's behavior isn't just really accurate?
I don’t remember these stutterings on my GameCube games, but, honestly, it’s been 10 years ago and I don’t remember what I ate this morning for breakfast.  Tongue


(08-03-2017, 08:56 AM)JMC47 Wrote: [ -> ]A lot of games lag on console too.  You could try overclocking the emulated CPU to see if it's smoother.
I tried to set the CPU at 200% and the stutters remain…



BUT



I found something very interesting:
I played my original video in slow-motion using VLC, I analysed the stuttering parts frame by frame, and I discovered weird frame pacing. The stutters are not all slowdowns, but, sometimes, Dolphin accelerates. I try to be more clear: Zelda’s intro is 30FPS, but Dolphin renders it on a 1080p60 display at 60FPS, so each game frame should be doubled.

The frame pace should be: AABBCCDDEEFFGGHH
Sometimes we have a slowdown with a frame played three times: AABBCC[color=#ff3333]DDD[/color]EEFFGGHH.
But most of the stutters are caused by a frame played a single time, followed by a frame played three times: AABBCC[color=#ff3333]DEEE[/color]FFGGHH
In this case we have the right single different frames rendered in a lapse of time, but they are badly paced.

Here’s a slow motion video analysis of the problem:

This video is a 4s clip (starting at 0:36) of the previous video, slowed down 60 times (60FPS to 1FPS) with a text overlay indicating the original frame number.
Frames 44-45-46 are an example of slowdown with a frame played three times: AABBCC[color=#ff3333]DDD[/color]EEFFGGHH.
Frames 105-106-107-108, 129-130-131-132, 151-152-153-154, 157-158-159-160 and others are examples of a frame played a single time, followed by a frame played three times: AABBCC[color=#ff3333]DEEE[/color]FFGGHH
 
I suspect this is a Dolphin problem, not a bug of the original game which, using CRT TV, changed the raster frequency to 30Hz (I guess).
I think this issue is worth further investigation and I hope this analysis will help.



Many thanks in advance.
Best regards.
Locutus73
Soulcalibur 2 has some kinda of frame skip or frame pace issues that happens when you are attacking and when effects like particles are appearing on screen when the oponent is guarding.

It happens on all backends, but it is worse on OpenGL here, using the wireframe option you can see it better, the game should play full smooth 60fps I tried many config here but nothing seems to change.

This issues happens on 5.0 and on lastest build too, btw: I never see one build that had fixed it though when I testing it with JitIL it would reduce the micro-stutters and it feeled more smooth in geral, a good place to test the micro-stuttering is go to Character profile and select Charade and then rotate the camera.

Edit: OK running in exclusive fullscreen with xfb on and per pixel light OFF, ubershader Hybrid mode, seem to reduce greatly the frame pace issues in Soulcalibur 2, there is still some stutter (camera shake) here and there but it is much more smooth now.

It seems that per pixel light ON causes the frame pace issues to be more notable Soulcalibur 2.
(08-04-2017, 12:41 AM)Locutus73 Wrote: [ -> ]I suspect this is a Dolphin problem, not a bug of the original game which, using CRT TV, changed the raster frequency to 30Hz (I guess).
I think this issue is worth further investigation and I hope this analysis will help.
Yeah, I agree. For further investigation, I suggest to use XFB emulation and to patch dolphin to print a frame number on the screen. The Wii doesn't support 30fps scanout, it just repeats each frame twice. And this is controlled by the game, so it *might* be accurate - but unlikely.
While you're at it, it might be a good idea to also visualize those variables: https://github.com/dolphin-emu/dolphin/b...s.cpp#L200 - They are responsible for syncing the emulated time with the real time. It allows to run the emulation faster for a few milli seconds if we're behind the real time. So aabbccDDDEffgg should be a common pattern, not the other way around...
Pages: 1 2 3