[mythtv-users] Pre-recording Script?

Stephen Worthington stephen_agent at jsw.gen.nz
Thu Jan 11 00:30:41 UTC 2018


On Wed, 10 Jan 2018 11:04:11 -0800, you wrote:

>Hi
>
>I have a very slow drive and I allow it to spin down.  One of those drives
>that are best used only for archiving.  Normally its fine for recordings,
>but sometimes I get failed recording because, I theorize, that I have a
>buffer overflow when the drive needs to spin up AND I have multiple
>recordings starting at the same time.  My recording are coming from an
>HDHomerun in h264.
>
>Is there a pre-recording script that can fire, say, 1-minute before a
>recording is scheduled?  All I want it to do is touch a dummy file in the
>recording directory.  I only have 1 recording directory so I don't even
>need to think about which dir/drive needs to be touched.
>
>Thanks for the help

Exactly what sort of drive is it?  If it is shingled drive, like the
Seagate ST8000AS0002 8 Tbyte archive drives I use for my archiving,
then spin up is not the only problem.  Shingled drives have to stop
writing every so often in order to re-write tracks that get
overwritten.  So they stop accepting write commands from the system
for considerable periods of time (many seconds).  The time involved is
way longer than the mythbackend and system buffers can cope with, so
such drives can not be used for recording.

How many recordings do you have starting at the same time?  When a
recording starts, there is significant disk activity where the heads
have to move back and forth to the system areas of the disk in order
to set up the directory entries and space allocation for the files
being opened.  Head movement takes a long time, and too much of it
happening at once will mean that the heads do not get back to the
correct location to write the next block of data for a recording
before the buffers overflow.  If the problem is only at startup of
multiple recordings, then you can manually fix that by telling one or
more of the recordings to start early.  So if you are starting three
recordings at the same time, you would set up override rules to start
one recording two minutes early,one recording one minute early, and
one recording would be left to start at the normal time.

However, while recording, if you are recording to three files at once,
the heads will be continually moving between the files.  There may be
enough time for that most of the time, but when more space needs to be
allocated for one of the files, the heads will then need to move to
the system areas as well and that may cause a buffer overflow and loss
of data in the middle of one or more of the recordings.

As a rule of thumb, with modern hard drives, I would not want to have
more than three recordings happening at once, and I have my system set
up with enough recording drives (7) so that I have no more  than two
recordings at once on any one drive.


More information about the mythtv-users mailing list