Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: running out of space during cutting



Manfred Schmidt-Voigt wrote:
> 
> At Saturday, 16 August 2003, you wrote:
> 
> >Manfred Schmidt-Voigt wrote:
> >>
> >> ...
> >> I have played a little bit with the AssertFreeDiskSpace Function
> and I
> >> think I know now the "weakness" of this function. It is optimized for
> >> a job during recordings. If you use this routine also for cutting
> than
> >> you should set some of the defines to other values. If you set
> >> MINDISKSPACE to 1024Mb than this is not enough for a "fast recording"
> >> as cutting is. You "record" more than 1GByte in 100 seconds
> >> (DISKCHECKDELTA) which is the second important value to this
> >> algorithm. So if you have a little bit more than 1GB free diskspace
> in
> >> the beginning but your recording need more than this you will only
> >> check in the beginning and than the "recording" runs out of space. I
> >> have set now MINDISKSPACE to 4096Mb and this should be sufficient to
> >> cut more than a 2hour movie. The other possibility is to lower
> >> DISKCHECKDELTA. But this will increase the process load.
> >>
> >> Maybe you can think about something to determine if this function is
> >> called by a real recording or by the cutter and set the values than
> >> dynamically but with the big and cheap disks today its maybe more
> easy
> >> to spend these aditional 3GByte as free buffer on the video disk.
> >
> >Increasing MINDISKSPACE would mean that a normal recording would also
> >delete more existing recordings than necessary if it has a higher
> >priority, so I'd like to keep that value as it is.
> >
> >How about setting DISKCHECKDELTA to 10 and REMOVELATENCY to 1 in
> AssertFreeDiskSpace()?
> >This could be done dynamically by using the special value of -1 for the
> >Priority parameter, and simply dividing DISKCHECKDELTA and REMOVELATENCY,
> 
> >respectively, by 10. That way deleted recording would be removed
> faster.
> >
> >Please try
> >
> >#define DISKCHECKDELTA    10 // seconds between checks for free
> disk space
> >#define REMOVELATENCY      1 // seconds to wait until next check after
> >removing a file
> >
> 
> OK, these values are doing the job! So it would be nice if you can
> include this in relation with a special priority value for cutting
> into the next maintenance release.

Here's how I'd like to do this:

--- cutter.c    2003/05/24 11:59:33     1.4
+++ cutter.c    2003/08/17 09:04:04
@@ -86,7 +86,7 @@

            // Make sure there is enough disk space:

-           AssertFreeDiskSpace();
+           AssertFreeDiskSpace(-1);

            // Read one frame:

--- recording.c 2003/05/30 13:23:54     1.80
+++ recording.c 2003/08/17 09:07:51
@@ -95,7 +95,8 @@
   // a file, or mark a file for removal ("delete" it), so that
   // it will get removed during the next call.
   static time_t LastFreeDiskCheck = 0;
-  if (time(NULL) - LastFreeDiskCheck > DISKCHECKDELTA) {
+  int Factor = (Priority == -1) ? 10 : 1;
+  if (time(NULL) - LastFreeDiskCheck > DISKCHECKDELTA / Factor) {
      if (!VideoFileSpaceAvailable(MINDISKSPACE)) {
         // Make sure only one instance of VDR does this:
         cLockFile LockFile(VideoDirectory);
@@ -113,7 +114,7 @@
                  r = Recordings.Next(r);
                  }
            if (r0 && r0->Remove()) {
-              LastFreeDiskCheck += REMOVELATENCY;
+              LastFreeDiskCheck += REMOVELATENCY / Factor;
               return;
               }
            }


Maybe you can run a test with this, so we don't break things when putting
this into VDR 1.2.3.

Klaus


-- 
Info:
To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe vdr" as subject.



Home | Main Index | Thread Index