> Here's the patch I'm ready to apply to the latest ivtv driver, but could
> you do more extensive testing - starting and stopping captures - to make
> sure your machine never hangs with your fix.
>
>
> diff -r e0cd9a337600 linux/drivers/media/video/ivtv/ivtv-streams.c
> --- a/linux/drivers/media/video/ivtv/ivtv-streams.c Sun Nov 29 12:08:02
> 2009 -0200 +++ b/linux/drivers/media/video/ivtv/ivtv-streams.c Wed Dec
> 02
> 20:31:43 2009 -0500 @@ -576,10 +576,16 @@
> clear_bit(IVTV_F_I_EOS, &itv->i_flags);
>
> /* Initialize Digitizer for Capture */
> - v4l2_subdev_call(itv->sd_video, video, s_stream, 0);
> + if (itv->sd_video->grp_id & IVTV_HW_CX25840)
> + v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
> + else
> + v4l2_subdev_call(itv->sd_video, video, s_stream, 0);
> ivtv_msleep_timeout(300, 1);
> +
> ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
> - v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
> +
> + if (!(itv->sd_video->grp_id & IVTV_HW_CX25840))
> + v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
> }
>
> /* begin_capture */
why this:
> + if (itv->sd_video->grp_id & IVTV_HW_CX25840)
> + v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
we never turned off the cx25840 digitizer before, so there should be no need
to turn it on.
Why do you suggest
(itv->sd_video->grp_id & IVTV_HW_CX25840)
instead of
(itv->hw_flags & IVTV_HW_CX25840)
? What is the difference?
My idea is to do it this way (whole code block):
if (atomic_read(&itv->capturing) == 0) {
/* Clear all Pending Interrupts */
ivtv_set_irq_mask(itv, IVTV_IRQ_MASK_CAPTURE);
clear_bit(IVTV_F_I_EOS, &itv->i_flags);
/* Initialize Digitizer for Capture */
if (!itv->hw_flags & IVTV_HW_CX25840) {
v4l2_subdev_call(itv->sd_video, video, s_stream, 0);
ivtv_msleep_timeout(300, 1);
}
ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
if (!itv->hw_flags & IVTV_HW_CX25840) {
v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
}
}
In this version I assume that the 300ms sleep is only necessary when the
digitizer was turned off, which only happens for non-cx25840 cards.
For saa7115-based cards like PVR350 the code remains unchanged. I have two
PVR350 cards and never had any audio problems.
I am only a hobbyist, so please forgive me if there is an error ...
> From: Argus <[email protected]>
>
> The trouble is: I am not running a latest kernel anywhere to
> test your patch below. I was making my patches against a 2.6.28
> kernel (older, I know, but the machine that holds the 150s is
> remote and not easily upgraded). Can I compile just the latest
> ivtv driver and install it over the 2.6.28 module? I'm guessing
> not ...
I think you need to replace
v4l2_subdev_call(itv->sd_video, video, s_stream, 0);
with
itv->video_dec_func(itv, VIDIOC_STREAMOFF, NULL);
and
v4l2_subdev_call(itv->sd_video, video, s_stream, 1);
with
itv->video_dec_func(itv, VIDIOC_STREAMON, NULL);
@ Andy:
Is this only a different cody style, or does a subdev_call effect other things
than the VIDIOC_STREAMOFF/ON ioctls?
Greets,
Martin
_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel