Jump backward in PCR detected! (1 Viewer)

chemelli

Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    49
    Milano, Italy
    Home Country
    Italy Italy
    No it's not since 10 days ago, it at least 2 month...since I started using DVB-T and I was never able to use it ;-(

    Simone
     

    xurr

    Portal Pro
    May 3, 2006
    74
    10
    Italy
    Home Country
    Italy Italy
    Possible fix...

    Given that developers do not seem to take care of this problem, I tried to fix it myself...

    From the logs I noticed that PCR jumps forward and backward by the same amount within a few centiseconds, which means that it looked like only a single "frame" was misplaced. My idea was to detect this (when the forward hole and the backward hole are nearly identical) and simple "clear" the holes.

    I added this to TimeShifting.cpp after line 1423 (where the jump forward/backward are detected):

    if ((m_pcrHole.ToClock() > m_backwardsPcrHole.ToClock() && m_pcrHole.ToClock()-m_backwardsPcrHole.ToClock() < 0.50) ||
    (m_pcrHole.ToClock() <= m_backwardsPcrHole.ToClock() && m_backwardsPcrHole.ToClock()-m_pcrHole.ToClock() < 0.50)) {
    m_pcrHole.Reset();
    m_backwardsPcrHole.Reset();
    LogDebug("Resetting forward/backward counters");
    }

    I don't know if this actually works (I only tried it for about 30 minutes on a Mediaset channel which used to show the problem, and this section of code has been executed 4 times), nor I know if there are unwanted side-effects, I hope that tourettes or any other developer can validate this and, if it is good code, commit it to SVN.

    I think there should be another file to fix in a similar way (Recorder.cpp), I'll take care of this soon. For now, the fix should only affect timeshifting, not recording.

    [See postings below for a much better fix...]
     

    chemelli

    Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    49
    Milano, Italy
    Home Country
    Italy Italy
    xurr,

    thanks for your work, will try as soon as I will be home tonight.

    Simone
     

    Cybertex

    Portal Pro
    August 9, 2007
    200
    14
    Milano
    Home Country
    Italy Italy
    I attach the TsWriter.ax file compiled with the above fix (taken from yesterday's SVN, please align the rest of TVE3 to this release).

    Can anybody confirm this fix is working and is not producing any negative effects?

    Hi xurr,
    I'll try your fix this evening, on mediaset provider. I hope it fixes the thing, this problem/bug/whatever has forced me away from mediaportal (I was using it mainly for TV recording)....

    If you have any time to re-compile the recorder file too, I could "heavy test" it :)
     

    xurr

    Portal Pro
    May 3, 2006
    74
    10
    Italy
    Home Country
    Italy Italy
    Another, proper, fix!

    Following my rough attempt to fix this issue, I produced a much better implementation which takes into account both my "cancel forward/backward PCR holes" idea and an actual fix for the PTS/DTS handling which was somewhat broken (it didn't take into account the backward hole and it always followed PCR jumps, even if it shouldn't).

    Please find a new TsWriter.ax file attached for testing. This time also recording should be fixed, not only timeshifting.

    I also attach the 4 files I had to modify to implement the fix, can any developer please validate the code and commit it to SVN if it looks good?

    [See further posts in this thread for the TsWriter.ax file, this one used to be bugged!]
     

    chemelli

    Retired Team Member
  • Premium Supporter
  • September 28, 2006
    6,159
    2,264
    49
    Milano, Italy
    Home Country
    Italy Italy
    xurr,

    yesterday I was too busy infortunatly to test your TsWriter.ax. Will do with the new one in any case...

    BTW, to commit any change to Tswriter source into the SVN you need to contact tourette(s). You can PM him with your patch...

    Simone
     

    sdf

    Portal Pro
    September 29, 2006
    292
    42
    Home Country
    Italy Italy
    xurr,
    problems seem gone with your latest compile.
    Good work!
    sdf
     

    Cybertex

    Portal Pro
    August 9, 2007
    200
    14
    Milano
    Home Country
    Italy Italy
    Please find a new TsWriter.ax file attached for testing. This time also recording should be fixed, not only timeshifting.

    Xurr, I didn't tested the fix for too long, but it seems to work :D

    First evening, it ran for 2-3 hours without freeze, this evening for 1 hour (more or less) without problem. I'll continue to test it, also the recording part.

    BTW, your fix is good. Thanks ;)
     

    gemx

    Retired Team Member
  • Premium Supporter
  • October 31, 2006
    1,972
    539
    Home Country
    Germany Germany
    Sounds, good.
    I am currently working on this problem.
    My approach is to use our own ref clock, so we don't have to rely that much on the broadcasted pcr.
    Since i have very little time atm (sadly :( ) we can see how this patch works.
    If it does i will have a closer at it and commit it.
     

    Users who are viewing this thread

    Top Bottom