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.

Vin-4b can't catch BT656 signal from ADV7182A

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 from adv7182a subdevice, but fail right now. Because i can't get any interrupt from system.

Below is my dts setting=>

&i2c1 {
   status = "okay";
   clock-frequency = <400000>;

   adv7182A@21 {
                               compatible = "adi,adv7182";
                               reg = <0x21>;

                                remote=<&vip2>;

                               port{
                                       adv7182A_out: endpoint{
                                        remote-endpoint = <&vin4b>;
                                       bus-width = <8>;
                                       channels = <0>;
                                         };
                                      };
                            };
};

&vin4b {
             status = "okay";
              endpoint@0 {
                                    slave-mode;
                                    remote-endpoint = <&adv7182A_out>;
                                  };
 };

At vip.c, i only force the sync_type as "EMBEDDED_SYNC_SINGLE_YUV422", it's because adv7182a is not like tvp5158 use multi-channel to transmit BT656 signal.

At adv7180.c(subdevice adv7182a driver), i modify video_code as "MEDIA_BUS_FMT_UYVY8_2X8" in order to match vip.c.

I also refer below article which look like have the same problem with me, but i still fail to have interrupt

=>

Below are adv7182A signals(free run NTSC mode) we catch through logic analyzer, can you also help to check signals format correct or not?

=>SAV(field:odd)       

=>SAV(field:even)        

=>Data after SAV(field:odd)          

=>EAV(field:even)        

Regards,

