TVplugin - avoiding RTSP in multiseat mode (test plz). (2 Viewers)

disaster123

MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    gibman
    i'm sorry but with your txreader i've stuttering directly from the beginnng. I cannot watch any channel at all. Doesn't matter SD or HD.

    Have you implemented to close and reopen tsbuffer file all the time? I've tried this one hour ago and this gives me the same extreme stuttering like with your reader.

    Ambass
    oh i see - i didn't know that i havent looked at the threadid in log - sorry.

    @all
    My version also without the sleep is still running fine. No stuttering at all. But starting TV takes longer that with RTSP. Channel switching is the same.
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    I didnt include anything from you patch but the "remove sleep" fix.

    if (m_currentPosition < (file->startPosition + file->length))
    + if (m_currentPosition < (file->startPosition + file->length-100))
    {
    - if (m_TSFileId != file->filePositionId)
    - {
    + //if (m_TSFileId != file->filePositionId)
    + //{
    m_TSFile.CloseFile();
    m_TSFile.SetFileName(file->filename);
    m_TSFile.OpenFile();
    @@ -213,7 +213,7 @@
    wsprintf(sz, TEXT("Current File Changed to %s\n"), W2T(file->filename));
    //::OutputDebugString(sz);
    }
    - }
    + //}

    - Sleep(10) ;
    + //Sleep(10) ;
    Error=0x80 ;


    /gibman
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    gibman
    could you explain the -100 in this line?
    + if (m_currentPosition < (file->startPosition + file->length-100))

    In your case the ts-file is closed and opened everytime - this causes stuttering for me. Have you tried your -100 version with my integrety patch? Perhaps these both are a solution.
     

    gibman

    Retired Team Member
  • Premium Supporter
  • October 4, 2006
    2,998
    1,372
    Aarhus
    Home Country
    Denmark Denmark
    @gibman
    could you explain the -100 in this line?
    + if (m_currentPosition < (file->startPosition + file->length-100))

    In your case the ts-file is closed and opened everytime - this causes stuttering for me. Have you tried your -100 version with my integrety patch? Perhaps these both are a solution.

    Are u able to stop by IRC ?

    /gibman
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    I don't know what stop mean but i think i'm able to install IRC :)

    I had often log lines like these:
    Code:
    09-02-2009 21:45:11.405 [620]CTsReaderFilter::Seek--
    09-02-2009 21:45:11.405 [620]CTsReaderFilter:: Seek-> 530.181000/530.522000
    09-02-2009 21:45:11.405 [620]seek to 530.181000 filepos:1527d734 pid:30
    09-02-2009 21:45:11.919 [620] got 529.734709 at filepos 152878c4 diff 0.446291
    09-02-2009 21:45:12.083 [620] got 529.883423 at filepos 1529fc26 diff 0.297577
    09-02-2009 21:45:12.164 [620] got 529.957839 at filepos 152abdd7 diff 0.223161
    09-02-2009 21:45:12.249 [620] got 529.995210 at filepos 152b1eb0 diff 0.185790
    09-02-2009 21:45:12.466 [620] got 530.032344 at filepos 152b7b2c diff 0.148656
    09-02-2009 21:45:12.552 [620] got 530.032344 at filepos 152b7d5b diff 0.148656
    09-02-2009 21:45:12.641 [620] got 530.032344 at filepos 152b7e72 diff 0.148656
    09-02-2009 21:45:12.735 [620] got 530.032344 at filepos 152b7efe diff 0.148656
    09-02-2009 21:45:12.817 [620] got 530.032344 at filepos 152b7f44 diff 0.148656
    09-02-2009 21:45:12.902 [620] got 530.032344 at filepos 152b7f67 diff 0.148656
    09-02-2009 21:45:12.981 [620] got 530.032344 at filepos 152b7f78 diff 0.148656
    09-02-2009 21:45:13.061 [620] got 530.032344 at filepos 152b7f81 diff 0.148656
    09-02-2009 21:45:13.149 [620] got 530.032344 at filepos 152b7f85 diff 0.148656
    09-02-2009 21:45:13.237 [620] got 530.032344 at filepos 152b7f87 diff 0.148656
    09-02-2009 21:45:13.300 [620] got 530.032344 at filepos 152b7830 diff 0.148656
    09-02-2009 21:45:13.384 [620] got 530.032344 at filepos 152b7bdd diff 0.148656
    09-02-2009 21:45:13.459 [620] got 530.032344 at filepos 152b7db3 diff 0.148656
    09-02-2009 21:45:13.539 [620] got 530.032344 at filepos 152b7e9e diff 0.148656
    09-02-2009 21:45:13.626 [620] got 530.032344 at filepos 152b7f14 diff 0.148656
    09-02-2009 21:45:13.717 [620] got 530.032344 at filepos 152b7f4f diff 0.148656
    09-02-2009 21:45:13.798 [620] got 530.032344 at filepos 152b7f6c diff 0.148656
    09-02-2009 21:45:13.877 [620] got 530.032344 at filepos 152b7f7b diff 0.148656
    09-02-2009 21:45:13.954 [620] got 530.032344 at filepos 152b7f82 diff 0.148656
    09-02-2009 21:45:14.033 [620] got 530.032344 at filepos 152b7f86 diff 0.148656
    09-02-2009 21:45:14.095 [620] got 530.032344 at filepos 152b7830 diff 0.148656
    09-02-2009 21:45:14.175 [620] got 530.032344 at filepos 152b7bdd diff 0.148656
    09-02-2009 21:45:14.258 [620] got 530.032344 at filepos 152b7db3 diff 0.148656
    09-02-2009 21:45:14.338 [620] got 530.032344 at filepos 152b7e9e diff 0.148656
    09-02-2009 21:45:14.426 [620] got 530.032344 at filepos 152b7f14 diff 0.148656
    09-02-2009 21:45:14.512 [620] got 530.032344 at filepos 152b7f4f diff 0.148656
    09-02-2009 21:45:14.587 [620] got 530.032344 at filepos 152b7f6c diff 0.148656
    09-02-2009 21:45:14.668 [620] got 530.032344 at filepos 152b7f7b diff 0.148656
    09-02-2009 21:45:14.790 [620] got 530.032344 at filepos 152b7f82 diff 0.148656
    09-02-2009 21:45:14.877 [620] got 530.032344 at filepos 152b7f86 diff 0.148656
    09-02-2009 21:45:14.949 [620] got 530.032344 at filepos 152b7830 diff 0.148656
    09-02-2009 21:45:15.039 [620] got 530.032344 at filepos 152b7bdd diff 0.148656
    09-02-2009 21:45:15.122 [620] got 530.032344 at filepos 152b7db3 diff 0.148656
    09-02-2009 21:45:15.204 [620] got 530.032344 at filepos 152b7e9e diff 0.148656
    09-02-2009 21:45:15.288 [620] got 530.032344 at filepos 152b7f14 diff 0.148656
    09-02-2009 21:45:15.369 [620] got 530.032344 at filepos 152b7f4f diff 0.148656
    09-02-2009 21:45:15.450 [620] got 530.032344 at filepos 152b7f6c diff 0.148656
    09-02-2009 21:45:15.528 [620] got 530.032344 at filepos 152b7f7b diff 0.148656
    09-02-2009 21:45:15.609 [620] got 530.032344 at filepos 152b7f82 diff 0.148656
    09-02-2009 21:45:15.706 [620] got 530.032344 at filepos 152b7f86 diff 0.148656
    09-02-2009 21:45:15.852 [620] got 530.032344 at filepos 152b7830 diff 0.148656
    09-02-2009 21:45:15.935 [620] got 530.032344 at filepos 152b7bdd diff 0.148656
    09-02-2009 21:45:16.012 [620] got 530.032344 at filepos 152b7db3 diff 0.148656
    09-02-2009 21:45:16.092 [620] got 530.032344 at filepos 152b7e9e diff 0.148656
    09-02-2009 21:45:16.169 [620] got 530.032344 at filepos 152b7f14 diff 0.148656
    09-02-2009 21:45:16.246 [620] got 530.032344 at filepos 152b7f4f diff 0.148656
    09-02-2009 21:45:16.326 [620] got 530.032344 at filepos 152b7f6c diff 0.148656
    09-02-2009 21:45:16.326 [620] stop seek max iterations reached (50): 530.032344 at 152b7f6c - target: 530.181000, diff: 0.148656
    09-02-2009 21:45:16.334 [620]CTsReaderFilter::--SeekDone()

    But why should we try again to find a new pos when the old and the new one are the same. So this must be the most accurate seek we can do.

    Patch for this:
    Code:
    Index: TsReader/source/TsFileSeek.cpp
    ===================================================================
    --- TsReader/source/TsFileSeek.cpp	(revision 21658)
    +++ TsReader/source/TsFileSeek.cpp	(working copy)
    @@ -173,6 +173,14 @@
                 return;
               }
     
    +		  if ( prevfilePos == filePos ) 
    +		  {
    +            LogDebug(" stop seek prevfilePos == filePos reached (%d): %f at %x - target: %f, diff: %f", 
    +              MAX_SEEKING_ITERATIONS, clockFound, (DWORD)filePos, seekTimeStamp, diff);
    +            m_reader->SetFilePointer(prevfilePos,FILE_BEGIN);
    +            return;
    +		  }
    +
               seekingIteration++;
               if( seekingIteration > MAX_SEEKING_ITERATIONS )
               {
     

    jhb

    Portal Pro
    September 19, 2006
    121
    2
    Gothenburg
    Home Country
    Sweden Sweden
    Old problems - not worked on...

    We have this entire tread trying to make a workaround to a number of bugs regarding the RTSP transfer of TV over the network in a split client TV-server setup. I haven't had time to test it yet, but it seems to solve most of the problems I have with MP.

    To quote the first post in this thread:
    This could potentially fix a lot of problems.
    Problems like ...
    slow channel change speed.
    seek problems.
    tsreader deadlocks.


    I have these problems and more that are all related to channel shifting and resume from stand-by...

    There are several threads (including mine - the first one) that have different kinds of problems related to RTSP that all seem to be solved by this solution:
    https://forum.team-mediaportal.com/...screen-after-channel-change-53609/index3.html
    https://forum.team-mediaportal.com/...er-return-stanby-hibernation-41368/index.html
    https://forum.team-mediaportal.com/.../no-tv-unable-start-timeshifting-error-53354/
    and there are obviously a lot of people that are having these problems....

    Why aren't the problems with RTSP looked into instead? Or maybe they are, it just happens that I haven't found the threads in the forum? I've looked through the bug tracker and the change log and the bugs don't even seem to be in there... :-(
    ...but the problems are known but are not worked on except in this thread in a not supported manner...

    I love this little piece of software, but my wife and children are not as forgiving as I am with the flaws...
    ...however I will help testing any solutions to the problems (including the one in this thread) to make MP as good as it should be!

    BTW, problems with stuttering at TS-buffer change are occuring also when RTSP is used. I have them from time to time, but haven't been able to pinpoint why they sometimes appear (during a whole show), but most of the time are not...
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    I think the idea of dot-i isn't bad. Use RTSP for Live-TV and non RTSP for recordings. Here is a small patch for that if you now provide a recordingpath like in the first post you can use non rtsp with recordings (Comskip... works) and rtsp with live tv.
    Code:
    Index: TVLibrary/TvPlugin/TvPlugin/TvRecorded.cs
    ===================================================================
    --- TVLibrary/TvPlugin/TvPlugin/TvRecorded.cs	(revision 21658)
    +++ TVLibrary/TvPlugin/TvPlugin/TvRecorded.cs	(working copy)
    @@ -1314,7 +1314,12 @@
     
           bool useRTSP = TVHome.UseRTSP();
           bool recFileExists = File.Exists(fileName);
    -
    +      if (TVHome.RecordingPath().Length > 0)
    +      {
    +          // We have a recordingpath - so disable RTSP in this case
    +          Log.Info("TvRecorded Play:{0} - NOT using rtsp cause RecordingPath is provided: {1}", fileName, TVHome.RecordingPath());
    +          useRTSP = false;
    +      }
           if (!recFileExists && !useRTSP) //singleseat      
           {
             if (TVHome.RecordingPath().Length > 0)

    The bad things are:
    1.) still no updated timeline while in pause mode in live-tv
    2.) starting movies with non RTSP takes long for me cause of the new mediainfo.dll which seems to load a huge amount of the file from SMB or my LAN / System is slow. Startuptime 3-5 seconds.
     

    Ambass

    Retired Team Member
  • Premium Supporter
  • December 24, 2007
    555
    129
    Home Country
    France France
    @disaster

    I had often log lines like these:

    Code:
    09-02-2009 21:45:11.405 [620]CTsReaderFilter:: Seek--
    09-02-2009 21:45:11.405 [620]CTsReaderFilter:: Seek-> 530.181000/530.522000
    09-02-2009 21:45:11.405 [620]seek to 530.181000 filepos:1527d734 pid:30
    09-02-2009 21:45:11.919 [620] got 529.734709 at filepos 152878c4 diff 0.446291
    09-02-2009 21:45:12.083 [620] got 529.883423 at filepos 1529fc26 diff 0.297577
    09-02-2009 21:45:12.164 [620] got 529.957839 at filepos 152abdd7 diff 0.223161
    09-02-

    This issue like other seek issues are fixed here.

    https://forum.team-mediaportal.com/...time-improvement-44021/index5.html#post375185

    Some RTSP issues like radio are also fixed.
    Stuttering in TV could also be fixed, TsReader has verbosity about late frames and how much they are late.

    This can help to understand if final compensation has just to be tuned of hundred of milliseconds to avoid stuttering or if there is really another big problem.
     

    Users who are viewing this thread

    Top Bottom