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.

saLoopBack failed with "VPSS_FVID2: create handle is NULL" error message during STREAM ON

Other Parts Discussed in Thread: TVP7002

Hi,

Currently I'm working on TI8148 with adv7180 encoder/decoder attached to VIN[0] port A.

I am using saLoopBack application to capture the video from the adv7180.

When I executed saLoopBack, I encountered the following error at startCapture. It is failed in Fvid2 device create.

LOG:

ti81xxvin ti81xxvin: vidioc_streamon
ti81xxvin ti81xxvin: ti81xxvin_check_format
Inside ti81xxvin_check_format
hpitch : 870
min_hpitch 0 min_numlines 240
sizeimage 12fc00
numlines 240
ti81xxvin_vps_create capt_num 2
VPSS_CAPTURE: create capture2
VPSS_SHRBUF: FOUND 0xa0215000, end 0xa0400000, map vir 0xd0415000 size 4096
VPSS_FVID2: Fvid2 handle 0x00000000 with notifyno 14 within 1 ms
VPSS_FVID2: create handle is NULL
VPSS_SHRBUF: free mem paddr 0xa0215000 vaddr 0xd0415000 size 4096
ti81xxvin ti81xxvin: ti81xxvin_vps_create failed
ti81xxvin ti81xxvin: Vps create failed
ti81xxvin ti81xxvin: ti81xxvin_release

I had set capture device as /dev/video0.

I had set fb device as /dev/fb0.

I have to capture 720x576 data in YCbCr format.

Here is my configurations:

Capture Control Parameters :

cctrl->ccparams->videoCaptureMode = VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC;

cctrl->ccparams->videoIfMode = VPS_CAPT_VIDEO_IF_MODE_8BIT;

cctrl->ccparams->inDataFormat = FVID2_DF_YUV422I_UYVY;

cctrl->ccparams->periodicCallbackEnable = 0;
cctrl->ccparams->numCh = 1;
cctrl->ccparams->numStream = 1;
cctrl->ccparams->vipParserInstConfig = NULL;
cctrl->ccparams->cscConfig = NULL;
cctrl->ccparams->vipParserPortConfig  = NULL;

cctrl->ccparams->inScanFormat = FVID2_SF_INTERLACED;

cctrl->decoder_width = 1920;
cctrl->decoder_width = 1080;
cctrl->scformat = FVID2_SF_PROGRESSIVE;

cctrl->fmt.channelnum = 0;
cctrl->fmt.width = 1920;
cctrl->fmt.height = 1080;
cctrl->fmt.pitch[0] = 1920 * 2;
cctrl->fmt.pitch[1] = 1920 * 2;
cctrl->fmt.pitch[2] = 1920 * 2;

cctrl->fmt.fieldmerged[0] = 0;
cctrl->fmt.fieldmerged[1] = 0;
cctrl->fmt.fieldmerged[2] = 0;
cctrl->fmt.dataformat = FVID2_DF_YUV422I_UYVY;
cctrl->fmt.scanformat = FVID2_SF_INTERLACED;
cctrl->fmt.bpp = 24;


ti81xxvin_vps_config_format:

cparams->videoCaptureMode = VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC;

cparams->videoIfMode = VPS_CAPT_VIDEO_IF_MODE_8BIT;

cparams->inDataFormat = FVID2_DF_YUV422I_UYVY;
cparams->periodicCallbackEnable = 0;
cparams->numCh = 1;
cparams->numStream = 1;

 fvid2_fmt.dataformat = df;
 fvid2_fmt.scanformat = cparams->inScanFormat; fvid2_fmt.bpp = 24;
 fvid2_fmt.reserved = NULL;
 cctrl->decoder_width = inst->video.buf_params.width;
 cctrl->decoder_height = inst->video.buf_params.height;

hdvpss_capture_sdev_info:


