mpc-hc
mpc-hc copied to clipboard
Occasional hangs on seek or after extended pause using D3D11 hardware decoder with MadVR
As mentioned in #1285, when using the D3D11 hardware decoder occasionally the whole player hangs. The hangs aren't reproducible (if I reopen the same video and try to skip around it usually doesn't hang) but I think they happen more often with videos downloaded using youtube-dl/yt-dlp.
Here's a process dump made using task manager while the process was hanging: https://mega.nz/file/3Y021LAR#GXOZsNEC0YHenA9iC43XAbMYjhOfX-EcHOO3Sx7OLRg
The video file itself is a bit big, but I downloaded it from https://www.youtube.com/watch?v=ySJslFpo91U (I can give you the yt-dlp settings if it would be helpful).
MPC-HC version: 1.9.15.56
(64-bit)
DirectShow video: madVR
(currently using tone mapping test build 140 but it happens with the official release as well)
OS: 64-bit Windows 10 21H1
GPU: Nvidia GeForce RTX 3080
(also happens on my laptop with a GTX 1060)
GPU driver version: 471.96
(also happens with older drivers)
This isn't a recent regression - I think I've had this problem ever since the D3D11 mode was added, but for a while I thought it was an issue with my laptop (but it happens on my desktop PC as well).
@nevcairiel Can you check this hang issue? I can provide the build+pdb files if needed.
Most likely a madVR thing how it eats up buffers and doesn't give them back
@madshi This hang can happen when resuming playback after a long pause or hibernation. Does madVR do anything special in that situation, like possibly doing some kind of re-init? You might be forgetting to flush sample buffers somewhere.
FWIW, this particular hang happened just from seeking: I was distracted for a while and wanted to go back a few minutes in the video to see what I missed. I think the hangs after a long pause only started after the workaround was added to force a reinitialization by seeking after a long pause.
@ehoogeveen-medweb Does the hang after seek issue still exist in latest version?
Development of madvr is inactive for the time being, so try MPCVR instead.
Sorry about the delay. I'll enable the D3D11 hardware decoder in the LAV Video Decoder configuration again and see if I still get hangs (I'll test with 1.9.18.50 and later in case the recent LAV filters changes make a difference).
Unfortunately it still seems to randomly hang on seeking. I use 3DLUTs so I don't know if I can use MPCVR, but I'll have a look.
MPCVR does not support 3DLUT.
If you have increased queue sizes in madvr settings, then reset them to default values. Large queues can cause issues with D3D11.