Andy,
That's great stuff. I am excited to try all what you have advised.
I will be trying it out in few days time. I am going to Singapore for
4 days and will be back on Thursday. Hopefully I should be able to try
it out next weekend. I am also sending reminder to Interact-TV today.
Thanks a lot for all your help.
Rajesh

On Fri, Nov 13, 2009 at 10:32 PM, Andy Walls <[email protected]> wrote:
> On Thu, 2009-11-12 at 20:34 +0300, Rajesh Padalia wrote:
>> Hi Andy,
>> 1. $ v4l2-ctl --log-status:
>> Status Log:
>>
>>    ivtv0: =================  START STATUS CARD #0  =================
>>    ivtv0: Version: 1.4.1 Card: Yuan PG600, Diamond PVR-550
>>    cx25840 1-0044: Video signal:              present
>>    cx25840 1-0044: Detected format:           PAL-BDGHI
>>    cx25840 1-0044: Specified standard:        NTSC-M
>>    cx25840 1-0044: Specified video input:     Composite 1
>>    cx25840 1-0044: Specified audioclock freq: 48000 Hz
>>    cx25840 1-0044: Detected audio mode:       mono
>>    cx25840 1-0044: Detected audio standard:   no detected audio standard
>>    cx25840 1-0044: Audio muted:               no
>>    cx25840 1-0044: Audio microcontroller:     stopped
>>    cx25840 1-0044: Configured audio standard: automatic detection
>>    cx25840 1-0044: Configured audio system:   BTSC
>>    cx25840 1-0044: Specified audio input:     External
>>    cx25840 1-0044: Preferred audio mode:      stereo
>>    tda9887 1-0043: Data bytes: b=0xd4 c=0x30 e=0x44
>>    tuner 1-0060: Tuner mode:      analog TV
>>    tuner 1-0060: Frequency:       67.25 MHz
>>    tuner 1-0060: Standard:        0x00001000
>>    ivtv0: Video Input:  Composite 1
>>    ivtv0: Audio Input:  Line In 1
>>    ivtv0: Tuner:  TV
>>    ivtv0: Stream: MPEG-2 Program Stream
>>    ivtv0: VBI Format: No VBI
>>    ivtv0: Video:  720x480, 30 fps
>>    ivtv0: Video:  MPEG-2, 4x3, Variable Bitrate, 6000000, Peak 8000000
>>    ivtv0: Video:  GOP Size 15, 2 B-Frames, GOP Closure
>>    ivtv0: Audio:  48 kHz, MPEG-1/2 Layer II, 224 kbps, Stereo, No
>> Emphasis, No CRC
>>    ivtv0: Spatial Filter:  Manual, Luma 1D Horizontal, Chroma 1D Horizontal, >> 0
>>    ivtv0: Temporal Filter: Manual, 8
>>    ivtv0: Median Filter:   Off, Luma [0, 255], Chroma [0, 255]
>>    ivtv0: Status flags:    0x00200000
>>    ivtv0: Stream encoder MPG: status 0x0118, 0% of 4096 KiB (128 buffers) in 
>> use
>>    ivtv0: Stream encoder YUV: status 0x0000, 0% of 2048 KiB (64 buffers) in 
>> use
>>    ivtv0: Stream encoder VBI: status 0x0000, 0% of 1040 KiB (61 buffers) in 
>> use
>>    ivtv0: Stream encoder PCM: status 0x0000, 0% of 324 KiB (72 buffers) in 
>> use
>>    ivtv0: Read MPG/VBI: 19052480/0 bytes
>>    ivtv0: ==================  END STATUS CARD #0  ==================
>
> OK.  You figured out that setting NTSc whne a PAL video signal is coming
> in, doesn't work so well.
>
>
>> 2. The one close to crystal is : 74HC4053D, AG124 29, URO 0348D
>>     The other one is: 5333KZ, GZ0337
>
> OK those chips are what I needed to know:
>
> Philips/NXP 74HC4053 Triple 2:1 analog multiplexer:
> http://www.nxp.com/acrobat_download/datasheets/74HC_HCT4053_4.pdf
>
> Cirrus Logic CS5333 24 bit, 96 kHz stereo A/D converter:
> http://www.digchip.com/datasheets/download_datasheet.php?id=228624&part-number=CDB5333
>
> This is where the information from Ineteract-TV could save everyone a
> lot of time and effort.  *sigh*
>
> Oh, well.  I have created a preliminary card entry for the PV-947D in my
> repository here:
>
>        http://linuxtv.org/hg/~awalls/ivtv-provideo/
>
>
> The easiest thing to do is to download the tar.gz archive from this
> link:
>
>        http://linuxtv.org/hg/~awalls/ivtv-provideo/archive/tip.tar.gz
>
> And build and install the v4l-dvb subsystem modules:
>
>        $ tar -xvf tip.tar.gz
>        $ cd (into the newly extarcted archive)
>        $ make
>        $ cd v4l2-apps
>        $ make   (it will fail, but ivtv-ctl will get built)
>        $ cd ..
>        $ su root
>        # make install
>        # make unload; make unload
>        # /sbin/modprobe ivtv
>
> (*WARNING* The 'make install' step will overwrite all of you existing
> v4l-dvb (media subsystem) modules under /lib/modules/`uname -r` .  Back
> them up if you wan to save them.)
>
> Now ivtv should at least automatically recognize your card.
>
> And now the fun part: *you* have to experiment and fix the card
> definition.
>
> 1. You will have to figure out which of the 8 CX25843 analog inputs
> correspond to which of the following:
>
> a. RF tuner assembly CVBS (composite) video
> b. RF Sound IF (SIF) audio
> c. Rear bracket CVBS (composite) video
> d. Rear bracket SVideo Luma (Y) video component
> e. Rear bracket SVideo Chroma (C) video component
>
> I assume you'll just ignore the internal black video connector with pins
> labeled Y (Luma or CVBS?), C (Chroma), AV (?), and G (ground) as these
> would be for Compsite 2 and SVideo 2.
>
>
> 2. You will have to figure out how to set the GPIO pin direction, and
> masks for audio routing:
>
> a. RF tuner baseband audio (if you can't use SIF audio for some reason)
> b. Rear bracket Line-in 1 L and R audio
>
> I assume you'll ignore the the internal black video connector with pins
> labeled L (Left), R (Right) and G (ground) as these would be Line in 2
> audio.
>
>
> OK. So that's the task.  Now how do you do it?  You'll need to edit
>
>        linux/drivers/media/video/ivtv/ivtv-cards.c
>
> to fix up the card entry for the Provideo PV-947D.  It currently looks Like 
> this:
>
> static const struct ivtv_card ivtv_card_provideo = {
>        .type = IVTV_CARD_PROVIDEO_PV947,
>        .name = "Provideo Multimedia PV-947D",
>        .v4l2_capabilities = IVTV_CAP_ENCODER,
>        .hw_video = IVTV_HW_CX25840,
>        .hw_audio = IVTV_HW_CX25840,
>        .hw_audio_ctrl = IVTV_HW_CX25840,
>        .hw_muxer = IVTV_HW_GPIO,
>        .hw_all = IVTV_HW_CX25840 | IVTV_HW_TUNER | IVTV_HW_GPIO,
>        .video_inputs = {
>                { IVTV_CARD_INPUT_VID_TUNER,  0, CX25840_COMPOSITE2 },
>                /* Rear Bracket connectors */
>                { IVTV_CARD_INPUT_SVIDEO1,    1,
>                  CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
>                { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE1 },
>                /* Internal Video-In connectors */
>                { IVTV_CARD_INPUT_SVIDEO2,    2,
>                  CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
>                { IVTV_CARD_INPUT_COMPOSITE2, 2, CX25840_COMPOSITE1 },
>        },
>        .audio_inputs = {
>                { IVTV_CARD_INPUT_AUD_TUNER,  CX25840_AUDIO5,           0 },
>                { IVTV_CARD_INPUT_LINE_IN1,   CX25840_AUDIO_SERIAL,     1 },
>                { IVTV_CARD_INPUT_LINE_IN2,   CX25840_AUDIO_SERIAL,     2 },
>        },
>        .tuners = {
>                { .std = V4L2_STD_NTSC, .tuner = TUNER_PHILIPS_FQ1236A_MK4 },
>        },
>        /*
>         * The 74HC4053 Triple 2:1 multiplexer must be controlled by 3 GPIOs.
>         * It is likely the mux switches Audio L and R between the rear bracket
>         * connector and the internal connectors.
>         * It is unclear if the third unit in the triple mux switches Y or C or
>         * something else.
>         *
>         * The board also has an LED (D2) which is likely controlled by a GPIO
>         */
>        .gpio_init = { .direction = 0x0000, .initial_value = 0 },
>        .gpio_audio_input  = { .mask   = 0x0000,
>                               .tuner  = 0x0000,
>                               .linein = 0x0000,   /* Line In 1: rear bracket 
> */
>                               .radio  = 0x0000 }, /* Line in 2: internal con 
> */
>        .pci_list = ivtv_pci_provideo,
>        .i2c = &ivtv_i2c_std,
> };
>
>
>
>
> 1. I assume you don't have an NTSC-M RF source available to you, so
> we'll forget about the RF tuner for now.  That means we won't be editing
> the lines that look like these:
>
>        { IVTV_CARD_INPUT_VID_TUNER,  0, CX25840_COMPOSITE2 },
>
>        { IVTV_CARD_INPUT_AUD_TUNER,  CX25840_AUDIO5,           0 },
>
>        .tuner  = 0x0000,
>
> 2. Set the card using v4l2-ctl to "Composite 1" and the proper video
> standard for the incoming signal (PAL, SECAM, NTSC) on the rear bracket
> connector.  If you have color video that looks correct go to the next
> step.  If not change this line:
>
>        { IVTV_CARD_INPUT_COMPOSITE1, 1, CX25840_COMPOSITE1 },
>
> so the last argument is CX25840_COMPOSITE2, rebuild the driver,
> reinstall the drivers, unload the ivtv module, load the new ivtv module
> and test again.  If that doesn't work continue to test
> CX24840_COMPOSITE3 through 8.  One of them should work.
>
>
> 3. Set the card using v4l2-ctl to "SVideo 1" and the proper video
> standard for the incoming SVideo signal (PAL, SECAM, NTSC) on the rear
> bracket connector.  If you have color video that looks correct go to the
> next step.  Otherwise change this line:
>
>        { IVTV_CARD_INPUT_SVIDEO1,    1,
>                  CX25840_SVIDEO_LUMA3 | CX25840_SVIDEO_CHROMA4 },
>
> so the last argument's LUMA value is CX25840_SVIDEO_LUMA1. rebuild the
> driver, reinstall the drivers, unload the ivtv module, load the new ivtv
> module and test again.  If that doesn't work continue to test
> CX25840_SVIDEO_LUMA2 through 8, skipping the value you found to be
> correct for video in the previous step(s).  One of them should work such
> that you get at least a good black and white picture.
>
> Once you have Black and White SVideo, repeat the process with the
> CX25840_SVIDEO_CHROMAn values, skipping the values you already know are
> correct for previous step(s), until you get good color.
>
>
>
> 4. You will need to determine the GPIO output settings for to make line
> in 1 audio work.  Using v4l2-ctl set the iput to "Composite 1" or
> "SVideo 1" and start a capture.  As root, from where you built the
> drivers, run
>
>        # v4l2-apps/util/ivtv-ctl -d /dev/video0 --list-gpio
>
> to show that state of the 16 GPIO pins.  They should all have their
> direction set as input, and some random garbage should be read in for
> the in and out values.  You will now use
>
>        # v4l2-apps/util/ivtv-ctl -d /dev/video0 --set-gpio 
> dir=0xuuuu,val=0xvvvv
>        # v4l2-apps/util/ivtv-ctl -d /dev/video0 --list-gpio
>
> To set 2 GPIO output pins (one for Line in 1 L audio, one for Line in 1
> R audio) to a high level (or maybe a low level) to hear audio from Line
> in 1.  I would start with the highest bits first:
>
>        # v4l2-apps/util/ivtv-ctl -d /dev/video0 --set-gpio 
> dir=0xc000,val=0xc000
>        # v4l2-apps/util/ivtv-ctl -d /dev/video0 --set-gpio 
> dir=0xc000,val=0x0000
>
> and work my way down to the lowest bits.  (One of the 16 bit will likely
> end up controlling the LED on the board.)
>
> One you find the bits that give you good Line in 1 audio: you will edit
> these lines in the card entry:
>
>        .gpio_init = { .direction = 0x0000, .initial_value = 0 },
>        .gpio_audio_input  = { .mask   = 0x0000,
>                               .tuner  = 0x0000,
>                               .linein = 0x0000,   /* Line In 1: rear bracket 
> */
>                               .radio  = 0x0000 }, /* Line in 2: internal con 
> */
>
> To fix the direction, mask, and linein value.
>
>
> Good luck.
>
> Regards,
> Andy
>
>
>> On Thu, Nov 12, 2009 at 2:18 AM, Andy Walls <[email protected]> wrote:
>> > On Wed, 2009-11-11 at 19:55 +0300, Rajesh Padalia wrote:
>> >> Hi Andy,
>> >> It works! I was able to capture video. I am yet to get Audio. Any idea?
>> >> -------------------------------
>> >
>> > 1. Please provide the output of
>> >
>> > $ v4l2-ctl --log-status
>> >
>> > while capturing TV.
>> >
>> > 2.  Also could you provide the chip numbers from the two black chips
>> > next to the end of the metal tuner can just above the 27.00 MHz crystal?
>> > I can't read them from the photograph.  One looks like it has a
>> > "Philips" logo, but I can't tell much else.
>> >
>> > 3. Make sure you have the firmware for the cx25843 chip in the proper
>> > firmware directory for your distirbution.  You will never get broadcast
>> > audio without that firmware loaded into the CX25843.
>> >
>> > Regards,
>> > Andy
>> >
>> >> ---------------------------------------------------------------------------------------------
>> >> Thanks for your help.
>> >> Rajesh
>
>
>
>

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

Reply via email to