MP 1.3.x dshowhelper development

Discussion in 'General Development (no feature request here!)' started by Owlsroost, October 7, 2012.

  1. Owlsroost
    • Team MediaPortal

    Owlsroost Development Group

    Joined:
    October 28, 2008
    Messages:
    5,537
    Likes Received:
    2,829
    Location:
    Cambridge
    Ratings:
    +4,131 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    This thread is a response to the requests I've received to produce a dshowhelper version for MP 1.3.x which includes some of the features from the later versions in the old development thread at https://forum.team-mediaportal.com/...nter-dshowhelper-community-development.81148/

    dshowhelper versions from this thread will not work in older versions of MP (before 1.3.0)

    The modifications only affect the EVR functionality - if you are using VMR9 (for Win XP) it will behave the same as the standard MP version.

    Sources are at https://github.com/MediaPortal/Medi...DWM_mod/mediaportal/Core.cpp/DirectShowHelper

    Feedback welcome :)



    Tony
     
    Last edited: October 7, 2012
    • Like Like x 5
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. Owlsroost
    • Team MediaPortal

    Owlsroost Development Group

    Joined:
    October 28, 2008
    Messages:
    5,537
    Likes Received:
    2,829
    Location:
    Cambridge
    Ratings:
    +4,131 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    For reference, the default settings for the registry values in "HKEY_CURRENT_USER\Software\Team MediaPortal\EVR Presenter" are:

    EnableDWMQueuedMode = 0​
    EnableMMCSSforDWM = 0​
    EnableMMCSSforSchedulerThread = 1​
    NumDWMBuffers = 3​
    EnableDWMAudioDelayComp = 0​
    SampleQueueSize = 5​
    WorkerThreadMmcssPriority = 1​
    TimerThreadMmcssPriority = 0​
    SchedulerThreadMmcssPriority = 2​
    ForceFirstFrame = 0​
    LowResVSyncCorrectionTiming = 0​
    FPSLimitFrameRate = 0​
    FPSLimitHeightThresh = 700​
    FPSLimitWidthThresh = 1200​
    EnableLateDWMInit = 0​
    Enable24HzDWM = 1​
    EnableDWMInitSleep = 1​




    Release v663b:
    • DWM 'queued' mode support added (like the older 'part_DWM' versions)
    • Sample queue management changed to fix occasional frame 'flashback' problems
    • High-hysteresis frame drop/repeat logic added to produce cleaner frame drops and repeats
    • Thread locking converted/reverted to hard locks as an experiment ('PauseThread' etc removed)
    • Potential deadlock situation when flushing worked around
    • Registry key added - 'HKEY_CURRENT_USER\Software\Team MediaPortal\EVR Presenter\EnableDWMQueuedMode - if this is '1' DWM queued mode is enabled, if '0' it is disabled (it is disabled in the standard dshowhelper).
    Release v666:
    • Converted to use Unicode for Windows API interfaces
    • Fixed a bug so the registry settings are now applied correctly
    • Added new Registry setting - 'HKEY_CURRENT_USER\Software\Team MediaPortal\EVR Presenter\NumDWMBuffers' - sets number of DWM buffers used, range is 3-7, default is 3. Only used when DWM queued mode is enabled.
    • Added automatic audio delay compensation for DWM buffering delay when MP Audio Renderer is used
    Release v667:
    • Fixed a bug with Unicode strings in logging
    • High-hysteresis frame drop/repeat logic enabled when MP Audio Renderer is in use.
    • Added new Registry setting - 'HKEY_CURRENT_USER\Software\Team MediaPortal\EVR Presenter\EnableDWMAudioDelayComp' - when '1' automatic audio delay compensation for DWM buffering delay is enabled (when MP Audio Renderer is used). Default is '0' (not enabled)
    • Internal sample queue length increased to 5
    • 'NumDWMBuffers' registry setting range is now 3-8
    • Sample dropping in ScheduleSample() disabled until pre-buffering is complete.
    Release v669:
    • Added new Registry setting - 'HKEY_CURRENT_USER\Software\Team MediaPortal\EVR Presenter\SampleQueueSize' - sets the input video sample queue length - range is 3 to 9, default is '5'
    • Added new Registry settings to control the (MMCSS) thread priorities: "TimerThreadMmcssPriority", "WorkerThreadMmcssPriority", "SchedulerThreadMmcssPriority"

      Possible values are 0 to 3:

      3 = AVRT_PRIORITY_CRITICAL
      2 = AVRT_PRIORITY_HIGH (default for Scheduler thread)
      1 = AVRT_PRIORITY_NORMAL (default for Worker thread)
      0 = AVRT_PRIORITY_LOW (default for Timer thread)
    • Default for 'EnableDWMQueuedMode' is now '0' (disabled) so that it behaves like the standard dshowhelper when first installed.
    Release v671:
    • Changes to fix hangs/crashes with AMD GPU (probably caused by calling DwmFlush() when shutdown)
    Release v672:
    • DwmInit() and DwmReset() delays now use Sleep()
    Release v675:
    • More changes to internal thread locking to fix hangs/crashes (small update from v674). Delays removed from DwmInit() and DwmReset() methods (experimental).
    Release v676:
    • Timer thread reworked to use WaitableTimers (might lower CPU usage a little)
    • 'LowResVSyncCorrectionTiming' registry option added (might lower CPU usage a little, but creates bumpy graph lines)
    • Some deadlock hazards worked around
    • Minor logging bug in DWM (Aero) detection code fixed.
    Release v677:

    Controllable FPS rate limiter added - can be used for low-performance systems to reduce rendering load, by discarding 50% of frames when video FPS and frame size exceeds thresholds. Controlled by registry values:

    FPSLimitFrameRate (FPS limit, default = 0, FPS limiter disabled)
    FPSLimitHeightThresh (default = 700)
    FPSLimitWidthThresh (default = 1200)

    e.g. if FPSLimitFrameRate = 40 AND FPSLimitHeightThresh = 700 AND FPSLimitWidthThresh = 1200 then all video with FPS higher than 40 and frame size greater than 1200 x 700 will have 50% of the frames dropped to reduce the GPU rendering load.

    Release v678:

    Identical to v677, except that the Scheduler thread locking is now 'soft' instead of 'hard' - this makes it behave like the thread locking inside the standard MP 1.2.3/1.3.0 dshowhelper. I'm not sure if the v677 or v678 approach is better, so I'm interested in feedback before deciding which way to go for the future. Hopefully you won't notice any difference in performance or stability :) (I can't, but then I can't reproduce some of the lockup/hang problems other people have reported in the past either).

    Release v679:
    • Version info added to dll (so it shows up in Windows file 'Properties' dialog).
    • DWM queued mode initialisation moved later in the start-of-play sequence, to minimise the temporary black screen effect.
    Release v684:
    • Reverted Scheduler thread locking back to 'hard'.
    • 'EnableLateDWMInit' registry option added - default is '0' (early initialisation, like v677 and earlier). DWM queued mode initialisation is done as late as possible in the start-of-play sequence when '1'
    • 'Enable24HzDWM' registry option added - default is '1' (enabled), uses normal DWM queued mode operation in 24 Hz display refresh situation. This is an experiment - feedback welcome, since this has caused problems in the past, but seems to help on my system now.
    • 'EnableDWMInitSleep' registry option added - default is '1' (enabled), adds small delay after DWM queued mode initialisation to help with 24 Hz display refresh situation (mostly). Another experiment...
     
    Last edited: January 7, 2013
    • Like Like x 11
  4. legnod
    • Premium Supporter

    legnod MP Donator

    Joined:
    September 24, 2011
    Messages:
    1,115
    Likes Received:
    275
    Gender:
    Male
    Location:
    Stuttgart
    Ratings:
    +303 / 0
    Home Country:
    Germany Germany
    Show System Specs
    Great work Owlsroost,
    working fine so far! Only 1 of 200k frames has been dropped while watching Live-TV!
     
  5. powermarcel10
    • Premium Supporter

    powermarcel10 Retired Team Member

    Joined:
    November 30, 2010
    Messages:
    2,839
    Likes Received:
    789
    Gender:
    Male
    Occupation:
    Callcenter Agent
    Location:
    Groningen
    Ratings:
    +1,028 / 4
    Home Country:
    Netherlands Netherlands
    Show System Specs
  6. Pat Clark

    Pat Clark Portal Pro

    Joined:
    April 25, 2012
    Messages:
    264
    Likes Received:
    24
    Gender:
    Male
    Occupation:
    Retired
    Location:
    Wisconsin
    Ratings:
    +34 / 2
    Home Country:
    United States of America United States of America
    Show System Specs
    Works as well as the former version, unless "repeats" are something new. The sum of drops and repeats in the new version exceeds drops in former version when drops are happening.

    As you may recall, my system is right on the edge when viewing 720p/60 signal. If I run task manager, there is a regular spacing of drops/repeats, presumably as task manager refreshes. When not running task manager, both versions report no drops or repeats.

    Viewing 1080i/60 with no deinterlacing, both versions are perfect, with or without task manager.

    Question: is there buffering after rendering? It seems that there is enough time overall to render perfectly, except for the occasional long render. A small buffer (.5 second?) might smooth it out entirely.
     
  7. red5goahead
    • Premium Supporter

    red5goahead MP Donator

    Joined:
    November 24, 2007
    Messages:
    695
    Likes Received:
    96
    Gender:
    Male
    Occupation:
    Software engineering
    Location:
    Italy, North West
    Ratings:
    +144 / 1
    Home Country:
    Italy Italy
    Show System Specs
    Just yesterday I've uninstall the 1.2.2 and installed the 1.3.0 alpha. Actually It work very well that renderer with reclock (with timestretching active because I tried a cinema fps tv series episode as usual on my tv with refresh of 50 Hz )
    With mp audio renderer there are some problem with Xonar and exclusive mode (not even driven mode).
     
  8. Owlsroost
    • Team MediaPortal

    Owlsroost Development Group

    Joined:
    October 28, 2008
    Messages:
    5,537
    Likes Received:
    2,829
    Location:
    Cambridge
    Ratings:
    +4,131 / 1
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    It's basically the interface between the EVR (Vista/Win7/Win8) 'renderer' in the DirectShow filtergraph and MP's render engine. It's only used when playing video, and it decides when each video frame is displayed - it compares the timestamp on each frame with the filtergraph 'clock' and drops frames which are late or holds/delays frames which are too early (this is when the 'repeat' frame count is incremented).

    (It is also used for VMR9 but that part of it hasn't changed for a long time - all of the recent updates are for the EVR side only)

    Tony
     
    • Like Like x 2
  9. cruse
    • Premium Supporter

    cruse MP Donator

    Joined:
    November 7, 2007
    Messages:
    166
    Likes Received:
    41
    Ratings:
    +41 / 0
    Home Country:
    Germany Germany
    Show System Specs
    Just wanted to let you know this dshowhelper is the bee's knees, pushing my borderline hardware (9400 GT) over the performance edge it desperately needs. Watching 1080i since half an hour with DWM 1 without one dropped frame, was a matter of seconds before with the default dshowhelper.

    I strongly suggest this makes its way into the next MP1.3 beta.

    Thanks Tony
     
  10. doveman

    doveman Portal Pro

    Joined:
    February 12, 2008
    Messages:
    2,326
    Likes Received:
    166
    Ratings:
    +182 / 3
    Home Country:
    United Kingdom United Kingdom
    Show System Specs
    Thanks for this Owlsroost. Do we need to create/set the registry key manually to enable 'queued' mode or is this auto-set/default?
     
  11. cruse
    • Premium Supporter

    cruse MP Donator

    Joined:
    November 7, 2007
    Messages:
    166
    Likes Received:
    41
    Ratings:
    +41 / 0
    Home Country:
    Germany Germany
    Show System Specs
    In my case the reg key was there (may have already been there) and set to 1, once I put the dll in MP folder and started MP.
     
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!