• Paul Walmsley's avatar
    [media] tvp5150: COMPOSITE0 input should not force-enable TV mode · 2962fc01
    Paul Walmsley authored
    When digitizing composite video from a analog videotape source using the
    TVP5150's first composite input channel, the captured stream exhibits
    tearing and synchronization problems[1].
    
    It turns out that commit c0477ad9 caused
    "TV mode" (as opposed to "VCR mode" or "auto-detect") to be forcibly
    enabled for both composite inputs.  According to the chip
    documentation[2], "TV mode" disables a "chrominance trap" input filter,
    which appears to be necessary for high-quality video capture from an
    analog videotape source.  [ Commit
    c7c0b34c subsequently restricted the
    problem to the first composite input, apparently inadvertently. ]
    
    Since any type of composite signal source can be connected to the
    TVP5150's first composite input, unconditionally forcing "TV mode" isn't
    correct.  There doesn't appear to be a good way for applications to tell
    the driver what is connected.  Fortunately, the TVP5150 has an operating
    mode auto-detection feature, which, when enabled, should cause the TVP5150
    to auto-detect whether it should use "VCR mode" or "TV mode".  Enabling
    operating mode auto-detection improved video capture quality
    significantly[3].
    
    Therefore, fix this bug by using operating mode auto-detection. (Also,
    while here, fix a CodingStyle issue.)
    
    For those users who may find this patch via a mailing list archive but who
    are not able to upgrade to a kernel with a fixed driver: the TVP5150's
    S-Video and second composite input sources have auto-detection enabled, so
    you may wish to try using those -- if available on your device -- until
    this fix makes it a downstream distribution near you.
    
    1. Pre-patch tvtime snapshot using a Pinnacle PCTV HD Pro as the
       capture device and a Sony EV-S2000 as a video source:
       http://www.booyaka.com/~paul/tvp5150/1a.png
    
    2. Section 3.21.3, "Operation Mode Control Register", _TVP5150AM1
       Ultralow-Power NTSC/PAL/SECAM Video Decoder (Rev. D)_ [SLES209D],
       downloaded 8 October 2010, available via
       http://focus.ti.com/lit/ds/symlink/tvp5150am1.pdf
    
    3. Post-patch tvtime snapshot (same signal chain as #1, above):
       http://www.booyaka.com/~paul/tvp5150/1b.pngSigned-off-by: default avatarPaul Walmsley <paul@booyaka.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
    2962fc01
tvp5150.c 29.7 KB