Log in

View Full Version : Maybe someone can answer once & for all: Why lag using madVR w/o intensive settings?


Ditto666
1st April 2017, 13:06
FOOTNOTE: If you'd like to skip the details to simply know what the problem is, just read the text in bold.

Hey guys, so I've had this bother me forever, and frankly, it doesn't make sense. It's rather annoying as it gives the constant impression like your computer is several generations behind where it actually is. The reason I say this is because in setting up madVR, taking baby steps in upping the quality until the video begins to lag/stutter (as maximizing the settings just starting out, and I mean sensibly, seems to immediately do this with any video source), there's really no indication of any of the resources being even close to actually maxing out.

When playing graphics intensive games, you can hear the graphics card fans start to really be working, and when rendering video from any video editing software (for example), your CPU is always totally maxed out. Through all versions of MPC (HC & BE) and madVR, and all the different computers and operating systems, not once did I see the CPU go significantly above like 30%. It's also a very draining process as with each minor change in all those extensive settings - even one little checkmark somewhere - you have to carefully test and analyze any frames possibly skipping for whatever clip you're optimizing things around, in both windowed mode and in fullscreen/full resolution. Once it's set, you have to hope that it works well with other content in all different resolutions and framerates (both in H.264 and H.265 - I guess settling for optimizing around H.264 if you don't have the latest hardware which doesn't natively support the latter).

In any case, I recently built three computers with a hexa-core i7-6800K, 16GB DDR4 3000 MHz RAM (if at all relevant), and a GeForce GTX 1070 8GB graphics card. Not to sound conceited, but it needs to be said: there is nothing wrong with my setup; I know what I'm doing, and everything down the line is considered in its setup/interaction including the LAV video decoder and whatever other filters for each source.

I keep this setup (I guess I'd mostly be referring to madVR) because I enjoy the optimizations that it brings regardless, but honestly, it's very distracting feeling like the processing of the video is dancing around some imaginary edge and can tip over/stutter at any moment (unless you bring everything down to at least just Lanczos scaling and call it a day).

Honestly, I suspect this is a known issue and almost a taboo to discuss, since, with as wonderful, knowledgeable, and talented as the developers are, they have no idea why this is happening. There's honestly nothing to troubleshoot on my end. I can list where my settings have maxed out on every generation system for which I had an optimized setup, but what would be the point? The problem is obviously there regardless, and in each case it seemed as if I should really be able to smoothly play back like triple that of what I was.

If someone actually has the answer and there's something I'm being ignorant of, I'd really like to know either way. Any input directly addressing the issue I would really appreciate. Thanks in advance!


PS- If it can't be explained or figured out, there are two things which could technically really help:
1) Also including a measure of how resource intensive each scaling algorithm is one whatever system as an additional metric alongside the others.
2) Having different settings automatically switch for each different format, resolution, and framerate (since you essentially have to test for and work around every one of them anyway). As it stands, you effectively have to compromise every other video for the lowest common denominator, or otherwise use an alternative player without madVR to play whichever one is most problematic (which due to additional upscaling being added, not on all systems/monitors in the past has necessary been the highest resolution - often times the opposite where obviously 1080p on a 1920x1080 screen didn't require the processing of upscaling algorithms).
3) An overlay you can activate which gives you a reading (or at least boolean value) of whether or not, or, how much of the full video framerate is actually being rendered, effectively indicating if there were any skipped frames (with perhaps also a counter of how many it was in the timespan which whatever clip was played).

sneaker_ger
1st April 2017, 13:14
2. madvr has profiles for that. https://forum.doom9.org/showthread.php?p=1709814#post1709814
1. You can measure GPU usage using e.g. GPU-Z. I've also heard about Pascal problems with DPC latency so give DPC latency checker (http://www.thesycon.de/eng/latency_check.shtml) a run. Some problems may be down to energy saving modes that cause stutter when switching between modes or even being too low altogether. Sometimes these are activated through hardware decoding (DXVA2 copy-back or software decoding are recommended), sometimes the drivers have profiles targeting e.g. "mpc-hc.exe". So even renaming the player executable can have an effect.
http://nvidia.custhelp.com/app/answers/detail/a_id/3130/~/setting-power-management-mode-from-adaptive-to-maximum-performance

