[Approved] Fix for stuttering/corrupted streaming of live tv (3 Viewers)

pilehave

Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    With version 2, I still see some slowdown when playing back recorded tv, do you want the normal logs, or debug-logs? (and I guess they need to be from the client, right?)

    :D
     

    miroslav22

    Development Group Member
  • Premium Supporter
  • September 4, 2009
    703
    460
    Warwick
    Home Country
    United Kingdom United Kingdom
    I have attached the version 2 patch and binaries to the first post for anyone who would like to test this.

    Thanks for all the testing and feedback so far.

    Are the binaries compiled for latest SVN?
    If not, could you provide then? I only need .ax (DirectShowFilters) binaries.. :)

    Sure, will do this tomorrow :)

    In version 2 I see that you have decided to use two buffer sizes 10 & 172.
    I think a better solution would be to adapt the #of buffers to the bitrate, so the playback time keept in the buffers are constant i.e low bitrate - low # of buffers, high bitrate - high # of buffers. A easy solution to this would be to measure the bitrate and calcuate # of buffers.

    void CDiskRecorder::Write(byte* buffer,int len)
    {
    ...
    if(m_MyPacketCounter == 0)
    m_iFirstPacketGetTime = timeGetTime();
    else if (m_MyPacketCounter == 10000) // calc after 10000 packets
    {
    DWORD now = timeGetTime();
    unsigned int bytesPerMsSec;
    unsigned int bufferSize;
    // Handle wrap
    if(now > m_iFirstPacketGetTime)
    bytesPerMsSec = (10000*188)/(now-m_iFirstPacketGetTime);
    else
    bytesPerMsSec = (10000*188)/(m_iFirstPacketGetTime-now);
    // Arbitary scaling
    bufferSize = bytesPerMsSec/25;

    if (bufferSize<10)
    m_iBufferSize=10*188;
    else if(bufferSize>100)
    m_iBufferSize = 100*188;
    else
    m_iBufferSize = bufferSize*188;
    }
    m_MyPacketCounter++;
    }

    A side benifit would be that the patch would not be so intrusive.

    Agreed, i'll look into this.

    There could be a few complications though as the write size needs to be matched in streamingserver to keep it properly in sync. Channel zapping would make the size of the buffer keep changing as well.
     

    mr viggo

    MP Donator
  • Premium Supporter
  • March 1, 2008
    500
    68
    Home Country
    Sweden Sweden
    Ok, trying to test v2 of the patch. But I think I got something wrong cos' now I can't tune a single channel without "unknown error". Perhaps someone can explain which binaries that goes into tvserver dir and which goes into MPclient dir, please!
     

    micko

    Portal Pro
    May 27, 2006
    258
    51
    Home Country
    Finland Finland
    Ok, trying to test v2 of the patch. But I think I got something wrong cos' now I can't tune a single channel without "unknown error". Perhaps someone can explain which binaries that goes into tvserver dir and which goes into MPclient dir, please!
    I have the same problem here. Replaced all binaries which I found in both directories (luckily renamed old ones first).
     

    pilehave

    Community Skin Designer
  • Premium Supporter
  • April 2, 2008
    2,566
    521
    Hornslet
    Home Country
    Denmark Denmark
    I have the same issue with patch #2 after restarting my server. This keeps getting as an error on the TV-Server with new patch + new binaries:

    2010-12-30 09:36:32.948800 [(16)]: Exception :confused:ystem.MissingMethodException: Method not found: 'Void TvLibrary.Streaming.RtspStream..ctor(System.String, System.String, TvLibrary.Interfaces.ITVCard)'.
    at TvService.TVController.StartTimeShifting(User& user, String& fileName)
    at TvService.TVController.StartTimeShifting(User& user, Int32 idChannel, VirtualCard& card, Boolean forceCardId, Boolean& cardChanged)
     

    disaster123

    MP Donator
  • Premium Supporter
  • May 14, 2008
    3,558
    434
    Home Country
    Germany Germany
    AW: Fix for stuttering/corrupted streaming of live tv

    Wrong binary for incorrect svn ver?
     

    miroslav22

    Development Group Member
  • Premium Supporter
  • September 4, 2009
    703
    460
    Warwick
    Home Country
    United Kingdom United Kingdom
    Apologies it looks like ive missed a file out of the upload

    Edit: Please redownload from the first post, the archive was missing tvservice.exe
     

    te3hpurp

    Retired Team Member
  • Premium Supporter
  • September 23, 2008
    910
    231
    Rovaniemi
    Home Country
    Finland Finland
    Hi.

    I'd like to test these against 27130 ie latest svn

    Br,
     

    mr viggo

    MP Donator
  • Premium Supporter
  • March 1, 2008
    500
    68
    Home Country
    Sweden Sweden
    I've been testing out v2 today, seems to be working nicely with smooth streaming of live Tv all night (hd&sd). Timeshifting on my second drive: WD green 1tbEADS (AHCI). Just to let you know..
     

    Users who are viewing this thread

    Top Bottom