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.

TDA2SX: Regarding the NTSC camera ADV7182 chip

Part Number: TDA2SX
Other Parts Discussed in Thread: TDA2, TVP5158

Hi,

I'm working on custom board with TDA2SX processor,In my board we are using the adv7182 Analog NTSC. I'm facing the issue like below.

root@dra7xx-evm:~# dmesg | grep adv
[    0.563399] i2c i2c-0: Failed to register i2c client adv7180 at 0x21 (-16)
[    0.563410] i2c i2c-0: of_i2c: Failure registering /ocp/i2c@48070000/adv7180@21
[    3.086968] systemd[1]: System time before build time, advancing clock.
root@dra7xx-evm:~# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- 09 -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- 28 -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
50: -- -- -- -- 54 -- -- -- UU UU UU 5b 5c -- -- --
60: -- -- -- -- -- -- -- -- -- -- UU -- -- -- -- --
70: -- -- -- -- -- -- -- --

The NTSC is connected via i2c1 with slave address as 0x21.

here is my dts information,

&i2c1{

status = "okay";
        clock-frequency = <400000>;

adv7180@21 {
compatible = "adi,adv7180";
reg = <0x21>;
        status = "okay";
port {
adv7180_1: endpoint{
remore-endpoint=<&vin3a>;
};
};
};
};

&vip1 {
status = "okay";
};

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

Please help me  to solve this issue.

Thanks & Regards,

