This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Fail to capture video through VIN-4B

Other Parts Discussed in Thread: TVP5158

Our processor is DRA74X, with 3.02.00.03 SDK version.

I'm using vin4b port to capture BT656 8-bit video signal, but fail right now. Because i can't get any interrupt from system.

First thing i want to make sure is about the source video format. I measure the pixel clock is about 27MHz, is it correct for BT656 8-bit video signal?

Regards,

Shawn

  • Hi Shawn,

    are you using Linux capture driver or Vision SDK capture link for the camera connected to vin4b?

    Is this on the TI-EVM?

    What is the failure signature you see?

    For bt656 video of 8bit 720x244 60fps video, 27Mhz looks correct.

    Check if the video is getting detected or not by the VIP parser by reading the register PORTB_SIZE register of VIP2 slice2

    Regards,

    Nikhil D

  • Hi Nikhil,

    Nikhil Devshatwar said:
    are you using Linux capture driver or Vision SDK capture link for the camera connected to vin4b?

    Yes.

    Nikhil Devshatwar said:
    Is this on the TI-EVM?

    No, it is on our custom board.

    Nikhil Devshatwar said:
    For bt656 video of 8bit 720x244 60fps video, 27Mhz looks correct.

    Currently, we use MEDIA_BUS_FMT_UYVY8_2X8 video format setting, 8 mean use 8-bit channel, but 2X8 mean each Y or U or V data is 16 bits? or a pixel is 16 bits?(which mean the pixel clock should be double as 54Mhz, right?)

    Regards,

    Shawn

  • Hi Shawn,

    It is 8bit interface with two bytes per pixel Y and either of U or V per pixel.

    So 27Mhz is correct clock.

    As mentioned, try to read the PORT_SIZE register to get more details on if the video is getting detected or not.

    Regards,

    Nikhil D

  • Hi Nikhil,

    How to calculate pixel clock for BT656 8 bit 720 x 480@60 YUV 4:2:2 video format?

    As i understand, pixel clock = resolution(include blanking pixel) times reflash rate, so basically 480p pixel clock should be (720 + 160) * (480 + 45) * 60 = about 27.7Mhz 

    Nikhil Devshatwar said:
    It is 8bit interface with two bytes per pixel Y and either of U or V per pixel.

    If each Y, U, V is two bytes size(16 bits), then should i times 6 with the pixel clock i calculated before(which mean pixel clock is 27.7Mhz * 6 = 166Mhz)? Because each pixel is composed of Y, U and V.

    Nikhil Devshatwar said:
    As mentioned, try to read the PORT_SIZE register to get more details on if the video is getting detected or not.

    The PORTB_SIZE register is 0. I also check the system interrupts through command "cat /proc/interrupts", it seems there is no interrupt at vip2-s0 and vip2-s1.

    Regards,

    Shawn

  • Hi Shawn,

    I am confirming that there is no issue with pixel clock.

    For BT656 video, the video is interlaced, only odd/even field is sent one at a time.

    So total of 60 fields of 720x240 resolution are sent.

    720 * 240 * 60 pixels / seconds = 720 * 240 * 60 * 2 bytes/second.

    If you add the padding, it will come about 27Mhz, which is correct.

    Regards,

    Nikhil D

  • Hi Nikhil,

    1.If we output 720x480p video format to vin-4b, can we get interrupts? or vin-4b can only accept interlace video format for BT656?

    2.Is there any limitation about BT656 8bit resolution for vin-4b to receive? can it accept 1440x480i@60 resolution?

    3.Currently, i still fail to capture video through vin-4b, i notice that out register setting for data path is using multi-channel, but this is suitable if we use TVP-5158 video converter. Now we're using different converter, should i reset register manually to use single-channel mode? 
     
    Regards,
    Shawn

  • Hi Nikhil,

    Can you help to answer my questions, thank you.

    Regards,
    Shawn
  • Hi all,

    Any updated?
  • You will start getting interrupts only after the PORT_SIZE register starts reflecting the correct size.
    You can have both 720x240 as well as 1440x480 video frames. There is no limitation from VIP on that.
    The resolutions are fixed by the analog video standards.

    You have to configure the multi channel,multiplexing mode, channel number according to the device being used.
    Please update the device tree accordingly so that the right settings are reflected. No driver change required if the device tree is described correctly

    Regards,
    Nikhil D
  • Hi Nikhil,

    Nikhil Devshatwar said:
    You can have both 720x240 as well as 1440x480 video frames. There is no limitation from VIP on that.

    So it's fine for us to output BT656 8-bit 1440x480i@60 interlace video signal to VIP, right?

    Nikhil Devshatwar said:
    You will start getting interrupts only after the PORT_SIZE register starts reflecting the correct size.

    I already check parser size register fo vin-4b(0x48995a70), got zero value.

    Nikhil Devshatwar said:
    You have to configure the multi channel,multiplexing mode, channel number according to the device being used.

    Here is our dts setting =>

    &i2c1 {
    	status = "okay";
    	clock-frequency = <400000>;
    
    	adv7611: adv7611@4c {
                    compatible = "adi,adv7611";
                    reg = <0x4c>;
    
    		#address-cells = <1>;
    		#size-cells = <0>;
    
    		//reset-gpios = <&ioexp 0 GPIO_ACTIVE_LOW>;
    		//hpd-gpios = <&ioexp 2 GPIO_ACTIVE_HIGH>;
    		
    		port@1 {
    			adv7611_out: endpoint@0 {
    				remote-endpoint = <&vin4b>;
    				//hsync-active = <1>;
    				//vsync-active = <1>;
    				pclk-sample = <1>;
    				bus-width = <8>;
    				channels = <0>;
    			};
    		};
            };
    };
    
    
    video_in4B: &vin4b {
    	status = "okay";
    	endpoint@0 {
    		slave-mode;
    		remote-endpoint = <&adv7611_out>;
    	};
    };

    I already set channel as single, buswidth as 8. How can i set multiplexing mode and channel number at dts file?

    Regards,

    Shawn

  • Hi Shawn,

    The VIP driver is smart to understand when the multiplexing mode is needed.
    If you are configuring the channels such that there is only one channel, then there is no multiplexing.
    In this case, you do not need any multiplexing mode.

    Just to be sure, you can experiment with different fields of the parser config register to check when the port size register reflects the size.
    That can give you the values that are needed for your video camera setup.


    Regards,
    NIkhil D
  • Hi Nikhil,

    Nikhil Devshatwar said:
    you can experiment with different fields of the parser config register to check when the port size register reflects the size.

    OK, i'll try different setting of the parser config register.

    BTW, if our video source is camera with PAL(576i 50Hz) or NTSC(480i 60Hz), and use a converter to output BT656 signal to VIN port, then which converter you'll recommend?(must have driver at 3.02.00.03 SDK, because i want to use V4L2 to capture video)

    Regards,

    Shawn

  • TI SDK has support for TVP5158 video decoder
    It is available for evaluation on the TI JAMR adapter card along with TI EVM
    Kernel has a V4L2 subdevice for this.

    Regards,
    Nikhil D
  • Hi Nikhil,

    Thanks for your suggestion. We already ask our supplier for TVP-5158, but TI reply that TVP-5158 is NRND(not recommend to use in the new DIN), which mean we can't get IC . So,

    1. Is there any other converter you recommend?

    2. If we select one converter and kernel has no V4L2 subdevice for it, can we still use VIP to capture the video? or we need to implement it manually?

    Regards,

    Shawn

  • Hi Shawn,

    The VIP driver controls the video capture port related programming.
    You will need a V4L2 subdevice driver which controls the camera related programming.

    So, if you get another converter device, you have to implement the driver yourself.
    It is not big deal to implement the driver if you know the i2c programming sequence.
    You can refer to the TVP5158 driver, customize the programming sequence as expected by new device.

    Regards,
    Nikhil D
  • Hi Nikhil,

    So except TVP5158 converter, is there any other converter(Kernel has a V4L2 subdevice for it) you recommend for converting PAL(576i 50Hz) or NTSC(480i 60Hz) to BT656?

    Regards,
    Shawn
  • In the kernel tree, (drivers/media/i2c)
    I see lot of drivers for tvp5xxx and adv7xxx devices some of which are analog video converters.

    You can choose the right part amongst these

    Regards,
    Nikhil D
  • Hi, Nikhil,

    There is a driver called "adv7604", and it also support for adv7611 converter.

    We already use adv7611 coverter at our custom board, but still fail to capture BT656 through vin-4b. According to adv7604 driver, i only can see it support "MEDIA_BUS_FMT_YUYV8_2X8" format at adv7611_formats[] array.Is this coverter still can be used for vin-4b BT656 capture?

    Because as i knew, TI dra7xx vin port only accept BT656 with UYVY video format, am i right?

    Regards,

    Shawn

  • Hi Shawn,

    You are right. VIP needs to have video camera with UYVY video. THe order of chroma/luma on a 8bit channel matters here.

    This is mostly relevant in the dedicated sync method where the Hardware has to interprete each 8bytes as either luma or chroma.

    For BT656, there are headers, footer and real data in known formats.

    BT656 is a standard for video decoder and for the capture port. The ADV decoder with BT656 video will work with VIP.


    Regards,

    Nikhil D

  • Hi Nikhil,

    Nikhil Devshatwar said:
    The ADV decoder with BT656 video will work with VIP

    So you mean vin-4b has no problem to capture BT656 which generated from ADV7611 decoder, even the support format only have "MEDIA_BUS_FMT_YUYV8_2X8" in ADV7611 driver, right?

    Because you already say "VIP needs to have video camera with UYVY video", but if support format of ADV7611 driver only have  "MEDIA_BUS_FMT_YUYV8_2X8", then why vin-4b can capture BT656 signal from ADV7611?

    Currently, i want to figure out is "can you be sure about vin-4b can capture BT656 signal from ADV7611 decoder"? Because we already fail to capture it, we want to know fail is because

    1. BT656 format from ADV7611 is not support by vin-4b or

    2. Our VIP register setting is incorrect

    Regards,

    Shawn

  • Hi Shawn,

    Please note that most of the standard video protocols (including BT656) use the UYVY order of pixel transmission.

    ADV76xxx decoder has been used with VIP by other users and it has worked.

    Most likely the driver is not reporting the mediabus format correctly. You can confirm with the vendor on the correct format output by the device.

    Its very likely that the ADV76 also outputs UYVY format. If such is the case, you need to revisit VIP parser configuration to debug the failure in video detection.

    Please check if the pixel multiplexing is turned on/off in the VIP parser.

    Regards,

    Nikhil D