static struct ti81xxvin_subdev_info hdvpss_capture_sdev_info[] = {
        {
                .name   = TVP7002_INST0,
                .board_info = {
                        /* TODO Find the correct address
                                of the TVP7002 connected */
                        I2C_BOARD_INFO("adv7180", 0x20),
                        .platform_data = &adv7180_pdata,
                },
                .vip_port_cfg = {
                        .ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_7_0,
                        .ancChSel8b = VPS_VIP_ANC_CH_SEL_DONT_CARE,
                        .pixClkEdgePol = VPS_VIP_PIX_CLK_EDGE_POL_RISING,
                        .invertFidPol = 0,
                        .embConfig = {
                                .errCorrEnable = 1,
                                .srcNumPos = VPS_VIP_SRC_NUM_POS_DONT_CARE,
                                .isMaxChan3Bits = 0,
                        },
                        .disConfig = {
                                .fidSkewPostCnt = 0,
                                .fidSkewPreCnt = 0,
                                .lineCaptureStyle =
                                        VPS_VIP_LINE_CAPTURE_STYLE_DONT_CARE,
                                .fidDetectMode =
                                        VPS_VIP_FID_DETECT_MODE_DONT_CARE,
                                .actvidPol = VPS_VIP_POLARITY_DONT_CARE,
                                .vsyncPol =  VPS_VIP_POLARITY_DONT_CARE,
                                .hsyncPol = VPS_VIP_POLARITY_DONT_CARE,
                        }
                },
                .video_capture_mode = VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC,
                .video_if_mode = VPS_CAPT_VIDEO_IF_MODE_8BIT,
                .input_data_format = FVID2_DF_YUV422I_UYVY,
        }

Are the above configurations correct ?

Please Clarify me.

Thanks,

 Rajeshkumar

  • Try setting inDataFormat to  FVID2_DF_YUV422P.

     

    Rgds,

    Brijesh

  • Hi Brijesh,

    I changed the in Data Format to FVID2_DF_YUV422P in driver source. Now I am able to capture the data.

    But my input format from adv7180 to DSP is FVID2_DF_UYVY. (<SAV Cb Y Cr Y Cb ... EAV>).

    But the output captured image from processor is not proper.

    I uploaded the capture image in the e2e forum, below is the link :

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/716/p/332883/1162392.aspx#1162392


    I am using saLoopBackFbdev application to capture the image. In saLoopBack Application, I configured the

    capture format as "RGB24".  But I can't get the image, if I am configure the capture format as "YUV422P".

    Kindly explain me.

     

    Regards,

    Rajeshkumar

  • Hi Rajesh,

     

    Input format YUV422P just tells driver that input is in YUV422P format. There is no other use of it.

    The output image that you have shared on this link does not have artifacts, it looks like it is downscaled by 2. It could be either because of the scalar in the path or input itself it half. When it shows this image, can you take a dump of the register at the offste 0x48105530 and share it?

     

    Regards,

    Brijesh

  • Hi Brijesh,

    Here is the registers dump taken at 0x48105500 after capturing (after execution of saLoopbackFbdev application).

    DSP TI8148 with adv7180 decoder attached to VIN[0] port A.

    PAL (720 x 576), BT656 standard.

