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.

Linux/DRA754: [Jacinto 6]Video capture failure: adv7182 decoder connected to vip

Part Number: DRA754

Tool/software: Linux

We have connected adv7182 video decoder to vin3a of video input port (vip) on J6 for one of our target. Available driver of adv7182 (drivers/media/i2c/adv7180.c) is used as v4l2 subdev. Subdev registering successful with vip driver and device node for this is coming, but video capture is  failing. Time-out error is coming. Before going for start of streaming, vpdma and vip setup and irq enable seems ok, code flow is as expected. Setting ADV7182 chip to run on free-run mode, it’s clear in status3 register that, it is getting set to run on free-run mode. But no interrupt is seen on vip.

Below are the few details:

 

  1. This is the dts change:

 

/* ADV7182 Video encoder */

 

&vip2 {

        status = "okay";

};

 

&vin3a {

        status = "okay";

        endpoint@0 {

                slave-mode;

                remote-endpoint = <&adv7182>;

        };

};

 

&i2c2 {

        status = "okay";

        clock-frequency = <400000>;

 

        adv7182-in@20 {

                compatible = "adi,adv7182";

                reg = <0x20>;

                pwrdwn-gpio = <&gpio6 4 GPIO_ACTIVE_HIGH>;

                reset-gpio = <&gpio6 18 GPIO_ACTIVE_HIGH>;

                intrq-gpio = <&gpio5 16 GPIO_ACTIVE_LOW>;

 

                remote = <&vip2>;

                port {

                        adv7182: endpoint {

                                buswidth = <8>;

                                remote-endpoint = <&vin3a>;

                                channels = <0>;

                        };

                };

        };

};

 

  1. Setting it to Embedded Sync Bt.656 and 8b data interface.
  2. Kernel version is  GSSDK 3.01. *Added “adv7180_s_stream” function extra on top of this, in adv7180.c driver.
  3. Log looks like this;

 

[    2.766616] vip2-s0: vip_set_slice_path:

[    2.774831] vip2-s0: vip_set_slice_path: DATA_PATH_SELECT(0000010C): 80008000

[    2.782678] vip2-s1: vip_set_slice_path:

[    2.790990] vip2-s1: vip_set_slice_path: DATA_PATH_SELECT(00000110): 80008000

[    2.798482] vip 48990000.vip: loading firmware vpdma-1b8.bin

OMAP_HSMMC_HL_HWINFO = 0x0  memsize = 0x0

[    2.818544] vip 48990000.vip: VPDMA firmware loaded

[    2.838065] vip2-s0: endpoing is registered

[    2.846825] vip2-s0: register async notifier for 1 subdevs

 

 

mnt# insmod adv7180.ko

[   31.979539] adv7180 1-0020: chip found @ 0x20 (OMAP I2C adapter)

[   32.054377] vip2-s0: vip_async_bound

[   32.058115] vip2-s0: Port A: Using subdev adv7180 1-0020 for capture

[   32.065199] vip2-s0: subdev adv7180 1-0020: code: 2006 idx: 0

[   32.071510] vip2-s0: matched fourcc: YUYV: code: 2006 idx: 0

[   32.093108] vip2-s0: device registered as video0

[   32.103259] vip2-s0: vip_async_complete

[   32.109483] vip2-s0: vip_open

[   32.109527] vip2-s0: vip_init_port: g_mbus_fmt subdev mbus_code: 2006 fourcc:YUYV size: 720x480

[   32.109541] vip2-s0: calc_format_size: fourcc:YUYV size: 720x480 bpl:1440 img_size:691200

[   32.109547] vip2-s0: init_stream fourcc:YUYV size: 720x480 bpl:1440 img_size:691200

[   32.109551] vip2-s0: init_stream vpdma data type: 0x07

[   32.109556] vip2-s0: vip_init_stream: stream instance 0xec46a800

[   32.109718] vip2-s0: vip_release

[   32.109727] vip2-s0: vip_release_stream: stream instance 0xec46a800

[   32.109733] vip2-s0: vip_release_port: port instance 0xee97f810

 

 

Running the test application:

 

:/mnt# ./capture

*** starting the application ***

[   36.193749] vip2-s0: vip_open

[   36.227863] vip2-s0: vip_init_port: g_mbus_fmt subdev mbus_code: 2006 fourcc:YUYV size: 720x480

[   36.243799] vip2-s0: calc_format_size: fourcc:YUYV size: 720x480 bpl:1440 img_size:691200

[   36.252638] vip2-s0: init_stream fourcc:YUYV size: 720x480 bpl:1440 img_size:691200

[   36.260921] vip2-s0: init_stream vpdma data type: 0x07

[   36.266291] vip2-s0: vip_init_stream: stream instance 0xec46a800

[   36.294565] vip2-s0: cropped (0,0)/720x480 of 720x480

[   36.304630] vip2-s0: s_fmt input fourcc:YUYV size: 720x576

[   36.318473] vip2-s0: try_fmt fourcc:YUYV size: 720x576

[   36.324260] vip2-s0: try_fmt best subdev size: 0x0

[   36.335750] vip2-s0: calc_format_size: fourcc:YUYV size: 128x128 bpl:256 img_size:32768

[   36.344504] vip2-s0: s_fmt try_fmt fourcc:YUYV size: 128x128

[   36.350712] vip2-s0: s_fmt fourcc:YUYV size: 128x128 bpl:256 img_size:32768

[   36.357997] vip2-s0: s_fmt pix_to_mbus mbus_code: 2006 size: 0x0

