TSWriter deadlock potential fix. (1 Viewer)

Sebastiii

Development Group
  • Team MediaPortal
  • November 12, 2007
    16,583
    10,403
    France
    Home Country
    France France
    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.

    Hi m8 :)

    Do we have a branch for it ?
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand

    nimrodel50

    Portal Pro
    February 6, 2008
    67
    15
    Home Country
    Spain Spain
    Hi,

    I'n testing it since yesterday and nothing wrong has appeared. I enabled the epg on the Chanel that always triggered the problem and still nothing.

    I will post the debug logs if the tvservice gets locked.

    Thanks for keep on the investigation.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Sadly I experienced the same problem.
    here the logs attached.
    Thanks nimrodel50, and good to hear from you again. (y)
    These log files are actually really interesting. We can see that it appears like the graph was successfully stopped:
    05-09-2013 18:09:23.85 CMpTsFilter::confused:top()
    05-09-2013 18:09:23.85 Stop streaming...
    05-09-2013 18:09:23.85 Stop filter...
    05-09-2013 18:09:23.85 HRESULT = 0x0

    ...so maybe I was wrong about what is going on.
    I've attached a TvService.exe [for MP 1.5 PR] with some added logging. Please could you try it? It won't fix the problem, but hopefully it will show where the problem is...
     

    Attachments

    • TvService.zip
      86.1 KB

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Here you have the logs.
    I don't know how, but it seems I missed your post. Thanks and sorry for the delayed response. (y)

    So, we start to narrow down the problem. :)
    Attached is a new version of TsWriter (one extra line of debug added) and three debug versions of TVLibrary.dll (for MP 1.5 PR).
    Please install the new TsWriter, then try the "extra debug" version of TVLibrary.dll first. It will still deadlock. When it does, please provide the log files and start trying the "remove MS extra filters" version. I hope that version will still work... and it might fix the deadlock. If it works but doesn't fix the deadlock, please try the "no use dsrot" version.

    Best regards,
    mm
     

    Attachments

    • TVLibrary [remove MS extra filters].zip
      202.2 KB
    • TVLibrary [extra debug].zip
      202.2 KB
    • TVLibrary [no use dsrot].zip
      202.1 KB
    • TsWriter_mm_deadlock_v5_[mp_1.5pr].zip
      132 KB

    doskabouter

    Development Group
  • Team MediaPortal
  • September 27, 2009
    4,646
    3,100
    Nuenen
    Home Country
    Netherlands Netherlands
    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 :)

    As my wife is recovering from surgery, I don't dare to change (and possibly break) our system.
    But as soon as she doesn't need mediaportal anymore to keep herself busy, I'll start the upgrade!
     

    Users who are viewing this thread

    Top Bottom