[mythtv] Loud hard drive due to NuppelVideoRecorder.cpp sync()

Sam N. Max (snx) snx at rogers.com
Fri Jun 13 02:25:56 EDT 2003


I am fairly new to MythTV, so please bare with me... :)

During recording or live recording my hard drive was getting very loud
writing little bits of the video to the hard drive every second.  After a
while I figured out that this had to do with the call to sync() in
NuppelVideoRecorder::WriteVideo which gets called every keyframe (which is
every second).  I imagine this was done to try to spread the load of any
hard drive writes so there isn't a large write later on.  I commented the
sync() out, and my hard drive settled down, and from what I can tell I
wasn't having any trouble recording.

I'm not sure if I'm the only one has this hard drive noise problem.  It's
not as big a problem when it's writing a long stream of bytes (i.e. a
copying a huge file), but it has a problem with writing small bits every
second as myth does.  Looking at the man page for sync() this causes myth to
wait, which may end up wasting CPU time that could have been used encoding
while the data gets sent to the hard drive (unless there's some
multithreading going on to get around this).

Perhaps an option could be added to allow the user to specify whether sync()
should be called.  I'm not sure about other users experiences, but it might
make sense to not have it all (or default off).  If it used, there might be
some gain in encoding speed by moving the call to sync into another thread,
though that may prove useless.

One final thought.  Many people seem to have noticed a slow down with
version 0.9 (for now I've been sticking with 0.8).  I haven't fiddled with
it yet, but I was wonderring if the "position map" database write that
occurs every key frame may be the culprit (it comes right after the sync()
call in NuppelVideoRecorder.cpp).  There's also the call to the somewhat
kludgy looking "KickDatabase" function which I'm not totally sure about...
;)

- Eron



More information about the mythtv-dev mailing list