Andy,

You are right. I've checked 0.23.1 tree and it has the same code in
lib/libmythtv/mpegrecorder.cpp.
It seems that we have driver name 'cx18' for cx18-based cards and we
need special case for (driver == "cx18").
I changed
has_buggy_vbi = requires_special_pause = false;
to
has_buggy_vbi = requires_special_pause = true;
and now channel switching works fine.
But now I have another problem :) After switching channel I have
distorted picture. It looks like b/w picture with vertical RGB lines.
Also there is no sound, only noise. As tuning was fine this channel
become default. If I restart LiveTV it looks fine. Below is usecase:
1. Default channel 1.
2. Start LiveTV. Tuning to default channel 1. Picture and sound fine.
3. Switch to channel 2. Tuning fine, but picture distorted, noise.
4. Channel 2 become default.
5. Stop LiveTV. Start LiveTV. Tuning to default channel 2. Picture and
sound fine.
6. Switch to channel 1. Tuning fine, but picture distorted, noise.
7. Swicth any channel. Tuning fine, but picture distorted, noise.
So I can get normal picture and sound only after LiveTV restart.
It looks like there is some issue with mpeg encoder restart.

>> >  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.
>
> Ah, I found the problem in MythTV 0.21 source code.
>
> Look at
>
> lib/libmythtv/mpegrecorder.cpp:MpegRecorder::OpenV4L2DeviceAsInput()
>
>    if (CardUtil::GetV4LInfo(chanfd, card, driver, version))
>    {
>        if (driver == "ivtv")
>        {
>            usingv4l2     = (version >= IVTV_KERNEL_VERSION(0, 8, 0));
>            has_v4l2_vbi  = (version >= IVTV_KERNEL_VERSION(0, 3, 8));
>            has_buggy_vbi = true;
>            requires_special_pause =
>                (version >= IVTV_KERNEL_VERSION(0, 10, 0));
>        }
>        else
>        {
>            VERBOSE(VB_IMPORTANT, "\n\nNot ivtv driver??\n\n");
>            usingv4l2 = has_v4l2_vbi = true;
>            has_buggy_vbi = requires_special_pause = false;
>        }
>    }
>
> Like all modern ivtv driver versions, I'm very confident all cx18 driver
> versions require
>
>        requires_special_pause = true;
>
> to be set.  Then libmythtv will send the VIDIOC_ENC_CMD,
> V4L2_ENC_CMD_STOP that is required.  Although the above code snippet is
> from 0.21, I suspect it is still the same in 0.23.
>
> I'm not sure what "has_buggy_vbi" means and whether or not it needs to
> be set for the cx18 driver.

Thanks,
Artem Astafyev

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

Reply via email to