[mythtv-users] Experimenting with TFW_DEF_BUF_SIZE to minimize HDTV IOBOUND errors

Yeechang Lee ylee at pobox.com
Sun Feb 19 01:00:00 UTC 2006

[Apologies if this belongs on mythtv-dev@, but I don't subscribe to
that list as I'm not really a coder--as my message will make
clear--and I know developers read mythtv-users at .]

I've been working on ways to minimize the IOBOUND errors that have
bedeviled my HDTV recordings since I started using 0.18 two months
ago. (See
among others, for some previous reports.) I'd hoped 0.19 would have
helped, but as far as I can it didn't.

My setup:
* Frontend/backend: 3.0GHz Hyperthreaded Pentium 4 with 512MB running
Fedora Core 4 and MythTV 0.19 from ATrpms
* Program sources: Two Motorola DCT-6200 boxes through FireWire
(One point-to-point and one broadcast, both at 200Mbps) and a HD5000
ATSC card.
* MythTV storage: Infrant ReadyNAS 600 gigabit Ethernet-capable NAS in
ext3 [1] over RAID 0, mounted via CIFS [2].
* Network: D-Link PCI Express gigabit Ethernet card and SMC gigabit
Ethernet switch .

After reading
<URL:http://www.gossamer-threads.com/lists/mythtv/dev/139332>, I
downloaded the ATrpms MythTV source RPM, unpacked the tarball, and
began fiddling with libs/libmythtv/ThreadedFileWriter.cpp. The key
lines are:

const uint ThreadedFileWriter::TFW_DEF_BUF_SIZE   = 2*1024*1024;
const uint ThreadedFileWriter::TFW_MAX_WRITE_SIZE = TFW_DEF_BUF_SIZE / 4;
const uint ThreadedFileWriter::TFW_MIN_WRITE_SIZE = TFW_DEF_BUF_SIZE / 8;

(Read the above, shown as it appears in the 0.19 source code, as

To experiment without unduly upsetting my MythTV setup I repacked the
tarball, rebuilt the source RPM, rebuilt the binary RPMs, then
installed only the new libmyth RPM.

Since nothing succeeds like excess, I first tried 64-4-8. This seemed
to work quite well when recording and playing back two FireWire
streams. However, adding the ATSC stream as a third or second (and,
I'm pretty sure, only) recording would consistently in under ten
seconds 1) generate an IOBOUND begin error (without, ominously, a
corresponding IOBOUND end error as is typical) and 2) hang the
backend. 64-8-16 ran into the same issue. By contrast, 64-12-24 (and,
I think, 64-16-32) did *not* hang with ATSC, but I saw IOBOUND errors
with just two recordings. Chastened, I next tried 16-4-8. Again no
ATSC hang, but I saw IOBOUND errors with playback plus three

With my current setup, 32-12-24, I *can* reliably record three sources
at once as long as I don't try any form of playback (even the preview
clips in 'Watch Recordings'); any playback results in some IOBOUND
errors (And, is it just me, or are the preview clips more
disk-intensive than actually playing back the shows themselves?). I
*can* also do playback plus two recordings (regardless of source)
reliably. Most interestingly, I can *also* delete recordings (I've
done up to 5GB so far) without causing IOBOUND errors, something that
formerly was guaranteed in any recording scenario whatsoever with any
file larger than a few hundred MB.

I suspect there indeed is some "right combination" of numbers that
will deliver what I want--being able to reliably do playback plus all
three recordings--but as the ATSC card is only used a few times a week
it's not *that* a big deal (and, as noted, I can apparently merely
avoid playback in order to capture pristine recordings). I'm burnt out
on the whole editing+rebuilding+installation rigamarole for now (so
didn't try many obvious combinations, such as other 32-x-y variants),
but hopefully this will inspire another to take up the torch.

[1] Yes, I'd prefer this to be JFS or XFS, but that's not available
with Infrant's firmware and may never be.

[2] Please see
<URL:http://www.gossamer-threads.com/lists/mythtv/users/169825> for
why I don't use NFS.

Yeechang Lee <ylee at pobox.com> | +1 650 776 7763 | San Francisco CA US

More information about the mythtv-users mailing list