On Mon, 2009-11-30 at 13:18 -0500, Argus wrote:
> Like many, I've been experiencing occassional tinny audio when
> recording using a Hauppauge PVR150 since upgrading from kernel 2.6.22
> to kernel 2.6.28.
>
> After poking about, I found that if I selectively reversed part of a
> particular checkin between 2.6.23 and 2.6.24
> (git: 3562c43be8cfd6e300508d7c33acebf3369eacd3)
> the issue disappeared for me. See patch below.
>
> Using the patch attached below, I've been recording steadily for a
> month or so with zero incidents of tinny audio, whereas before the
> patch I was experiencing corruption approximately 1 in 10 recordings.
>
> I have no idea why this section of code appears to be critical, so
> any thoughts would be appreciated. At one point, I believed that
> making the 300ms ivtv_msleep_timeout after the STREAMOFF function
> uninterruptable might also fix the problem, but my cursory initial
> attempts at changing the "intr" parameter to it still resulted in
> occassional audio artifacts.
>
> I'm hoping that this may assist in any ongoing ivtv debugging efforts
> for the PVR150 cards.
>
> - Argus
>
> PATCH:
> ========================================================================
> --- drivers/media/video/ivtv/ivtv-streams.c.original 2008-12-24
> 18:26:37.000000000 -0500
> +++ drivers/media/video/ivtv/ivtv-streams.c 2009-10-28 13:46:10.000000000
> -0400
> @@ -575,15 +575,21 @@
> ivtv_set_irq_mask(itv, IVTV_IRQ_MASK_CAPTURE);
>
> clear_bit(IVTV_F_I_EOS, &itv->i_flags);
>
> /* Initialize Digitizer for Capture */
> + if (itv->card->type != IVTV_CARD_PVR_150) {
> itv->video_dec_func(itv, VIDIOC_STREAMOFF, NULL);
> ivtv_msleep_timeout(300, 1);
> + }
> +
> ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
> +
> + if (itv->card->type != IVTV_CARD_PVR_150) {
> itv->video_dec_func(itv, VIDIOC_STREAMON, NULL);
> }
> + }
>
> /* begin_capture */
> if (ivtv_vapi(itv, CX2341X_ENC_START_CAPTURE, 2, captype, subtype))
> {
> IVTV_DEBUG_WARN( "Error starting capture!\n");
>
>
> ========================================================================
Wow. Just bizarre. One that you found it; two that we're actually
chaning IO pins to be disabled and float on the CX25843 when setting up
a capture.
The above function calls to VIDIOC_STREAMON/OFF are actually now calls
to linux/drivers/media/video/cx25840/cx25840-core.c:cx25840_s_stream()
in the latest version of the driver. This function disables or enables
(mostly) audio, audio clock, and video clock related pins on the
CX25843. These pins likely feed into the CX23416 MPEG encoder chip.
I suspect that these signals floating cause the CX23416 to make some bad
guesses about audio sample rate when CX2341X_ENC_INTIALIZE_INPUT is
called. The only note I have about INITIALIZE_INPUT is that it is for
video input initialization.
I don't know the history here, but on the surface your patch looks
plausible that it would solve the problem. I just don't know about the
applicability to other CX2584x/CX23416 boards other then the PVR-150;
the patch might apply to them too.
Regards,
Andy
_______________________________________________
ivtv-devel mailing list
[email protected]
http://ivtvdriver.org/mailman/listinfo/ivtv-devel