View Full Version : madVR - high quality video renderer (GPU assisted)
Asmodian
18th October 2021, 02:30
I am still thinking there must be some API function that could automatically reset the bug on MPC-HC exit. Something that does the equivalent to dragging a window around, such as rendering a few frames of video at a higher rate?
Creating a workaround for a buggy Windows 7 DWM + specific driver is very unlikely at this point in the life cycle. :p
Trying different GPU drivers is what I would do, if I wanted to stay on 7.
DMU
18th October 2021, 09:31
A "trick" to help with the bandwidth situation is to disable 10/16-bit output formats in LAV Video Decoder settings. Then it will convert 10-bit stuff to 8-bit. That costs a little CPU usage, but reduces the required bandwidth by half.
And thus, 10-bit uses twice as much memory as 8-bit, because its really 16-bit with 6 empty bits.
Thanks for the easy-to-understand and complete explanation!
I have not yet been able to reduce the bandwidth by changing the Output Formats in the LAV. Am I missing something?
Pic. (https://drive.google.com/file/d/1gq0MsBQN83gwq2GbVUw_5KLkwy_UuyEN/view?usp=sharing)
huhn
18th October 2021, 10:42
it only cuts the load for upload in half which is not that much compared to other processing which is also done on the dram on an APU.
DMU
18th October 2021, 11:33
Then there is no point in this "trick". A much more efficient solution to reduce bandwidth is to "use 10bit chroma/image buffer instead of 16bit".
thighhighs
18th October 2021, 12:01
b) tick "restore original display mode ... when media player is closed"
What happens "when media player leaves fullscreen"? Same problem?
flossy_cake
18th October 2021, 12:38
What happens "when media player leaves fullscreen"? Same problem?
Yeah.
clsid
18th October 2021, 13:51
Then there is no point in this "trick". A much more efficient solution to reduce bandwidth is to "use 10bit chroma/image buffer instead of 16bit".No, it actually is a very useful general trick, and it has helped several people solve issues. In case of madVR of course additional tweaks can be used.
Your graphs might only be showing direct CPU=>DRAM transfers, and not CPU=>GPU(=>DRAM).
huhn
18th October 2021, 14:24
if this would be for ram bandwidth not bus "PCIe" bandwidth maybe.
this is to lower the load on the connection between GPU and CPU not the ram the ram is in a totally different league compared to the bus.
flossy_cake
18th October 2021, 14:25
Is the "1 repeat frame every x minutes" on Ctrl+J accurate?
I fine-tuned my refresh rate with CRU so that my display rate on Ctrl+J is 23.97605hz, but when playing a 23.976 video it's saying "1 repeat frame every 12 minutes" which seems way too often.
By my calculation it should be something like 1/(23.97605-23.976) = 1 repeat frame every 20,000 seconds (5.5 hours).
Also should I trust the reported display rate on Ctrl+J, because I noticed it has a discrepancy of about 0.003hz vs the rate reported in Radeon Settings. Doesn't sound like much but it would amount to a repeat frame every 5.5 minutes.
ashlar42
18th October 2021, 15:21
Is the "1 repeat frame every x minutes" on Ctrl+J accurate?
I fine-tuned my refresh rate with CRU so that my display rate on Ctrl+J is 23.97605hz, but when playing a 23.976 video it's saying "1 repeat frame every 12 minutes" which seems way too often.
By my calculation it should be something like 1/(23.97605-23.976) = 1 repeat frame every 20,000 seconds (5.5 hours).
Also should I trust the reported display rate on Ctrl+J, because I noticed it has a discrepancy of about 0.003hz vs the rate reported in Radeon Settings. Doesn't sound like much but it would amount to a repeat frame every 5.5 minutes.
Here I provided (thanks to madshi info) a general explanation of what you are experiencing. You must not aim for perfect 24/1.001, the target refresh rate depends on how much they audio clock is out of sync with video clock.
https://forum.doom9.org/showthread.php?t=173571
DMU
18th October 2021, 16:14
Your graphs might only be showing direct CPU=>DRAM transfers, and not CPU=>GPU(=>DRAM).
GPU-Z (https://drive.google.com/file/d/1cCSB_eYaAxkcAJK-qlRuzMyQbEAJkJRK/view?usp=sharing)
huhn
19th October 2021, 00:50
you have 16 lanes of PCIe 3.0 an intel iGPU from 2013 doesn't not even close to it.
while this test will show the bus speed it does not hammer it.
flossy_cake
19th October 2021, 04:41
Here I provided (thanks to madshi info) a general explanation of what you are experiencing. You must not aim for perfect 24/1.001, the target refresh rate depends on how much they audio clock is out of sync with video clock.
https://forum.doom9.org/showthread.php?t=173571
Thank you, and I can confirm it works as you describe.
It turns out my 23.976hz and 50.0hz modes are already well tuned from factory, with Ctrl+J reporting 1 repeat frame every 2-4 hours. So I didn't need to tweak those modes.
However my 59.94hz mode is reporting 1 dropped frame every 3 minutes with 59.94fps video, so I need to speed up the refresh rate a bit.
This is where I ran into trouble as it seems the AMD driver or monitor only allows me tuning +/-0.003hz, otherwise it just falls back to the default timing. So the most I could achieve was 59.943hz which reports 1 repeat frame every 1.5 hours. Not great, but tolerable.
Curiously, the value first starts out at 1 repeat every 10 minutes, then gradually starts climbing until after ~2 minutes of playback it starts reporting 1-2 hours. But then sometimes it goes back down again to around 30 minutes for no apparent reason. All the while the display rate remains consistent, so I'm guessing it's the audio or system clock that is fluctuating.
I'm sure I could improve this if the driver/monitor allowed more than +/-0.003hz tuning, however I think it may be limited to this narrow range as it's a HDMI mode (1080p YCbCr 4:4:4) and maybe HDMI has strict timing requirements?
DMU
19th October 2021, 17:51
you have 16 lanes of PCIe 3.0 an intel iGPU from 2013 doesn't not even close to it.
I doubt that in the case of the iGPU, the quality and number of PCIe lanes matters. The iGPU is connected to the CPU using Infinity Fabric (AMD) or the Ring Bus (Intel). In both cases, the bandwidth of such a connection will be much larger than that of an external PCIe. And the DRAM bandwidth will be the bottleneck.
ashlar42
19th October 2021, 23:32
This is where I ran into trouble as it seems the AMD driver or monitor only allows me tuning +/-0.003hz, otherwise it just falls back to the default timing. So the most I could achieve was 59.943hz which reports 1 repeat frame every 1.5 hours. Not great, but tolerable.
This is why in the guide I use CRU. To have more control on those things... although I've been an Nvidia user for a very long time, don't know how AMD works with it.
I am glad you found the guide at least somehow useful. I should rewrite it but I never find the time.
flossy_cake
20th October 2021, 02:14
This is why in the guide I use CRU. To have more control on those things... although I've been an Nvidia user for a very long time, don't know how AMD works with it.
I am using CRU. So if I go further than +/-0.003hz in CRU, the actual display rate -- as reported in Ctrl+J and Radeon Settings -- just falls back to the default 59.940hz timing.
I suspect it's because the HDMI 1080p mode I'm using isn't a "PC mode" but rather a "TV mode", and perhaps TV mode rates are more strictly standardised by HDMI spec.
I am limited to "TV mode" HDMI signal as otherwise my TV thinks it's a "PC mode" and disables a lot of picture controls and uses different processing which I don't like. edit: and I'm pretty sure the TV's 24hz mode wouldn't work either unless it's the specific TV mode HDMI 1080p24hz signal.
huhn
20th October 2021, 09:29
don't use the HZ to fine tune use the image "size".
flossy_cake
20th October 2021, 13:30
There appears to be a serious bug related to the "composition rate" used by MadVR, which can cause intense frame rate stuttering in many scenarios.
The issue appears that "composition rate" gets stuck at the rate used by the previously played file.
So the workaround I'm using which seems to be effective, is to set MadVR to D3D9, which then allows desktop compositor to be auto disabled.
So now when I double click a video file, MPC-HC opens it automatically in full screen, in MadVR exclusive mode, with desktop compositor disabled.
Then after exiting the video, MadVR reinstates desktop compositor, and compositor appears to be running at full frame rate, thus bypassing the compositor bug.
The relevant MadVR settings are in rendering > general settings:
- tick: enable automatic fullscreen exclusive mode
- tick: disable desktop composition
- untick: use Direct3D 11 for presentation
For convenience I'm also setting rendering > exclusive mode > untick delay switch to exclusive mode by 3 seconds.
In theory this configuration should be compatible with Kodi, but I haven't tested it yet.
ashlar42
20th October 2021, 22:07
I am using CRU. So if I go further than +/-0.003hz in CRU, the actual display rate -- as reported in Ctrl+J and Radeon Settings -- just falls back to the default 59.940hz timing.
I suspect it's because the HDMI 1080p mode I'm using isn't a "PC mode" but rather a "TV mode", and perhaps TV mode rates are more strictly standardised by HDMI spec.
I am limited to "TV mode" HDMI signal as otherwise my TV thinks it's a "PC mode" and disables a lot of picture controls and uses different processing which I don't like. edit: and I'm pretty sure the TV's 24hz mode wouldn't work either unless it's the specific TV mode HDMI 1080p24hz signal.
I've found this useful, can't promise the same for you, but have a look: https://www.extron.com/product/videotools.aspx
You can select both PC (VESA) timings and HDMI (SMTPE) timings. If you use the advanced tab, you have all the details and work it out from there.
zveroboy
22nd October 2021, 19:40
madVR can`t switch the display modes.
--------------------
madVR 141
Win 11 22000.258
NVIDIA ForceWare 496.13 DCH
================
There are no problems with switching modes on another configuration:
Win 10 19043.1200
NVIDIA ForceWare 472.12 Standart
Asmodian
23rd October 2021, 03:50
It works for me. :confused:
madVR v0.92.17
Win 11 22000.282
NVIDIA 496.13 DCH
zveroboy
23rd October 2021, 04:38
it`s strange...
maybe cos of .282 ?
Asmodian
23rd October 2021, 05:04
Check for updates? I did get an update yesterday.
zveroboy
23rd October 2021, 05:16
I will update next week (as I guess) and post result here.
Rippner
23rd October 2021, 14:56
madVR can`t switch the display modes.
--------------------
madVR 141
Win 11 22000.258
NVIDIA ForceWare 496.13 DCH
same problem! also, no hdr switch
madVR v0.92.17
Win 11 22000.282
NVIDIA 496.13 DCH
ashlar42
23rd October 2021, 14:56
Envy starting to get interesting feature absent from madVR. The 1D Lut thing is something I'd be happy to pay for madshi in order for it to be added to madVR, if you'll ever read this.
zveroboy
23rd October 2021, 20:12
same problem! also, no hdr switch
madVR v0.92.17
Win 11 22000.282
NVIDIA 496.13 DCH
is the StartAllBack installed?
zveroboy
23rd October 2021, 23:26
same problem!
I meant switching the refresh rates (23Hz, 24Hz, 50Hz, 59Hz, 60Hz).
We're talking about the same thing, I hope?
Asmodian
24th October 2021, 00:49
I meant refresh rates as well.
But HDR switching does work for me too, as long as I make the video fullscreen.
Rippner
24th October 2021, 00:58
is the StartAllBack installed?
nope
I meant switching the refresh rates (23Hz, 24Hz, 50Hz, 59Hz, 60Hz).
We're talking about the same thing, I hope?
yes refresh rate :D
zveroboy
24th October 2021, 01:46
Asmodian
Rippner
2-monitors config (extended display mode) ?
Rippner
24th October 2021, 03:00
Asmodian
Rippner
2-monitors config (extended display mode) ?
show only on 1
I use my aoc 24 for daily use and lg cx for movies
zveroboy
24th October 2021, 04:01
Rippner
Hmm...
It seems the issue at madVR side.
Asmodian
24th October 2021, 04:30
2-monitors config (extended display mode) ?
No, only one display (LG CX).
flossy_cake
24th October 2021, 07:17
I've found this useful, can't promise the same for you, but have a look: https://www.extron.com/product/videotools.aspx
You can select both PC (VESA) timings and HDMI (SMTPE) timings. If you use the advanced tab, you have all the details and work it out from there.
Thanks. According to that website it appears that:
SMPTE/CTA/DCI = "Automatic (HDTV)" in CRU = what I referred to as "TV mode"
VESA = "CVT standard" in CRU = what I referred to as "PC mode"
Unfortunately I cannot use PC mode timings otherwise my TV uses different, unsatisfactory video processing and locks out a lot of the picture controls, and no 24/50hz modes either.
So I am stuck with TV mode timings which appear limited to +/-0.003hz from the spec. I am not sure if this is my display's fault or the GPU driver not allowing it.
This is not a huge problem as the worst case scenario is Ctrl+J reporting a repeated frame every 2 hours, which means at most a dropped frame for a movie.
By the way, is it possible to map the Ctrl+J debug screen to a mouse button, such as middle click, or double click right mouse button? I'm just using a mouse only for HTPC operation in the lounge room, and I don't want the burden of a keyboard. MadVR's keyboard shortcuts section only seems to allow key combinations, whereas MPC-HC allows mouse clicks, but they can't be mapped to MadVRs Ctrl+J debug screen, only "OSD: display renderer statistics" which is a different, unrelated screen.
________________________________________________________
On a separate note, I'm having trouble understanding why HDR is so much more system intensive than SDR -- can anyone shed some light on this?
For example I have this Peru8k clip which is 4k60 in SDR. It plays flawlessly without any dropped frames on my i5-4570 + R9 380 system.
But 4k60 HDR clips are not playable -- my system struggles to render frames very slowly with constant pausing and breaks in audio. CPU is pegged at around 70% so doesn't seem to be a CPU issue -- maybe memory bandwidth issue? GPU is doing very little, some bursts of 50% usage every now and then, but mostly at 0% -- I presume this means it's not doing hardware decoding and everything is being done by CPU -- consistent with R9 380 being an old card that wouldn't be capable of HEVC decoding presumably. On my GTX 1070 system, GPU usage is pegged at 50% so I'm assuming that's the GPU's HEVC decoding taking a large portion of the load, and I get smooth playback.
Is 4k60 HDR really that much more system intensive than 4k60 SDR? I can't imagine it being that much more intensive, with maybe some higher bit depth render targets and an additional tonemap pass for the HDR to SDR conversion. Surely that can't be the difference between perfect playback and being totally unplayable? :scared:
Asmodian
24th October 2021, 07:25
Is 4k60 HDR really that much more system intensive than 4k60 SDR? I can't imagine it being that much more intensive, with maybe some higher bit depth render targets and an additional tonemap pass for the HDR to SDR conversion. Surely that can't be the difference between perfect playback and being totally unplayable? :scared:
Yes, that tone mapping can be VERY intensive. Adjust HDR tone mapping options to improve performance or turn off tone mapping to see how much impact it has.
flossy_cake
24th October 2021, 08:06
Yes, that tone mapping can be VERY intensive. Adjust HDR tone mapping options to improve performance or turn off tone mapping to see how much impact it has.
Thanks, I've tried just now turning off HDR tone mapping in MadVR ("passthrough hdr to display"). This results in the expected "washed out" image when presented as SDR at the display. I observe no effect on performance on my system (i5-4570 + R9 380).
I've dabbled a bit with 2D pixel shaders in ReShade, and this seems like it wouldn't be particularly GPU intensive. It should only be a few lines of shader code at most, and the GPU has lots of cores to do it all in parallel to every pixel. In ReShade I'm seeing around 1-3% increase in GPU load from applying various tonemap shaders. However some tonemap shaders are much more GPU expensive so I guess the devil is in the details.
My GPU usage during playback is a bit curious:
https://i3.lensdump.com/i/gdNTyC.png
Asmodian
24th October 2021, 09:58
That means you cannot decode the video fast enough. Is one HEVC and one AVC? You can probably use hardware decoding for the SDR one, but cannot for the HDR one. Look at CPU usage for both files.
flossy_cake
24th October 2021, 12:39
That means you cannot decode the video fast enough. Is one HEVC and one AVC? You can probably use hardware decoding for the SDR one, but cannot for the HDR one. Look at CPU usage for both files.
Peru 4k60 SDR clip
VP9, 24mbps, CPU 65%, GPU 0% but occasionally spiking to 100%
LG 4k60 HDR clip
HEVC, 60mbps, CPU 70%, GPU 0% but occasionally spiking to 50%
I guess it's to do with VP9 vs HEVC and the bit rate?
And I suppose the fluctuating GPU usage means it's NOT doing hardware decoding, since on my other PC which uses a GTX 1070 -- which supports HEVC & VP9 -- the GPU usage is pegged at a constant 50% during playback.
goldfield
24th October 2021, 14:26
Thanks. According to that website it appears that:
But 4k60 HDR clips are not playable -- my system struggles to render frames very slowly with constant pausing and breaks in audio. CPU is pegged at around 70% so doesn't seem to be a CPU issue -- maybe memory bandwidth issue? GPU is doing very little, some bursts of 50% usage every now and then, but mostly at 0% -- I presume this means it's not doing hardware decoding and everything is being done by CPU
I don't know that much about the technology.
But for a long time I also had the problem, up to 4K / 60Hz everything ran smoothly, but 4K / 60Hz even had severe problems.
After a hint in the German Hifi-Forum I switched from D3D11 (copyback) to D3D11 (native) in the LAV-Filters under "Hardware device to use", and that means that 4K / 60Hz works fine for me.
Maybe it will solve the problem for you too.
But it is well known that deinterlacing and black bar detection do not work with D3D11 (native).
huhn
24th October 2021, 14:34
you can disable hardware acceleration for none 4K sources or none HEVC/VP9/AV1 sources.
but he is talking about video decoder they don't really use the GPU and even if hardware decoding is used ot not the GPU load should still be anything but 0%.
flossy_cake
24th October 2021, 15:15
After a hint in the German Hifi-Forum I switched from D3D11 (copyback) to D3D11 (native) in the LAV-Filters under "Hardware device to use", and that means that 4K / 60Hz works fine for me.
Maybe it will solve the problem for you too.
4k60 does actually work perfect for me, but in SDR only. I am trying to figure out why HDR brings my video playback to a crawl.
I had already tried playing with that LAV video decoder setting you mentioned, to no effect. I believe it relates to the GPU hardware decoding, which may not be relevant since my AMD GPU doesn't appear to support it based on the GPU usage pattern during video playback.
Is there a status debug screen somewhere that tells us whether GPU hardware decoding is in effect?
edit: oh it's there in the LAV video decoder screen:
https://i1.lensdump.com/i/gdUviP.png
So I'm getting GPU decoding on my 1070 but not my R9 380.
I guess the CPU decoding of HEVC is very intensive and too much for an i5-4570. But VP9 is doable for some reason.
lvqcl
24th October 2021, 15:27
4k60 does actually work perfect for me, but in SDR only.
Does it mean that your system can play 4K60 HEVC videos? What about 4K60 HEVC 10-bit (SDR)?
You can test it with jellyfish test videos from https://jell.yfish.us/
Also you can download 4K60 VP9 HDR videos from Youtube. VP9 requires much less CPU to decode than HEVC.
flossy_cake
24th October 2021, 16:28
Does it mean that your system can play 4K60 HEVC videos? What about 4K60 HEVC 10-bit (SDR)?
You can test it with jellyfish test videos from https://jell.yfish.us/
Also you can download 4K60 VP9 HDR videos from Youtube. VP9 requires much less CPU to decode than HEVC.
So on my i5-4570 + R9 380 system, the jellyfish 4k30 8-bit h.264 video plays effortlessly with very low CPU and GPU usage. LAV reports GPU decoding active, which I expect from the R9 380.
The jellyfish 4k30 10-bit HEVC file grinds the system to a halt with 100% CPU usage and stuttering video. LAV reports no GPU decoding active, which is to be expected for the old R9 380.
Peru 4k60 8-bit VP9 plays flawlessly with 65% CPU usage and no GPU decoding active.
LG 4k60 10-bit HEVC grinds to a stutter with 70% CPU usage and no GPU decoding.
So SDR/HDR had nothing to do with it.
It seems that 4k 10-bit HEVC is processor intensive and needs GPU decoding for smooth playback, which R9 380 doesn't support. I tested this also by disabling GPU decoding on my higher spec i7-4790k + GTX 1070, and got the same stuttery result.
The real surprise is that 4k60 8-bit VP9 is fine without GPU decoding and a mediocre CPU. I guess that is a testament to the efficiency of VP9.
One thing I have yet to try is the LAV GPU decoding setting "D3D11", however I cannot try it as I am using Win7 and it requires 8+.
I suspect an upgrade to Win10 might do the trick and get 4k 10-bit HEVC playable on the R9 380.
DMU
24th October 2021, 16:57
Or if anyone knows a workaround to get D3D11 decoding from LAV under Win7, please advise.
Try this trick (https://forum.doom9.org/showthread.php?p=1951532#post1951532)first.
lvqcl
24th October 2021, 17:16
One thing I have yet to try is the LAV GPU decoding setting "D3D11", however I cannot try it as I am using Win7 and it requires 8+.
I suspect an upgrade to Win10 might do the trick and get 4k 10-bit HEVC playable on the R9 380.
According to https://en.wikipedia.org/wiki/Radeon_Rx_300_series#Desktop_models and https://en.wikipedia.org/wiki/Graphics_Core_Next#third your R9 380 is based on Tonga GPU which has UVD 5.0. And according to https://en.wikipedia.org/wiki/Unified_Video_Decoder#UVD_5 there's no hardware support for HEVC or VP9 in it.
You need UVD 6.0 for h/w decoding of 8-bit HEVC, UVD 6.3 for h/w decoding of 10-bit HEVC and VCN 1.0 for h/w decoding of VP9.
lvqcl
24th October 2021, 17:21
Also: do you use 32-bit or 64-bit video player?
Rippner
24th October 2021, 17:49
Rippner
Hmm...
It seems the issue at madVR side.
today i tried again, now the frequency changes. I don't know why lol still no hdr
but i found another problem: when i switch to the second screen, the exclusive mode no longer works
zveroboy
24th October 2021, 18:31
No, only one display (LG CX).
I`m using a dual display configuration.
1 - default: Asus VG259QM
2 - extended: Panasonic TX-P55ST60
madVR can switch a modes for default display only, but for extended display it can`t.
flossy_cake
24th October 2021, 19:31
Try this trick (https://forum.doom9.org/showthread.php?p=1951532#post1951532)first.
Thanks, but no effect.
I am pretty certain the issue is that 4k HEVC decoding is simply too expensive for CPU, as demonstrated by CPU decoding still being too slow on my i7-4790k which is not a weak CPU.
You need UVD 6.0 for h/w decoding of 8-bit HEVC, UVD 6.3 for h/w decoding of 10-bit HEVC and VCN 1.0 for h/w decoding of VP9.
Correct me if I'm wrong, but I seem to get the impression that LAV's D3D11 decoding option may be compatible with any GPU that supports D3D11?
Also: do you use 32-bit or 64-bit video player?
64-bit.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.