[Rejected] Fix for streaming discontinuity errors (1 Viewer)

miroslav22

Development Group Member
  • Premium Supporter
  • September 4, 2009
    703
    460
    Warwick
    Home Country
    United Kingdom United Kingdom
    Hi

    Ive created a patch that alleviates a problem with discontinuity errors in live/recorded TV streaming. The bug is generally triggered on HD channels/recordings (high bitrate) but can happen on SD with a lower probability . See this thread: https://forum.team-mediaportal.com/...ng-issue-seek-beyond-end-infinite-loop-79008/

    The bug causes tsreader on connected clients to give discontinuity errors and a corrupted picture. The bug is triggered when a call to Read() on the ts buffer file returns less data than "m_lTSBufferItemSize". The resulting seeks and refreshes performed on the file seem to cause disk IOs to spike and the 100ms Sleep() seems to combine to cause the discontinuity errors. The combination also causes the process to keep repeating meaning the picture on clients doesnt recover until the user intervenes (eg skip stepping/changing channel). The bug then triggers again after a short period.

    The patch changes the methodology to append to the buffer on any subsequent reads (when not initially filled). This is instead of seeking and re-reading the entire block. This is generally accepted as the standard way to handle IO operations. The sleep has also been reduced to 10ms as a 100ms delay seems to aggravate the problem. I dont think this completely fixes the problem (as I believe a design change would be needed), but it significantly reduces the probability of it triggering and continually repeating.

    Testing: HD channels always triggered the bug within 15 minutes on my system before the patch. So far with the patch the bug has not triggered with over 6 hours of continuous playback.

    Thanks I hope you will consider this patch for inclusion,
     

    Attachments

    • streamingfix.patch
      1,013 bytes

    wawa79

    Portal Pro
    December 9, 2008
    111
    28
    Niort
    Home Country
    France France
    Your patch gives me hope in fixing the freeze issue I have been experiencing for years with MP (both on SD and HD): TV freezes several times during the first 30min after starting watch it (both after a reboot and after resuming from stand by). Not a big issue when watching live TV : I just change channel to get back TV playing, as you describe :rolleyes:. More problematic when it comes to recordings: the bug crashes 90% of recordings! :mad:

    I am afraid I tested it all: hardware changes and different settings, drivers, quality / strength of signal checked, RAMdisk, network stream, network card loopback setting, various settings in MP, many full format / reinstall of Windows and MP, all codecs on earth and I still get the issue.

    I would really appreciate if you could share the compiled library using your routine to use in MP 1.1.0 and run the test!

    :D
     

    miroslav22

    Development Group Member
  • Premium Supporter
  • September 4, 2009
    703
    460
    Warwick
    Home Country
    United Kingdom United Kingdom
    Hi,

    Ive attached StreamingServer.dll with this change compiled in (based on 1.1.0)

    I'm not sure if it will help with the problem you describe, but let me know if it does. Thanks!
     

    Attachments

    • StreamingServer.zip
      78 KB

    wawa79

    Portal Pro
    December 9, 2008
    111
    28
    Niort
    Home Country
    France France
    Thank you for the patch. Unfortunately, it does not work for me. See logs attached as some log lines in TsReader probably come from your updated file.

    I think my problem is in TSWriter (or before): when TV hangs, timeshift buffer stops being fed.

    I will keep your Dll anyway for testing. If my log inspires you for any comment, feel free to give me your comments!
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    Thank you for the patch. Unfortunately, it does not work for me. See logs attached as some log lines in TsReader probably come from your updated file.

    I think my problem is in TSWriter (or before): when TV hangs, timeshift buffer stops being fed.

    I will keep your Dll anyway for testing. If my log inspires you for any comment, feel free to give me your comments!

    I think you forgot to post the logs.

    Mark
     

    wonkyd

    Retired Team Member
  • Premium Supporter
  • August 29, 2007
    792
    177
    Home Country
    United Kingdom United Kingdom
    I've been using the patched .dll for the past week and not seen any negative effects.
     

    elliottmc

    Retired Team Member
  • Premium Supporter
  • August 7, 2005
    14,927
    6,061
    Cardiff, UK
    Home Country
    United Kingdom United Kingdom
    Would it be possible to get a binary based on current SVN?

    Thanks,

    Mark
     

    miroslav22

    Development Group Member
  • Premium Supporter
  • September 4, 2009
    703
    460
    Warwick
    Home Country
    United Kingdom United Kingdom
    Hi Mark

    There hasnt been any other changes to StreamingServer since April 2010 so the binary posted above is ok to use for 1.1.1.
     

    Users who are viewing this thread

    Top Bottom