TSWriter deadlock potential fix. (1 Viewer)

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Looks like the same old symptoms. I find it interesting that the deadlock only seems to manifest on transponders when no EPG data is found.

    New patch for MP 1.5 PR is attached. This version adds a new lock which is shared between all input pin instances. The lock must be acquired when each sample is Receive()'d and when the filter is Stop()'d. Additionally, once the lock is acquired in Receive(), there is a new check to confirm that the filter is running before sample processing is allowed to proceed. All this effectively means pins must finish processing their last sample before the filter can stop, and once the filter is stopped the pins will reject samples properly.

    I did this because I think the deadlock is occurring in the pin Inactive() method (called from CBaseFilter::confused:top()). Inactive() attempts to Decommit() the pin allocator which in turn attempts to acquire the lock on the allocator. It won't be able to acquire the allocator if the upstream filter is trying to use it to prepare a new sample for TsWriter.

    Note: in order to reduce my workload I'm not going to be providing patches for MP 1.4 or MP 1.3. Sorry. I hope you can understand and will be willing to upgrade to test.
     

    Attachments

    • TsWriter_mm_deadlock_v4_[mp_1.5pr].zip
      333.5 KB

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,583
    2,972
    Nuenen
    Home Country
    Netherlands Netherlands
    Nice work!

    Will see if I'll await the official release of 1.5.0. Don't know if it's worth to upgrade now, as the symptoms are not likely to occur (once every three weeks or so).
    Is this going into the final 1.5.0 as well, or is it still a side-step?
     

    FreakyJ

    Retired Team Member
  • Premium Supporter
  • July 25, 2010
    4,024
    1,420
    Home Country
    Germany Germany
    Is this going into the final 1.5.0 as well, or is it still a side-step?
    it will not be in the 1.5 final ;)
    Everything needs testing, so if this patch should have a chance to get in 1.6 it needs prober testing, so it would be better if you upgrade now for testing and if it only occurs every three weeks the time is pretty short for MP 1.6 :)
     

    Vasilich

    Portal Pro
    August 30, 2009
    3,394
    1,170
    Germany, Mayence
    Home Country
    Russian Federation Russian Federation
    AIUI this is a test version, and if nobody reports thatt this helped, then it will not be included in 1.5 release.

    @mm1352000 do you know if anything was changed in TSWriter since 1.4 that will prevent its version 1.5 to work with tv server 1.4?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    do you know if anything was changed in TSWriter since 1.4 that will prevent its version 1.5 to work with tv server 1.4?
    The TsWriter will probably work. Interfaces with TV library have not changed for quite some time. The problem will be the pached TVLibrary.dll - you definitely can't use that with MP 1.4... but now that I think about it, you could use the v3 TV library from -->here<-- (because there are no new changes in TV library in this v4 patch).
    So to be clear, use the TsWriter from v4 and the TV library from v3 for MP 1.4.
    Does that make sense?
     
    Last edited:

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,583
    2,972
    Nuenen
    Home Country
    Netherlands Netherlands
    So, if I get the TsWriter v4 and Tvlib v3, I could still use my existing 1.4 setup?

    If not, is MP 1.4 working with tvservice 1.5 PR + patches?

    Just don't want to upgrade everything to a non-released version, if it can be avoided, because (apart from the epg issue), my systems are running very stable now
     

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,583
    2,972
    Nuenen
    Home Country
    Netherlands Netherlands
    As far as I know, the P is from "pre" as in: not yet... :)
     

    Users who are viewing this thread

    Top Bottom