[mythtv-commits] Ticket #9191: Channel switching doesn't work with cx18 driver

MythTV mythtv at cvs.mythtv.org
Sat Nov 13 21:38:41 UTC 2010

#9191: Channel switching doesn't work with cx18 driver
 Reporter:  Artem Astafyev          |           Owner:         
     Type:  defect                  |          Status:  new    
 Priority:  minor                   |       Milestone:  unknown
Component:  MythTV - General        |         Version:  0.23.1 
 Severity:  medium                  |      Resolution:         
 Keywords:  cx18 SetInputAndFormat  |   Ticket locked:  0      

Comment (by Artem Astafyev):

 I asked ivtv-devel mailing list and below is what Andy Walls answered me:

 > I'm testing a new card GoTView PCI DVD3 with patch Alexey Chernov
 > provided recently. I have problem changing channel in MythTV but it
 > seems that it's not because of this patch. The problem is that cx18
 > driver rejects standard changing if there are some active analog
 > streams.

 That is valid behavior per the V4L2 API:


 the driver is allowed to return an errno of EBUSY when it is busy.

 That check exists, because it is not possible to change the capture and
 MPEG encoding engine between a 525 line standard (NTSC), 625 line
 stanadrd (PAL, SECAM), or audio only (FM radio) capture in mid-stream.

 Note, the CX23415/6/7/8 chips can only handle one incoming analog video
 and audio source at a time.

 >  I filed ticket in MythTV trac
 > http://svn.mythtv.org/trac/ticket/9191. Could somebody take a look at
 > it?

 Since at least Apr 27, 2007, when ivtv went into the mainline kernel,
 ivtv has always returned EBUSY for this case.  cx18 has always returned
 EBUSY for this case as well.

 Unless MythTV doesn't call close() once on the MPEG stream's file handle
 before trying to switch standards, I suspect the MythTV devs will close
 it without action.  MythTV needs to close() the MPEG file descriptor, if
 trying to switch standards on ivtv and cx18 type devices.

 BTW, VIDIOC_STREAMOFF is only supported for Streaming I/O methods.  The
 cx18 driver only supports the read() method.  Calling close() once on
 all *active* analog capture stream (MPEG, YUV/HM12, PCM, and/or VBI)
 file descriptors is required to free up the CX23418's encoding engine.


 > I wonder if it's possible to stop streams on standard change? That
 > would solve the problem.

 The application, i.e. MythTV, needs to be the one to do that.  Also note
 that if you are using the cx18-alsa.ko module, pulseaudio *may* have the
 PCM analog stream open.

 There really is only one analog video and audio stream being processed
 by the CX23418 chip.  You can get it in multiple output formats - MPEG,
 YUV/HM12, PCM audio only - at the same time, but it's still the same
 video and audio stream.

 The cx18 driver automatically closing all analog streams (MPEG,
 YUV/HM12, PCM, VBI) when someone calls a VIDIOC_S_STD ioctl() on a
 device node would be considered a non-compliance with the V4L2 API.  I'm
 not sure it would be a desirable feature either.
 So I think this issue should be fixed on MythTV side.
 It seems that this problem exists for a long time and I wonder how nobody
 else discovered it.

Ticket URL: <http://svn.mythtv.org/trac/ticket/9191#comment:3>
MythTV <http://www.mythtv.org/>
MythTV Media Center

More information about the mythtv-commits mailing list