A.Kavya Harini

  • Hi,

    I believe you want to use the camera from Linux driver  (not from the RTOS driver, which is typical for TDA2 platforms)

    Please confirm if this is correct.

    From the kernel log, I can see that the adv7180 driver has failed with error code -16 (EBUSY)

    You can check the i2c subdevice driver for adv7180 about why this failure occured.

    Also, the fact that i2cdetect does not show the device 0x21 indicates that the chip is not responding to i2c transactions with chip address = 0x21

    Please confirm if the address is correct

    Also, if you need to driver any GPIOs to turn on the decoder, you should do that based on your board design.

    Regards,

    Nikhil D

  • Hi Nikhil,

    I believe you want to use the camera from Linux driver  (not from the RTOS driver, which is typical for TDA2 platforms)

    YES

    Now,I am able to load the ADV7180 driver.

    But while loading the driver,I am getting below issue.

    insmod adv7180.ko

    adv7180 0-0021: chip found @ 0x21 (OMAP I2C adapter)
    [   37.543365] omap_i2c 48070000.i2c: controller timed out
    [   37.594780] Adding alias for supply vdd,cpu0 -> vdd,4a003b20.oppdm
    [   37.600992] Adding alias for supply vbb,cpu0 -> vbb,4a003b20.oppdm

    Manually also I try to write value 80 into 0x0f register by using i2cset command,I am getting same i2c timeout problem.

    Before load the ADV7180 driver,I need to load any other dependency drivers ?

    Could you please help me to solve this issue. 

    Regards,

    Kavya.

  • Hi Kavya,

    The i2c controller timeout happens when the external device does not respond to the commands.

    This might be because the address you have specified in DT is not correct or the adv device is in reset and not responding to any i2c commands.

    Check your board schematics if you need to get the ADV out of reset.

    Regards,

    Nikhil D

  • Hi Nikhil,

    I am able to read and write the registers.
    root@dra7xx-evm:~# i2cget -f -y 0 0x21 0x00 b

    0x0e
    root@dra7xx-evm:~# i2cset -f -y 0 0x21 0x00 0 b
    root@dra7xx-evm:~# i2cget -f -y 0 0x21 0x00 b
    0x00
    root@dra7xx-evm:~# i2cset -y -r 0 0x21 0x0f 0x80 b                      \\ for this register only I am getting time out error.
    [  800.403403] omap_i2c 48070000.i2c: controller timed out
    Error: Write failed
    root@dra7xx-evm:~# i2cget -f -y 0 0x21 0x00 b
    0x0e
    root@dra7xx-evm:~#
     
    Reset and powerdown I am handling though  GPIO's by using sysfs.

    As per the datasheet after successful reset,all the register values goes to their default value,as per above i2c commands It is happened.

    But,after loading the adv7180 I am not seen any video node in /dev

    Could you please help me to solve this problem.

    Regards,

    Kavya.

  • Hi Kavya,

    The problem is not with the TI VIP driver. It will register the /dev/video device if the external camera driver (in this case adv driver) implements all the

    subdevice calls and returns success to all of them.

    You are getting a timeout as part of probe, and also confirmed by directly read/write.

    The timeout is caused because the chip is responding to the i2c master.

    You might want to check the i2c speed and try reducing it so as to support this sensor.

    You can go from 400khz to 100khz. See if that helps.

    Regards,

    Nikhil D

  • Hi Nikhil,

    Thanks for the reply.

    After reducing the i2c speed from 400khz(default) to 100khz in the dts.Now, I'm able to load the driver without time-out issue.

    I followed the procedure like below to load the NTSC camera driver :

    root@dra7xx-evm:~# insmod ti-vpdma.ko

    root@dra7xx-evm:~# insmod ti-csc.ko

    root@dra7xx-evm:~# insmod ti-sc.ko

    root@dra7xx-evm:~# insmod ti-vip.ko

    root@dra7xx-evm:~# insmod adv7180.ko

    While loading the drivers i'm not getting any debug messages,I checked in /dev node there is no video port in /dev.

    Please help me to get the node & to capture the data from camera.

    Note: we are using adv7182 chip in our custom board.Is this adv7180.ko supports this chip?

    Thanks,

    kavya

  • Hi Kavya,

    Refer to this app note https://www.ti.com/lit/an/spracd8/spracd8.pdf

    You will have to modify the device tree and the kernel subdevice driver for linking VIP and adv 

    Regards,

    Nikhil D

  • Hi Nikhil,

    We are using the vin2b 8-bit data lines.vin2b is configured under vip1. Please find the below dts information we are using.

    &i2c1{

    status = okay;

    adv7180@20 {

                            compatible = "adi,adv7180";
                            reg = <0x21>;
                            status = "okay";

                            port {
                            
                                    adv7182: endpoint{
                                    status = "okay";
                                    remote-endpoint=<&vin2b>;
                            
                            };
                    };
         };
    };

    &vip1 {
            status = "okay";
    };

    /* composite video input */
    &vin2b {

            status = "okay";

            endpoint@0 {

                    status = "okay";
                    slave-mode;
                    remote-endpoint = <&adv7182>;
                    bus_width = <8>;

            };

    };


    In vip driver probe, we added the printk but we are not getting any debug messages after loading the driver(we tried as static & modules).It didn't work,I'm wondering why it's not showing atleast printk messages also.

    Please check once our dts info wether it is correct or not?

    If it is correct then guide me how to solve the issue.

    Thanks,

    kavya

  • Hi Nikhil,

    Now we are able to see the debug messages but i'm not getting the /dev/video* node.

    root@dra7xx-evm:~#dmesg | grep vip

    [    2.092434] vip 48970000.vip: sc_create_inst
    [    2.092450] vip 48970000.vip: csc_create
    [    2.092823] vip 48970000.vip: sc_create_inst
    [    2.092838] vip 48970000.vip: csc_create
    [    2.100040] vip 48970000.vip: vpdma_create
    [    2.100059] vip 48970000.vip: loading firmware vpdma-1b8.bin
    [    2.105766] vip 48970000.vip: firmware callback
    [    2.123678] vip 48970000.vip: VPDMA firmware loaded
    [   32.441003] vip1-s1: Port B: Using subdev adv7180 0-0021 for capture

    Driver is loaded properly & adv7180 is also detected.But node is not created.Please help me.

    Thanks,

    kavya

  • Hi Nikhil,

    Finally we got the /dev/video0 node. But unable to open the node.

    Please find the log.

    root@dra7xx-evm:~# cat /dev/video0
    cat: can't open '/dev/video0': No such device
    root@dra7xx-evm:~# dmesg | grep vip
                    vip_probe
    [    2.102665] vip 48970000.vip: sc_create_inst
    [    2.102681] vip 48970000.vip: csc_create
    [    2.103055] vip 48970000.vip: sc_create_inst
    [    2.103070] vip 48970000.vip: csc_create
    [    2.110269] vip 48970000.vip: vpdma_create
    [    2.110289] vip 48970000.vip: loading firmware vpdma-1b8.bin
    [    2.115995] vip 48970000.vip: firmware callback
    [    2.133914] vip 48970000.vip: VPDMA firmware loaded
    [   33.284856] vip1-s1: Port B: Using subdev adv7180 0-0021 for capture
    [   33.292636] vip1-s1: device registered as video0
    root@dra7xx-evm:~#

    Please help me to solve this issue.

    Thanks,

    kavya

  • HI Kavya,

    This is because the subdevice driver (adv) is returning ENODEV as part of the subdev ioctls.

    Please review the driver where it is returning ENODEV.

    Regards,

    Nikhil D

  • Hi Nikhil,

    Thanks for the quick reply.

    May i know,why adv7180 giving   ENODEV error ?

    Regards,

    Kavya.

  • Hi,

    I would want you to debug that.

    TI supports neither hardware or software for the adv devices.

    I suggest you read through the driver to find out where it is failing the subdev API.

    Any failed subdev API will result into ENODEV being returned by ti-vip driver.

    You can enable the debug logs in ti-vip by passing additional kernel command line parameter ti_vip.debug=8

    Regards,

    Nikhil D

  • Hi Nikhil,

    After debugging in to the driver, we are able to solve the ENODEV error.To solve the ENODEV error we added the below patch in the vip.c

    static int vip_calc_format_size(struct vip_port *port,
            }
            field = &f->fmt.pix.field;
    -       if (*field == V4L2_FIELD_ANY)
    +       //if (*field == V4L2_FIELD_ANY)
    +       switch (*field) {
    +       case V4L2_FIELD_ANY:
                    *field = V4L2_FIELD_NONE;
    -       else if (V4L2_FIELD_NONE != *field && V4L2_FIELD_ALTERNATE != *field)
    +//     else if (V4L2_FIELD_NONE != *field && V4L2_FIELD_ALTERNATE != *field)
    +       break;
    +       case V4L2_FIELD_NONE:
    +       case V4L2_FIELD_ALTERNATE:
    +       case V4L2_FIELD_INTERLACED:
    +               break;
    +       default:

    Now, we are facing kernel crash while capturing from using the command yavta.Please find the attached log for dmesg and kernel crash log.

    vip.txt
    root@dra7xx-evm:~#yavta /dev/video0 -c10 -fUYVY -Fvout_test.yuv -s720x576
    Device /dev/video0 opened.
    Device `vip' on `platform:vip' is a video output (without mplanes) device.[   50.089373] ------------[ cut here ]------------
    
    Video format set: UYVY (59565955) 128x128 (stride 256) field none buffer size 32768
    Video format: UYVY (59565955) 128x128 (stride 256) field none buffer size 32768
    8 buffers requested.
    length: 32768 offset: 0 timestamp type/source: mono/EoF
    Buffer 0/0 mapped at address 0xb6fdf000.
    length: 32768 offset: 32768 timestamp type/source: mono/EoF
    Buffer 1/0 mapped at address 0xb6ea1000.
    length: 32768 offset: 65536 timestamp type/source: mono/EoF
    Buffer 2/0 mapped at address 0xb6e99000.
    length: 32768 offset: 98304 timestamp type/source: mono/EoF
    Buffer 3/0 mapped at address 0xb6e91000.
    length: 32768 offset: 131072 timestamp type/source: mono/EoF
    Buffer 4/0 mapped at address 0xb6e89000.
    length: 32768 offset: 163840 timestamp type/source: mono/EoF
    Buffer 5/0 mapped at address 0xb6e81000.
    length: 32768 offset: 196608 timestamp type/source: mono/EoF
    Buffer 6/0 mapped at address 0xb6e79000.
    length: 32768 offset: 229376 timestamp type/source: mono/EoF
    Buffer 7/0 mapped at address 0xb6e71000.
    0.101242] WARNING: CPU: 1 PID: 956 at drivers/media/v4l2-core/videobuf2-core.c:1315 vb2_start_streaming+0xe0/0x15c()
    [   50.199675] Modules linked in: adv7180 bc_example(O) rpmsg_proto xfrm_user xfrm4_tunnel ipcomp xfrm_ipcomp esp4 virtio_rpmsg_bus ah4 af_key xfrm_algo bluetooth ahci_p
    latform libahci_platform pvrsrvkm(O) libahci libata c_can_platform extcon_usb_gpio c_can omap_aes_driver scsi_mod can_dev omap_sham dwc3_omap extcon rtc_omap omap_rng om
    ap_des rng_core omap_remoteproc remoteproc virtio virtio_ring sch_fq_codel
    [   50.236221] CPU: 1 PID: 956 Comm: yavta Tainted: G        W  O    4.4.84-00031-g9bee036-dirty #190
    [   50.245217] Hardware name: Generic DRA74X (Flattened Device Tree)
    [   50.251334] Backtrace: 
    [   50.253808] [<c0013b1c>] (dump_backtrace) from [<c0013d18>] (show_stack+0x18/0x1c)
    [   50.261407]  r7:c04ac55c r6:600f0013 r5:00000000 r4:c09b5590
    [   50.267130] [<c0013d00>] (show_stack) from [<c02b39a8>] (dump_stack+0x8c/0xa0)
    [   50.274387] [<c02b391c>] (dump_stack) from [<c003581c>] (warn_slowpath_common+0x88/0xb8)
    [   50.282510]  r7:c04ac55c r6:00000523 r5:00000009 r4:00000000
    [   50.288228] [<c0035794>] (warn_slowpath_common) from [<c00358f0>] (warn_slowpath_null+0x24/0x2c)
    [   50.297047]  r8:c09d0964 r7:fffffdfd r6:edf5f87c r5:edf5fad0 r4:edf5f9d8
    [   50.303821] [<c00358cc>] (warn_slowpath_null) from [<c04ac55c>] (vb2_start_streaming+0xe0/0x15c)
    [   50.312648] [<c04ac47c>] (vb2_start_streaming) from [<c04ae168>] (vb2_core_streamon+0x114/0x160)
    [   50.321469]  r7:c0498b80 r6:ee6d1000 r5:edc82300 r4:edf5f87c
    [   50.327189] [<c04ae054>] (vb2_core_streamon) from [<c04affb8>] (vb2_streamon+0x38/0x58)
    [   50.335223]  r5:edc82300 r4:00000001
    [   50.338830] [<c04aff80>] (vb2_streamon) from [<c04b001c>] (vb2_ioctl_streamon+0x44/0x48)
    [   50.346962] [<c04affd8>] (vb2_ioctl_streamon) from [<c0498ba4>] (v4l_streamon+0x24/0x28)
    [   50.355084]  r5:40045612 r4:c04affd8
    [   50.358696] [<c0498b80>] (v4l_streamon) from [<c049ca24>] (__video_do_ioctl+0x2c0/0x334)
    [   50.366818]  r5:40045612 r4:00000001
    [   50.370427] [<c049c764>] (__video_do_ioctl) from [<c049c41c>] (video_usercopy+0x1d0/0x4fc)
    [   50.378723]  r10:edcf1e30 r9:bec0270c r8:00000001 r7:00000000 r6:00000004 r5:00000004
    [   50.386624]  r4:40045612
    [   50.389178] [<c049c24c>] (video_usercopy) from [<c049c760>] (video_ioctl2+0x18/0x1c)
    [   50.396952]  r10:00000000 r9:edcf0000 r8:eeac10cc r7:bec0270c r6:40045612 r5:edc82300
    [   50.404854]  r4:ee6d1000
    [   50.407407] [<c049c748>] (video_ioctl2) from [<c0497688>] (v4l2_ioctl+0xa8/0xe0)
    [   50.414839] [<c04975e0>] (v4l2_ioctl) from [<c013158c>] (do_vfs_ioctl+0x460/0x6dc)
    [   50.422439]  r9:edcf0000 r8:bec0270c r7:00000003 r6:edc82300 r5:d8c2c4c0 r4:bec0270c
    [   50.430262] [<c013112c>] (do_vfs_ioctl) from [<c0131844>] (SyS_ioctl+0x3c/0x64)
    [   50.437600]  r10:00000000 r9:edcf0000 r8:bec0270c r7:40045612 r6:edc82300 r5:00000003
    [   50.445499]  r4:edc82300
    [   50.448053] [<c0131808>] (SyS_ioctl) from [<c000fc60>] (ret_fast_syscall+0x0/0x3c)
    [   50.455653]  r9:edcf0000 r8:c000fe24 r7:00000036 r6:0002736c r5:00000000 r4:00000008
    [   50.463535] ---[ end trace 8fa707bf247eebb8 ]---
    Unable to start streaming: Inappropriate ioctl for device (25).
    8 buffers released.
    root@dra7xx-evm:~# dmesg | grep vip
    [    0.000000] Kernel command line: console=ttyO0,115200n8 vram=16M root=PARTUUID=ac319478-02 rw rootwait ip=none mem=1024M  ti_vip.debug=8
    [    2.096169] vip1-s0: vip_set_slice_path:
    [    2.096181] vip1-s0: vip_set_slice_path: DATA_PATH_SELECT(0000010C): 80008000
    [    2.096198] vip 48970000.vip: sc_create_inst
    [    2.096213] vip 48970000.vip: csc_create
    [    2.096578] vip1-s1: vip_set_slice_path:
    [    2.096589] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 80008000
    [    2.096605] vip 48970000.vip: sc_create_inst
    [    2.096620] vip 48970000.vip: csc_create
    [    2.096633] vip 48970000.vip: vpdma_create
    [    2.096651] vip 48970000.vip: loading firmware vpdma-1b8.bin
    [    2.102342] vip 48970000.vip: firmware callback
    [    2.115035] vip 48970000.vip: VPDMA firmware loaded
    [    2.119999] vip1-s0: can't get next endpoint: loop: 1
    [    2.120007] vip1-s0: register async notifier for 1 subdevs
    [    2.120073] vip1-s1: can't get next endpoint: loop: 1
    [    2.120080] vip1-s1: register async notifier for 1 subdevs
    [   47.365057] vip1-s1: vip_async_bound
    [   47.365068] vip1-s1: Port B: Using subdev adv7180 0-0021 for capture
    [   47.371453] vip1-s1: subdev adv7180 0-0021: code: 2006 idx: 0
    [   47.371462] vip1-s1: matched fourcc: NV12: code: 2006 idx: 0
    [   47.371470] vip1-s1: matched fourcc: UYVY: code: 2006 idx: 1
    [   47.371478] vip1-s1: matched fourcc: YUYV: code: 2006 idx: 2
    [   47.371485] vip1-s1: matched fourcc: VYUY: code: 2006 idx: 3
    [   47.371492] vip1-s1: matched fourcc: YVYU: code: 2006 idx: 4
    [   47.371499] vip1-s1: matched fourcc: RGB3: code: 2006 idx: 5
    [   47.371506] vip1-s1: matched fourcc: RGB4: code: 2006 idx: 6
    [   47.371512] vip1-s1: matched fourcc: BGR3: code: 2006 idx: 7
    [   47.371519] vip1-s1: matched fourcc: BGR4: code: 2006 idx: 8
    [   47.372741] vip1-s1: device registered as video0
    [   47.377896] vip1-s1: vip_async_complete
    [   47.387612] vip1-s1: vip_open
    [   47.387635] vip1-s1: vip_init_port: g_mbus_fmt subdev mbus_code: 2006 fourcc:NV12 size: 720x576
    [   47.387650] vip1-s1: calc_format_size: fourcc:NV12 size: 720x576 bpl:720 img_size:622080
    [   47.387660] vip1-s1: init_stream fourcc:NV12 size: 720x576 bpl:720 img_size:622080
    [   47.387668] vip1-s1: init_stream vpdma data type: 0x02
    [   47.387678] vip1-s1: vip_init_stream: stream instance 0xedf5f000
    [   47.387685] vip1-s1: 
                    vip_open sucess 
    [   47.387766] vip1-s1: vip_release
    [   47.387780] vip1-s1: vip_release_stream: stream instance 0xedf5f000
    [   47.387789] vip1-s1: vip_release_port: port instance 0xeead1c10
    [   50.086399] vip1-s1: vip_open
    [   50.086422] vip1-s1: vip_init_port: g_mbus_fmt subdev mbus_code: 2006 fourcc:NV12 size: 720x576
    [   50.086438] vip1-s1: calc_format_size: fourcc:NV12 size: 720x576 bpl:720 img_size:622080
    [   50.086447] vip1-s1: init_stream fourcc:NV12 size: 720x576 bpl:720 img_size:622080
    [   50.086455] vip1-s1: init_stream vpdma data type: 0x02
    [   50.086464] vip1-s1: vip_init_stream: stream instance 0xedf5f000
    [   50.086470] vip1-s1: 
                    vip_open sucess 
    [   50.086621] vip1-s1: s_fmt input fourcc:UYVY size: 720x576
    [   50.086630] vip1-s1: try_fmt fourcc:UYVY size: 720x576
    [   50.086639] vip1-s1: try_fmt best subdev size: 0x0
    [   50.086647] vip1-s1: calc_format_size: fourcc:UYVY size: 128x128 bpl:256 img_size:32768
    [   50.086654] vip1-s1: s_fmt try_fmt fourcc:UYVY size: 128x128
    [   50.086662] vip1-s1: s_fmt fourcc:UYVY size: 128x128 bpl:256 img_size:32768
    [   50.086670] vip1-s1: s_fmt pix_to_mbus mbus_code: 2006 size: 0x0
    [   50.086678] vip1-s1: s_fmt subdev fmt mbus_code: 2006 size: 720x576
    [   50.086684] vip1-s1: s_fmt vpdma data type: 0x27
    [   50.086716] vip1-s1: g_fmt fourcc:UYVY code: 2006 size: 128x128 bpl:256 img_size:32768
    [   50.086723] vip1-s1: g_fmt vpdma data type: 0x27
    [   50.086754] vip1-s1: get 8 buffer(s) of size 32768 each.
    [   50.087757] vip 48970000.vip: hs config: src_w = 720, dst_w = 128, decimation = 4x, lin_acc_inc = 0168d1a3
    [   50.087772] vip 48970000.vip: vs config(RAV): src_h = 576, dst_h = 128, factor = 227, acc_init = 00000155, acc_init_b = 00000000
    [   50.087804] vip1-s1: Added mmr_adb config desc
    [   50.087841] vip1-s1: Added sc_coeff_h config desc
    [   50.087878] vip1-s1: Added sc_coeff_v config desc
    [   50.087884] vip1-s1: CFD_SC_CLIENT 8 slice_id: 1
    [   50.087890] vip1-s1: Submitting desc on list# 0
    [   50.089026] vip1-s1: vip_set_slice_path:
    [   50.089036] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 20000018
    [   50.089043] vip1-s1: vip_set_slice_path:
    [   50.089050] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 70001018
    [   50.089056] vip1-s1: vip_set_slice_path:
    [   50.089064] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 90011018
    [   50.089070] vip1-s1: vip_set_slice_path:
    [   50.089077] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): A0031018
    [   50.089083] vip1-s1: vip_set_slice_path:
    [   50.089091] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 50031018
    [   50.089366] vip1-s1: stream on failed in subdev
    [   50.468531] vip1-s1: vip_release
    [   50.468545] vip1-s1: vip_release_stream: stream instance 0xedf5f000
    [   50.468554] vip1-s1: vip_release_port: port instance 0xeead1c10
    
    

    Thanks,

    Kavya.

  • Hi Kavya,

    You should not need to change anything in the VIP driver.

    It supports all types of video devices in generic way.

    A video source should not provide the FIELD_INTERLACED as format.

    The expected value is FIELD_ALTERNATE. You should modify the adv driver to report correct field value.

    Regards,

    Nikhil D

  • Hi Nikhil,

    I had enable below debugs

    • echo 3 >/sys/class/video4linux/video1/dev_debug
    • echo 3 > /sys/module/videobuf2_core/parameters/debug

    I got below error,

    vip1-s1: stream on failed in subdev
    [   62.322583] vb2: vb2_start_streaming: driver refused to start streaming

    For more details,please find the attached error.txt.

    4812.error.txt
    [   23.525232] adv7180 0-0021: chip found @ 0x21 (OMAP I2C adapter)
    [   23.544910] vip1-s1: vip_async_bound
    [   23.544922] vip1-s1: Port B: Using subdev adv7180 0-0021 for capture
    [   23.551305] vip1-s1: subdev adv7180 0-0021: code: 2006 idx: 0
    [   23.551314] vip1-s1: matched fourcc: NV12: code: 2006 idx: 0
    [   23.551322] vip1-s1: matched fourcc: UYVY: code: 2006 idx: 1
    [   23.551330] vip1-s1: matched fourcc: YUYV: code: 2006 idx: 2
    [   23.551337] vip1-s1: matched fourcc: VYUY: code: 2006 idx: 3
    [   23.551343] vip1-s1: matched fourcc: YVYU: code: 2006 idx: 4
    [   23.551350] vip1-s1: matched fourcc: RGB3: code: 2006 idx: 5
    [   23.551357] vip1-s1: matched fourcc: RGB4: code: 2006 idx: 6
    [   23.551364] vip1-s1: matched fourcc: BGR3: code: 2006 idx: 7
    [   23.551370] vip1-s1: matched fourcc: BGR4: code: 2006 idx: 8
    [   23.552737] vip1-s1: device registered as video0
    [   23.557881] vip1-s1: vip_async_complete
    [   23.564302] Adding alias for supply vdd,cpu0 -> vdd,4a003b20.oppdm
    [   23.566494] vip1-s1: vip_open
    [   23.566509] vip1-s1: vip_init_port: g_mbus_fmt subdev mbus_code: 2006 fourcc:NV12 size: 720x480
    [   23.566519] vip1-s1: calc_format_size: fourcc:NV12 size: 720x480 bpl:720 img_size:518400
    [   23.566523] vip1-s1: init_stream fourcc:NV12 size: 720x480 bpl:720 img_size:518400
    [   23.566526] vip1-s1: init_stream vpdma data type: 0x02
    [   23.566531] vip1-s1: vip_init_stream: stream instance 0xee59c000
    [   23.566638] vip1-s1: vip_release
    [   23.566646] vip1-s1: vip_release_stream: stream instance 0xee59c000
    [   23.566650] vip1-s1: vip_release_port: port instance 0xeead5c10
    [   23.573209] Adding alias for supply vbb,cpu0 -> vbb,4a003b20.oppdm
    [   23.580254] ti_oppdm 4a003b20.oppdm: Unable to get vdd regulator:-517
    [   62.210007] vip1-s1: vip_open
    [   62.210030] vip1-s1: vip_init_port: g_mbus_fmt subdev mbus_code: 2006 fourcc:NV12 size: 720x480
    [   62.210044] vip1-s1: calc_format_size: fourcc:NV12 size: 720x480 bpl:720 img_size:518400
    [   62.210053] vip1-s1: init_stream fourcc:NV12 size: 720x480 bpl:720 img_size:518400
    [   62.210060] vip1-s1: init_stream vpdma data type: 0x02
    [   62.210069] vip1-s1: vip_init_stream: stream instance 0xee59c000
    [   62.210086] video0: VIDIOC_QUERYCAP: driver=vip, card=vip, bus=platform:vip, version=0x00040454, capabilities=0x85200001, device_caps=0x05200001
    [   62.210115] video0: VIDIOC_CROPCAP: type=vid-cap, bounds wxh=720x480, x,y=0,0, defrect wxh=720x480, x,y=0,0, pixelaspect 1/1
    [   62.210142] vip1-s1: cropped (0,0)/720x480 of 720x480
    [   62.210148] video0: VIDIOC_S_CROP: type=vid-cap, wxh=720x480, x,y=0,0
    [   62.210172] vip1-s1: g_fmt fourcc:NV12 code: 2006 size: 720x480 bpl:720 img_size:518400
    [   62.210179] vip1-s1: g_fmt vpdma data type: 0x02
    [   62.210185] video0: VIDIOC_G_FMT: type=vid-cap, width=720, height=480, pixelformat=NV12, field=interlaced, bytesperline=720, sizeimage=518400, colorspace=1, flags=0x0
    [   62.210219] vip1-s1: get 4 buffer(s) of size 518400 each.
    [   62.212019] vb2: __setup_offsets: buffer 0, plane 0 offset 0x00000000
    [   62.230638] vb2: __setup_offsets: buffer 1, plane 0 offset 0x0007f000
    [   62.237163] vb2: __setup_offsets: buffer 2, plane 0 offset 0x000fe000
    [   62.245339] vb2: __setup_offsets: buffer 3, plane 0 offset 0x0017d000
    [   62.251810] vb2: __vb2_queue_alloc: allocated 4 buffers, 1 plane(s) each
    [   62.260211] video0: VIDIOC_REQBUFS: count=4, type=vid-cap, memory=mmap
    [   62.260403] video0: VIDIOC_QUERYBUF: 00:00:00.00000000 index=0, type=vid-cap, flags=0x00002000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0x0, 0
    [   62.260433] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
    [   62.260459] vb2: vb2_mmap: buffer 0, plane 0 successfully mapped
    [   62.269672] video0: VIDIOC_QUERYBUF: 00:00:00.00000000 index=1, type=vid-cap, flags=0x00002000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0x7f00
    [   62.269703] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
    [   62.269729] vb2: vb2_mmap: buffer 1, plane 0 successfully mapped
    [   62.278177] video0: VIDIOC_QUERYBUF: 00:00:00.00000000 index=2, type=vid-cap, flags=0x00002000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0xfe00
    [   62.278207] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
    [   62.278229] vb2: vb2_mmap: buffer 2, plane 0 successfully mapped
    [   62.286686] video0: VIDIOC_QUERYBUF: 00:00:00.00000000 index=3, type=vid-cap, flags=0x00002000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0x17d0
    [   62.286715] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
    [   62.286737] vb2: vb2_mmap: buffer 3, plane 0 successfully mapped
    [   62.292780] vb2: vb2_core_qbuf: qbuf of buffer 0 succeeded
    [   62.298364] vb2: vb2_core_qbuf: qbuf of buffer 1 succeeded
    [   62.304046] vb2: vb2_core_qbuf: qbuf of buffer 2 succeeded
    [   62.309559] vb2: vb2_core_qbuf: qbuf of buffer 3 succeeded
    [   62.315117] vip1-s1: vip_set_slice_path:
    [   62.315128] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 70004000
    [   62.315136] vip1-s1: vip_set_slice_path:
    [   62.315144] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): A0004000
    [   62.315154] vip1-s1: vip_set_slice_path:
    [   62.315171] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 80004000
    [   62.315178] vip1-s1: vip_set_slice_path:
    [   62.315185] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 40004000
    [   62.322573] vip1-s1: stream on failed in subdev
    [   62.322583] vb2: vb2_start_streaming: driver refused to start streaming
    [   62.330803] ------------[ cut here ]------------
    [   62.336275] WARNING: CPU: 0 PID: 952 at drivers/media/v4l2-core/videobuf2-core.c:1315 vb2_start_streaming+0xe0/0x15c()
    [   62.347847] Modules linked in: adv7180 bc_example(O) rpmsg_proto xfrm_user xfrm4_tunnel ipcomp xfrm_ipcomp esp4 virtio_rpmsg_bus ah4 af_key xfrm_algo bluetooth pvrsrl
    [   62.384457] CPU: 1 PID: 952 Comm: capure Tainted: G           O    4.4.84-00031-g9bee036-dirty #210
    [   62.393541] Hardware name: Generic DRA74X (Flattened Device Tree)
    [   62.399657] Backtrace: 
    [   62.402133] [<c0013b1c>] (dump_backtrace) from [<c0013d18>] (show_stack+0x18/0x1c)
    [   62.409733]  r7:c04ac55c r6:600c0013 r5:00000000 r4:c09b5590
    [   62.415459] [<c0013d00>] (show_stack) from [<c02b39a8>] (dump_stack+0x8c/0xa0)
    [   62.422714] [<c02b391c>] (dump_stack) from [<c003581c>] (warn_slowpath_common+0x88/0xb8)
    [   62.430837]  r7:c04ac55c r6:00000523 r5:00000009 r4:00000000
    [   62.436554] [<c0035794>] (warn_slowpath_common) from [<c00358f0>] (warn_slowpath_null+0x24/0x2c)
    [   62.445375]  r8:c09d0964 r7:fffffdfd r6:ee59c87c r5:ee59cad0 r4:ee59c9d8
    [   62.452152] [<c00358cc>] (warn_slowpath_null) from [<c04ac55c>] (vb2_start_streaming+0xe0/0x15c)
    [   62.460979] [<c04ac47c>] (vb2_start_streaming) from [<c04ae168>] (vb2_core_streamon+0x114/0x160)
    [   62.469799]  r7:c0498b80 r6:ee2fcc00 r5:ee1099c0 r4:ee59c87c
    [   62.475519] [<c04ae054>] (vb2_core_streamon) from [<c04affb8>] (vb2_streamon+0x38/0x58)
    [   62.483553]  r5:ee1099c0 r4:00000001
    [   62.487159] [<c04aff80>] (vb2_streamon) from [<c04b001c>] (vb2_ioctl_streamon+0x44/0x48)
    [   62.495290] [<c04affd8>] (vb2_ioctl_streamon) from [<c0498ba4>] (v4l_streamon+0x24/0x28)
    [   62.503411]  r5:40045612 r4:c04affd8
    [   62.507022] [<c0498b80>] (v4l_streamon) from [<c049ca24>] (__video_do_ioctl+0x2c0/0x334)
    [   62.515144]  r5:40045612 r4:00000001
    [   62.518754] [<c049c764>] (__video_do_ioctl) from [<c049c41c>] (video_usercopy+0x1d0/0x4fc)
    [   62.527050]  r10:ee0a7e30 r9:bee22bb0 r8:00000001 r7:00000000 r6:00000004 r5:00000004
    [   62.534951]  r4:40045612
    [   62.537506] [<c049c24c>] (video_usercopy) from [<c049c760>] (video_ioctl2+0x18/0x1c)
    [   62.545279]  r10:00000000 r9:ee0a6000 r8:eeab50cc r7:bee22bb0 r6:40045612 r5:ee1099c0
    [   62.553184]  r4:ee2fcc00
    [   62.555739] [<c049c748>] (video_ioctl2) from [<c0497688>] (v4l2_ioctl+0xa8/0xe0)
    [   62.563170] [<c04975e0>] (v4l2_ioctl) from [<c013158c>] (do_vfs_ioctl+0x460/0x6dc)
    [   62.570769]  r9:ee0a6000 r8:bee22bb0 r7:00000003 r6:ee1099c0 r5:ed14d720 r4:bee22bb0
    [   62.578589] [<c013112c>] (do_vfs_ioctl) from [<c0131844>] (SyS_ioctl+0x3c/0x64)
    [   62.585926]  r10:00000000 r9:ee0a6000 r8:bee22bb0 r7:40045612 r6:ee1099c0 r5:00000003
    [   62.593828]  r4:ee1099c0
    [   62.596381] [<c0131808>] (SyS_ioctl) from [<c000fc60>] (ret_fast_syscall+0x0/0x3c)
    [   62.603981]  r9:ee0a6000 r8:c000fe24 r7:00000036 r6:00000000 r5:00000000 r4:bee22bf8
    [   62.615850] ---[ end trace 8a98eca6f1a727d2 ]---
    [   62.620619] video0: VIDIOC_STREAMON: error -515: type=vid-cap
    [   62.620961] vip1-s1: vip_release
    [   62.621057] vb2: __vb2_buf_mem_free: freed plane 0 of buffer 0
    [   62.632035] vb2: __vb2_buf_mem_free: freed plane 0 of buffer 1
    [   62.638172] vb2: __vb2_buf_mem_free: freed plane 0 of buffer 2
    [   62.644299] vb2: __vb2_buf_mem_free: freed plane 0 of buffer 3
    [   62.650163] vip1-s1: vip_release_stream: stream instance 0xee59c000
    [   62.650171] vip1-s1: vip_release_port: port instance 0xeead5c10
    
    

    I got "video0: VIDIOC_STREAMON: error -515"   no ioctl command error, so please tell me,is there any functionality need to be included in adv7180 regarding ioctl calls ?

    Regards,

    Kavya.

  • Hi,

    As I said earlier, you have to implement the subdev operations in the adv driver.

    You can use the tvp 5158 driver as a reference for  implementation.

    TVP5158 is TI supported NTSC analog camera

    I hope you find it helpful.

    Regards,

    Nikhil D

  • Hi Nikhil,

    Thanks for your inputs.

    I modified the ADV7180 driver by taking reference from TVP5158.

    While capturing the data I got below error

    "vb2: __vb2_wait_for_done_vb: will sleep waiting for buffers" 

    Please find the attachment for more details.

    adv7182_dmesg_log.txt
    [   23.919942] adv7180 0-0021: chip found @ 0x21 (OMAP I2C adapter)
    [   23.934920] vip1-s1: vip_async_bound
    [   23.934932] vip1-s1: Port B: Using subdev adv7180 0-0021 for capture
    [   23.941316] vip1-s1: subdev adv7180 0-0021: code: 2006 idx: 0
    [   23.941325] vip1-s1: matched fourcc: NV12: code: 2006 idx: 0
    [   23.941333] vip1-s1: matched fourcc: UYVY: code: 2006 idx: 1
    [   23.941341] vip1-s1: matched fourcc: YUYV: code: 2006 idx: 2
    [   23.941348] vip1-s1: matched fourcc: VYUY: code: 2006 idx: 3
    [   23.941354] vip1-s1: matched fourcc: YVYU: code: 2006 idx: 4
    [   23.941361] vip1-s1: matched fourcc: RGB3: code: 2006 idx: 5
    [   23.941368] vip1-s1: matched fourcc: RGB4: code: 2006 idx: 6
    [   23.941374] vip1-s1: matched fourcc: BGR3: code: 2006 idx: 7
    [   23.941380] vip1-s1: matched fourcc: BGR4: code: 2006 idx: 8
    [   23.942762] vip1-s1: device registered as video0
    [   23.947532] vip1-s1: vip_async_complete
    [   23.951625] Adding alias for supply vdd,cpu0 -> vdd,4a003b20.oppdm
    [   23.959942] vip1-s1: vip_open
    [   23.959962] vip1-s1: vip_init_port: g_mbus_fmt subdev mbus_code: 2006 fourcc:NV12 size: 720x576
    [   23.959977] vip1-s1: calc_format_size: fourcc:NV12 size: 720x576 bpl:720 img_size:622080
    [   23.959987] vip1-s1: init_stream fourcc:NV12 size: 720x576 bpl:720 img_size:622080
    [   23.959995] vip1-s1: init_stream vpdma data type: 0x02
    [   23.960004] vip1-s1: vip_init_stream: stream instance 0xedce2000
    [   23.960021] video0: VIDIOC_QUERYCAP: driver=vip, card=vip, bus=platform:vip, version=0x00040454, capabilities=0x85200001, device_caps=0x05200001
    [   23.960148] vip1-s1: vip_release
    [   23.960161] vip1-s1: vip_release_stream: stream instance 0xedce2000
    [   23.960170] vip1-s1: vip_release_port: port instance 0xeead5c10
    [   23.963382] Adding alias for supply vbb,cpu0 -> vbb,4a003b20.oppdm
    [   23.970765] ti_oppdm 4a003b20.oppdm: Unable to get vdd regulator:-517
    [   25.891822] vip1-s1: vip_open
    [   25.891844] vip1-s1: vip_init_port: g_mbus_fmt subdev mbus_code: 2006 fourcc:NV12 size: 720x576
    [   25.891858] vip1-s1: calc_format_size: fourcc:NV12 size: 720x576 bpl:720 img_size:622080
    [   25.891867] vip1-s1: init_stream fourcc:NV12 size: 720x576 bpl:720 img_size:622080
    [   25.891874] vip1-s1: init_stream vpdma data type: 0x02
    [   25.891884] vip1-s1: vip_init_stream: stream instance 0xedce2000
    [   25.891993] video0: VIDIOC_QUERYCAP: driver=vip, card=vip, bus=platform:vip, version=0x00040454, capabilities=0x85200001, device_caps=0x05200001
    [   25.892044] vip1-s1: s_fmt input fourcc:UYVY size: 720x576
    [   25.892054] vip1-s1: try_fmt fourcc:UYVY size: 720x576
    [   25.892065] vip1-s1: try_fmt loop:0 fourcc:UYVY size: -335545356x-485097464
    [   25.892073] vip1-s1: try_fmt best subdev size: 0x0
    [   25.892081] vip1-s1: calc_format_size: fourcc:UYVY size: 128x128 bpl:256 img_size:32768
    [   25.892088] vip1-s1: s_fmt try_fmt fourcc:UYVY size: 128x128
    [   25.892096] vip1-s1: s_fmt fourcc:UYVY size: 128x128 bpl:256 img_size:32768
    [   25.892104] vip1-s1: s_fmt pix_to_mbus mbus_code: 2006 size: 0x0
    [   25.892112] vip1-s1: s_fmt subdev fmt mbus_code: 2006 size: 720x576
    [   25.892118] vip1-s1: s_fmt vpdma data type: 0x27
    [   25.892123] video0: VIDIOC_S_FMT: type=vid-cap, width=128, height=128, pixelformat=UYVY, field=none, bytesperline=256, sizeimage=32768, colorspace=1, flags=0x0, ycbc0
    [   25.892175] vip1-s1: g_fmt fourcc:UYVY code: 2006 size: 128x128 bpl:256 img_size:32768
    [   25.892183] vip1-s1: g_fmt vpdma data type: 0x27
    [   25.892188] video0: VIDIOC_G_FMT: type=vid-cap, width=128, height=128, pixelformat=UYVY, field=none, bytesperline=256, sizeimage=32768, colorspace=1, flags=0x0, ycbc0
    [   25.892235] vip1-s1: get 4 buffer(s) of size 32768 each.
    [   25.892583] vb2: __setup_offsets: buffer 0, plane 0 offset 0x00000000
    [   25.907880] vb2: __setup_offsets: buffer 1, plane 0 offset 0x00008000
    [   25.928523] vb2: __setup_offsets: buffer 2, plane 0 offset 0x00010000
    [   25.935062] vb2: __setup_offsets: buffer 3, plane 0 offset 0x00018000
    [   25.941532] vb2: __vb2_queue_alloc: allocated 4 buffers, 1 plane(s) each
    [   25.948358] video0: VIDIOC_REQBUFS: count=4, type=vid-cap, memory=mmap
    [   25.948521] video0: VIDIOC_QUERYBUF: 00:00:00.00000000 index=0, type=vid-cap, flags=0x00002000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0x0, 8
    [   25.948553] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
    [   25.948597] vb2: vb2_mmap: buffer 0, plane 0 successfully mapped
    [   25.961305] video0: VIDIOC_QUERYBUF: 00:00:00.00000000 index=1, type=vid-cap, flags=0x00002000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0x8008
    [   25.961334] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
    [   25.961371] vb2: vb2_mmap: buffer 1, plane 0 successfully mapped
    [   25.976297] video0: VIDIOC_QUERYBUF: 00:00:00.00000000 index=2, type=vid-cap, flags=0x00002000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0x1008
    [   25.976325] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
    [   25.976362] vb2: vb2_mmap: buffer 2, plane 0 successfully mapped
    [   25.991360] video0: VIDIOC_QUERYBUF: 00:00:00.00000000 index=3, type=vid-cap, flags=0x00002000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0x1808
    [   25.991388] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
    [   25.991423] vb2: vb2_mmap: buffer 3, plane 0 successfully mapped
    [   26.006327] vb2: vb2_core_qbuf: qbuf of buffer 0 succeeded
    [   26.018276] vb2: vb2_core_qbuf: qbuf of buffer 1 succeeded
    [   26.024644] vb2: vb2_core_qbuf: qbuf of buffer 2 succeeded
    [   26.030160] vb2: vb2_core_qbuf: qbuf of buffer 3 succeeded
    [   26.035852] vip 48970000.vip: hs config: src_w = 720, dst_w = 128, decimation = 4x, lin_acc_inc = 0168d1a3
    [   26.035867] vip 48970000.vip: vs config(RAV): src_h = 576, dst_h = 128, factor = 227, acc_init = 00000155, acc_init_b = 00000000
    [   26.035879] config descriptor of payload class: address data block
    [   26.035886] word2: payload_addr = 0xad0ef100
    [   26.035894] word3: pkt_type = 11, direct = 0, class = 0, dest = 0, payload_len = 13
    [   26.035901] vip1-s1: Added mmr_adb config desc
    [   26.035909] config descriptor of payload class: simple block
    [   26.035918] word0: dst_addr_offset = 0x00000000
    [   26.035923] word1: num_data_wrds = 1024
    [   26.035929] word2: payload_addr = 0xadcdd800
    [   26.035936] word3: pkt_type = 11, direct = 0, class = 1, dest = 8, payload_len = 64
    [   26.035942] vip1-s1: Added sc_coeff_h config desc
    [   26.035949] config descriptor of payload class: simple block
    [   26.035955] word0: dst_addr_offset = 0x00000040
    [   26.035961] word1: num_data_wrds = 1024
    [   26.035966] word2: payload_addr = 0xadcde000
    [   26.035973] word3: pkt_type = 11, direct = 0, class = 1, dest = 8, payload_len = 64
    [   26.035979] vip1-s1: Added sc_coeff_v config desc
    [   26.035985] vip1-s1: CFD_SC_CLIENT 8 slice_id: 1
    [   26.035992] vip1-s1: Submitting desc on list# 0
    [   26.037123] vip1-s1: vip_set_slice_path:
    [   26.037133] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 20000018
    [   26.037139] vip1-s1: vip_set_slice_path:
    [   26.037150] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 70001018
    [   26.037156] vip1-s1: vip_set_slice_path:
    [   26.037163] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 90011018
    [   26.037169] vip1-s1: vip_set_slice_path:
    [   26.037177] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): A0031018
    [   26.037183] vip1-s1: vip_set_slice_path:
    [   26.037190] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 50031018
    [   26.037476] outbound data transfer descriptor for channel 173
    [   26.037486] word0: data_type = 39, notify = 1, field = 0, 1D = 0, even_ln_skp = 0, odd_ln_skp = 0, line_stride = 256
    [   26.037493] word2: start_addr = 0x00000000
    [   26.037500] word3: pkt_type = 10, mode = 0, dir = 1, chan = 173, pri = 0, next_chan = 173
    [   26.037508] word4: desc_write_addr = 0x00000000, write_desc = 0, drp_data = 0, use_desc_reg = 0
    [   26.037516] word5: max_width 2, max_height 2
    [   26.037522] word6: client specific attr0 = 0x00000000
    [   26.037528] word7: client specific attr1 = 0x00000000
    [   26.037537] vip1-s1: vip_load_vpdma_list_fifo: start_dma vb2 buf idx:0
    [   26.037545] vip1-s1: start_dma: vb2 buf idx:0, dma_addr:0xbe448000
    [   26.037552] outbound data transfer descriptor for channel 173
    [   26.037560] word0: data_type = 39, notify = 1, field = 0, 1D = 0, even_ln_skp = 0, odd_ln_skp = 0, line_stride = 256
    [   26.037567] word2: start_addr = 0xbe448000
    [   26.037574] word3: pkt_type = 10, mode = 0, dir = 1, chan = 173, pri = 0, next_chan = 173
    [   26.037581] word4: desc_write_addr = 0xadcdfde0, write_desc = 1, drp_data = 0, use_desc_reg = 0
    [   26.037588] word5: max_width 2, max_height 2
    [   26.037593] word6: client specific attr0 = 0x00000000
    [   26.037601] word7: client specific attr1 = 0x00000000
    [   26.038726] vip1-s1: vip_load_vpdma_list_fifo: start_dma vb2 buf idx:1
    [   26.038735] vip1-s1: start_dma: vb2 buf idx:1, dma_addr:0xbe450000
    [   26.038743] outbound data transfer descriptor for channel 173
    [   26.038750] word0: data_type = 39, notify = 1, field = 0, 1D = 0, even_ln_skp = 0, odd_ln_skp = 0, line_stride = 256
    [   26.038757] word2: start_addr = 0xbe450000
    [   26.038764] word3: pkt_type = 10, mode = 0, dir = 1, chan = 173, pri = 0, next_chan = 173
    [   26.038773] word4: desc_write_addr = 0xadcdfde0, write_desc = 1, drp_data = 0, use_desc_reg = 0
    [   26.038779] word5: max_width 2, max_height 2
    [   26.038785] word6: client specific attr0 = 0x00000000
    [   26.038791] word7: client specific attr1 = 0x00000000
    [   26.039915] vip1-s1: added next buffer
    [   26.039925] vip1-s1: start_dma: vb2 buf idx:2, dma_addr:0xbe458000
    [   26.039935] outbound data transfer descriptor for channel 173
    [   26.039943] word0: data_type = 39, notify = 1, field = 0, 1D = 0, even_ln_skp = 0, odd_ln_skp = 0, line_stride = 256
    [   26.039950] word2: start_addr = 0xbe458000
    [   26.039957] word3: pkt_type = 10, mode = 0, dir = 1, chan = 173, pri = 0, next_chan = 173
    [   26.039964] word4: desc_write_addr = 0xadcdfde0, write_desc = 1, drp_data = 0, use_desc_reg = 0
    [   26.039970] word5: max_width 2, max_height 2
    [   26.039975] word6: client specific attr0 = 0x00000000
    [   26.039981] word7: client specific attr1 = 0x00000000
    [   26.039990] vb2: vb2_core_streamon: successful
    [   26.044565] video0: VIDIOC_STREAMON: type=vid-cap
    [   26.044627] vb2: __vb2_wait_for_done_vb: will sleep waiting for buffers
    [   33.470497] vb2: __vb2_wait_for_done_vb: sleep was interrupted
    [   33.476772] vip1-s1: vip_release
    [   33.476783] vip1-s1: vip_stop_streaming:
    [   33.476791] vip1-s1: vip_disable_sc_path:
    [   33.476798] vip1-s1: vip_set_slice_path:
    [   33.476807] vip1-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 20031000
    [   33.476818] vip1-s1: Clear channel no: 173
    [   33.476826] control descriptor
    [   33.476833] word3: pkt_type = 12, source = 173, ctl_type = 8
    [   33.476877] vb2: __vb2_buf_mem_free: freed plane 0 of buffer 0
    [   33.482746] vb2: __vb2_buf_mem_free: freed plane 0 of buffer 1
    [   33.488647] vb2: __vb2_buf_mem_free: freed plane 0 of buffer 2
    [   33.494697] vb2: __vb2_buf_mem_free: freed plane 0 of buffer 3
    [   33.500653] vip1-s1: vip_release_stream: stream instance 0xedce2000
    [   33.500663] vip1-s1: vip_release_port: port instance 0xeead5c10
    
    

    I am using "yavta -f UYVY -s 720x576 -n 4 --capture=1 --file=image.rgb -F /dev/video0" command for capture the data.

    Could you please give me some inputs to solve this issue.

    Regards,

    Kavya.

  • Hi,

    That is happening because the VIP is not able to detect frames.

    Please make sure that you have the right endpoint properties described for the adv subdevice.

    Again, refer to tvp5158 DT entry for dra7 jamr board

    Regards,

    Nikhil D

  • Hi Nikhil,

    Please find the below dts information what i'm using now.

     adv7180@21 {

                            compatible = "adi,adv7180";
                            reg = <0x21>;
                            status = "okay";

                            port {

                                    adv7182: endpoint@0{
                                    status = "okay";
                                    pclk-sample = <0>;
                                    channels = <0>;

                            };
                    };
         };
    };

    &vip1 {
            status = "okay";
    };

    /* composite video input */
    &vin2a {

            status = "okay";

            endpoint {

                    status = "okay";
                    slave-mode;
                    remote-endpoint = <&adv7182>;

            };

    };

    Please tell me wether this DTS information & pinmuxing  i'm using is correct or not?

    I'm using the VIN2A_D16-VIN2A_D23 pins for digital output of NTSC decoder,these are mapped to vin2b_d7-vin2b_d0.In dts which port i have to use either vin2a or vin2b?

    I'm configuring the pins in u-boot. Please find the below pinmuxing details.

        {VIN2A_D16, (M2 | PIN_INPUT)},   /* vin2a_d16.vin2b_d7 */
            {VIN2A_D17, (M2 | PIN_INPUT)},   /* vin2a_d17.vin2b_d6 */
            {VIN2A_D18, (M2 | PIN_INPUT)},   /* vin2a_d18.vin2b_d5 */
            {VIN2A_D19, (M2 | PIN_INPUT)},   /* vin2a_d19.vin2b_d4 */
            {VIN2A_D20, (M2 | PIN_INPUT)},   /* vin2a_d20.vin2b_d3 */
            {VIN2A_D21, (M2 | PIN_INPUT)},   /* vin2a_d21.vin2b_d2 */
            {VIN2A_D22, (M2 | PIN_INPUT)},   /* vin2a_d22.vin2b_d1 */
            {VIN2A_D23, (M2 | PIN_INPUT)},   /* vin2a_d23.vin2b_d0 */
            {VIN2A_FLD0, (M2 | PIN_INPUT)},  /* vin2a_fld0.vin2b_clk1 */
            {VIN2A_HSYNC0, (M3 | PIN_INPUT)},        /* vin2a_hsync0.vin2b_hsync1 */
            {VIN2A_VSYNC0, (M3 | PIN_INPUT_PULLDOWN)},        /* vin2a_vsync0.vin2b_vsync0 */


    I'm not getting any buffers.Please help me to solve this issue.

    Thanks,

    kavya

  • Hi Nikhil,

    I am waiting for your valuable inputs.

    Regards,

    Kavya.

  • Hi Kavya,

    Sorry for the delay.

    You should be adding the endpoint node in vin2b.

    You are using vin2b video port.

    VIN2A is just name of the pad

    Regards,

    Nikhil D

  • Hi Nikhil,

    Could you please confirm devicetree support and pinmuxing.

    If everything fine means,where could be the problem ?

    Regards,

    Kavya.

  • Hi Kavya,

    I pointed out your problem in last reply.

    You should add the endpoint in vin2b port. The DTS snippet you posted is wrong.

    Regards,

    Nikhil D

  • Hi Nikhil,

    I already added the endpoint in vin2b port,at that time also i'm not getting any buffers.Please help me to solve the issue.

    Again I'm giving the DTS info,Please check it wether I'm missing anything.

     adv7180@21 {

                            compatible = "adi,adv7182";
                            reg = <0x21>;                    
                            status = "okay";

                            port {

                                    adv7182: endpoint@0{
                                    status = "okay";
                                    pclk-sample = <0>;
                                    channels = <0>;
                                    remote-endpoint=<&vin2b>;

                            };
                    };
         };
    };

    &vip1 {
            status = "okay";
    };

    /* composite video input*/
    &vin2b {

            status = "okay";

            endpoint {

                    status = "okay";
                    slave-mode;
                    remote-endpoint = <&adv7182>;
            };

    };

    Thanks,

    Kavya.

  • Hi Kavya,

    You can refer to this app note for debugging failures with video capture.

    http://www.ti.com/lit/an/spracd3/spracd3.pdf

    Hope you find this useful.

    Regards,

    Nikhil D