Timeshift file configuration (1 Viewer)

Jay_UK

Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Hi all,

    i know this has been asked before, but we never got a definitive answer....

    What would be the best way of configuring the timeshift files.

    I have 8GB space to play with.... system has 4 tuners....3 clients... but only a single client is really in use at once.

    If I keep 256MB as the file size, and all tuners share the same folder, what is the best minimum and maximum number?

    Many thanks,

    J.
     

    mm1352000

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

    The timeshift file contraints are effectively applied on a per user basis.
    As such, it doesn't really matter how many tuners you have. The more important figure is how many clients you have timeshifting concurrently.
    Each client that is timeshifting a channel could use up to [timeshift file size] * [max number of timeshift files] worth of space.
    If you only have one client timeshifting at any given time then I would set the constraints based on that. In other words, you could set the maximum number of timeshift files to 31 (deduct 256 MB for overhead). That would use your full 8 GB.
    If you had two clients with identical use patterns, you'd need to drop to 15 (31 / 2, round down). etc.

    mm
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    Thanks,
    I'm using a 4GB RAM Drive with 2 clients, found that the wiki didn't explain it adequately.
    You should write that in the wiki :D
     
    Last edited:

    Jay_UK

    Test Group
  • Team MediaPortal
  • October 6, 2009
    1,781
    283
    Derby
    Home Country
    United Kingdom United Kingdom
    Hi there,

    Many thanks for clarifying this.... so maximum size is based on the "maximum" x filesize (+ overhead)..... the "minimum" is a subset of the maximum?

    minimum = timeshift back buffer
    maximum = paused TV (which obviously includes the timeshift back buffer)

    So in you above example of two clients with a maximum of 15 files...what would the minimum be set to?

    I would have thought most people pause for a longer period than they would for jumping back?

    J.
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    The wierd thing is that tv server tells you the space needed, but it seems to calculate space needed based on the #minimum files x size of files + overhead (rather than using max files)
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    so maximum size is based on the "maximum" x filesize (+ overhead)..... the "minimum" is a subset of the maximum?
    Think of minimum as the default/standard size of the buffer. The TS buffer size remains at minimum [edit: ie. files are reused] unless you pause. In other words, minimum sets the amount of time that you can normally skip within. When you pause, MP uses up to maximum size [edit: depending on space availability].

    minimum = timeshift back buffer
    maximum = paused TV (which obviously includes the timeshift back buffer)
    Yes.

    So in you above example of two clients with a maximum of 15 files...what would the minimum be set to?
    Whatever you like, up to and including 15. Set it based on the amount of time you want in your back buffer.

    I would have thought most people pause for a longer period than they would for jumping back?
    Yes, which is why minimum is usually less than maximum.
     
    Last edited:

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    The wierd thing is that tv server tells you the space needed, but it seems to calculate space needed based on the #minimum files x size of files + overhead (rather than using max files)
    It is actually quite complex to figure out and explain. I spent at least an hour trying to write an update for the wiki but failed.
    I guess TV Server notes the minimum because the minimum is the nominal amount of space that would be used. Maximum is only used in the pause case if you have space available.
     

    kiwijunglist

    Super Moderator
  • Team MediaPortal
  • June 10, 2008
    6,746
    1,751
    New Zealand
    Home Country
    New Zealand New Zealand
    when calculated space available for pausing does it use
    1. total space on drive - ( min# files x size of files) or
    2. currently available space on drive
    3. total space on drive - ( max# files x size of files) or
    4. the difference between max + min

    I currently have max + min set to the same number, because i didn't understand how it worked.

    EDIT: I just read your other post, I think I will change min + max, because I'd rather have a very long pause time. I assume I will need to manually calculate max# files x size of files + overhead to make sure this variable is not larger than my ram drive???
     
    Last edited:

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    when calculating space available for pausing does it use...
    None of the above... I think... but maybe I'm misunderstanding your options.
    When paused, TV Server will use up to [Maximum] * [Filesize] for each paused client/session.
    There is one caveat: the available HDD space must be >= [Filesize] * 2 in order for TV Server to create a new timeshift file. In other words, TV Server prevents you from using the last [Filesize] space on your HDD.

    In case you understand code, here is the relevant section from deep inside TsWriter:
    Code:
    __int64 llDiskSpaceAvailable = 0;
    if (SUCCEEDED(GetAvailableDiskSpace(&llDiskSpaceAvailable)) && (__int64)llDiskSpaceAvailable < (__int64)(m_maxTSFileSize*2))
    {
      hr = ReuseTSFile();
    }
    else
    {
      if (m_tsFileNames.size() >= (UINT)m_minTSFiles)
      {
        if FAILED(hr = ReuseTSFile())
        {
          if (m_tsFileNames.size() < (UINT)m_maxTSFiles)
          {
            if (hr != 0x80070020) // ERROR_SHARING_VIOLATION
              LogDebug("Failed to reopen old file. Unexpected reason. Trying to create a new file.");
     
            hr = CreateNewTSFile();
          }
          else
          {
            if (hr != 0x80070020) // ERROR_SHARING_VIOLATION
              LogDebug("Failed to reopen old file. Unexpected reason. Dropping data!");
            else
              LogDebug("Failed to reopen old file. It's currently in use. Dropping data!");
     
            Sleep(500);
          }
        }
      }
      else
      {
        hr = CreateNewTSFile();
      }
    }

    I currently have max + min set to the same number, because i didn't understand how it worked.
    Set maximum to the size corresponding with the longest pause you anticipate using... or just set it up to the maximum free space on the HDD.
    Set minimum to the size corresponding with the back buffer that you might nominally want... or if you don't care about HDD wear and speed set it the same as maximum.
    This really isn't something that is particularly critical as MP will prevent you from completely filling the HDD.
     
    Last edited:

    Users who are viewing this thread

    Top Bottom