[mythtv-commits] Ticket #11410: backend hang: mpeg recordings with vbi sometimes hang at finish

MythTV noreply at mythtv.org
Sat Feb 23 16:47:26 UTC 2013


#11410: backend hang: mpeg recordings with vbi sometimes hang at finish
----------------------------------------+----------------------------
 Reporter:  rd.mora@…                   |          Owner:  danielk
     Type:  Bug Report - Hang/Deadlock  |         Status:  new
 Priority:  minor                       |      Milestone:  unknown
Component:  MythTV - Recording          |        Version:  0.26-fixes
 Severity:  medium                      |     Resolution:
 Keywords:  mpegrecorder vbi hang       |  Ticket locked:  0
----------------------------------------+----------------------------

Comment (by rd.mora@…):

 Hmm, that diff isn't going to work - it is still possible for the vbi
 thread to be blocked in a read before we signal it and then stop the
 encoding.  Even moving the StopEncoding() to after the vbi_thread->wait()
 won't work - the vbi_thread could be blocked on a read and because there
 is now nothing reading data from the mpeg FD the driver buffers full up
 and it stops writing to the VBI FD.  The best solution seems to be to put
 the VBI FD into non-blocking mode, for which the changes required actually
 seem pretty minimal, i.e.:

 {{{
 diff --git a/mythtv/libs/libmythtv/v4lrecorder.cpp
 b/mythtv/libs/libmythtv/v4lrecorder.cpp
 index a16214f..79239ad 100644
 --- a/mythtv/libs/libmythtv/v4lrecorder.cpp
 +++ b/mythtv/libs/libmythtv/v4lrecorder.cpp
 @@ -129,7 +129,7 @@ int V4LRecorder::OpenVBIDevice(void)
      }
      else if (VBIMode::NTSC_CC == vbimode)
      {
 -        fd = open(vbidev.constData(), O_RDONLY/*|O_NONBLOCK*/);
 +        fd = open(vbidev.constData(), O_RDONLY|O_NONBLOCK);
      }
      else
      {
 @@ -326,7 +326,7 @@ void V4LRecorder::RunVBIDevice(void)
                  }
                  ptr = buf;
              }
 -            else if (ret < 0)
 +            else if ((ret < 0) && (EAGAIN != errno) && (EINTR != errno))
              {
                  LOG(VB_GENERAL, LOG_ERR, LOC + "Reading VBI data" + ENO);
              }
 }}}

 NOTE: This diff does not handle PAL VBI, just NTSC!

 I'll update the ticket if I run into any trouble with this change....

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/11410#comment:2>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list