Ditto666
1st April 2017, 13:47
2. madvr has profiles for that. https://forum.doom9.org/showthread.php?p=1709814#post1709814
1. You can measure GPU usage using e.g. GPU-Z. I've also heard about Pascal problems with DPC latency so give DPC latency checker (http://www.thesycon.de/eng/latency_check.shtml) a run. Some problems may be down to energy saving modes that cause stutter when switching between modes or even being too low altogether. Sometimes these are activated through hardware decoding (DXVA2 copy-back or software decoding are recommended), sometimes the drivers have profiles targeting e.g. "mpc-hc.exe". So even renaming the player executable can have an effect.
http://nvidia.custhelp.com/app/answers/detail/a_id/3130/~/setting-power-management-mode-from-adaptive-to-maximum-performance

Profile groups are manual controls (you're not going to go in there and switch it every time you play a different video).

I am aware of different tools for measuring your GPU; I already do that. That doesn't really help much. I hoped that the difference between having every option indicate the usage in advance and manually changing to it, checking your usage going through random scenes, and then memorizing/marking it down was obvious..

Regarding energy saving's mode, I suspected that a long time ago, and all the machines I build are performance machines intended for that purpose (so I optimize them as such). No setting do I have set for any kind of energy savings, particularly ones which affect media playback. That's including the BIOS, drivers, or Windows OS. The issue isn't nor has it been with any of my machines. It's exactly the same issue on yours and everyone else's, and if it wasn't, that would still leave a lot of explaining to do. The issue is like I stated in bold, not that there's generally lag regardless of anything.

A quick game of badminton (whether I did/have set this, this, or that) is fine, but only with the full knowledge and intention of getting to the bottom of the problem completely. Otherwise, my word just has to be taken for it. Don't know how I could better prove I know what I'm doing at this point (it's why I didn't come with this issue before because I knew people would just point at whatever I might not know as red herrings, pretty much just ending it there even if obviously affecting them as well - just how people are).

With respect to DPC latency, I've actually had that problem on one of my (non-custom built) machines before. I am aware of it and it's not an issue on any of the computers I referenced.

Btw, one thing though I never actually fully did do is weigh the pros and cons of DXVA2 vs. NVIDIA CUVID. Why is DXVA recommended and, apart from possible energy savings getting in the way, how might CUVID impede or otherwise affect the performance compared to it? Thanks!

CruNcher
1st April 2017, 14:01
Quantum Physics Observer problem on a non RTOS especially Windows as soon as you measure something you get weird results ;)

sneaker_ger
1st April 2017, 14:08
Profile groups are manual controls (you're not going to go in there and switch it every time you play a different video).
It can be automatic.
https://forum.doom9.org/showthread.php?p=1271417#post1271417

Regarding energy saving's mode, I suspected that a long time ago, and all the machines I build are performance machines intended for that purpose (so I optimize them as such). No setting do I have set for any kind of energy savings, particularly ones which affect media playback. That's including the BIOS, drivers, or Windows OS.
Energy saving settings are usually activated by default. You have to disable or work around them to test.

Don't know how I could better prove I know what I'm doing at this point (it's why I didn't come with this issue before because I knew people would just point at whatever I might not know as red herrings, pretty much just ending it there even if obviously affecting them as well - just how people are).
By describing what you tested and how you diagnosed your problem in detail. Saying "I know and tested everything" .. well, no one knows what that actually means.

Btw, one thing though I never actually fully did do is weigh the pros and cons of DXVA2 vs. NVIDIA CUVID. Why is DXVA recommended and, apart from possible energy savings getting in the way, how might CUVID impede or otherwise affect the performance compared to it? Thanks!
LAV author has said it often. It's mainly about bugs/features.
https://forum.doom9.org/showthread.php?p=1784300#post1784300

Ditto666
1st April 2017, 14:09
Quantum Physics Observer problem on a non RTOS especially Windows as soon as you measure something you get weired results ;)