[   36.400192] vip2-s0: s_fmt subdev fmt mbus_code: 2006 size: 720x480

[   36.406749] vip2-s0: s_fmt vpdma data type: 0x07

[   36.428627] vip2-s0: get 4 buffer(s) of size 32768 each.

[   36.476174] vip2-s0: Added mmr_adb config desc

[   36.481404] vip2-s0: Added sc_coeff_h config desc

[   36.486372] vip2-s0: Added sc_coeff_v config desc

[   36.492254] vip2-s0: CFD_SC_CLIENT 7 slice_id: 0

[   36.497125] vip2-s0: Submitting desc on list# 0

[   36.515476] vip2-s0: vip_set_slice_path:

[   36.524278] vip2-s0: vip_set_slice_path: DATA_PATH_SELECT(0000010C): 00010210

[   36.578804] vip2-s0: start_streaming: buf 0xee6bf000 4

[   36.635164] vip2-s0: start_streaming: start_dma buf 0xee6bf000

[   36.645388] vip2-s0: start_dma: buf:0xee6bf000, vb:0xec46ac68, dma_addr:0xbd480000

** start_capturing 279 **

** main 694 **

select timeout

[   38.690035] vip2-s0: vip_release

[   38.697601] vip2-s0: vip_stop_streaming:

[   38.702255] vip2-s0: vip_disable_sc_path:

[   38.706454] vip2-s0: vip_set_slice_path:

[   38.715048] vip2-s0: vip_set_slice_path: DATA_PATH_SELECT(0000010C): 20010200

[   38.750216] vip2-s0: Clear channel no: 102

[   38.754614] vip2-s0: vip_release_stream: stream instance 0xec46a800

[   38.761666] vip2-s0: vip_release_port: port instance 0xee97f810

 

 

