Page tree


Search


 Recently Updated



 Latest Releases

 MediaPortal 1.20 
            Releasenews | Download
 MediaPortal 2 2.2 
            Releasenews | Download

Theory

At the beginning there is always boring theory.

RAM drive

A RAM drive treats a segment of RAM as a virtual harddisk. Due to the lack of moving parts the RAM drive has much faster read and write speeds than a common harddisk. Even faster than SSD drives due to greater bandwidth. However the big disadvantage of a RAM drive is that it is voltatile memory, the complete content is deleted at poweroff. Thus it's perfect for temporary files like the timeshiftbuffer files which are accessed frequently but are not needed after shutdown.

Timeshiftbuffer of the TV-Server

  Tip On a Singleseat-Setup only one buffer is created because you can watch only one stream at the same time. Start recording would open a second stream but recordings are written directly to disk. For Multiseat-Setups there can be a buffer for each card in use. Consider this at the min./max. and filesize configuration of the buffer.

LiveTv is always turned on at the TV-Server because of streaming to the TV-Plugin. When switching TV on, a minimal count of files is written to disk which will be expanded to a maximum configurable count of files. The minimal count of files in combination with the size decide how long you can turn back to normal watching. The difference between minimum and maximum files decides how long you can pause live TV. The time for timeshifting can be easily calculated but depends on the datarate of the TV-Stream. Approximately it's 2 GB for 60 minutes.

Example for a 1GB RAM drive

  Tip When the last buffer file is written the TV-Server starts to override the first one and the buffer gets mixed up. You will lose some fragments of the paused program.

Because of the different conversion of kB to MB to GB using 1000 or 1024 units, we are not going to use the mathematical maximal values. Another reason is the overhead that Windows produces for systemfolders. A solution for this could be setting the filesize to 16 MB or 32 MB and the minimal and maximal values higher.

Min. count of files: 2
Max. count of files: 8
Filesize: 120 MB

Normal time to jump back:
Min. files * size = MB / 2 GB * 60 minutes = time to jump back
2 * 120 = 240 / 2000 * 60 = 7.2 minutes

Max time for break live TV:
(Max. files – min. files) * size = MB / 2GB * 60 minutes = Max break time
8 – 2 = 6 * 120 = 720 / 2000 * 60 = 21.6 minutes
 

Suggested Examples for 1 GB - 8 GB RAM drives

Click here to view a table with suggested timshift buffer settings

RAM drive software

The choice of RAM drive software is mostly unimportant. Just make sure that the RAM drive lets you configure at least 1 GB of RAM. Less is not recommended. For this reason the Windows Ramdisk is unusable.

Conclusion

Pros

  • Less annoying hard disk seek noise
  • Because of this, less strain and longer lifetime for the hard disk

Cons

  • Costs per GB (RAM costs considerably more)
  • Maximum 4GB RAM for 32-bit OS, resulting in 2GB respectively 3GB of maximal RAM drive size
  • Less Timeshiftbuffer

You'll should note that RAM disk won't provide any faster channel change times. Current bottleneck is not the hard disk speed.

Practice

Let's get started.

Installation

The installation should be more or less the same for all RAM drives. For this example we use RRamdisk.

  1. Download and unzip

    ramdisk.zip

    to e.g.

    c:\RRamdisk
  2. Execute the

    ramdisk.exe

    and click Install Ramdisk

  3. Select the size of the RAM drive under Disk Size and set Media Type to Fixed Media. The Drive Letter doesn't matter.
  4. After another click on OK a success dialog appears and we're done.

Configuring TV-Server to use the RAM drive

  1. Start the TV-Server configuration and select Timeshifting / Folders tab. Now set the path for the timeshiftbuffer files to your RAM drive drive letter.
  2. Under Timeshifting / General tab you can set the minimum and maximum number and overall size of the timeshiftbuffer files according to your RAM drive size. Note that the file settings are per tuner so your available RAM drive must be at least max files * size * num tuners (assuming all cards use the same RAM drive for their timeshift buffer per step 1 above). If not, live TV will freeze when the RAM drive fills.
  3. Try to start timeshifting under Manual Control.
  4. That's it, close the configuration, start MediaPortal and enjoy.

Automatically create a RAM drive at startup using IMdisk

You can let Windows run a batch file on every startup which uses IMdisk to create a RAM drive.

  1. Create an empty text file and name it, for example

    CreateRAMdrive.bat

    . Paste the following commands into the file:

    imdisk.exe \-a \-s %1 \-m R: \-p "/fs:NTFS /q /y"
    label R: Timeshift
    
  2. Start

    gpedit.msc

    and navigate to Computer Configuration\Windows Settings\Scripts (Startup/Shutdown)\Startup. Add the batch file to the Script Name field and type a drive size in the Script Parameters field, for example

    to create a 8 GB RAM drive.
    If you want to setup the automatic startup in a batch file (e.g. as part of an unattended installation) instead of interactively, it is easier to use a scheduled task instead of a group policy.  Here is a command line to set up a scheduled task based on the batch file above:

    schtasks.exe /create /TN CreateRAMdrive /tr "<location of batch file>\CreateRAMdrive.bat <size of RAMdrive>" /sc ONSTART /ru "System"
    


    The command line must be executed with administrative privileges. If you cut and paste from above, remove any line breaks from the result.
    See The easy - and free - way to create and use a RAMdisk for a step-by-step description of how to generate a RAM drive at boot using IMdisk.

    Note

    Putting your internet, and other application's, cache files on the RAM drive is generally a good idea, however, assigning the Windows TEMP and TMP variables to a RAM drive can cause problems, despite the "answer" in this thread. Here are some discussions of the pitfalls:

   

 

2 Comments

  1. says:
    Since the comments are only visible when logged in, I added IMdisk to the list of RAMdisk software and added installation instructions to the bottom of the page.
    Posted Sep, 22 2012 10:30

  2. says:
    Yep updating page is much better - thx rsbrux!
    Posted Sep, 22 2012 22:09