Shawn

  • Hi Shawn,

    Do you see the VIN4B video port size registers getting updated with detected size?

    Your first check should be to confim that.

    Please provide the register dump of the VIN4B parser registers in VIP

    Regards,

    Nikhil D

  • Hi Nikhil,

    Nikhil Devshatwar said:
    Do you see the VIN4B video port size registers getting updated with detected size?

    I already check vin4b port size register, the value is zero.

    Nikhil Devshatwar said:
    Please provide the register dump of the VIN4B parser registers in VIP

    Here are the vin4b parser registers dump => 

    vin4b_parser_registers.txt
    ==========VIPx_Slicex_parser==========
    VIP_MAIN is:0x00000002
    [  117.076264]
    [  117.076264] VIP_PORT_A is:0x00000000
    [  117.085480]
    [  117.085480] VIP_XTRA_PORT_A is:0x00000000
    [  117.092453]
    [  117.092453] VIP_PORT_B is:0x00000100
    [  117.099037]
    [  117.099037] VIP_XTRA_PORT_B is:0x00000000
    [  117.104547]
    [  117.104547] VIP_FIQ_MASK is:0x003ffe4f
    [  117.112600]
    [  117.112600] VIP_FIQ_CLEAR is:0x00000000
    [  117.119418]
    [  117.119418] VIP_FIQ_STATUS is:0x00000000
    [  117.124842]
    [  117.124842] VIP_OUTPUT_PORT_A_SRC_FID is:0xffffffff
    [  117.134036]
    [  117.134036] VIP_OUTPUT_PORT_A_ENC_FID is:0xffffffff
    [  117.141892]
    [  117.141892] VIP_OUTPUT_PORT_B_SRC_FID is:0xffffffff
    [  117.149754]
    [  117.149754] VIP_OUTPUT_PORT_B_ENC_FID is:0xffffffff
    [  117.156136]
    [  117.156136] VIP_OUTPUT_PORT_A_SRC0_SIZE is:0x00000000
    [  117.165560]
    [  117.165560] VIP_OUTPUT_PORT_A_SRC1_SIZE is:0x00000000
    [  117.173588]
    [  117.173588] VIP_OUTPUT_PORT_A_SRC2_SIZE is:0x00000000
    [  117.181623]
    [  117.181623] VIP_OUTPUT_PORT_A_SRC3_SIZE is:0x00000000
    [  117.189630]
    [  117.189630] VIP_OUTPUT_PORT_B_SRC0_SIZE is:0x00000000
    [  117.196187]
    [  117.196187] VIP_OUTPUT_PORT_B_SRC1_SIZE is:0x00000000
    [  117.205593]
    [  117.205593] VIP_OUTPUT_PORT_B_SRC2_SIZE is:0x00000000
    [  117.213618]
    [  117.213618] VIP_OUTPUT_PORT_B_SRC3_SIZE is:0x00000000
    [  117.221648]
    [  117.221648] VIP_PORT_A_VDET_VEC is:0x00000000
    [  117.228970]
    [  117.228970] VIP_PORT_B_VDET_VEC is:0x00000000
    [  117.234828]
    [  117.234828] VIP_ANC_CROP_HORZ_PORT_A is:0x00000000
    [  117.243967]
    [  117.243967] VIP_ANC_CROP_VERT_PORT_A is:0x00000000
    [  117.251750]
    [  117.251750] VIP_CROP_HORZ_PORT_A is:0x00000000
    [  117.259164]
    [  117.259164] VIP_CROP_VERT_PORT_A is:0x00000000
    [  117.265110]
    [  117.265110] VIP_ANC_VIP_CROP_HORZ_PORT_B is:0x00000000
    [  117.274575]
    [  117.274575] VIP_ANC_VIP_CROP_VERT_PORT_B is:0x00000000
    [  117.282726]
    [  117.282726] VIP_CROP_HORZ_PORT_B is:0x02d08000
    [  117.290133]
    [  117.290133] VIP_CROP_VERT_PORT_B is:0x02400000
    [  117.296079]
    [  117.296079] VIP_XTRA6_PORT_A is:0x00000000
    [  117.304517]
    [  117.304517] VIP_XTRA7_PORT_B is:0x00000000
    [  117.311582]
    [  117.311582] VIP_XTRA8_PORT_A is:0x00000000
    [  117.318654]
    [  117.318654] VIP_XTRA9_PORT_B is:0x00000000

    Another question, according to the below thread, they also have no interrupt at vip, after they modify vip.c then interrupts are coming. Do we need to modify vip.c in order to get interrupts? Because i remember that you said there is no need to modify vip.c, it can automatically select the data path and format based on the handshake with converter driver, all i need to do is modify dts file, am i right?

    => 

          

    Regards,

    Shawn   

  • Hi Nikhil,

    Any updated?

    Regards,
    Shawn
  • Hi Shawn,

    The register settings look all fine for the parser to detect video.

    You do not have to modify vip.c with the DT describing everything correctly.

    Also check if the pinmux is setup correctly such that the video is reaching vin4b pins in the VIP.

    Regards,

    Nikhil D

  • Hi Nikhil,

    Nikhil Devshatwar said:
    Also check if the pinmux is setup correctly such that the video is reaching vin4b pins in the VIP.

    I already check vin4b related pin mux setting, it's ok.

    Nikhil Devshatwar said:
    You do not have to modify vip.c with the DT describing everything correctly.

    Can you help to check my dts setting is correct or not? I already post my dts setting at the beginning of my article.

    BTW, below is our BT656 source(from adv7182a), can you also help to check the signal is correct or not?

    BT656_CLK =>     

    BT656_D7=>      

    BT656_D0=>       

    Regards,

    Shawn

  • Hi Shawn,

    Yes, the DTS file is also correct. The parser configuration also looks correct.
    Configured for one channel 8bit BT656 video at PORT_B

    At this point, hardware should automatically detect the video and populate the PORT_SIZE registers.
    Not much software configuration is needed for the size to be detected in parser.
    I am not sure what else might have gone wrong here.


    Regards,
    Nikhil D
  • Shawn,

    Please check if the data lines are connected correctly, from ADV to VIP. VIP supports only 8bit input. So if ADV supports 10bit, make sure to connect upper 8bits. 

    Please check if VIP is reporting any error...

    Rgds,

    Brijesh

  • Hi Nikhil,

    According to your previous reply => "You do not have to modify vip.c with the DT describing everything correctly."
    Now my dts configured vin-4b as one channel, but if i don't force the sync_type as "EMBEDDED_SYNC_SINGLE_YUV422" at function vip_setup_parser() of vip.c, then my sync_type will be set as "EMBEDDED_SYNC_LINE_MULTIPLEXED_YUV422".
    Why?

    Regards,
    Shawn
  • Hi Shawn,

    If you are not using line multiplexing and using pixel multiplexing in your video source,
    You should have a device tree property as following

    adv7182A@21 {
    compatible = "adi,adv7182";
    reg = <0x21>;

    remote=<&vip2>;

    port{
    adv7182A_out: endpoint{
    remote-endpoint = <&vin4b>;
    bus-width = <8>;
    channels = <0>;
    pixel-mux;
    };
    };
    };
    };


    This will set the correct sync type. Still no need to change the vip.c

    Regards,
    Nikhil D
  • Hi Brijesh,

    Brijesh Jadav said:
    VIP supports only 8bit input. So if ADV supports 10bit, make sure to connect upper 8bits. 

    adv7182a only has 8-bit output.

    Brijesh Jadav said:
    Please check if VIP is reporting any error...

    I already modify adv driver(adv7180.c) in order to binding with VIP to capture BT656 video, below is my modification:

    1.Modify video code as "MEDIA_BUS_FMT_UYVY8_2X8"(original is MEDIA_BUS_FMT_YUYV8_2X8, this is not match with vip.c).

    2.At vip_calc_format_size() function of vip.c, there is a judgement for field variable, when program run here, the field value is "V4L2_FIELD_INTERLACED", which will cause function return -EINVAL, and stop capture procedure. So currently, i disable this "return -EINVAL" code in order to let capture procedure keep running. But why here can't accept field value as "V4L2_FIELD_INTERLACED"?

    3.There are no "s_stream" and "enum_frame_size" function at adv driver(adv7180.c), so i add these two functions.

    Here is our log while capture BT656 through vin-4b, can you help to check is there anything abnormal? => 

    vin4b_capture_flow.txt
    root@dra7xx-evm:~# yavta -c1 -fUYVY -Fvout_720x480_UYVY.yuv -s720x480 /dev/video1
    [  117.687782]
    [  117.687782] @@@[vip_open()]@@@
    [  117.692343]
    [  117.692343] @@@[vip_init_stream()]@@@
    [  117.697706]
    [  117.697706] @@@[vip_init_port()]@@@
    [  117.702801]
    [  117.702801] @@@[vip_init_dev()]@@@
    [  117.707909]
    [  117.707909] @@@[vip_set_clock_enable()]@@@
    [  117.713572]
    [  117.713572] @@@[vip_module_reset()]@@@
    [  117.718962]
    [  117.718962] @@@[vip_module_reset()]@@@
    [  117.724291]
    [  117.724291] ***[adv7180_get_pad_format]***
    [  117.730029]
    [  117.730029] ***[adv7180_mbus_fmt]***
    [  117.735184]
    [  117.735184] @@@[vip_enable_parser()]@@@
    [  117.740662]
    [  117.740662] @@@[vip_calc_format_size()]@@@
    [  117.746336]
    Device /dev/video1 opened.[  117.768099]
    [  117.768099] @@@[vip_querycap()]@@@
    
    Device `vip' on `platform:vip' is a video output (without mplanes) device.[  117.775309]
    [  117.775309] @@@[vip_s_fmt_vid_cap()]@@@
    
    [  117.787371]
    [  117.787371] @@@[vip_try_fmt_vid_cap()]@@@
    [  117.792990]
    [  117.792990] ***[adv7180_enum_frame_size]***
    [  117.798813]
    [  117.798813] @@@[vip_calc_format_size()]@@@
    [  117.804487]
    [  117.823026]
    [  117.823026] ***[adv7180_set_pad_format]***
    [  117.828791]
    [  117.828791] ***[adv7180_mbus_fmt]***
    Video format set: UYVY (59565955) 720x480 (stride 1440) field none buffer size 691200[  117.833949]
    [  117.833949] @@@[vip_g_fmt_vid_cap()]@@@
    
    Video format: UYVY (59565955) 720x480 (stride 1440) field none buffer size 691200[  117.846848]
    [  117.846848] @@@[vip_queue_setup()]@@@
    
    8 buffers requested.
    length: 691200 offset: 0 timestamp type/source: mono/EoF[  117.864835]
    [  117.864835] @@@[vip_buf_prepare()]@@@
    
    Buffer 0/0 mapped at address 0xb6d6a000.
    length: 691200 offset: 692224 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xb6cc1000.
    length: 691200 offset: 1384448 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xb6c18000.
    length: 691200 offset: 2076672 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xb6b6f000.
    length: 691200 offset: 2768896 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xb6ac6000.
    length: 691200 offset: 3461120 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xb6a1d000.
    length: 691200 offset: 4153344 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xb6974000.
    length: 691200 offset: 4845568 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xb68cb000.
    17.876459]
    [  117.876459] @@@[vip_buf_prepare()]@@@
    [  117.949848]
    [  117.949848] @@@[vip_buf_prepare()]@@@
    [  117.955066]
    [  117.955066] @@@[vip_buf_prepare()]@@@
    [  117.960372]
    [  117.960372] @@@[vip_buf_prepare()]@@@
    [  117.965616]
    [  117.965616] @@@[vip_buf_prepare()]@@@
    [  117.970916]
    [  117.970916] @@@[vip_buf_prepare()]@@@
    [  117.976159]
    [  117.976159] @@@[vip_buf_prepare()]@@@
    [  117.981464]
    [  117.981464] @@@[vip_buf_queue()]@@@
    [  117.986529]
    [  117.986529] @@@[vip_buf_queue()]@@@
    [  117.991652]
    [  117.991652] @@@[vip_buf_queue()]@@@
    [  117.996827]
    [  117.996827] @@@[vip_buf_queue()]@@@
    [  118.001864]
    [  118.001864] @@@[vip_buf_queue()]@@@
    [  118.006988]
    [  118.006988] @@@[vip_buf_queue()]@@@
    [  118.012053]
    [  118.012053] @@@[vip_buf_queue()]@@@
    [  118.017177]
    [  118.017177] @@@[vip_buf_queue()]@@@
    [  118.022241]
    [  118.022241] @@@[vip_start_streaming()]@@@
    [  118.027893]
    [  118.027893] @@@[vip_setup_scaler()]@@@
    [  118.033220]
    [  118.033220] @@@[set_fmt_params()]@@@
    [  118.038491]
    [  118.038491] [set_fmt_params()]---OTHER   (YUV422 -> YUV422)
    [  118.045634]
    [  118.045634] @@@[vip_set_slice_path()]@@@
    [  118.051202]
    [  118.051202] @@@[vip_set_slice_path()]@@@
    [  118.056808]
    [  118.056808] @@@[vip_setup_parser()]@@@
    [  118.062107]
    [  118.062107] @@@[vip_reset_parser()]@@@
    [  118.067760]
    [  118.067760] @@@[vip_reset_parser()]@@@
    [  118.087510]
    [  118.087510] @@@[vip_set_data_interface()]@@@
    [  118.093320]
    [  118.093320] @@@[vip_set_crop_parser()]@@@
    [  118.104221]
    [  118.104221] ***[adv7180_s_stream]***
    [  118.109415]
    [  118.109415] @@@[populate_desc_list()]@@@
    [  118.114903]
    [  118.114903] @@@[add_stream_dtds()]@@@
    [  118.120199]
    [  118.125091] @@@[add_out_dtd()]@@@---channel is:124
    [  118.132718]
    [  118.132718] @@@[vip_load_vpdma_list_fifo()]@@@
    [  118.138805]
    [  118.138805] @@@[start_dma()]@@@
    [  118.144619]
    [  118.144619] @@@[start_dma()]@@@
    [  118.150540]
    [  118.150540] [vip_start_streaming()], dev->slice_id is:1, stream->list_num is:0
    [  118.159426]
    [  118.159426] @@@[clear_irqs()]@@@
    [  118.164203]
    [  118.164203] @@@[enable_irqs()]@@@
    [  118.331349]
    [  118.331349] @@@[vip_schedule_next_buffer()]@@@
    [  118.337467]
    [  118.337467] @@@[start_dma()]@@@
    [  118.342160]
    [  118.342160] @@@[vip_parser_stop_imm()]@@@
    [  118.347824]
    [  118.347824] @@@[vip_enable_parser()]@@@
    [  118.353239]
       

    Regards,

    Shawn

  • Hi, Nikhil,

    You are right, after i modify dts as you said, i don't need to force sync_type setting at vip.c. But i still can't get interrupt at vin4b.
    Can you help to explain what different between line multiplex and pixel multiplex?
    Our sub-device is adv7182a, not like tvp5158, without multi-channel to transfer, so i choose pixel multiplex, is this correct?
    Regards,
    Shawn
  • Hi Brijeah,
    Any updated?
    Regards,
    Shawn
  • Hi,

    Pixel mux - Data for each channel is sent such that each channel's one pixel is sent and then switch to next channel

    e.g. for 4channels(A,B,C,D) The sequence is A1B1C1D1 A2B2C2D2 .....

    Line mux - Data for each channel is sent such that each channel's one line is sent and then switch to next channel

    e.g. for 4channels(A,B,C,D) The sequence is A1A2A3..A720 B1B2B3...B720 C1C2C3...C720 D1D2D3...D720 .....

    When there is only one channel, there is no multiplexing. Neverthless, add pixel-mux so that driver sets the correct parser registers.

    Regards,

    Nikhil D

  • Hi Nikhil,

    Nikhil Devshatwar said:
    When there is only one channel, there is no multiplexing. Neverthless, add pixel-mux so that driver sets the correct parser registers.

    So if our sub-device without multi-channel to transfer BT656, then  it looks like there is no multiplexing, which mean we should choose one channel to receive BT656 signal, and if there is only one channel, then there is no different between pixel mux and line mux, right?

    BTW, below items are my modification for vip.c and adv7180.c(sub-device driver), can you also help to check is there anything wrong, thanks.

    I already modify sub-device driver(adv7180.c) in order to binding with VIP to capture BT656 video, below is my modification:

    1.Modify video code as "MEDIA_BUS_FMT_UYVY8_2X8"(original is MEDIA_BUS_FMT_YUYV8_2X8, this is not match with vip.c).

    2.At vip_calc_format_size() function of vip.c, there is a judgement for field variable, when program run here, the field value is "V4L2_FIELD_INTERLACED", which will cause function return -EINVAL, and stop capture procedure. So currently, i disable this "return -EINVAL" code in order to let capture procedure keep running. But why here can't accept field value as "V4L2_FIELD_INTERLACED"?

    3.There are no "s_stream" and "enum_frame_size" function at adv driver(adv7180.c), so i add these two functions.

    Here is our log while capture BT656 through vin-4b, can you help to check is there anything abnormal? => 

    7343.vin4b_capture_flow.txt
    root@dra7xx-evm:~# yavta -c1 -fUYVY -Fvout_720x480_UYVY.yuv -s720x480 /dev/video1
    [  117.687782]
    [  117.687782] @@@[vip_open()]@@@
    [  117.692343]
    [  117.692343] @@@[vip_init_stream()]@@@
    [  117.697706]
    [  117.697706] @@@[vip_init_port()]@@@
    [  117.702801]
    [  117.702801] @@@[vip_init_dev()]@@@
    [  117.707909]
    [  117.707909] @@@[vip_set_clock_enable()]@@@
    [  117.713572]
    [  117.713572] @@@[vip_module_reset()]@@@
    [  117.718962]
    [  117.718962] @@@[vip_module_reset()]@@@
    [  117.724291]
    [  117.724291] ***[adv7180_get_pad_format]***
    [  117.730029]
    [  117.730029] ***[adv7180_mbus_fmt]***
    [  117.735184]
    [  117.735184] @@@[vip_enable_parser()]@@@
    [  117.740662]
    [  117.740662] @@@[vip_calc_format_size()]@@@
    [  117.746336]
    Device /dev/video1 opened.[  117.768099]
    [  117.768099] @@@[vip_querycap()]@@@
    
    Device `vip' on `platform:vip' is a video output (without mplanes) device.[  117.775309]
    [  117.775309] @@@[vip_s_fmt_vid_cap()]@@@
    
    [  117.787371]
    [  117.787371] @@@[vip_try_fmt_vid_cap()]@@@
    [  117.792990]
    [  117.792990] ***[adv7180_enum_frame_size]***
    [  117.798813]
    [  117.798813] @@@[vip_calc_format_size()]@@@
    [  117.804487]
    [  117.823026]
    [  117.823026] ***[adv7180_set_pad_format]***
    [  117.828791]
    [  117.828791] ***[adv7180_mbus_fmt]***
    Video format set: UYVY (59565955) 720x480 (stride 1440) field none buffer size 691200[  117.833949]
    [  117.833949] @@@[vip_g_fmt_vid_cap()]@@@
    
    Video format: UYVY (59565955) 720x480 (stride 1440) field none buffer size 691200[  117.846848]
    [  117.846848] @@@[vip_queue_setup()]@@@
    
    8 buffers requested.
    length: 691200 offset: 0 timestamp type/source: mono/EoF[  117.864835]
    [  117.864835] @@@[vip_buf_prepare()]@@@
    
    Buffer 0/0 mapped at address 0xb6d6a000.
    length: 691200 offset: 692224 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xb6cc1000.
    length: 691200 offset: 1384448 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xb6c18000.
    length: 691200 offset: 2076672 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xb6b6f000.
    length: 691200 offset: 2768896 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xb6ac6000.
    length: 691200 offset: 3461120 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xb6a1d000.
    length: 691200 offset: 4153344 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xb6974000.
    length: 691200 offset: 4845568 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xb68cb000.
    17.876459]
    [  117.876459] @@@[vip_buf_prepare()]@@@
    [  117.949848]
    [  117.949848] @@@[vip_buf_prepare()]@@@
    [  117.955066]
    [  117.955066] @@@[vip_buf_prepare()]@@@
    [  117.960372]
    [  117.960372] @@@[vip_buf_prepare()]@@@
    [  117.965616]
    [  117.965616] @@@[vip_buf_prepare()]@@@
    [  117.970916]
    [  117.970916] @@@[vip_buf_prepare()]@@@
    [  117.976159]
    [  117.976159] @@@[vip_buf_prepare()]@@@
    [  117.981464]
    [  117.981464] @@@[vip_buf_queue()]@@@
    [  117.986529]
    [  117.986529] @@@[vip_buf_queue()]@@@
    [  117.991652]
    [  117.991652] @@@[vip_buf_queue()]@@@
    [  117.996827]
    [  117.996827] @@@[vip_buf_queue()]@@@
    [  118.001864]
    [  118.001864] @@@[vip_buf_queue()]@@@
    [  118.006988]
    [  118.006988] @@@[vip_buf_queue()]@@@
    [  118.012053]
    [  118.012053] @@@[vip_buf_queue()]@@@
    [  118.017177]
    [  118.017177] @@@[vip_buf_queue()]@@@
    [  118.022241]
    [  118.022241] @@@[vip_start_streaming()]@@@
    [  118.027893]
    [  118.027893] @@@[vip_setup_scaler()]@@@
    [  118.033220]
    [  118.033220] @@@[set_fmt_params()]@@@
    [  118.038491]
    [  118.038491] [set_fmt_params()]---OTHER   (YUV422 -> YUV422)
    [  118.045634]
    [  118.045634] @@@[vip_set_slice_path()]@@@
    [  118.051202]
    [  118.051202] @@@[vip_set_slice_path()]@@@
    [  118.056808]
    [  118.056808] @@@[vip_setup_parser()]@@@
    [  118.062107]
    [  118.062107] @@@[vip_reset_parser()]@@@
    [  118.067760]
    [  118.067760] @@@[vip_reset_parser()]@@@
    [  118.087510]
    [  118.087510] @@@[vip_set_data_interface()]@@@
    [  118.093320]
    [  118.093320] @@@[vip_set_crop_parser()]@@@
    [  118.104221]
    [  118.104221] ***[adv7180_s_stream]***
    [  118.109415]
    [  118.109415] @@@[populate_desc_list()]@@@
    [  118.114903]
    [  118.114903] @@@[add_stream_dtds()]@@@
    [  118.120199]
    [  118.125091] @@@[add_out_dtd()]@@@---channel is:124
    [  118.132718]
    [  118.132718] @@@[vip_load_vpdma_list_fifo()]@@@
    [  118.138805]
    [  118.138805] @@@[start_dma()]@@@
    [  118.144619]
    [  118.144619] @@@[start_dma()]@@@
    [  118.150540]
    [  118.150540] [vip_start_streaming()], dev->slice_id is:1, stream->list_num is:0
    [  118.159426]
    [  118.159426] @@@[clear_irqs()]@@@
    [  118.164203]
    [  118.164203] @@@[enable_irqs()]@@@
    [  118.331349]
    [  118.331349] @@@[vip_schedule_next_buffer()]@@@
    [  118.337467]
    [  118.337467] @@@[start_dma()]@@@
    [  118.342160]
    [  118.342160] @@@[vip_parser_stop_imm()]@@@
    [  118.347824]
    [  118.347824] @@@[vip_enable_parser()]@@@
    [  118.353239]
           

    Regards,

    Shawn

  • Hi Shawn,

    You are right. But we don't want to enable line multiplexing sync type.

    Driver checks if the pixel-mux property is present or not, if no, applies the line mutliplexing sync type.

    That's why I recommended to use this property.

    MEDIA_BUS_FMT_UYVY8_2X8 is the correct format ADV should have returned for BT656 standard video.

    In the function vip_calc_format_size, driver expects V4L2_FIELD_ALTERNATE

    According to V4L2 spec, ALTERNATE format is where each field is captured one after other. INTERLACED means both fields are present in the buffer in interlaced manner.

    You should use V4L2_FIELD_ALTERNATE for the format selection.

    Regards,

    Nikhil D

  • Hi Nikhil,

    Nikhil Devshatwar said:
    In the function vip_calc_format_size, driver expects V4L2_FIELD_ALTERNATE

    I trace the vip procedure for evm + tvp-5158(can catch BT656 successfully), it totally call vip_calc_format_size() function twice. At 1st time, the field value is "V4L2_FIELD_ALTERNATE", then after vip_querycap(), vip_s_fmt_vid_cap(), vip_try_fmt_vid_cap(), these functions, vip call vip_calc_format_size() function again, this time field vaule become "V4L2_FIELD_NONE". I have some questions:

    1. Why vip need to call vip_calc_format_size() twice?

    2. Why the field value is different for each time? Because the handshake result between vip.c and adv7180.c?

    Regards,

    Shawn

  • Can you provide the trace you have collected.

    Most likely, the function is getting called from try_fmt and s_fmt

    That's why 2 times being called.

    Nikhil D

  • Hi Nikhil,

    Here is our program trace for evm + tvp5158 => 

    program trace(evm_tvp5158).txt
    orot@dra7xx-evm:~# ayvta -c1 -fUYVY -Fvout_720x480_UYVY.yuv -s720x480 /dev/video1
    [  209.571781]
    [  209.571781] @@@[vip_open()]@@@
    [  209.576343]
    [  209.576343] @@@[vip_init_stream()]@@@
    [  209.581710]
    [  209.581710] @@@[vip_init_port()]@@@
    [  209.586699]
    [  209.586699] @@@[vip_init_dev()]@@@
    [  209.591748]
    [  209.591748] @@@[vip_set_clock_enable()]@@@
    [  209.597347]
    [  209.597347] @@@[vip_module_reset()]@@@
    [  209.602733]
    [  209.602733] @@@[vip_module_reset()]@@@
    [  209.607982]
    [  209.607982] ***[tvp5158_get_fmt]***
    [  209.613108]
    [  209.613108] ***[tvp5158_get_video_std]***
    [  209.619219] tvp5158 1-0058: NTSC video detected
    [  209.623773]
    [  209.623773] @@@[vip_enable_parser()]@@@
    [  209.629260]
    [  209.629260] @@@[vip_calc_format_size()]@@@
    [  209.634860]
    [  209.641823] @@@ *field value is 7
    [  209.645151]
    eDvice /dev/video1 opened.[  209.653441]
    [  209.653441] @@@[vip_querycap()]@@@
    
    eDvice `vip' on `platform:vip' is a video output (without mplane) device.
    [  209.660719] @@@[vip_s_fmt_vid_cap()]@@@
    
    [  209.672605]
    [  209.672605] @@@[vip_try_fmt_vid_cap()]@@@
    [  209.678277]
    [  209.678277] ***[tvp5158_enum_frame_size]***
    [  209.684100]
    [  209.684100] @@@[vip_calc_format_size()]@@@
    [  209.689811]
    [  209.696659] @@@ *field value is 1
    [  209.700049]
    [  209.708117] ***[tvp5158_set_fmt]***
    [  209.713173]
    [  209.713173] ***[tvp5158_get_fmt]***
    [  209.718182]
    [  209.718182] ***[tvp5158_get_video_std]***
      

    It look like the 2nd vip_calc_format_size() is called by vip_try_fmt_vid_cap().

    1. But why the field value changed?(1st time is V4L2_FIELD_ALTERNATE, 2nd time is V4L2_FIELD_NONE) 

    2. May i use logic analyzer or oscilloscope to observe different fiel value(V4L2_FIELD_ALTERNATE and V4L2_FIELD_INTERLACED) video signal? and what different will i see?

    3. Currently, i modify field value as V4L2_FIELD_ALTERNATE at sub-device driver(adv7180.c), but vin-4b still can't get interrupt, is there any setting i should pay attention to?

    4. BTW, i can't get any interrupt(the value of cat /proc/interrupts is 0 for vip2-s1), is this normal? I remember there should have interrupt even if the camera isn't connected, but why i get zero interrupt?

    Regards,

    Shawn

  • Hi Nikhil,

    Any updated?

    Regards,

    Shawn
  • Hi Shawn,

    1. field values are provided by the subdev driver.

    2. No, this is software issue, Logic analyzer will not help here

    3. Interrupt will start coming when you have the VIP parser detect video size correctly in the parser register

    4. Old SDK driver had VPDMA FIFO list interrupts, so that's why you would have seen 2 interrupts at the start

    New driver populate the FIFO before hand and waits for real frame complete interrupt

    Regards,

    Nikhil D

  • Hi Nikhil,

    Currently, i can get interrupt of VIP and capture video frame through vin-4b, thanks for your help.
    But the video size detected by VIP parser seems not correct. The value of register VIP_OUTPUT_PORT_B_SRC0_SIZE(0x48995A70) is 0x07200000, which mean only get the width size without height size(our BT656 size is 720 x 480), but the video frame we caught is correct(only have a little noise at the first byte of each horizontal line), why can't i get the correct video size?

    Regards,
    Shawn
  • Hi Shawn,

    Glad to know that you are getting the interrupts finally. What change did you have to do for this?

    Parser reporting zero height is unheard behavior.

    In my experiments, I have always seen a fluctuating value of 0xf3 or 0xf4 for the odd and even fields

    Parser sends the video to the VPDMA and that decides how much video is to be written to RAM.

    Also, I doubt the 0x0720 values here, Its hex value - Its actually is reporting 1824 pixels, not 720 pixels

    You can dump the VPDMA write descriptor details. After the capture is finished, driver looks at the write descriptor to find out

    if the buffer contains and even field or odd field. You can use the same descriptor to find out the size of buffer written by VPDMA

    Regards,

    Nikhil D

  • Hi Nikhil,

    Nikhil Devshatwar said:
    Glad to know that you are getting the interrupts finally. What change did you have to do for this?

    After our HW rework, the interrupt is coming, could be the signal unstable. Anyway, thanks for your great help.

    Nikhil Devshatwar said:
    Also, I doubt the 0x0720 values here, Its hex value - Its actually is reporting 1824 pixels, not 720 pixels

    It's my mistake, the value of register VIP_OUTPUT_PORT_B_SRC0_SIZE(0x48995A70) is 0x02700000.

    Nikhil Devshatwar said:
    You can dump the VPDMA write descriptor details. After the capture is finished, driver looks at the write descriptor to find out

    Can you provide detailed steps(ex. which files, what parameters should be observed...etc.).

    Regards,

    Shawn

  • Hi Shawn,

    In the kernel "drivers/media/platform/ti-vpe/vip.c" file, modify the function vip_process_buffer_complete

    to extract VPDMA descriptor parameters.

    Right now, following code only extracts the field value.

    fld = dtd_get_field(stream->write_desc);

    You can use this dtd to extract other fields like frame size, etc

    This is the descriptor written by VPDMA to describe the actual size of the frame that was written to memory.

    Regards,

    Niklhil D

  • I haven't heard back from you, I'm assuming you were able to resolve your issue.

    If not, just post a reply below (or create a new thread if the thread has locked due to time-out).

    Regards,

    Nikhil D