[other] Problems with dropping frames with EVR (3 Viewers)

Scythe42

Retired Team Member
  • Premium Supporter
  • June 20, 2009
    2,065
    2,703
    51
    Berlin
    Home Country
    Germany Germany
    Re: AW: Re: AW: Problems with dropping frames with EVR

    my graphs are all perfectly smooth now with fanart plugin disabled.
    Some process plugins really steal a lot of CPU power. HTPCInfo was another candidate, but the author changed some things so that you now can configure if the plugins runs during playback and how often it tries to update information. Would be nice seeing other authors follow this and make sure their plugins don't interfere with playback on slower CPUs.

    In general when you do testing for playback quality you should disable all plugins that didn't come with MP to make sure none of them is hogging the CPU.
     

    nyt

    Retired Team Member
  • Premium Supporter
  • October 15, 2009
    199
    48
    Home Country
    United States of America United States of America
    Re: AW: Re: AW: Problems with dropping frames with EVR

    my graphs are all perfectly smooth now with fanart plugin disabled.
    Some process plugins really steal a lot of CPU power. HTPCInfo was another candidate, but the author changed some things so that you now can configure if the plugins runs during playback and how often it tries to update information. Would be nice seeing other authors follow this and make sure their plugins don't interfere with playback on slower CPUs.

    In general when you do testing for playback quality you should disable all plugins that didn't come with MP to make sure none of them is hogging the CPU.

    thought I had it disabled. It's not even a slow cpu, dual core pentium @ 2.8 ghz. it really eats it up tho for some reason. not sure what its doing.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Re: AW: Re: AW: Problems with dropping frames with EVR

    my graphs are all perfectly smooth now with fanart plugin disabled.

    grrr... didn't we tell the 3rd party plugins need to be disabled? Makes me really angry when I have to spend wasted hours when people cannot read a simple instructions provided (I have been writing at least ten times in different posts and threads that if you are using 3rd party plugins or even skins, dont bother us with video palyback quality issues).
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Re: AW: Re: AW: Problems with dropping frames with EVR

    my graphs are all perfectly smooth now with fanart plugin disabled.
    Some process plugins really steal a lot of CPU power. HTPCInfo was another candidate, but the author changed some things so that you now can configure if the plugins runs during playback and how often it tries to update information. Would be nice seeing other authors follow this and make sure their plugins don't interfere with playback on slower CPUs.

    In general when you do testing for playback quality you should disable all plugins that didn't come with MP to make sure none of them is hogging the CPU.

    thought I had it disabled. It's not even a slow cpu, dual core pentium @ 2.8 ghz. it really eats it up tho for some reason. not sure what its doing.

    It doesn't even have to show up in the Task Manager that some plugin / skin hogs CPU. It is enough that it steals 20ms of time once per few seconds and the playback quality is already ruined. Especially it it happens to be done in Main thread.
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Another question...

    again this line:
    Code:
    if (fabs(m_dD3DRefreshCycle - timePerFrame/20000) < 0.0015)

    Indeed again, as it was explained in some other post (or maybe in PM for someone, cannot remember) :D

    dD3DRefreshCycle = for 50Hz -> 20
    timePerFrame = 400000 for 25 PAL progressive -> as result of the /20000 it will be 20.

    20 minus 20 (that might vary a bit as it is the detected sample duration) is pretty close to zero.

    Basilcy it is used to detect the 1:2 fps to Hz matching.
     

    belcom

    Retired Team Member
  • Premium Supporter
  • February 27, 2009
    154
    42
    44
    Leibnitz
    Home Country
    Austria Austria
    Another question...

    again this line:
    Code:
    if (fabs(m_dD3DRefreshCycle - timePerFrame/20000) < 0.0015)

    Indeed again, as it was explained in some other post (or maybe in PM for someone, cannot remember) :D

    dD3DRefreshCycle = for 50Hz -> 20
    timePerFrame = 400000 for 25 PAL progressive -> as result of the /20000 it will be 20.

    20 minus 20 (that might vary a bit as it is the detected sample duration) is pretty close to zero.

    Basilcy it is used to detect the 1:2 fps to Hz matching.

    Sry, maybe it was too late in the night when I thought about it...
     

    tourettes

    Retired Team Member
  • Premium Supporter
  • January 7, 2005
    17,301
    4,800
    Re: AW: Problems with dropping frames with EVR

    @tourettes / @scythe42
    any idea why this simply code takes sometimes up to 15ms to execute?
    Code:
    dshowhelper.cpp:
    //avoid dependency into MFGetService, aparently only availabe on vista
    HRESULT MyGetService(IUnknown* punkObject, REFGUID guidService, REFIID riid, LPVOID* ppvObject)
    {
      if (ppvObject == NULL)
      {
        return E_POINTER;
      }
      HRESULT hr;
      IMFGetService* pGetService;
      hr = punkObject->QueryInterface(__uuidof(IMFGetService), (void**)&pGetService);
      if (SUCCEEDED(hr)) 
      {
        hr = pGetService->GetService(guidService, riid, ppvObject);
        SAFE_RELEASE(pGetService);
      }
      return hr;
    }

    But that isn't used at all? Are you talking about some local code modifications you have (in that case the thread gets even more complex to understand :)). It could be some higher priority thread that is blocking the code execution, or some lock / synchronization code on Media Foundation side (yes, EVR is part of MF :)).

    Why not cache that result? Just have a look what EVR presenter's constructor does...
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Re: AW: Problems with dropping frames with EVR

    @tourettes / @scythe42
    any idea why this simply code takes sometimes up to 15ms to execute?
    Code:
    dshowhelper.cpp:
    //avoid dependency into MFGetService, aparently only availabe on vista
    HRESULT MyGetService(IUnknown* punkObject, REFGUID guidService, REFIID riid, LPVOID* ppvObject)
    {
      if (ppvObject == NULL)
      {
        return E_POINTER;
      }
      HRESULT hr;
      IMFGetService* pGetService;
      hr = punkObject->QueryInterface(__uuidof(IMFGetService), (void**)&pGetService);
      if (SUCCEEDED(hr)) 
      {
        hr = pGetService->GetService(guidService, riid, ppvObject);
        SAFE_RELEASE(pGetService);
      }
      return hr;
    }

    But that isn't used at all? Are you talking about some local code modifications you have (in that case the thread gets even more complex to understand :)). It could be some higher priority thread that is blocking the code execution, or some lock / synchronization code on Media Foundation side (yes, EVR is part of MF :)).

    Why not cache that result? Just have a look what EVR presenter's constructor does...


    For shure it is used.

    Function: MPEVRCustomPresenter::presentSample

    Code:
      place2 = GetCurrentTimestamp();
      CHECK_HR(hr = MyGetService(
        pBuffer, 
        MR_BUFFER_SERVICE, 
        __uuidof(IDirect3DSurface9), 
        (void**)&pSurface),
        "failed: MyGetService");
      place2 = GetCurrentTimestamp()-place2;

    The place 2 variables are from my testing how long it takes. And it takes between 0.3s up to 15ms on my system. I'm not shure why this result is not cached. But there are more strange places where my measurement shows strange ms consumption.

    This peace of code also takes sometimes up to 5ms:
    Code:
    	place3 = GetCurrentTimestamp();
          m_pClock->GetCorrelatedTime(0, &hnsTimeNow, &hnsSystemTime);
    	place3 = GetCurrentTimestamp()-place3;


    scheduler patch:
    Here is my patch (includes still a lot of debugging code but as i wont be available for the next 36 hours - i decided to post the patch here - didn't had the time to clean it up).

    With this patch (except the placesX stuff) i have positive response also from OnkelChris. So this dll works fine on my HD3200 and also on ION systems. Fine does not mean no dropped frames. It does only mean as good as dll#2 for ION user and as good as dll#3 for me as an HD3200 user.

    Regarding plugins:
    @tourettes:
    Isn't it possible to run all plugins under LOW / IDLE system priority in general?
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Problems with dropping frames with EVR

    I've seen in XMBC that they've completely removed everything which has todo with MR_BUFFER_SERVICE which is example sometimes very slow for me. Not shure how they handle this stuff now. I've now to leave... see you on Monday.
     

    Users who are viewing this thread

    Top Bottom