[vdr] DeleteResume patch for vdr 1.3.32.

christian jacobsen Christian.Jacobsen at stage-entertainment.de
Mon Sep 12 09:30:47 CEST 2005


Hallo Carsten, 

> I currently have 519 recordings on 9 disks.
> Even with my patch it takes 30-40 seconds to bring up
> the recordings menu.
> So some of my family members often inadvertendly start
> the first recording in the first folder because they keep
> pressing OK thinking VDR did not receive the previous OK
> command.
> 
> 3) You could spawn a separate thread for every disk
>     you process, so waiting for 9 disks to spin up does
>     not take 9*spinup_time, but only 1*spinup_time.

Why does all the disks spinup ?

IIRC VDR does only read the directory and the index.vdr file. If this is
on the first disk (as it should be) then only the first disk is read ...
and all other disks stay asleep!

If I may guess then you have spread the recordings all over disks -
including index.vdr, right ?
Or maybe even linked the complete recording directory to another disk ?

Other things that wakeup disks :
- recording to a disk
- Replaying Recording
- Removing Deleted recordings every hour (that can be changed - see
below)


FYI
I have a 2 disk system in my living room - the first disk is allways on,
the second "allways" sleeping (and only wakeup if something is Cutted to
it or a recording is replayed from it). The first disk is mapped on
/video and only that one is used for recording. The secod disk ist
/video1 and is only filled when cutting recordings (search for
AutoCutter for more). 


One could also move the recordings at a certain time (like shortly after
booting) with a script without cutting - IIRC Emil is doing that, maybe
he could be so friendly to post his perl script :)


If you only want to remove the Deleted recordings once a day you should
change REMOVECHECKDELTA in recording.c to 86400.

But you can also disable "Removing Deleted recordings" completely -
thats what I did. The reason for tis is that I would like to keep the
second disk sleeping as long as possible :

--- vdr.c.ORG   2005-08-25 12:07:27.208113418 +0200
+++ vdr.c       2005-08-25 12:07:59.176569418 +0200
@@ -976,7 +976,8 @@
                     }
                  }
               // Disk housekeeping:
-              RemoveDeletedRecordings();
+              // CJAC - now deleting is done by a script
+              // RemoveDeletedRecordings();
               cSchedules::Cleanup();
               // Plugins housekeeping:
               PluginManager.Housekeeping();

You will then have to write a script that takes care of Removing the
Deleted Recordings. 
On my system that is done on every boot 5 min. after VDR start (disk
goes to sleep after 20min.). And I am booting once a day because the
system goes to sleep at night and wakes up with NVRAM in the morning
again - unless somebody watches TV all night ;)

Here is my RemoveDeletedRecordings.sh script - I am sure it could be
done a lot more nice, but thats what I "hacked togehter" and it works
nicely :)

Warning : you shold check that "rmdir -pv" does not do anything strange
on your system - otherwiese you make end up with an Empty disk !!


#!/bin/sh

# This script Really Deletes the Recordings that was "deleted" by VDR

VDRROOT=/video

printf "\n\nStart $(basename $0) : $(date)\n"

find $VDRROOT/ -name "*.del" -type d | while read i
do
  printf "\n\nREMOVING %s :\n\n" "$i"

  SecondaryVideoDir=""
  for f in $i/*; do
    FileLink=$(readlink $f)
    if [ "$FileLink" != "" ]; then
      printf "Linked $(basename $f) : "
      rm -fv $FileLink
      SecondaryVideoDir=$(echo $FileLink|cut -f1-$(echo $FileLink|sed -e
's/\// /g'|wc -w) -d/)
    fi
    rm -fv $f
  done

  # Try to remove maybe empty Directory and Parents
  [ "$SecondaryVideoDir" != "" ] && rmdir -pv $SecondaryVideoDir
  rmdir -pv $i

  touch $VDRROOT/.update

Greetings
Christian Jacobsen



More information about the vdr mailing list