I guess that makes sense. How come that's not the case for literally anything else though, like real-time video editing or audio mixing in a fully-loaded DAW (as just examples)? I mean, for video editing, it's literally using all the same resources, factoring in much of the same stuff, but.. just coded differently. I mean seriously, what's different, and whatever the difference is, wouldn't it technically be a problem if it can otherwise be made to work different? I mean, there are all-in-one media player solutions which render video with quite high quality settings and they work totally in accordance with expectations. I'm just a tinkerer and I love the modularity of this setup. I mean, I like it functionally as well, but I've finally had enough of this with my current listed specs and a totally clean installation, consistent throughout three machines and all the knowledge of possibly further needed external customizations.

Ditto666
1st April 2017, 14:21
It can be automatic.
https://forum.doom9.org/showthread.php?p=1271417#post1271417


Energy saving settings are usually activated by default. You have to disable or work around them to test.


By describing what you tested and how you diagnosed your problem in detail. Saying "I know and tested everything" .. well, no one knows what that actually means.


LAV author has said it often. It's mainly about bugs/features.
https://forum.doom9.org/showthread.php?p=1784300#post1784300

Oh, wow. Well that's quite the headache. I think I'll pass. For once in my life when it comes to this stuff, I have to say no. Too much time is spent on this as it is already. I'll trade off quality for literally having to code this (not saying it's complicated). In any case, it would be hard to argue it being somewhat.. inconvenient, but I appreciate being informed. Maybe if at some point I'm feeling up to it, though I don't see why this literally can't just be built into the interface like other regular user options. There are quite obvious defaults which can also otherwise be set to achieve this.

Regarding energy savings, yes, I know. I meant to imply that I am aware and always disable them. Describing my whole entire setup process and everything I change/disable/activate would be way too much. That's more of a tutorial and a long thread in and of itself. If there's anything specific someone wants to ask with a clue as to what the problem might be relevant and suspected I maybe haven't done, then by all means. However, like I said, very doubtful something to troubleshoot on my end and can just as easily be confirmed with whatever personal PC). You mean to tell me your video only starts skipping frames once your hardware is showing and otherwise acting like it's maxing out?

Regarding CUVID, I thought that with the introduction of Pascal, those issues would've been resolved, but considering how recently you the post you referenced was, better to be safe than sorry I guess. Definitely noted and I'll stick with DXVA2 for now; thanks! Only thing, why use copy-back if all the processing is being done by madVR and there otherwise aren't any limitations? I know the impact on performance is practically negligible but why have the data go through loops? I imagine that would only be necessary if using scripts like AviSynth or something.

sneaker_ger
1st April 2017, 15:05
Regarding energy savings, yes, I know. I meant to imply that I am aware and always disable them. Describing my whole entire setup process and everything I change/disable/activate would be way too much. That's more of a tutorial and a long thread in and of itself. If there's anything specific someone wants to ask with a clue as to what the problem might be relevant and suspected I maybe haven't done, then by all means. However, like I said, very doubtful something to troubleshoot on my end and can just as easily be confirmed with whatever personal PC). You mean to tell me your video only starts skipping frames once your hardware is showing and otherwise acting like it's maxing out?
Just to test the basics I would:
1. Rename "mpc-hc.exe" to e.g. "whatever.exe".
2. Set Windows' "Power scheme" to "High Performance". https://www.tenforums.com/tutorials/21434-choose-power-plan-windows-10-a.html
3. Set player to "Power management mode" from "Adaptive" to "Prefer maximum Performance". http://nvidia.custhelp.com/app/answers/detail/a_id/3130/~/setting-power-management-mode-from-adaptive-to-maximum-performance
4. Disable C-State power saving in BIOS. http://www.hardwaresecrets.com/everything-you-need-to-know-about-the-cpu-c-states-power-saving-modes/ (not actually sure this is needed when 2. is already set)
5. Maybe even disable Hyper Threading while you're at it.

But: only for testing. It will greatly increase power usage. If there are still problems proceed to explain what exactly those problems are, show OSD and maybe upload a log for madshi. Other things we don't know about are your Windows and driver versions.

