[mythtv] "ivtv driver has stopped responding" - with diff

Derek Battams derek at battams.ca
Mon Feb 13 23:05:32 UTC 2006

Quoting Derek Battams <derek at battams.ca>:

> Quoting George Nassas <gnassas at mac.com>:
>> On 9-Feb-06, at 4:47 PM, Derek Battams wrote:
>>> For me, recordings start, but in the middle of the recording it stops
>>> and
>>> then my log fills with the 'select timeout' error until the scheduled
>>> end of the recording.
>>> Whatever was recorded up until the error is saved and I can watch the
>>> partial recording.  The error is produced by the select() call on line
>>> 475 of libs/libmythtv/mpegrecorder.cpp returning 0, which signals a
>>> timeout.
> Unfortunately, all my profiles were already set to PS and I still
> haven't had a reoccurence since I added my attempted fix.  Of course, I
> can also say I haven't had a reoccurence since I upgraded to SVN 8906
> so perhaps that's the reason (fingers crossed)?  I'll continue to
> monitor this.

Ok, this finally happened again today while watching live tv.  And my 
fix worked.  On the select timeout, the device was closed, reopened, 
and recording continued.  I only lost about 1-2 seconds of the 
recording, but then it continued with no problems until the end of the 
program.  I'd like some feedback on this before I go opening a ticket 
for this.  I think the more interesting issue is why this timeout 
occurs during a recording in the first place.  I wasn't able to find an 
explanation for this so this patch is the next best thing I could come 
up with and, most importantly, it works by allowing an in-progress 
recording to continue instead of just dumping the printf over and over 
until the program ends.

  - Derek

Here's my diff for the fix:

Index: libs/libmythtv/mpegrecorder.cpp
--- libs/libmythtv/mpegrecorder.cpp     (revision 8928)
+++ libs/libmythtv/mpegrecorder.cpp     (working copy)
@@ -481,6 +481,15 @@
             case 0:
                 printf("select timeout - ivtv driver has stopped 
+                // Let's try to close the device and reopen it; I'm guessing
+                // we may lose a second or two of video, but I believe that's
+                // better than losing the entire remainder of the recording
+                // when this timeout occurs.
+                //
+                // More importantly, what exactly would cause this timeout?
+                if(close(readfd) != 0)
+                    perror("close");
+                readfd = -1;  // Force the PVR card to be reopened 
            default: break;

More information about the mythtv-dev mailing list