DeleteResume patch for vdr 1.3.32.

Message ID
State New

Commit Message

christian jacobsen Sept. 12, 2005, 7:30 a.m. UTC
  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

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 :

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 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 !!


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


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

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

  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/)
    rm -fv $f

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

  touch $VDRROOT/.update

Christian Jacobsen


Carsten Koch Sept. 12, 2005, 11:48 a.m. UTC | #1
christian jacobsen wrote:
> Why does all the disks spinup ?
> Or maybe even linked the complete recording directory to another disk ?


My /video directory looks like that:

vdr /home/cko> ls -l /video
total 12784
lrwxrwxrwx  1 cko users       15 Apr 16 21:49 Action -> ../diskb/Action
lrwxrwxrwx  1 cko users       15 Apr 16 21:49 Comedy -> ../diskc/Comedy
lrwxrwxrwx  1 cko users       20 Aug  1 16:17 Fantasy -> /athlon/vdr5/Fantasy
lrwxrwxrwx  1 cko users       19 Aug  1 16:18 Horror -> /athlon/vdr8/Horror
lrwxrwxrwx  1 cko users       17 Aug  1 16:17 Kids -> /athlon/vdr6/Kids
lrwxrwxrwx  1 cko users       17 Aug  1 16:17 Misc -> /athlon/vdr5/Misc
lrwxrwxrwx  1 cko users       18 Aug  1 16:18 Music -> /athlon/vdr8/Music
lrwxrwxrwx  1 cko users       18 Sep  7 15:51 SciFi -> /athlon/vdr9/SciFi
lrwxrwxrwx  1 cko users       16 Apr 16 21:49 Science -> ../diskd/Science
lrwxrwxrwx  1 cko users       17 Apr 16 21:49 Thriller -> ../diskb/Thriller
-rw-r--r--  1 cko users 13081841 Sep 12 13:40
-rw-r--r--  1 cko users      366 Sep 10 17:53 global.mplayer.resume
-rw-r--r--  1 cko users      774 Sep 12 01:35 id3info.cache

And I have epg2timers set up, so it assigns a genre to each recording
automatically, so recordings usually go right into one of the above
10 genre folders.
Only if epg2timers fails to determine the genre or if I program a
recording from the OSD, it goes directly into /video and I move it
into a genre folder later or watch and delete it right away.



--- 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();
               // Plugins housekeeping: