mpc-hc icon indicating copy to clipboard operation
mpc-hc copied to clipboard

Occasional hangs on seek or after extended pause using D3D11 hardware decoder with MadVR

Open ehoogeveen-medweb opened this issue 3 years ago • 8 comments

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).

ehoogeveen-medweb avatar Sep 07 '21 14:09 ehoogeveen-medweb

@nevcairiel Can you check this hang issue? I can provide the build+pdb files if needed.

d3d11hang_thread1 d3d11hang_thread2 d3d11hang_data1 d3d11hang_data2 d3d11hang_data3

clsid2 avatar Sep 07 '21 14:09 clsid2

Most likely a madVR thing how it eats up buffers and doesn't give them back

Nevcairiel avatar Sep 07 '21 14:09 Nevcairiel

@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.

clsid2 avatar Sep 07 '21 15:09 clsid2

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 avatar Sep 07 '21 15:09 ehoogeveen-medweb

@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.

clsid2 avatar Dec 26 '21 15:12 clsid2

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).

ehoogeveen-medweb avatar Jan 18 '22 20:01 ehoogeveen-medweb

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.

ehoogeveen-medweb avatar Jan 23 '22 19:01 ehoogeveen-medweb

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.

clsid2 avatar Jan 23 '22 19:01 clsid2