[Videos] Adding madVR support (2 Viewers)

Owlsroost

Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    That is already done by MP's own custom EVR renderer when A/V clocks match 1:1.
    Theoretically MPC-HC's internal renderers do that, too. But my users report that madVR still does it better than any other renderer. Furthermore some madVR users have CRTs with high refresh rates (e.g. 120Hz) and only madVR achieves smooth playback in that situation, according to what my users report.

    On my own HTPC with integrated NVidia 9400 GPU, I'm only getting smooth playback with madVR, when playing 25fps movies @ 50Hz. All other renderers I've tried so far fail miserably.

    Have you tried MP 1.2.0 beta ?

    Tony
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    On my own HTPC with integrated NVidia 9400 GPU, I'm only getting smooth playback with madVR, when playing 25fps movies @ 50Hz. All other renderers I've tried so far fail miserably.

    Getting off topic, but lets allow that for a visiting developer :)

    Could it be possible that when using madVR the interlacing is not done on HW and therefore GPU will have much more resources to handle the actual rendering? Many on-board GPUs are having trouble with 1080i content since their deinterlacing power is insufficient. Or is it really the 1:2 fps to refresh rate that the renderers you have been testing / using what they are incapable?

    What comes to 25i or 25p movies @ 50 Hz I haven't seen any issues with MP's internal renderer when it comes to frame scheduling. Watching few hours per day such content.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Oh, an in addition to that previous post - any volunteers to start to work with the madVR integration?
     

    madshi

    Portal Member
    August 13, 2011
    10
    2
    Home Country
    Germany Germany
    Could it be possible that when using madVR the interlacing is not done on HW and therefore GPU will have much more resources to handle the actual rendering? Many on-board GPUs are having trouble with 1080i content since their deinterlacing power is insufficient. Or is it really the 1:2 fps to refresh rate that the renderers you have been testing / using what they are incapable?
    The 50i movies I'm watching are all h264 European broadcasts, which are all perfectly flagged, so a simple "weave" does the trick to get perfect 25p playback. This is all done via software, the GPU only has to render 25p frames. I've setup CoreAVC to output 25p via weave. That applies to all renderers I've tested.

    What comes to 25i or 25p movies @ 50 Hz I haven't seen any issues with MP's internal renderer when it comes to frame scheduling. Watching few hours per day such content.
    I think a lot depends on which GPU you're using. Are you using ATI or NVidia? Based on feedback from madVR users it seems that ATI has less problems in this area. Personally, the only way to get 25p playback to be perfectly smooth with my HTPC is to use fullscreen exclusive mode and presenting multiple frames in advance (in exclusive mode "ID3D.Present()" does not block, so you can present multiple frames in advance). In every other mode playing back 25p movies with 50Hz is not perfectly smooth on my HTPC. It's "ok", but not perfect. When presenting multiple frames in advance in exclusive mode, I'm getting pretty much perfectly smooth results.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Could it be possible that when using madVR the interlacing is not done on HW and therefore GPU will have much more resources to handle the actual rendering? Many on-board GPUs are having trouble with 1080i content since their deinterlacing power is insufficient. Or is it really the 1:2 fps to refresh rate that the renderers you have been testing / using what they are incapable?
    The 50i movies I'm watching are all h264 European broadcasts, which are all perfectly flagged, so a simple "weave" does the trick to get perfect 25p playback. This is all done via software, the GPU only has to render 25p frames. I've setup CoreAVC to output 25p via weave. That applies to all renderers I've tested.

    In that case the deinterlace shouldn't be the issue. I use HW based deinterlace for 50i to create 50p as end result. Other 25 fps content is 23.976 speed up to 25 fps by MP audio renderer - I know not optimal solution, but haven't got money to upgrade the TV and beamer to support 23.976 natively.

    What comes to 25i or 25p movies @ 50 Hz I haven't seen any issues with MP's internal renderer when it comes to frame scheduling. Watching few hours per day such content.
    I think a lot depends on which GPU you're using. Are you using ATI or NVidia? Based on feedback from madVR users it seems that ATI has less problems in this area. Personally, the only way to get 25p playback to be perfectly smooth with my HTPC is to use fullscreen exclusive mode and presenting multiple frames in advance (in exclusive mode "ID3D.Present()" does not block, so you can present multiple frames in advance). In every other mode playing back 25p movies with 50Hz is not perfectly smooth on my HTPC. It's "ok", but not perfect. When presenting multiple frames in advance in exclusive mode, I'm getting pretty much perfectly smooth results.

    HTPC has Nvidia GT9500 and dev PC Nvidia GT220. In both PCs smooth playback without the exclusive mode / rendering in advance.
     

    madshi

    Portal Member
    August 13, 2011
    10
    2
    Home Country
    Germany Germany
    HTPC has Nvidia GT9500 and dev PC Nvidia GT220. In both PCs smooth playback without the exclusive mode / rendering in advance.
    That's good. Maybe MediaPortal's renderer does a better job than MPC-HC. Or maybe your GPUs are better than the integrated 9400 I'm using. For madVR things are a bit more difficult because I'm doing a lot of work in pixel shaders, which can take up to 1 video frame (40ms with 25p) processing time. I've found that when the pixel shader processing takes longer than 1 VSync interrupt (20ms with 50Hz), current NVidia drivers sometimes run into trouble achieving smooth playback. If your renderer gets along with less than 20ms GPU processing time per frame you probably have an easier life achieving smooth playback.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    HTPC has Nvidia GT9500 and dev PC Nvidia GT220. In both PCs smooth playback without the exclusive mode / rendering in advance.
    That's good. Maybe MediaPortal's renderer does a better job than MPC-HC. Or maybe your GPUs are better than the integrated 9400 I'm using.

    I think 9500 is a bit beefier GPU than the integrated 9400. Althou I cannot remember that 9400 owners would have been complaining about stuttering / juddering. But maybe there aren't that many 9400 owners in MediaPortal users or maybe the ones who own it wont notice the juddering / stuttering etc.

    For madVR things are a bit more difficult because I'm doing a lot of work in pixel shaders, which can take up to 1 video frame (40ms with 25p) processing time. I've found that when the pixel shader processing takes longer than 1 VSync interrupt (20ms with 50Hz), current NVidia drivers sometimes run into trouble achieving smooth playback. If your renderer gets along with less than 20ms GPU processing time per frame you probably have an easier life achieving smooth playback.

    Currently there is no pixel shaders usage at all in MP's renderer - I would love to add some scaling and some chroma upsampling for example but you know, there is just not enough free time around. And it doesn't help at all when there are other DS components as well (I haven't worked with the video renderer for about a year at least, probably even much more).

    About that > 20 ms pixel shader time. How much over 20 ms it is? I don't know the GPU's internals (at all) - maybe the drivers or GPU are only able to process a batch that fits into the one v-sync period for some strange reason? Maybe some texture locking or other comes into way to block the rendering pipeline. Have you tried to make sure that the pixel shader processing is started as close to the v-sync target as possible? Just to see if it changes the behavior at all.
     

    madshi

    Portal Member
    August 13, 2011
    10
    2
    Home Country
    Germany Germany
    About that > 20 ms pixel shader time. How much over 20 ms it is?
    It can be up to 39.9ms. Theoretically playback can be fluid as long as the render time is lower than the movie frame rate. Well, unless the GPU driver drops the ball, of course, as it happens on my 9400 HTPC. The render time depends very much on the movie and display resolution and on which scaling algorithm you're using. 4-tap Lanzcos is of course much slower than 2-tap Bicubic.

    I don't know the GPU's internals (at all) - maybe the drivers or GPU are only able to process a batch that fits into the one v-sync period for some strange reason? Maybe some texture locking or other comes into way to block the rendering pipeline.
    Yes, it must be some kind of locking problem, I guess. NVidia users are telling me that it didn't occur with very old drivers, so it seems to be a relatively new problem.

    Have you tried to make sure that the pixel shader processing is started as close to the v-sync target as possible? Just to see if it changes the behavior at all.
    I've added all sorts of "tweaking options" to madVR. One of them makes sure that rendering is only performed in a specific vsync scanline range. These tweaks do help reducing the problem. However, limiting the time during which rendering can be performed of course also lowers the rendering performance. And this tweak isn't 100% reliable, either. What seems to work best is to create two separate D3D devices, one for rendering and one for presentation. In Vista/Win7 D3D resources can be shared between different D3D devices. This way it seems I can work around most of the locking problem. It's not still 100% perfect, though. Some users have to combine several tweak options to get perfectly smooth playback.
     

    Users who are viewing this thread

    Top Bottom