On Sat, 2010-11-13 at 16:59 +0200, Artem Astafyev wrote:
> Hi All,

Hi.

> 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:

http://linuxtv.org/downloads/v4l-dvb-apis/vidioc-g-std.html

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.

http://linuxtv.org/downloads/v4l-dvb-apis/func-close.html


> 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.

I hope that helps.

Regards,
Andy


_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to