MP1-4100 Rework Refresh Rate when using multi monitor (1 Viewer)

vuego

Documentation Group
  • Team MediaPortal
  • August 5, 2006
    1,637
    764
    Göteborg
    Home Country
    Sweden Sweden
    I've tested v3 with MP on primary and secondary connected to both one and two graphics cards and all is perfect!
    It's also possible to play 24 and 50 Hz videos on the secondary monitor while the primary is still 60 Hz.

    Many thanks to Sebastiii (y)
     

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    Strangely, on my WIN8, running Primary screen to 60Hz and a movie @ 50Hz on secondary monitor (it where i have set to start MP), the line were flat and no stutter :) (not sure if it's placebo or Win8).

    I think that scythe42 mentioned something about that (for Win8) a while ago, so it may be a 'feature' of Win8 :)

    Win7 API is back to have decimal value for refresh rate display stats (that needed also for C++ components (MPAR ?) :) )

    Do you mean a float (as you had decimal before with the Win32 API) ?

    MPAR really needs a very accurate measurement of refresh rate (i.e. the one that EVR presenter estimates), otherwise it can create worse dropped/repeated frames (instead of making it better). So it's better to force MPAR bias to 1.0 (no correction) unless we know for sure that the video is running on the primary monitor (and MP was started there etc.). We need to disable EVR presenter vsync correction for the same reason in the 'no primary' situation as well. Of course this hopefully doesn't apply to Win8 :)

    I'm happy to make the changes to dshowhelper (for MPAR and vsync correction control), but I think it might be better for MP C# to handle the 'logic' of this - what do you think ?
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    • Thread starter
    • Moderator
    • #13
    Hi Tony,

    1- Cool if it comes from win8 :)
    2- Yes i mean float, in fact it's like old code about float (double) value, the only change that i have made, it's to get the correct screen to refresh, before it was not 100% accurate, maybe the method used is not 100% the best lol
    About MPAR, not sure if we need to change something, i mean, the Device is created @ MP start and we always keep that from C# and C++ side now.
    So for Win8 we should keep it like this because it's seems to be better than Win7 for that and maybe it will be usefull to add the check you talking for vista/win7.
    3- If you can help me, of course it will be better :) how do you think it's possible to handle it on C# side ? (add a bool on EVRINIT from c# side to tell dshowhelper that we are on vista/win7 and not in primary monitor and then force bias to 1.0 and disable EVR Presenter ?)

    Thanks :)

    So to summarize and for sure that i have correctly understand, on Win8 it seems now that we refresh the correct screen (with internal Dynamic Refresh Rate) and MPAR will run correctly.
    On win7 or lower, we need to disable EVR presenter and force the BIAS to 1 if MP is not started on primary monitor.

    That's correct ?
    Thanks :)
     
    Last edited:

    Owlsroost

    Retired Team Member
  • Premium Supporter
  • October 28, 2008
    5,540
    5,038
    Cambridge
    Home Country
    United Kingdom United Kingdom
    So to summarize and for sure that i have correctly understand, on Win8 it seems now that we refresh the correct screen (with internal Dynamic Refresh Rate) and MPAR will run correctly. On win7 or lower, we need to disable EVR presenter and force the BIAS to 1 if MP is not started on primary monitor. That's correct ?

    Yes, I think that's correct.

    EVR presenter vsync correction = off and MPAR bias = 1.0 is normal situation anyway if video and display FPS are not well matched, so we're just adding an interface to force this from MP C# when we need to.


    add a bool on EVRINIT from c# side to tell dshowhelper that we are on vista/win7 and not in primary monitor

    That would be OK - or maybe two bools - bool disableVsyncCorrection, bool disableMparCorrection ?

    Tony
     
    Last edited by a moderator:

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    • Thread starter
    • Moderator
    • #18
    Thanks Tony,

    So what left to do is :

    Adapt that part :
    Code:
    	  if (_useEvr)
    	  {
    		if (GUIGraphicsContext.currentMonitorIdx != -1)
    		{
    		  EvrInit(_scene, (uint) upDevice.ToInt32(), ref _vmr9Filter, (uint) hMonitor.ToInt32(), GUIGraphicsContext.currentMonitorIdx, false, false);
    		}
    		else
    		{
    		  EvrInit(_scene, (uint)upDevice.ToInt32(), ref _vmr9Filter, (uint)hMonitor.ToInt32(), GUIGraphicsContext.DX9Device.DeviceCaps.AdapterOrdinal, false, false);
    		}

    To fill correct bool depend of Win8 or later / Primary screen right ? :p
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    • Thread starter
    • Moderator
    • #19
    I think it's ok :)

    Code:
    if (_useEvr)
    	  {
    		if (GUIGraphicsContext.currentMonitorIdx != -1)
    		{
    		  if ((OSInfo.OSInfo.Win7OrLater() && Screen.AllScreens[GUIGraphicsContext.DX9Device.DeviceCaps.AdapterOrdinal].Primary) || OSInfo.OSInfo.Win8OrLater())
    		  {
    			EvrInit(_scene, (uint) upDevice.ToInt32(), ref _vmr9Filter, (uint) hMonitor.ToInt32(),
    					GUIGraphicsContext.currentMonitorIdx, false, false);
    		  }
    		  else
    		  {
    			EvrInit(_scene, (uint)upDevice.ToInt32(), ref _vmr9Filter, (uint)hMonitor.ToInt32(),
    					GUIGraphicsContext.currentMonitorIdx, true, true);
    		  }
    		}
    		else
    		{
    		  if ((OSInfo.OSInfo.Win7OrLater() && Screen.AllScreens[GUIGraphicsContext.DX9Device.DeviceCaps.AdapterOrdinal].Primary) || OSInfo.OSInfo.Win8OrLater())
    		  {
    			EvrInit(_scene, (uint) upDevice.ToInt32(), ref _vmr9Filter, (uint) hMonitor.ToInt32(),
    					GUIGraphicsContext.DX9Device.DeviceCaps.AdapterOrdinal, false, false);
    		  }
    		  else
    		  {
    			EvrInit(_scene, (uint)upDevice.ToInt32(), ref _vmr9Filter, (uint)hMonitor.ToInt32(),
    					GUIGraphicsContext.DX9Device.DeviceCaps.AdapterOrdinal, true, true);
    		  }
    		}
    		hr = new HResult(graphBuilder.AddFilter(_vmr9Filter, "Enhanced Video Renderer"));
    		Log.Info("VMR9: added EVR Renderer to graph");
    	  }

    On Above code :

    If we are on win7 and MP on primary screen or if we run Win8 : we don't disable Vsync and bias otherwise if win7 and MP is not on primary screen, Vsync and bias are disable :)
     

    Sebastiii

    Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    • Thread starter
    • Moderator
    • #20
    Tony,

    I have rebase the branch with the VMR9.cs change and added Jira issue Key :)
    Thanks :)
     

    Users who are viewing this thread

    Top Bottom