Please let us know if I have to do any configuration in vip driver to support adv7182 video decoder.   

  • Moving this to the device forum.

    Best Regards,
    Yordan
  • Hi Ishaqe,

    I have forwarded your question to VIP expert.

    Regards,
    Yordan
  • Hello, Can you please make sure that the VIP parser is detecting the video in correct sizes. Please read the VIP_PORT_SIZE registers (0x48995530 for vin3a) This would ensure that all the boardmux, pinmux, subdev related issues are clear. Thanks & Regards, Nikhil D
  • Its not detecting in the correct size. Read value of the VIP_PORT_SIZE (0x48995530) is 0x0 .

    val = reg_read(port->dev->parser, VIP_PARSER_PORTA_SRC0_SIZE);
    val is zero .

    #devmem 0x48995530
    0x00000000
    But, from our side pinmuxing is done, not very sure about the other issues. subdev registration and working seems okay. Anyways, will check it again. Let me know if this can be debugged in any other way.
    One more thing, sometimes register 0x48995530 read value is coming 0x05A00000. This is not always, most of the time in the first boot. This value is coming

    # devmem 0x48995530
    0x05A00000
  • That indicates the data coming to the parser is not stable.

    Another way to find out the pinmux/boardmux issues is by probing the signals.
    If you can, use CRO to probe the data/sync/clk lines.

    OR use the GPIO software probe method.
    Please provide me the dump of the pad register, I can attach the probe script for the vin3a

    Regards,
    Nikhil D
  • Thanks Nikhil D for the support.

    Please find the vin3a pad register dumps;

    shell~# devmem 0x4A00361C
    0x00040104
    shell~# devmem 0x4A0035D0
    0x00040104
    shell~# devmem 0x4A003620
    0x00040104
    shell~# devmem 0x4A003624
    0x00040104
    shell~# devmem 0x4A003628
    0x00040104
    shell~# devmem 0x4A00362C
    0x00040104
    shell~# devmem 0x4A003630
    0x00040104
    shell~# devmem 0x4A003634
    0x00040104
    shell~# devmem 0x4A003638
    0x00040104

    We will verify vin3a clk and data lines in Oscilloscope.
    Please provide me more details of GPIO software probe method or probe scripts of vin3a. Is it to check connectivity with gpio?
  • Hi,

    The GPIO probing method uses GPIO to find out if the data is toggling at the pad level.

    Use the attached script based on the pad dumps you have provided.

    I notice that you haven;t considered hsync/vsync You can get the full pad dumps using following command. omapconf dump 0x4a003400 0x4a00380c

    Regards,

    Nikhil D

  • I notice that you haven;t considered hsync/vsync
    You can get the full pad dumps using following command.
    omapconf dump 0x4a003400 0x4a00380c
  • ########################################### # Read VIN3A signals using GPIO sysfs ########################################### VIN3A_data=( CLK0:0x4a0035d0:GPIO4_21:117:0x48059138:21 D0:0x4a00361c:GPIO8_16:240:0x48053138:16 D1:0x4a003620:GPIO8_17:241:0x48053138:17 D2:0x4a003624:GPIO8_18:242:0x48053138:18 D3:0x4a003628:GPIO8_19:243:0x48053138:19 D4:0x4a00362c:GPIO8_20:244:0x48053138:20 D5:0x4a003630:GPIO8_21:245:0x48053138:21 D6:0x4a003634:GPIO8_22:246:0x48053138:22 D7:0x4a003638:GPIO8_23:247:0x48053138:23 ) echo; echo Probing VIN3A signals for data in ${VIN3A_data[@]} do pin=`echo $data | cut -d ':' -f1` pad=`echo $data | cut -d ':' -f2` ngpio=`echo $data | cut -d ':' -f4` echo $ngpio > /sys/class/gpio/export 2>/dev/null omapconf set bit $pad 18 1>/dev/null 2>/dev/null printf "%8s" $pin done echo while true; do for data in ${VIN3A_data[@]} do # pin=`echo $data | cut -d ':' -f1` # pad=`echo $data | cut -d ':' -f2` # gpio=`echo $data | cut -d ':' -f3` ngpio=`echo $data | cut -d ':' -f4` # addr=`echo $data | cut -d ':' -f5` # bit=`echo $data | cut -d ':' -f6` val=`cat /sys/class/gpio/gpio$ngpio/value` printf %8d $val done echo done ###########################################
  • Hi Nikhil,

    the script shows as a long single line (maybe because of unix lineendings), I will just post it formatted:

    ###########################################
    # Read VIN3A signals using GPIO sysfs
    ###########################################
    VIN3A_data=( CLK0:0x4a0035d0:GPIO4_21:117:0x48059138:21 D0:0x4a00361c:GPIO8_16:240:0x48053138:16 D1:0x4a003620:GPIO8_17:241:0x48053138:17 D2:0x4a003624:GPIO8_18:242:0x48053138:18 D3:0x4a003628:GPIO8_19:243:0x48053138:19 D4:0x4a00362c:GPIO8_20:244:0x48053138:20 D5:0x4a003630:GPIO8_21:245:0x48053138:21 D6:0x4a003634:GPIO8_22:246:0x48053138:22 D7:0x4a003638:GPIO8_23:247:0x48053138:23 )

    echo;
    echo Probing VIN3A signals
    for data in ${VIN3A_data[@]}
    do
    pin=`echo $data | cut -d ':' -f1`
    pad=`echo $data | cut -d ':' -f2`
    ngpio=`echo $data | cut -d ':' -f4`
    echo $ngpio > /sys/class/gpio/export 2>/dev/null
    omapconf set bit $pad 18 1>/dev/null 2>/dev/null
    printf "%8s" $pin
    done
    echo
    while true;
    do
    for data in ${VIN3A_data[@]}
    do
    # pin=`echo $data | cut -d ':' -f1`
    # pad=`echo $data | cut -d ':' -f2`
    # gpio=`echo $data | cut -d ':' -f3`
    ngpio=`echo $data | cut -d ':' -f4`
    # addr=`echo $data | cut -d ':' -f5`
    # bit=`echo $data | cut -d ':' -f6`
    val=`cat /sys/class/gpio/gpio$ngpio/value`
    printf %8d $val
    done
    echo
    done
    ###########################################

    Regards,
    Yordan
  • Hsync and Vsync are not used. Configured to work on Embedded sync format.
    Verified output of ADV7182 video decoder on oscilloscope. Output of ADV7182 seems correct. Verified pixclk (LLC), P0 and P7 data lines.

    Not clearly understood the above script. Its only printing 0, like this continuously.

    Probing VIN3A signals
    CLK0 D0 D1 D2 D3 D4 D5 D6 D7
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
  • omapconf binary is not present . That's why its failing. i will check with omapconf utility, but i think no issue in connectivity. Adv7182 signal starts coming on oscilloscope after streamon function.
  • ./omapconf dump 0x4a003400 0x4a00380c
    |----------------------------|
    | Address (hex) | Data (hex) |
    |----------------------------|
    | 0x4A003400 | 0x000101C3 |
    | 0x4A003404 | 0x000101C3 |
    | 0x4A003408 | 0x000101C3 |
    | 0x4A00340C | 0x000101C3 |
    | 0x4A003410 | 0x000101C3 |
    | 0x4A003414 | 0x000101C3 |
    | 0x4A003418 | 0x000101C3 |
    | 0x4A00341C | 0x000101C3 |
    | 0x4A003420 | 0x000101C3 |
    | 0x4A003424 | 0x000101C3 |
    | 0x4A003428 | 0x000101C3 |
    | 0x4A00342C | 0x000101C3 |
    | 0x4A003430 | 0x000101C3 |
    | 0x4A003434 | 0x000101C3 |
    | 0x4A003438 | 0x000101C3 |
    | 0x4A00343C | 0x000101C3 |
    | 0x4A003440 | 0x000101C3 |
    | 0x4A003444 | 0x000101C3 |
    | 0x4A003448 | 0x000101C3 |
    | 0x4A00344C | 0x000101B3 |
    | 0x4A003450 | 0x000001B3 |
    | 0x4A003454 | 0x000001C3 |
    | 0x4A003458 | 0x000101C3 |
    | 0x4A00345C | 0x000101C3 |
    | 0x4A003460 | 0x000001D3 |
    | 0x4A003464 | 0x000001D3 |
    | 0x4A003468 | 0x000001D3 |
    | 0x4A00346C | 0x000401CE |
    | 0x4A003470 | 0x0004000E |
    | 0x4A003474 | 0x00040101 |
    | 0x4A003478 | 0x00060101 |
    | 0x4A00347C | 0x00040101 |
    | 0x4A003480 | 0x00040101 |
    | 0x4A003484 | 0x00040101 |
    | 0x4A003488 | 0x00040101 |
    | 0x4A00348C | 0x00060101 |
    | 0x4A003490 | 0x00060101 |
    | 0x4A003494 | 0x00060101 |
    | 0x4A003498 | 0x00060101 |
    | 0x4A00349C | 0x00000101 |
    | 0x4A0034A0 | 0x00060101 |
    | 0x4A0034A4 | 0x00060101 |
    | 0x4A0034A8 | 0x00060101 |
    | 0x4A0034AC | 0x00060101 |
    | 0x4A0034B0 | 0x00060101 |
    | 0x4A0034B4 | 0x0004000F |
    | 0x4A0034B8 | 0x00060101 |
    | 0x4A0034BC | 0x000001B3 |
    | 0x4A0034C0 | 0x0006000E |
    | 0x4A0034C4 | 0x0006000F |
    | 0x4A0034C8 | 0x0006000F |
    | 0x4A0034CC | 0x0006000F |
    | 0x4A0034D0 | 0x0006000F |
    | 0x4A0034D4 | 0x0006000E |
    | 0x4A0034D8 | 0x000E000F |
    | 0x4A0034DC | 0x00040100 |
    | 0x4A0034E0 | 0x000C000E |
    | 0x4A0034E4 | 0x00040100 |
    | 0x4A0034E8 | 0x0004010F |
    | 0x4A0034EC | 0x00040100 |
    | 0x4A0034F0 | 0x00040100 |
    | 0x4A0034F4 | 0x00040100 |
    | 0x4A0034F8 | 0x00040100 |
    | 0x4A0034FC | 0x00040100 |
    | 0x4A003500 | 0x00040100 |
    | 0x4A003504 | 0x00040100 |
    | 0x4A003508 | 0x00040100 |
    | 0x4A00350C | 0x00040100 |
    | 0x4A003510 | 0x00040100 |
    | 0x4A003514 | 0x00040100 |
    | 0x4A003518 | 0x00040100 |
    | 0x4A00351C | 0x00040100 |
    | 0x4A003520 | 0x00040100 |
    | 0x4A003524 | 0x00040100 |
    | 0x4A003528 | 0x00040100 |
    | 0x4A00352C | 0x00040100 |
    | 0x4A003530 | 0x00040100 |
    | 0x4A003534 | 0x00040100 |
    | 0x4A003538 | 0x00040100 |
    | 0x4A00353C | 0x00040100 |
    | 0x4A003540 | 0x00040100 |
    | 0x4A003544 | 0x00040100 |
    | 0x4A003548 | 0x00040100 |
    | 0x4A00354C | 0x00040100 |
    | 0x4A003550 | 0x00040100 |
    | 0x4A003554 | 0x0006000E |
    | 0x4A003558 | 0x00000104 |
    | 0x4A00355C | 0x00000104 |
    | 0x4A003560 | 0x00000104 |
    | 0x4A003564 | 0x00000104 |
    | 0x4A003568 | 0x00000104 |
    | 0x4A00356C | 0x00000104 |
    | 0x4A003570 | 0x00000104 |
    | 0x4A003574 | 0x00000104 |
    | 0x4A003578 | 0x00000104 |
    | 0x4A00357C | 0x00000104 |
    | 0x4A003580 | 0x00000104 |
    | 0x4A003584 | 0x00000104 |
    | 0x4A003588 | 0x00000104 |
    | 0x4A00358C | 0x00000104 |
    | 0x4A003590 | 0x00000104 |
    | 0x4A003594 | 0x00000104 |
    | 0x4A003598 | 0x00000104 |
    | 0x4A00359C | 0x00000104 |
    | 0x4A0035A0 | 0x00000104 |
    | 0x4A0035A4 | 0x00000104 |
    | 0x4A0035A8 | 0x00000104 |
    | 0x4A0035AC | 0x00000104 |
    | 0x4A0035B0 | 0x00000104 |
    | 0x4A0035B4 | 0x00000104 |
    | 0x4A0035B8 | 0x00000104 |
    | 0x4A0035BC | 0x00000104 |
    | 0x4A0035C0 | 0x00000104 |
    | 0x4A0035C4 | 0x00000104 |
    | 0x4A0035C8 | 0x0000001F |
    | 0x4A0035CC | 0x000000DF |
    | 0x4A0035D0 | 0x00040104 |
    | 0x4A0035D4 | 0x000000DF |
    | 0x4A0035D8 | 0x000000BF |
    | 0x4A0035DC | 0x0000009F |
    | 0x4A0035E0 | 0x0000009F |
    | 0x4A0035E4 | 0x0000009F |
    | 0x4A0035E8 | 0x0000009F |
    | 0x4A0035EC | 0x000000BF |
    | 0x4A0035F0 | 0x0000009F |
    | 0x4A0035F4 | 0x000000BF |
    | 0x4A0035F8 | 0x0000009F |
    | 0x4A0035FC | 0x0000009F |
    | 0x4A003600 | 0x0000009F |
    | 0x4A003604 | 0x000000BF |
    | 0x4A003608 | 0x0000009F |
    | 0x4A00360C | 0x0000009F |
    | 0x4A003610 | 0x0000009F |
    | 0x4A003614 | 0x0000009F |
    | 0x4A003618 | 0x0000009F |
    | 0x4A00361C | 0x00040104 |
    | 0x4A003620 | 0x00040104 |
    | 0x4A003624 | 0x00040104 |
    | 0x4A003628 | 0x00040104 |
    | 0x4A00362C | 0x00040104 |
    | 0x4A003630 | 0x00040104 |
    | 0x4A003634 | 0x00040104 |
    | 0x4A003638 | 0x00040104 |
    | 0x4A00363C | 0x000E000E |
    | 0x4A003640 | 0x000E000E |
    | 0x4A003644 | 0x00040100 |
    | 0x4A003648 | 0x000C0102 |
    | 0x4A00364C | 0x000C000E |
    | 0x4A003650 | 0x00050002 |
    | 0x4A003654 | 0x00050002 |
    | 0x4A003658 | 0x00040007 |
    | 0x4A00365C | 0x00040007 |
    | 0x4A003660 | 0x00040007 |
    | 0x4A003664 | 0x00060007 |
    | 0x4A003668 | 0x00040002 |
    | 0x4A00366C | 0x00040002 |
    | 0x4A003670 | 0x00040002 |
    | 0x4A003674 | 0x0004000E |
    | 0x4A003678 | 0x0004000E |
    | 0x4A00367C | 0x0006000E |
    | 0x4A003680 | 0x000C0000 |
    | 0x4A003684 | 0x000C0000 |
    | 0x4A003688 | 0x00060000 |
    | 0x4A00368C | 0x0006000E |
    | 0x4A003690 | 0x0006000E |
    | 0x4A003694 | 0x0004000F |
    | 0x4A003698 | 0x0004000E |
    | 0x4A00369C | 0x0006000E |
    | 0x4A0036A0 | 0x0006000E |
    | 0x4A0036A4 | 0x00040000 |
    | 0x4A0036A8 | 0x000C0000 |
    | 0x4A0036AC | 0x0006000A |
    | 0x4A0036B0 | 0x0006000A |
    | 0x4A0036B4 | 0x000E000A |
    | 0x4A0036B8 | 0x000E000A |
    | 0x4A0036BC | 0x00040000 |
    | 0x4A0036C0 | 0x00040000 |
    | 0x4A0036C4 | 0x00040000 |
    | 0x4A0036C8 | 0x00040000 |
    | 0x4A0036CC | 0x0004000E |
    | 0x4A0036D0 | 0x0004000E |
    | 0x4A0036D4 | 0x000E000E |
    | 0x4A0036D8 | 0x000C000E |
    | 0x4A0036DC | 0x000C000E |
    | 0x4A0036E0 | 0x000C000E |
    | 0x4A0036E4 | 0x000C000E |
    | 0x4A0036E8 | 0x000C000E |
    | 0x4A0036EC | 0x000C000E |
    | 0x4A0036F0 | 0x0006000E |
    | 0x4A0036F4 | 0x00040000 |
    | 0x4A0036F8 | 0x000C0000 |
    | 0x4A0036FC | 0x0004000F |
    | 0x4A003700 | 0x0004000F |
    | 0x4A003704 | 0x00040000 |
    | 0x4A003708 | 0x00040000 |
    | 0x4A00370C | 0x000C000E |
    | 0x4A003710 | 0x000C0001 |
    | 0x4A003714 | 0x0004000E |
    | 0x4A003718 | 0x0004000E |
    | 0x4A00371C | 0x0004000E |
    | 0x4A003720 | 0x0004000E |
    | 0x4A003724 | 0x00040000 |
    | 0x4A003728 | 0x000C0000 |
    | 0x4A00372C | 0x000E0004 |
    | 0x4A003730 | 0x000E0004 |
    | 0x4A003734 | 0x00060003 |
    | 0x4A003738 | 0x00060003 |
    | 0x4A00373C | 0x00060004 |
    | 0x4A003740 | 0x00060004 |
    | 0x4A003744 | 0x00060003 |
    | 0x4A003748 | 0x00060003 |
    | 0x4A00374C | 0x00060004 |
    | 0x4A003750 | 0x00060004 |
    | 0x4A003754 | 0x00060170 |
    | 0x4A003758 | 0x00060170 |
    | 0x4A00375C | 0x00060170 |
    | 0x4A003760 | 0x00060170 |
    | 0x4A003764 | 0x00060170 |
    | 0x4A003768 | 0x00060170 |
    | 0x4A00376C | 0x000E0000 |
    | 0x4A003770 | 0x000E0000 |
    | 0x4A003774 | 0x00060002 |
    | 0x4A003778 | 0x00060002 |
    | 0x4A00377C | 0x00060100 |
    | 0x4A003780 | 0x00060100 |
    | 0x4A003784 | 0x00060100 |
    | 0x4A003788 | 0x00060100 |
    | 0x4A00378C | 0x00060100 |
    | 0x4A003790 | 0x00060100 |
    | 0x4A003794 | 0x00060002 |
    | 0x4A003798 | 0x00060002 |
    | 0x4A00379C | 0x00060002 |
    | 0x4A0037A0 | 0x00060002 |
    | 0x4A0037A4 | 0x00040000 |
    | 0x4A0037A8 | 0x00040000 |
    | 0x4A0037AC | 0x00040000 |
    | 0x4A0037B0 | 0x00060000 |
    | 0x4A0037B4 | 0x0004000F |
    | 0x4A0037B8 | 0x000E0005 |
    | 0x4A0037BC | 0x000E0005 |
    | 0x4A0037C0 | 0x00040000 |
    | 0x4A0037C4 | 0x000C0000 |
    | 0x4A0037C8 | 0x000C0000 |
    | 0x4A0037CC | 0x000E0000 |
    | 0x4A0037D0 | 0x000C000F |
    | 0x4A0037D4 | 0x000C000E |
    | 0x4A0037D8 | 0x000E000F |
    | 0x4A0037DC | 0x000E000F |
    | 0x4A0037E0 | 0x000E0003 |
    | 0x4A0037E4 | 0x000E0003 |
    | 0x4A0037E8 | 0x00060103 |
    | 0x4A0037EC | 0x00060103 |
    | 0x4A0037F0 | 0x00060103 |
    | 0x4A0037F4 | 0x00060103 |
    | 0x4A0037F8 | 0x00060103 |
    | 0x4A0037FC | 0x00060103 |
    | 0x4A003800 | 0x00060000 |
    | 0x4A003804 | 0x00060000 |
    | 0x4A003808 | 0x00060000 |
    | 0x4A00380C | 0x00060000 |
    |----------------------------|

    omapconf: powerdm_deinit(): cpu not supported!!!
    omapconf: clockdm_deinit(): cpu not supported!!!
  • output of this script is still coming 0, even with omapconf.

    Probing VIN3A signals
    CLK0 D0 D1 D2 D3 D4 D5 D6 D7
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
    0 0 0 0 0 0 0 0 0
  • Hi Akshay, Sync signals not needed for embedded sync. You seem to have done all required pinmux correctly. Also, you see the signals on the oscilloscope. But the script prints '0' which means that the signals are not available at the SoC pads. The script tries to read the signal at the pad and keeps printing the status. This typically means that you haven't setup the right board muxes for the board. Video signal from ADV is not routed correctly to the pads vin3a. Please refer your schematics and set any required board muxes. Regards, Nikhil D
  • Hi Nikhil,

    Thanks for the support.

    Sorry, last time when i verified this script, i was not running the capture application. I was not aware adv7180 driver has to be up and running. This is the output of your script, when adv7182 driver is inserted and it is powered on,


    Probing VIN3A signals
    CLK0 D0 D1 D2 D3 D4 D5 D6 D7
    1 0 0 0 0 1 1 0 1
    0 0 0 0 0 1 1 0 0
    1 0 0 1 0 1 1 0 0
    1 0 0 1 0 0 1 0 0
    0 1 0 1 0 1 1 1 1
    0 0 0 0 0 1 1 1 0
    1 0 0 1 0 1 1 1 0
    0 0 1 0 1 1 1 0 1
    1 0 0 0 0 1 0 0 1
    1 0 0 1 0 1 1 0 0
    1 0 0 0 0 1 0 0 1
    0 0 0 1 0 1 0 0 0
  • Pixel clk is running at 27MHz. Any configuration is required in vip for this?
  • Hi Akshay,

    From the script output, I can infer that all the signals are toggling, which means the pinmux/boardmux required for clk/data is done.
    There is no board issue here, its narrowed on software issue now.

    As you mentioned early, that you are using embedded syncs.
    Are you configuring your subdev in the DTS for embedded sync.
    DO NOT put any properties like hsync, vsync polarity in DTS file.
    Refer to jamr3.dts for tvp5158 integration. Follow the same method for defining your ADV decoder node.
    Once the parser is configured properly, you shall see frames getting detected at the PORTA_SIZE register.

    Regards,
    Nikhil D
  • Hi Nikhil D,

    I think, its taken care in the subdev dtsi. Dts is as per tvp5158. Please check the below adv dt node.


    /* ADV7182 Video encoder */

    &vip2 {
    status = "okay";
    };

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

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

    adv7182-in@20 {
    compatible = "adi,adv7182";
    reg = <0x20>;

    port {
    adv7182: endpoint {
    buswidth = <8>;
    remote-endpoint = <&vin3a>;
    channels = <0>;
    };
    };
    };
    };
  • Hi Nikhil D,

    #devmem 0x48995530
    0x02D00120

    Now, parser is getting stable data.

    if (endpoint->bus.parallel.pixmux == 0) {
    sync_type =
    EMBEDDED_SYNC_SINGLE_YUV422;
    //EMBEDDED_SYNC_LINE_MULTIPLEXED_YUV422;

    }
    Setting Sync_type to Embedded sync single yuv422, sync_type was getting changed because of pimux =0.
    Hard-coded the config value for time being,
    reg_write(parser, VIP_PARSER_PORT(port->port_id),0x100);


    So, this confirms parser getting the stable data from adv7182 decoder.
    Please let me know if there is any other register to confirm data to VIP_CSC, VIP_SC and VPDMA.

    Issue is still there. No interrupts to vip. Frames are not getting captures.
    For more information, added the complete vip log in my first comments.

    Thanks,
    Akshay
  • VIP_FIQ_STATUS value is 0x00014C00 . Port A Disconnect FIQ is problem?
  • Hi Akshay,

    Use the dmabuftest application (Refer to Processor SDK software developer guide for details)
    You should be able to run the simple capture/display usecase.

    Enable VIP driver logs in the kernel (/sys/module/ti_vip/parameters/debug)
    Enable V4L2 log (echo 15 in /sys/class/video4linux/videoX/dev_debug)

    Share these logs

    Regards,
    Nikhil D
  • Format difference is there between adv7182 and vip driver, Adv7182 code is "MEDIA_BUS_FMT_YUYV8_2X8" and vip code is "MEDIA_BUS_FMT_UYVY8_2X8". ADV7182 bt656 is YCrCb. Doubting its because of this mismatch. To support this added below change in vip, driver; please check it and let me know if its not correct;

    {
    .fourcc = V4L2_PIX_FMT_YVYU,
    .code = MEDIA_BUS_FMT_YUYV8_2X8,
    .colorspace = V4L2_COLORSPACE_SMPTE170M,
    .coplanar = 0,
    .vpdma_fmt = { &vpdma_yuv_fmts[VPDMA_DATA_FMT_Y422];
    },
    },

    VIP_FIQ_STATUS value is 0x00014C00, Correcsponding mask register is 0x0. Though, PORT_A_YUV_PROTOCOL_VILOATION bit is set, other bits are also 1. This should atleast trigger one interrupt. Not sure why no interrupts are coming for this.
  • Hi Nikhil

    Logs are shared in the first comment. Same logs will get for dmabufftest. vip related logs are enabled in it. I have used capture_raw_frames applicaiton. Please check that log. Will share the log with dmabufftest in sometime.

    As mentioned in the previous comments, VIP_FIQ_STATUS value is 0x00014C00 and 0x48995530 VIP_OUTPUT_PORT_A_SRC0_SIZE is having value 0x02D00120

    Regards,
    Akshay
  • Hi Nikhil,

    This is the output with dmabuftest command. Its stops in "will sleep waiting for buffers", doesn't proceed further.

    /mnt# dmabuftest -s 4:800x480 -d /dev/video0 -c 720x288@YUYV
    Opening Display..
    using 1 connectors, 0x0 display,
    [ 765.709513] vip2-s0: vip_init_port: g_mbus_fmt subdev mbus_code: 2008 fourcc:YVYU size: 720x576
    [ 765.724919] vip2-s0: calc_format_size: fourcc:YVYU size: 720x576 bpl:1440 img_size:829440
    [ 765.733512] vip2-s0: init_stream fourcc:YVYU size: 720x576 bpl:1440 img_size:829440
    [ 765.741641] vip2-s0: init_stream vpdma data type: 0x17
    [ 765.747059] vip2-s0: vip_init_stream: stream instance 0xed69a000
    [ 765.761133] vip2-s0: g_fmt fourcc:YVYU code: 2008 size: 720x576 bpl:1440 img_size:829440
    [ 765.769639] vip2-s0: g_fmt vpdma data type: 0x17
    [ 765.778085] vip2-s0: s_fmt input fourcc:YUYV size: 720x288
    [ 765.791759] vip2-s0: try_fmt fourcc:YUYV size: 720x288
    [ 765.797175] vip2-s0: Fourcc format (0x56595559) not found.
    [ 765.802975] vip2-s0: try_fmt best subdev size: 0x0
    [ 765.814282] vip2-s0: calc_format_size: fourcc:YVYU size: 128x128 bpl:256 img_size:32768
    [ 765.822697] vip2-s0: s_fmt try_fmt fourcc:YVYU size: 128x128
    [ 765.828713] vip2-s0: s_fmt fourcc:YVYU size: 128x128 bpl:256 img_size:32768
    [ 765.836038] vip2-s0: s_fmt pix_to_mbus mbus_code: 2008 size: 0x0
    [ 765.851148] vip2-s0: s_fmt subdev fmt mbus_code: 2008 size: 720x576
    [ 765.857752] vip2-s0: s_fmt vpdma data type: 0x17
    [ 765.868674] vip2-s0: get 6 buffer(s) of size 32768 each.
    Exported buffer fd = 6

    Exported buffer fd = 8

    Exported buffer fd = 1[ 765.877678] -- vip_buf_prepare 1729 --
    0

    Exported buffer fd = 12

    Exported buffer [ 765.885842]
    fd = 14

    Exported buffer fd = 16

    [ 765.941619] vip2-s0: Added mmr_adb config desc
    [ 765.946379] vip2-s0: Added sc_coeff_h config desc
    [ 765.951462] vip2-s0: Added sc_coeff_v config desc
    [ 765.956514] vip2-s0: CFD_SC_CLIENT 7 slice_id: 0
    [ 765.961469] vip2-s0: Submitting desc on list# 0
    [ 765.983256] vip2-s0: vip_set_slice_path:
    [ 765.994410] vip2-s0: vip_set_slice_path: DATA_PATH_SELECT(0000010C): 00010210
    [ 766.059795] vip2-s0: start_streaming: buf 0xed4e7c00 6
    [ 766.098002] add_out_dtd 583 srce_type = 2 --
    [ 766.112436] vip2-s0: start_streaming: start_dma buf 0xed4e7c00
    [ 766.122017] vip2-s0: start_dma: buf:0xed4e7c00, vb:0xed69a468, dma_addr:0x7fdba000
    [ 766.130061] -- enable_irqs 689 irq_num = 0 list_num = 0 --
    [ 766.135971] -- vpdma_enable_list_complete_irq 140 irq_num = 0 --
    [ 766.142344] -- VPDMA_LIST_ATTR val = 80002 --
    [ 766.146943] -- VPDMA_MAX_SIZE1 val = 7f007f --
    [ 766.151669] -- 0x40 val = 0 --
    [ 766.154862] -- 0x44 val = 0 --
    [ 766.158131] __vb2_wait_for_done_vb 1471
    [ 766.162226] will sleep waiting for buffers


    ^C[ 1353.993276] sleep was interrupted
    [ 1353.996939] -- vb2_core_dqbuf 1612 --
    [ 1354.001726] -- vip_release 2444 --
    [ 1354.005285] vip2-s0: vip_release
    [ 1354.013205] -- vip_stop_streaming 1958 --
    [ 1354.018236] vip2-s0: vip_stop_streaming:
    [ 1354.022342] vip2-s0: vip_disable_sc_path:
    [ 1354.028028] vip2-s0: vip_set_slice_path:
    [ 1354.032136] -- vip_set_slice_path 503 data_path = 2 path_val = 0 --
    [ 1354.040196] vip2-s0: vip_set_slice_path: DATA_PATH_SELECT(0000010C): 20010200
    [ 1354.048762] -- vpdma_enable_list_complete_irq 140 irq_num = 0 --
    [ 1354.055048] -- VPDMA_LIST_ATTR val = 80002 --
    [ 1354.061151] -- VPDMA_MAX_SIZE1 val = 7f007f --
    [ 1354.066646] -- 0x40 val = 0 --
    [ 1354.069843] -- 0x44 val = 0 --
    [ 1354.073040] vip2-s0: Clear channel no: 102
    [ 1354.079800] vip2-s0: vip_release_stream: stream instance 0xed69a000
    [ 1354.088580] vip2-s0: vip_release_port: port instance 0xef3eec10
    [ 1354.094784] -- vip_module_reset 338 val = 400000 --
    [ 1354.101665] -- vip_set_clock_enable 373 val = 0 --

    #cat /proc/interrupts
    ----
    369: 0 0 CBAR 352 Level vip2-s0
    370: 0 0 CBAR 393 Level vip2-s1
  • Hi akshay, First, The VIP hardware expects ONLY UYVY type of media format. Most likely the decoder you have would also be generting output in UYVY format. Please confirm this. Also, I see that there are no IRQs getting fired for any of the VIP instances/slices. Even if the camera is not connected, video is not present, you should have seen two IRQs fired. First two IRQs get fired from VPDMA FIFO after it accepted the DMA request. I don't see that happening, Is there any change you did with respect to IRQ enablement or IRQ crossbar? Regards, Nikhil D Regards, Nikhil D
  • Hi Nikhil D,

    Thanks a lot for the support. Now, interrupts are coming:). Below are the changes.
    1. Forced sync_type to EMBEDDED_SYNC_SINGLE_YUV422. This was the only change required in the vip side.
    2. Changed vip format code to "MEDIA_BUS_FMT_YUYV8_2X8". Tried this change in vip and changed adv driver code to MEDIA_BUS_FMT_UYVY8_2X8, with replacing cb and cr to YCbCr format.
    3. Removed debug messages which i had added earlier to know the code flow. Few debug messages were in "enable_irq" and "start_dma" functions. Removed these and started getting interrupts.

    Captured frames are not able to play properly on yuv player. I think its because of format mismatch. ADV7182 output is in YCrCb 8bit 656 data. VIP expects in UYVY format. Is because of this? In ADV7182 side i can change output to YCbCr format.

    I have doubt in the height and width;

    [ 43.358535] vip2-s0: vip_open
    [ 43.358559] vip2-s0: vip_init_port: g_mbus_fmt subdev mbus_code: 2006 fourcc:UYVY size: 720x576
    [ 43.358575] vip2-s0: calc_format_size: fourcc:UYVY size: 720x576 bpl:1440 img_size:829440
    [ 43.358586] vip2-s0: init_stream fourcc:UYVY size: 720x576 bpl:1440 img_size:829440
    [ 43.358595] vip2-s0: init_stream vpdma data type: 0x27
    [ 43.358605] vip2-s0: vip_init_stream: stream instance 0xee9bf000
    [ 43.358788] vip2-s0: s_fmt input fourcc:UYVY size: 720x576
    [ 43.358799] vip2-s0: try_fmt fourcc:UYVY size: 720x576
    [ 43.358809] vip2-s0: try_fmt best subdev size: 0x0
    [ 43.358818] vip2-s0: calc_format_size: fourcc:UYVY size: 128x128 bpl:256 img_size:32768
    [ 43.358827] vip2-s0: s_fmt try_fmt fourcc:UYVY size: 128x128
    [ 43.358836] vip2-s0: s_fmt fourcc:UYVY size: 128x128 bpl:256 img_size:32768
    [ 43.358844] vip2-s0: s_fmt pix_to_mbus mbus_code: 2006 size: 0x0
    [ 43.358853] vip2-s0: s_fmt subdev fmt mbus_code: 2006 size: 720x576
    [ 43.358861] vip2-s0: s_fmt vpdma data type: 0x27
    [ 43.358902] vip2-s0: g_fmt fourcc:UYVY code: 2006 size: 128x128 bpl:256 img_size:32768
    [ 43.358910] vip2-s0: g_fmt vpdma data type: 0x27
    [ 43.358946] vip2-s0: get 32 buffer(s) of size 32768 each.

    Though, setting it to 720x576 in ADV side, its getting set to 128x128. ouput is in 128x128?

    Regards and thanks,
    Akshay
  • Hi Akshay, Glad to know that the issue with interrupts is solved. I understand that the capture path is working well, except you have issues wrt format and sizes. I recommend to use 7yuv tool for viewing YUV files. (It has many format options and allows conversion too) You can try to change the luma/chroma order to get the right colors. From hardware side, UYUV is expected at parser. Regarding the size, this is happening because the VIP driver isn't able to find the supported subdev size. If you notice, it calls subdev enum_size, try_fmt in a loop and the finds the best format for them. In your case, the try_fmt returned from subdev seems invalid, so it is getting rejected. You may have to revisit the subdev implementation for the try_fmt. Refer to TVP5158 subdev for the details (It has both NTSC and PAL support). One key pitfall is to get confused between frame size and field size. If you specify rhe interlaced flag, driver corrects size to get the field size. I hope this helps. Regards, Nikhil D
  • Thanks for the support Nikhil Devshatwar . ADV7182 Bringup is done and camera is working as expected.