Only thing, why use copy-back if all the processing is being done by madVR and there otherwise aren't any limitations?
There's at least one known problem with how madvr accesses the DXVA2 native picture resulting in loss of quality.

huhn
1st April 2017, 18:12
1. You can measure GPU usage using e.g. GPU-Z. I've also heard about Pascal problems with DPC latency so give DPC latency checker (http://www.thesycon.de/eng/latency_check.shtml) a run.

please read your like this program is totally useless for years now!

and power saving options are not that important doing benchmarks with pascal GPU is pretty much impossible with there very high boost clock.

CruNcher
1st April 2017, 18:20
please read your like this program is totally useless for years now!

and power saving options are not that important doing benchmarks with pascal GPU is pretty much impossible with there very high boost clock.

Pascals whole Board Power Circuitry Design changed Optimal Power should work "optimal" and with optimal latency in most use cases unless you use a unstable 3rd party cheap AIB Design which Bruteforces Performance out to save Engineering costs and targets users especially with the overclockers emblem on it by some of those Asian Gamer targeting idiot companies Brands, which roughly care about stability but benchmark results by some shit dumb youtube reviewer that don't even understand that they got a modfied vbios and lieng to their whole viewers selling a dumb shit overpriced product to them based on some freaking idiotic measurements you can push right into the trash bin.

Nvidia has since some time Lower Level Driver Protection against there AIBs Bios Modifications (Debug Mode) so if things show strange unstable results always try that first (Stability iisues,Crashes,to high Latency,unexpected Frame Drops) ;)

Allways try to evaluate issues Objectively especial don't trust FPS Numbers coming from some Kernel or Top level DX Hook blindly, take benchmark bars with a grain of salt if at all you can partly only trust frametime results measured at short intervals (be careful of the overhead this causes on Multithreads) and look more at goals you want to achieve.

At best Externalize your measurements out of the System as much as possible.

Avoid Windows 10 Insider move to a stable branch or Windows 7/8.1 ;)

jkauff
2nd April 2017, 01:30
I don't know how exactly you have madVR set up, but under Rendering/General settings, I've checked "use Direct3D 11 for presentation" and below it "present a frame for every VSync". I was getting lots of dropped frames with those settings, but using D3D9 everything was fine.

The result of some detective work was very surprising: VSync was turned off in Nvidia Control Panel! I don't game, so I guess I didn't notice, but it may have been that way since I ran a DDU driver uninstall and re-installed the drivers for my GTX1060. I turned on VSync, and no more dropped frames!

I have no idea if that's your problem, but you might check it. Also, with a CPU that powerful you probably should be using software decoding in LAV. Why take away GPU resources from madVR?

CruNcher
2nd April 2017, 12:14
V-sync in Video Playback generaly doesn't matter as your Refreshrate should be allways in Sync to the Content (CFR) being playbacked anyways, else frames get repeated/decimated by LAV Video/MadVR also advising CPU Decoding for Playback is not a good idea at all you also in case of Nvidia roughly gonna lose any GPU Shader resources when using VPX for Decoding only in Hybrid Mode (Cuda Decoder) this becomes a problem.

pirlouy
2nd April 2017, 12:15
1. You can measure GPU usage using e.g. GPU-Z. I've also heard about Pascal problems with DPC latency so give DPC latency checker (http://www.thesycon.de/eng/latency_check.shtml) a run.
GPU-Z interferes with madVR exclusive mode. I use Open Hardware Monitor with detailed graphs. It is not that much developed and does not always work in some cases, but it works for me.

For Latency, I'd rather use LatencyMon.

CruNcher
2nd April 2017, 12:27
Every Polling interferes in some way with Windows some do it more efficient then others though saving valuable resources and create less problems even at low polling intervals, but you always imply overhead and problems for the Windows Kernel which can result in bad application behavior ;)

Rule of thumb for efficient coding minimize your timers and try to be sane with polling anything on Windows ;)

And a general no go fast polling with Power Management on High levels :D