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.

V4L2 1080I Capture

Other Parts Discussed in Thread: TVP7002

I am using ti-ezsdk_dm814x-evm_5_05_02_00 with GST_DM81XX_00_06_00_00 on a custom DM8148
board. All progressive formats (720/1080p) work but interlaced 1080I formats fail. The V4l2 ioctl fails on

the call to the ti81xxvin driver if interlaced format is set.



  fmt_win.type = V4L2_BUF_TYPE_VIDEO_OVERLAY;
  fmt_win.fmt.win.w.left = 0;
  fmt_win.fmt.win.w.top = 0;
  fmt_win.fmt.win.w.width = width;
  fmt_win.fmt.win.w.height = height;

  ret = v4l2_ioctl (fd, VIDIOC_S_FMT, &fmt_win) ;


ti81xxvin_main.c
...
        if (params->interlaced) {
                mutex_unlock(&buf_obj->buf_lock);
                return -EINVAL;
        }
...

Has anyone been able to get interlaced formats to work with V4l2?

  • Hello,

    Could you try with the latest EZSDK 5.05.02 with GST_DM81XX_00_07_00_00.

    Could you run saLoopBack exapmle.

    Which platform and which revision you are using for 1080i capture?

    Let me know the result.

    Best Regards,

    Margarita

  • We are using EZSDK 5.05.02 with gst-openmax_GST_DM81XX_00_07_00_00. Our board
    is based on the 8148 EVM. I have downloaded and compiled TAG_GST_DM81XX_00_06_00_00
    for GStreamer to debug  GStreamer V4l2 since the sources are not included in the SDK.
    Using both saLoopBack and saLoopBackScale work with progressive formats but fail on 1080I.
    The failure is identical using GStreamer V4L2. I have added kernel printk to debug ti81xxvin_main.c
    (ti81xxvin.ko) ioctl calls from v4l2. The output from the console is shows both the user app
    and printk output from the driver. The check for interlaced format first occurs in vidioc_s_crop
    and is defined by the video presets.


    ---------------------------------------------------- 720P60 ---------------------------------------
    root@DVM8148:~/tools/tests# ./saLoopBackScale
    Driver Name: ti81xxvin
    Driver bus info: TI81xx Platform
    Driver is capable of doing capture
    saLoopBackScale:
     Mode set is 720P60
    Driver Name: t81xx_vidout
    Driver bus info:
    Driver is capable of doing capture
    =============================================================
    Capture Format:
    =============================================================
    fmt.type                 = 1
    fmt.width                = 1280
    fmt.height               = 720
    fmt.pixelformat  = 1448695129
    fmt.bytesperline         = 2560
    fmt.sizeimage    = 1843200
    =============================================================
    =============================================================
    Display Format:
    =============================================================
    fmt.type                 = 2
    fmt.width                = 480
    fmt.height               = 272
    fmt.pixelformat  = 1448695129
    fmt.bytesperline         = 960
    fmt.sizeimage    = 261120
    =============================================================
    Count=0
    Frame rate = 62


    root@DVM8148:~# dvmsdia 1-0010: SDI read error 0
    dvm_sdi_query_dv_preset SDI Input is HD/3G
    dvm_sdi_query_dv_preset Format: 00000007
    dvm_sdi_query_dv_preset preset index: 00000008
    ti81xxvin_config_format crop.width: 1280 crop.height: 720
    ti81xxvin_config_format win.w.width: 1280 win.w.height: 720
    ti81xxvin_vps_config_scalar Width: 1280 Height: 720
    ti81xxvin_vps_config_scalar Crop Width: 1280 Crop Height: 720
    ti81xxvin_config_format crop.width: 1280 crop.height: 720
    ti81xxvin_config_format win.w.width: 1280 win.w.height: 720
    vidioc_querycap cap: 4000002
    vidioc_s_crop
    ti81xxvin_new_crop
    vidioc_s_crop Error: 0
    vidioc_s_fmt_vid_overlay
    vidioc_s_fmt_vid_cap Width: 1280 Height: 720
    ti81xxvin_check_format sizeimage: 1843200 hpitch: 2560
    ti81xxvin_vps_config_scalar Width: 480 Height: 272
    ti81xxvin_vps_config_scalar Crop Width: 1280 Crop Height: 720
    ti81xxvin_vps_config_scalar Width: 480 Height: 272
    vidioc_s_fmt_vid_out
    ti81xxvid_setup_video width:480 height:272
    ti81xxvid_setup_video width:480 height:272
    vidioc_streamon Width: 1280 Height: 720
    ti81xxvin_check_format sizeimage: 1843200 hpitch: 2560

    ---------------------------------------------------- 1080I60 ---------------------------------------

    root@DVM8148:~/tools/tests# ./saLoopBackScale
    Driver Name: ti81xxvin
    Driver bus info: TI81xx Platform
    Driver is capable of doing capture
    saLoopBackScale:
     Mode set is 1080I60
    Driver Name: t81xx_vidout
    Driver bus info:
    Driver is capable of doing capture
    Setting format failed

    root@DVM8148:~# dvmsdia 1-0010: SDI read error 0
    dvm_sdi_query_dv_preset SDI Input is HD/3G
    dvm_sdi_query_dv_preset Format: 00000002
    dvm_sdi_query_dv_preset preset index: 0000000d
    ti81xxvin_config_format crop.width: 1920 crop.height: 1080
    ti81xxvin_config_format win.w.width: 1920 win.w.height: 1080
    ti81xxvin_vps_config_scalar Width: 1920 Height: 1080
    ti81xxvin_vps_config_scalar Crop Width: 1920 Crop Height: 1080
    ti81xxvin_config_format crop.width: 1920 crop.height: 1080
    ti81xxvin_config_format win.w.width: 1920 win.w.height: 1080
    vidioc_querycap cap: 4000002
    vidioc_s_crop
    vidioc_s_crop Interlaced

    ---------------------
    ti81xxvin_main.c
    ---------------------
    static int vidioc_s_crop(struct file *file, void *priv,
                    struct v4l2_crop *crop)
    {
            int err = -EINVAL;
            struct ti81xxvin_fh *fh = priv;
            struct ti81xxvin_instance_obj *inst = fh->instance;
            struct ti81xxvin_buffer_obj *buf_obj = &inst->buf_obj;
            u32 decoder_width = inst->video.buf_params.width;
            u32 decoder_height = inst->video.buf_params.height;
            struct ti81xxvin_buffer_params *params = &inst->video.buf_params;

            printk(KERN_INFO "%s \n", __FUNCTION__) ;

            if (buf_obj->started)
                    return -EBUSY;

            if (mutex_lock_interruptible(&buf_obj->buf_lock))
                    return -ERESTARTSYS;

            if (params->interlaced) {
                    printk(KERN_INFO "%s Interlaced\n", __FUNCTION__) ;
                    mutex_unlock(&buf_obj->buf_lock);
                    return -EINVAL;
            }

            if (crop->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
                    err = ti81xxvin_new_crop(decoder_width, decoder_height,
                                    &inst->crop, &crop->c);
                    inst->win.w.left = 0;
                    inst->win.w.top = 0;
                    inst->win.w.width = inst->crop.width;
                    inst->win.w.height = inst->crop.height;
                    printk(KERN_INFO "%s Error: %d\n", __FUNCTION__, err) ;
                    mutex_unlock(&buf_obj->buf_lock);
                    return err;
            } else {
                    mutex_unlock(&buf_obj->buf_lock);
                    return -EINVAL;
            }
    }

    ------------
    tvp7002.c
    ------------
    /* Struct list for digital video presets */
    static const struct tvp7002_preset_definition tvp7002_presets[] = {

            {
                    V4L2_DV_720P60,
                    tvp7002_parms_720P60,
                    V4L2_COLORSPACE_REC709,
                    V4L2_FIELD_NONE,
                    1,
                    0x2EE,
                    135,
                    153
            },

            {
                    V4L2_DV_1080I60,
                    tvp7002_parms_1080I60,
                    V4L2_COLORSPACE_REC709,
                    V4L2_FIELD_INTERLACED,
                    0,
                    0x465,
                    181,
                    205
            },
    Best Regards,

    John

  • Hi,

    Scaing is done as a part of capture itself. Scaling is not possible on interlaced inputs. Thats why saLoopBack Scale is failing. SaLoopBackfbdev will also fail with graphics since color conversion is also not possible with fbdev.

  • Hi Hardik,

    Since the current driver code has interlaced video disabled the question is what must be done in the drivers to configure the video
    capture to support interlaced inputs?

    Tech Ref Man seems to indicate Scaler is fed downstream of DEI so while the scaler engine does not support scaling
    of interlaced sources it doesn't have to as DEI converts interlaced sources to progressive  upstream of scaler.

    The extract below from Tech Ref Man indicates this given one of its input sources is from DEI output being upstream of scaler.

    12.8.1 SC Features
    SC features include:
    • Input– DEI output, Chroma_up output of VIP output
    • Output – YUV422 YUYV Interleaved
    • Horizontal/vertical cropping
    • Polyphase filter for horizontal
    • Polyphase filter/running average filter for vertical
    • Scaling up to maximum 1920 pixels in horizontal direction and 1080 pixels in the vertical direction

    Best Regards,

    John

  • Hello,

    We are facing the same v4l2 1080i capture problem.

    Any progress now?

    Thank you very much.