[mythtv] fix for IOBOUND - blocking in ThreadedFileWriter::Write

Mudit Wahal mwahal at gmail.com
Wed Jul 6 20:55:30 EDT 2005


Hi,

I'm running myth 0.18 release version on a 2.6.12.1 kernel. My card is
HD3000 HDTV tuner card. I've one 180GB hard drive in my setup,
standard knoppix myth partition. /, /root, /cache and /myth , are all
ext 3.

Whenever the tuner is recording a program, and I try to copy a large
file, I get the following error message in the backend logs.

2005-07-06 16:07:00.217 IOBOUND - blocking in ThreadedFileWriter::Write()
2005-07-06 16:07:05.419 IOBOUND - blocking in ThreadedFileWriter::Write()
2005-07-06 16:07:09.360 IOBOUND - blocking in ThreadedFileWriter::Write()
2005-07-06 16:07:17.400 IOBOUND - blocking in ThreadedFileWriter::Write()
2005-07-06 16:07:26.623 IOBOUND - blocking in ThreadedFileWriter::Write()
2005-07-06 16:07:31.437 IOBOUND - blocking in ThreadedFileWriter::Write()

If I stop the copy, the message will also stop. 

When mythcommflag runs on a recorded file with these error messages,
it also complains about ac-tex damage, etc etc.

[mpeg2video @ 0xb7676010]ac-tex damaged at 22 53
[mpeg2video @ 0xb7676010]Warning MVs not available
[mpeg2video @ 0xb7676010]slice mismatch
[mpeg2video @ 0xb7676010]00 motion_type at 107 38 
[mpeg2video @ 0xb7676010]00 motion_type at 43 39

The video has lots of stuttering and it skips badly.

I searched through the archives and found out that the
TFW_DEF_BUF_SIZE (in libs/libmythtv/RingBuffer.cpp) definition changed
to a higher number fixes the issue. The default value is 2MB. I
changed it to 8MB and recompiled the libmythtv library.

Then I restarted the mythbackend, start to record one program and also
started to copy a large file. This time, I just got one error message,
probably at the very beginning of the copy. Then I started another
copy, and just got two messages, which is not as bad compared to one
message every couple of seconds.

2005-07-06 17:38:13.106 DVB#0 Successfully tuned to channel 20_1.
2005-07-06 17:38:13.120 adding: mythtvbe as a client (events: 0)
2005-07-06 17:38:13.841 Changing from None to RecordingOnly
2005-07-06 17:38:16.303 New DB connection, total: 4
2005-07-06 17:38:16.625 DVB#0 Recorder: Card opened successfully
(using TS mode).
2005-07-06 17:38:17.075 DVB#0 Data read from DMX - This is for
debugging with transform.c
2005-07-06 17:38:19.654 MainServer::HandleAnnounce Playback
2005-07-06 17:38:20.688 adding: mythtvbe as a client (events: 0)
2005-07-06 17:40:30.398 IOBOUND - blocking in ThreadedFileWriter::Write()
2005-07-06 17:45:06.337 IOBOUND - blocking in ThreadedFileWriter::Write()
2005-07-06 17:47:40.387 IOBOUND - blocking in ThreadedFileWriter::Write()


I think 2MB buffer may be fine for SD stuff, but for HD stuff, we need
a bigger buffer. I'll experiment with a 12MB and 16MB buffer also. I
did check the 0.18.1 code and the SVN code and the value is still 2MB.

Is it possible to set this option in configuration or pass an option via CLI ?

Thanks

Mudit


More information about the mythtv-dev mailing list