    # ./a.out -v -r -l 1024 0x48105500
    Request to memread 0x400 bytes from address 0x48105500
            using 1 byte accesses
    Attempting to map 0x1000 bytes at address 0x48105000
    open(/dev/mem) ok
    mmap() ok
    OK? y
    48105500:  02 00 00 00 00 a0 00 80 00 00 00 00 00 00 00 00
    48105510:  00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00
    48105520:  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    48105530:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105540:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105550:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105560:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105570:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105580:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105590:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481055a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481055b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481055c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481055d0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481055e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481055f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105600:  02 00 00 00 00 a0 00 80 00 00 00 00 00 00 00 00
    48105610:  00 00 00 00 00 00 00 00 00 44 00 00 00 00 00 00
    48105620:  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    48105630:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105640:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105650:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105660:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105670:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105680:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105690:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481056a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481056b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481056c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481056d0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481056e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481056f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105700:  a8 04 00 00 2c 07 a8 04 26 1f de 1d a8 04 73 08
    48105710:  00 00 20 0c 34 01 7c 0b 00 00 00 00 00 00 00 00
    48105720:  a8 04 00 00 2c 07 a8 04 26 1f de 1d a8 04 73 08
    48105730:  00 00 20 0c 34 01 7c 0b 00 00 00 00 00 00 00 00
    48105740:  a8 04 00 00 2c 07 a8 04 26 1f de 1d a8 04 73 08
    48105750:  00 00 20 0c 34 01 7c 0b 00 00 00 00 00 00 00 00
    48105760:  a8 04 00 00 2c 07 a8 04 26 1f de 1d a8 04 73 08
    48105770:  00 00 20 0c 34 01 7c 0b 00 00 00 00 00 00 00 00
    48105780:  a8 04 00 00 2c 07 a8 04 26 1f de 1d a8 04 73 08
    48105790:  00 00 20 0c 34 01 7c 0b 00 00 00 00 00 00 00 00
    481057a0:  a8 04 00 00 2c 07 a8 04 26 1f de 1d a8 04 73 08
    481057b0:  00 00 20 0c 34 01 7c 0b 00 00 00 00 00 00 00 00
    481057c0:  a8 04 00 00 2c 07 a8 04 26 1f de 1d a8 04 73 08
    481057d0:  00 00 20 0c 34 01 7c 0b 00 00 00 00 00 00 00 00
    481057e0:  a8 04 00 00 2c 07 a8 04 26 1f de 1d a8 04 73 08
    481057f0:  00 00 20 0c 34 01 7c 0b 00 00 00 00 00 00 00 00
    48105800:  00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105810:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105820:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105830:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105840:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
    48105850:  00 08 84 0c 10 00 10 00 90 01 04 00 00 00 00 00
    48105860:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105870:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105880:  00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105890:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481058a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481058b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481058c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
    481058d0:  00 08 84 0c 10 00 10 00 90 01 04 00 00 00 00 00
    481058e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    481058f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    #
    #

    Thnks and Rgds,

    Rajeshkumar

  • Hi Rajeshkumar,

     

    From the register dump, i could say that VIP is not receiving any input streams on both the ports A and B. There is no size reported by VIP register and even there is no overflow. so VIP is not receiving any correct stream.

     

    Rgds,

    Brijesh

  • Hi Brijesh,

      I had mentioned the HDVPSS configuration in this thread (you can see at top).

     So what could be the problem in video capture configuration?

    Apart from, modifying the configuration to our customized board in the files (ti81xx_vpss.c, capt.c and ti81xxvin_main.c)  any files I have to modify ?


    NOTE : I commented the VIDIOC_QUERY_DV_PRESET and VIDIOC_S_DV_PRESET ioctl part in saLoopBackFbdev application. Because I encountered the problem " Setting DV Preset failed" in these ioctls.

    I am using "echo pal > /sys/devices/platform/vpss/display0/mode" to set as PAL std.

    Linux kernel : 2.6.37

    Patch : psp04.04.00.01

    Kindly check the all variables mentioned in the top of the thread.

    Thanks and Regards,

    Rajeshkumar

  • Hi Brijesh,

    Do you have any idea on my previous question?


    Thanks,

    Rajesh

  • Hi Rajeshkumar,

     

    As i said, VIP is not receiving any data, so you will need to check you decoder settings.

     

    Regards,

    Brijesh

  • Hi Brijesh,

            We have routed the output of decoder (adv7180) to DSP as well as to FPGA. Through the FPGA core we have checked the data and the same data given to encoder, then routed to TV.  The output is coming properly in TV.

    So I am sure about the decoder settings are correct.

    Regards,

    Rajesh

  • Hi Brijesh,

      One more question,  Is this capture problem related to INTERLACED mode ?


    Regards,

    Rajesh

  • Hi Rajeshkumar,

          We were able to capture NTSC/PAL using the EVM and saloopback and gstreamer, you can check some of the patches as reference here:

    http://e2e.ti.com/support/dsp/davinci_digital_media_processors/f/717/p/326172/1170437.aspx#1170437

    If you want you can contact us and we can support you to get it working in your side too (https://www.ridgerun.com/www/index.php/contact-us.html)

    Hope this helps,

    -David