Timeshifting setting recommendation (1 Viewer)

enricong

Portal Pro
November 18, 2008
65
0
What are the recommended settings?

What is the advantage/disadvantage of having a larger number of small files vs having a smaller number of large files?
 

mm1352000

Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    What are the recommended settings?
    The defaults... unless you understand the settings enough to change them.

    What is the advantage/disadvantage of having a larger number of small files vs having a smaller number of large files?
    Access to more back buffer when your timeshift buffer space is very constrained.
     

    enricong

    Portal Pro
    November 18, 2008
    65
    0
    I read the wiki and under stand it is saving files to create a buffer. And the minimum number is for the buffer to rewind. and the max number defines how much more to record once you hit pause.

    However, I did not see any mention as to the difference between having, for example. 50 250MB files vs 1 12gb file. It adds up to the same amount of time.

    I figure maybe there is a difference in terms of overhead with keeping track of more files. And perhaps more delay with opening and closing files more often.
     
    Last edited:

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    However, I did not see any mention as to the difference between having, for example. 50 250MB files vs 1 12gb file. It adds up to the same amount of time.
    You're right - the wiki doesn't explain everything.

    Here's the thing. The difference is subtle and difficult to explain/understand unless you're technically minded or want to spend time really understanding how MP works. By coincidence I was asked to explain this very thing recently. The explanation took more than an hour to write. You can read my answer here:
    https://forum.team-mediaportal.com/...lpha-4-2014-02-15.114068/page-30#post-1065222

    The short answer is that in most cases it makes no difference. Like I said above, it can make a difference in cases where the timeshift buffer is very small and you're trying to maximise how much back buffer you can get out of it in all scenarios.

    Ultimately the point I'd like to convey is that if you don't need to change the setting then don't change it. If you don't know whether you need to change a setting then you probably don't need to change it. There is no harm or shame in not understanding a setting and leaving it at defaults. The defaults are defaults for a reason - to be safe/good values for most people.
     

    enricong

    Portal Pro
    November 18, 2008
    65
    0
    Thanks, I do need to change it because I'd like a larger buffer. Thats why the question came up, to understand which values to change.

    I read through your post and understand the difference now, pretty minor. Now I would assume if this was taken to the extreme and the file size was 1mb to reduce the wasted buffer time, we'd start hitting issues with the overhead of switching files. Ofcourse we're only talking about maybe 2min lost
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    I think larger files would take longer to create/allocate (though I could be wrong)... and yes, smaller files would lead to more overhead in switching files.

    Primarily the way to increase the buffer size is to increase <minimum> (and <maximum>). The max <minimum> value is 100.

    100 x 256 MB = 25600 MB = ~25 GB = normal buffer size
    10 Mb/s = 1.25 MB/s
    25600 / 1.25 = 20480 seconds / 60 = 341.33 minutes / 60 = 5.688 hours.

    If you really need a buffer which is longer than 5.6 hours (or whatever the calculation gives for your source bitrate) then by all means go ahead and bump the file size. Otherwise I suggest just increase <minimum>. I note default <minimum> and <filesize> yields 20 minutes... which for many people is enough.

    mm
     

    enricong

    Portal Pro
    November 18, 2008
    65
    0
    Actually, I was going to ask why not create one file and just track the write pointer and read pointer and keep looping within the file. Depending how it is being done in code it may not make a difference how big the file is when you first open the file. Does it actually need to allocate the space or does it just open a file handle and start writing. Anyways for such a minor inefficiency, maybe it doesnt matter.

    Yeah, I just changed minimum and maximum.
     

    mm1352000

    Retired Team Member
  • Premium Supporter
  • September 1, 2008
    21,577
    8,224
    Home Country
    New Zealand New Zealand
    Actually, I was going to ask why not create one file and just track the write pointer and read pointer and keep looping within the file.
    What you've suggested is known as a ring buffer. This has been suggested previously though as far as I know nobody has attempted to implement it for MediaPortal. From a technical perspective it is more complex than the current approach, but perhaps "cleaner" or easier to configure/understand from a user perspective.

    Also, file size is limited on certain file system types. For example, FAT32 (still moderately common) has a maximum file size of 4 GB. That might be an issue for some people.

    Depending how it is being done in code it may not make a difference how big the file is when you first open the file. Does it actually need to allocate the space or does it just open a file handle and start writing.
    My understanding is that timeshift buffer file space is pre-allocated to minimise overhead. In other words: writing to file that continuously grows in is more intensive for the storage subsystem than pre-allocating 256 MB and writing into that pre-allocated space.

    Anyways for such a minor inefficiency, maybe it doesnt matter.
    Don't quote me (I had no part in the original design choices - was long before my time - and I'm not an expert on file systems) but I'm not so sure that the inefficiency is minor. The HDD load/performance in part determines some key things like the maximum number of users and channel change speed. Therefore it makes sense to minimise the load on the HDD where possible.
     

    enricong

    Portal Pro
    November 18, 2008
    65
    0
    Good points. Its easy to suggest ideas, implementation is another story. When I said minor inefficiency, I was referring to the current implementation and missing out on like 2-3min of your back buffer so its probably pretty low on the list with regards to improvement.
     

    regeszter

    Retired Team Member
  • Premium Supporter
  • October 29, 2005
    5,335
    4,954
    Home Country
    Hungary Hungary
    Hi,

    However, I did not see any mention as to the difference between having, for example. 50 250MB files vs 1 12gb file. It adds up to the same amount of time.

    When the buffer is full, the 1st buffer will be overwited.
    If you have 40 x 250MB = 10GB buffer, you will stay 39 x 250 = 9,75 GB when a buffer file is overwited.
    If you have 4 x 2500MB = 10GB buffer, you will stay 3 x 2500 = 7,5 GB when a buffer file is overwited.

    I think the 1st. is better.
     

    Users who are viewing this thread

    Similar threads

    Thanks for your reply. In my configuration this setting is set to "no". To avoid misunderstandings, the MP window size changes on screen resolution changes, MP always fulfills the whole screen. Also, the home screen buttons size is adjusted. Only the font size is not adjusted to the new screen resolution.
    Thanks for your reply. In my configuration this setting is set to "no". To avoid misunderstandings, the MP window size changes on...
    I use two monitors - a large display for TV and video watching and a small display for music playback, to get the current track...
    Replies
    2
    Views
    620
    THX for info. 0.62 plugin version doesn't crash with MP 1.31 therefore, it seems to me to be little buggy...
    THX for info. 0.62 plugin version doesn't crash with MP 1.31 therefore, it seems to me to be little buggy...
    Started on: 2023-12-26 last update: 2023-12-26 Summary: Minimize the amount of data written to disk by simulating a tempfs RAM...
    Replies
    4
    Views
    810
    I have looked at your log files, but as usual they are unintelligible gobbledegook. (I am sure that the original developers who wrote that code know what the log entries mean, but those developers have long since retired from the MP team.) I regret to say that I think that you will have to use the "brute force" method to track down...
    I have looked at your log files, but as usual they are unintelligible gobbledegook. (I am sure that the original developers who...
    Sometimes when displaying the OSD whilst playing a recorded TV show the video freezes and the sound continues for about 30 seconds...
    Replies
    1
    Views
    646
    I am Sure the Issues will be fixed towards a stable. NET6 Version. Please don't get me wrong - My Intent was not any Complaint at all. I just wanted to: understand current Status & Situation understand my Options for a stable System improve my Knowledge & learn from Experts Especially because your limited Dev Resources and the...
    I am Sure the Issues will be fixed towards a stable. NET6 Version. Please don't get me wrong - My Intent was not any Complaint at...
    Hello Folks, Yesterday I upgraded to Mediaportal 2.5 via uninstalling 2.4.1 first and then install the latest .NET6 Variant of...
    Replies
    12
    Views
    1K
    @CyberSimian As I have just posted in the MP2 subforum I will stay with MP1 for the time being. Many thanks for all your very informative and detailed responses. I will take your advice and monitor the Scheduled recordings list for the discrepancies you have described. Cheers.
    @CyberSimian As I have just posted in the MP2 subforum I will stay with MP1 for the time being. Many thanks for all your very...
    I am in Australia. My problem is with recorded tv programs. Most times the program title and info are correct but quite often the...
    Replies
    36
    Views
    3K
    Top Bottom