Like many people with PVR150/500 cards, I've been plagued by fuzzy
sound when capturing with Myth 0.19.5 while using composite/s-video
with audio line-in. I am running ivtv-0.4.6 on a stock Ubuntu distro
with a Hauppauge PVR150 capture card.

Anyone interested can read the history and cooperative debugging 
effort here:

  http://www.mythtvtalk.com/forum/viewtopic.php?t=2690

The attached patch seems to completely clear up the audio issues for
me. I imagine the patch could easily be adjusted for later versions
of ivtv ...

The patch is to ivtv_init_digitizer() in ivtv-streams.c.

Empirically, it appears that putting a delay between turning off the
decoder stream and initialising the decoder inputs, at least for the
PVR150 card, seems to stabilise the audio stream in the decoder. I'm
not quite sure why this works, but at least for my equipment it
does. I'm presuming that the 50ms delay is giving the decoder
stream enough time to fully turn off before trying to initialise the
inputs (or possibly before turning the stream back on) and therefore
stabilize the audio stream. I imagine the timing delay here would be
safe enough for all supported cards, though I am unable to test
this. I'd be interested if anyone else has any ideas why this delay
might be necessary for these particular cards.

Additionally, and again through empirical testing, I also had success
by removing the decoder stream control completely from this function;
however, I imagine that while it works OK for the PVR150, such a drastic
manoeuvre would affect other supported cards. As another option, I
suppose, one might be able to avoid the nasty timing delay if one
selectively disabled the decoder stream STREAMOFF/ON controls 
for PVR150/500 cards only.

If the patch is deemed safe for the general case, it would also be
nice to see this resolved in the ivtv codebase. Is there any further
process involved to submit these kinds of changes to ivtv?

--------------------------------------------------------------------
The patch (against ivtv-0.4.6 release snapshot):
--------------------------------------------------------------------

diff -Naur ivtv-0.4.6/driver/ivtv-streams.c 
ivtv-0.4.6-stream-timeout/driver/ivtv-streams.c
--- ivtv-0.4.6/driver/ivtv-streams.c    2006-05-24 06:09:17.000000000 -0400
+++ ivtv-0.4.6-stream-timeout/driver/ivtv-streams.c     2006-09-20 
00:02:48.000000000 -0400
@@ -789,6 +789,9 @@
         IVTV_DEBUG_INFO("Disabling digitizer\n");
        itv->card->video_dec_func(itv, VIDIOC_STREAMOFF, &dummy);
 
+       /* give PVR150/500 cards 50ms to shut down the decoder stream */
+       ivtv_sleep_timeout(HZ / 20, 0);
+
         /* initialize or refresh input */
         if (atomic_read(&itv->capturing) == 0)
                 ivtv_vapi(itv, IVTV_API_INITIALIZE_INPUT, 0);


_______________________________________________
ivtv-devel mailing list
ivtv-devel@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to