Closed nestflow closed 2 years ago
Test if disabling "Use Direct3D 11" solves it.
Which Intel and Nvidia GPU models?
No, it exists in both D3D9 and D3D11 mode.
I use a I9-11900H and RTX3060 model.
Record video from desktop with stutter, enable statistics(Ctrl+J) in MPC VR.
I know it's weird, but if I run my OBS (even NOT start recording), the stutter magically disappears.
But I can give a screenshot of shutter (with no recording software running) here: https://imgur.com/a/AV55boj
Actually, I find that the stutter is gone as long as there's any application using dedicated (Nvidia) GPU at the same time, like OBS or games.
It also works if I just completely disable Nvidia GPU in utility of my laptop. Related to GPU initialization I guess?
You can set Nvidia (or Intel) as preferred GPU for MPC-BE in the Windows 10 settings. Settings > Display > Advanced
Yes I can (and that's how I did in the first post), but it won't solve the stutter if Intel GPU is set as preferred. But for a laptop, I really don't want to use power-consuming Nvidia GPU just for video playing...
Does it also happen with MPC-HC? I ask because the Nvidia driver has an application profile for MPC-HC, which defaults to the integrated GPU. I don't know if this overrules the Windows setting.
If it works better with MPC-HC, then you can add the BE exe names to its profile with Nvidia Profile Inspector.
Does it also happen with MPC-HC? I ask because the Nvidia driver has an application profile for MPC-HC, which defaults to the integrated GPU. I don't know if this overrules the Windows setting.
If it works better with MPC-HC, then you can add the BE exe names to its profile with Nvidia Profile Inspector.
I did a quick test and unfortunately MPC-HC situation is basically the same. (with your fork of MPC-HC 1.9.18)
Developers don't have such hardware and can't debug/test.
It looks like the system or video driver, when starting playback, does some initialization when using Intel. And it takes a long time. There is no such code in the renderer.
It looks like the system or video driver, when starting playback, does some initialization when using Intel. And it takes a long time. There is no such code in the renderer.
I agree. But EVR (and I remember madVR on my previous system) doesn't have this issue. I'll go back to EVR for now and maybe try to locate the problem afterwards. Thanks for your suggestions!
EVR uses D3D9. It also does not use the DXVA2 video processor for scaling. So test if disabling the video processor in MPCVR makes any difference. Open the Intel graphics control panel. In the video section, find the option "Contrast Enhancement" and disable that. This feature is useless, and known to cause a whole lot of problems.
@Aleksoid1978 A debug build plus DebugView tool could maybe show which part of the code has the delay?
Are you using D3D11 hardware acceleration in the video decoder? Test with DXVA2 decoding.
There was a fix in LAV Filters today that solves a startup delay with D3D11 decoding.
Enable/Disable DXVA2 options makes no difference. Also want to note that when using D3D9, there's a similar stutter when resizing videos in addition to startup, where D3D11 doesn't have. Here is a comparison by randomly resizing:
Are you using D3D11 hardware acceleration in the video decoder? Test with DXVA2 decoding.
There was a fix in LAV Filters today that solves a startup delay with D3D11 decoding.
I'm using MPC video decoder with MPC-BE, and all decoders (DXVA2, D3D11 and D3D11CB) has this problem, but NVDEC doesn't. I'll test the Intel driver and LAV filters later.
Ok I tried with latest LAV filter build (0.75.1.45-git) and its decoders. Result is similar: Only Nvidia CUVID decoder has no stutter, and even "None" (software decoder I guess) is problematic.
Turning on/off Contrast Enhancement and other various options in Intel control panel also doesn't make any differences.
As i see on screenshots, there is no issue when using D3D11 Native in decoder and D3D11 in VR.
As i see on screenshots, there is no issue when using D3D11 Native in decoder and D3D11 in VR.
Yes, if I use D3D11, there's no issue in resizing, only in starting playing. It's hard to be shown in a screenshot, since it happens before rendering videos and statistics.
But the situations are pretty similar to resizing issues in D3D9. Just wandering if the causes are related and help debugging.
Ok I use my phone to record the issue. You can see that before first start playing, the window of MPC-BE and the mouse (actually the whole screen) freezes for a while. It also happens when loading.
Hmm, normal opening.
Hmm, normal opening.
Well I forget to note that I'm moving my mouse all the time in the recording. It's not quite normal that when opening videos, the screen freezes and the cursor stops moving. And it's not happened when using EVR.
Could you provide some debug/log ways like @clsid2 suggests? I think it's hard to locate the problem by screenshots or recordings.
Here is debug version + dbgview - https://disk.yandex.ru/d/0cFtmsMD81QQdA Register this version or replace over you's. Run dbgview, then open video in MPC-BE. Close MPC-BE and save log in dbgview. Then upload here, better in .zip format.
If mouse cursor stop moving - it's something with you system, it's freeze. Software can't prevent mouse cursor from moving.
Here's the log: mpc.zip - but as you said, it seems not a problem of software.
After searching around the Internet, I found several posts about this "micro stutter" problem. The stutter is caused by dedicated GPU switching, especially when dGPU is awaked. I confimed it by installing an older Nvidia driver which keeps dGPU awaken more aggresively.
However, it's strange that neither the LAV decoder and MPCVR actually uses dGPU in this situation - they all run on Intel GPU and dGPU is just awaken at start and went back to sleep for a while, without any workloads. If the GPU goes back to sleep, the stutter comes back if a new video starts playing (and wake up dGPU again, which cause the stutter).
So, if the switching stutter is problem of driver (or system), I wonder if it's possible to avoid waking up the dGPU in MPCVR when the workloads are on Intel GPU? Or maybe an option to do that compulsively?
If it's drivers fault - close issue. I think bug in driver - when application want access to some functional(or something similar) in D3D9/D3D11, driver wake up dGPU, although it shouldn't.
Yes I think it's driver - but EVR seems to find a way to avoid it and doesn't wake up dGPU. I'll close this issue but hope there's some future improvement on it.
Between opening video and before playing, there's a stutter like one second long. In this period the display stops updating (and also the pointer), which is a bit annoying.
It seems somehow related to the Intel + Nvidia GPU setting on laptop, because when I run MPC-BE with VR on dedicated GPU, the stutter is gone. Also, the stutter doesn't happen with MPC-BE & inbuilt EVR renderer.
It should not a problem of specific system, as I had exactly the same problem on my previous laptop. However I couldn't find any solutions and discussions on Internet :(
My MPC-BE version is 1.6.0.6767, and I tested with both VR 0.5.6.1807 and 0.5.7.1812.