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/AM5728: VPE interlace issue

Part Number: AM5728
Other Parts Discussed in Thread: TVP5158

Tool/software: Linux

Hi,

In my old thread : https://e2e.ti.com/support/arm/sitara_arm/f/791/t/660340#pi316653=1 

Our board is capture PAL(576I) from tvp5158.We need VPE to do interlace so that we can run our own algo.

I 'm using capturevpedisplay demo in omapdrmtest.

I found that there is almost no time remains between vpe output a buf (V4L2 dqbuf)  and display the buf.

Blow is what I'm debuging in capturevpedisplay demo: 

index = vpe_output_dqbuf(vpe);

testbuf = vpe->disp_bufs[index];    // add a cmem buf in struct buffer, try to transmit cmem buf to our algo(opencv)

usleep(2000);       // if this delay is more than 2ms .Sometimes it will display the original image (interlace) .

display_buffer(vpe, index);

I tried to use delay to replace our algo.I found that if delay is more than about 2ms the "deinterlace" will be unstable.

Is this due to hardware features ?

  • Hello,

    What is PSDK version that you are using here?

    BR
    Margarita
  • Hi,Margarita Gashova
    It's 4.2.0.9.
  • Hi,

    Can anyone help us?

  • Hello,

    Could you try to use -fps option. Currently –fps is not enabled for capturevpedisplay since the number of arguments is fixed but you can make change in the main function to respect fps option from user.
    You can hardcode fps in the source code for your requirement or you can modify the argument list to interpret –fps option.
    You could refer other applciations like viddec3test, filevpedisplay.

    BR
    Margarita

  • Hi,
    I've done to add --fps to capturevpedisplay demo :

    if (argc != 11) {
    printf (
    "USAGE : <SRCWidth> <SRCHeight> <SRCFormat> "
    "<DSTWidth> <DSTHeight> <DSTformat> "
    "<interlace> <translen> -s <connector_id>:<mode>\n");

    //return 1;
    }

    Is that right?

    If so what should I configure this parameter?

    It will display interlace video if I config fps to 25 (PAL) ?

    Displaying steady with more than 60.

  • Hi,

    How could I do next ?

  • Hello,

    I am sorry for delay I was OoO.
    This seems right. Make sure that –fps option is respected and you are seeing slow playback with –fps 10 for example.

    BR
    Margarita
  • Hi,
    Thanks for your reply
    Unfortunately I got a interlaced stream when I config -fps to 10.(original src code without changed except -fps)
  • Hello,

    Please  set interlace field in the arguments to 2.

    BR
    Margarita

  • Hi,

    Thanks for your reply.

    Blow is the command I use :

    ./capturevpedisplay 704 288 yuyv 704 576 bgr24 2 3 -s 31:1920x1080 -fps 25

    I got a wrong picture:

    So I use control C to stop this app,the system crashed.

    [ 653.283060] CPU: 1 PID: 1150 Comm: capturevpedispl Tainted: G W O 4.9.59-ga75d8e9305 #2
    [ 653.292055] Hardware name: Generic DRA74X (Flattened Device Tree)
    [ 653.298172] Backtrace:
    [ 653.300644] [<c020b29c>] (dump_backtrace) from [<c020b558>] (show_stack+0x18/0x1c)
    [ 653.308248] r7:00000009 r6:600e0093 r5:00000000 r4:c1022668
    [ 653.313935] [<c020b540>] (show_stack) from [<c04cd680>] (dump_stack+0x8c/0xa0)
    [ 653.321191] [<c04cd5f4>] (dump_stack) from [<c022e3d4>] (__warn+0xec/0x104)
    [ 653.328184] r7:00000009 r6:c0bf902c r5:00000000 r4:00000000
    [ 653.333869] [<c022e2e8>] (__warn) from [<c022e4a4>] (warn_slowpath_null+0x28/0x30)
    [ 653.341473] r9:ed141350 r8:00000007 r7:d54422c8 r6:d1f3fa00 r5:00000007 r4:200e0013
    [ 653.349252] [<c022e47c>] (warn_slowpath_null) from [<c06f35c0>] (vb2_buffer_done+0x160/0x184)
    [ 653.357825] [<c06f3460>] (vb2_buffer_done) from [<bf0ec6d0>] (vpe_return_all_buffers+0x154/0x1c4 [ti_vpe])
    [ 653.367522] r9:ed141350 r8:a00e0013 r7:00000000 r6:d0711600 r5:00000007 r4:200e0013
    [ 653.375311] [<bf0ec57c>] (vpe_return_all_buffers [ti_vpe]) from [<bf0ec83c>] (vpe_stop_streaming+0x44/0x48 [ti_vpe])
    [ 653.385879] r9:ed141350 r8:00000000 r7:d54422c8 r6:ed549810 r5:d54422c8 r4:d0711600
    [ 653.393665] [<bf0ec7f8>] (vpe_stop_streaming [ti_vpe]) from [<c06f49d8>] (__vb2_queue_cancel+0x30/0x188)
    [ 653.403185] r7:d54422c8 r6:ed549bac r5:d5442304 r4:d54422c8
    [ 653.408872] [<c06f49a8>] (__vb2_queue_cancel) from [<c06f51b4>] (vb2_core_queue_release+0x20/0x40)
    [ 653.417871] r9:ed141350 r8:00000000 r7:ee8f5710 r6:ed549bac r5:d5442304 r4:d54422c8
    [ 653.425650] [<c06f5194>] (vb2_core_queue_release) from [<c06f707c>] (vb2_queue_release+0x10/0x14)
    [ 653.434559] r5:ed549810 r4:d5442000
    [ 653.438154] [<c06f706c>] (vb2_queue_release) from [<c06f2990>] (v4l2_m2m_ctx_release+0x24/0x30)
    [ 653.446897] [<c06f296c>] (v4l2_m2m_ctx_release) from [<bf0ec43c>] (vpe_release+0x74/0xb0 [ti_vpe])
    [ 653.455892] r5:ed549810 r4:d0711600
    [ 653.459490] [<bf0ec3c8>] (vpe_release [ti_vpe]) from [<c06dd7bc>] (v4l2_release+0x40/0x7c)
    [ 653.467788] r7:ee8f5710 r6:eccb3880 r5:ed549868 r4:dfbcee40
    [ 653.473477] [<c06dd77c>] (v4l2_release) from [<c0331544>] (__fput+0x8c/0x1dc)
    [ 653.480640] r5:ed141350 r4:dfbcee40
    [ 653.484233] [<c03314b8>] (__fput) from [<c03316f4>] (____fput+0x10/0x14)
    [ 653.490963] r10:cf0bc504 r9:cf0a857c r8:dfbce300 r7:cf0b0640 r6:cf0b0b20 r5:c10527e4
    [ 653.498825] r4:cf0b0b04
    [ 653.501372] [<c03316e4>] (____fput) from [<c02492a8>] (task_work_run+0xc4/0xe4)
    [ 653.508716] [<c02491e4>] (task_work_run) from [<c0231f14>] (do_exit+0x318/0x9f0)
    [ 653.516145] r9:cf0a857c r8:c1003050 r7:ee8a7e40 r6:ffffe000 r5:cf0b0b1c r4:cf0b0640
    [ 653.523924] [<c0231bfc>] (do_exit) from [<c0232670>] (do_group_exit+0x48/0xc4)
    [ 653.531175] r7:ee8a7edc
    [ 653.533722] [<c0232628>] (do_group_exit) from [<c023c4f0>] (get_signal+0x22c/0x5b4)
    [ 653.541411] r7:ee8a7edc r6:00418004 r5:ee8a6000 r4:08430000
    [ 653.547097] [<c023c2c4>] (get_signal) from [<c020a980>] (do_signal+0x6c/0x3c0)
    [ 653.554352] r10:00000000 r9:ee8a6000 r8:b512b116 r7:fffffe00 r6:ee8a7ec8 r5:b512b114
    [ 653.562212] r4:ee8a7fb0
    [ 653.564758] [<c020a914>] (do_signal) from [<c020ae9c>] (do_work_pending+0xa8/0xc0)
    [ 653.572361] r10:00000000 r9:ee8a6000 r8:c0207d84 r7:00000036 r6:ee8a7fb0 r5:c0207d84
    [ 653.580222] r4:ee8a6000
    [ 653.582770] [<c020adf4>] (do_work_pending) from [<c0207c2c>] (slow_work_pending+0xc/0x20)
    [ 653.590983] r7:00000036 r6:00000004 r5:bea0da58 r4:000a94c8
    [ 653.596665] ---[ end trace a6872446aa038c5d ]---

  • Hi,Margarita
    Do you mean I just need to set "capturevpedisplay 704 288 yuyv 704 576 bgr24 2 3 -s 31:1920x108"if we want to make 50 fields to 25 frames (not 50 frames)
  • Hello,

    Could you try to set -fps 50 now? Is this shows correct result?

    BR
    Margarita
  • Hi,Margarita
    The command I 've tried was : capturevpedisplay 704 288 yuyv 704 576 yuyv 2 3 -s 31:1920x1080 (result as above)
    I 've also tried --fps 50 which display the same picture.
  • Hello,

    I am wondering what is the behavior with gstreamer?
    Have you tried?

    BR
    Margarita
  • Hi,Margarita

    First I try:

    gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)704, height=(int)288' ! vpe num-input-buffers=8 ! queue ! waylandsink

    It work fine .That means v4l2src is ok.

    Then:

    gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)704, height=(int)288, framerate=(fraction)50/1 , interlace-mode=interlaced' ! vpe ! 'video/x-raw, format=(string)YUY2, width=(int)704, height=(int)576, framerate=(fraction)25/1, interlace-mode=progressive' ! queue ! waylandsink

    Pipeline is live and does not need PREROLL ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.

    So I try to use :

    gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=500 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)704, height=(int)288' ! vpe ! 'video/x-raw, format=(string)NV12, width=(int)704, height=(int)576, framerate=(fraction)25/1, interlace-mode=progressive' ! queue ! ducatimpeg4enc bitrate=6000 ! queue ! mpeg4videoparse ! qtmux ! filesink location=x.mp4

    Below is the output: /cfs-file/__key/communityserver-discussions-components-files/791/6710.x.mp4

  • Hello,

    I see this issue is discussing here also:
    e2e.ti.com/.../660340
    Please do not open two threads for the same issue.
    I am closing this one.

    BR
    Margarita