Freescale i.MX6DL GStreamer imxv4l2src tee'd framerate-issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Freescale i.MX6DL GStreamer imxv4l2src tee'd framerate-issue

945 Views
__pka
Contributor I

Hi everyone,

I'm working on a project using the i.MX6 to send out two different video/image signals using GStreamer.
The basic idea of the project/pipe is this:

NXP.jpg

My pipe-construct looks like this:

gst-launch-1.0 __SOURCE__ ! tee name=t \
t. ! videorate drop-only=true ! capsfilter name=frame_rate ! imxvideoconvert_ipu ! queue max-size-buffers=1 leaky=2 name=q ! vpuenc_h264 ! flvmux ! rtmpsink_rlm #someworkingrtmpsink# \
t. ! queue !  __FRAMERATE__ ! videoscale sharpen=1 sharpness=1.5 ! pngenc compression-level=1 !  multifilesink max-files=3 location=/tmp/SinkPic%05d.png

Now when using "__SOURCE__" = "videotestsrc" the following results occur:

__FRAMERATE__=   " videorate drop-only=true max-rate= X " [X from 1 to ~10]  everything works fine

__FRAMERATE__=   " videorate drop-only=true ! video/x-raw,framerate=1/2 " it works fine, but for any other value than 1/2 i get the following error:


0:00:00.093046097  1076  0x10ec5c0 DEBUG              videorate gstvideorate.c:563:gst_video_rate_reset:<GstVideoRate@0x10fe090> resetting internal variables
0:00:00.093229099  1076  0x10ec5c0 LOG                videorate gstvideorate.c:671:gst_video_rate_swap_prev:<GstVideoRate@0x10fe090> swap_prev: storing buffer (nil) in prev
0:00:00.142006516  1076  0x10ec5c0 DEBUG              videorate gstvideorate.c:563:gst_video_rate_reset:<GstVideoRate@0x10fe3c0> resetting internal variables
0:00:00.142134518  1076  0x10ec5c0 LOG                videorate gstvideorate.c:671:gst_video_rate_swap_prev:<GstVideoRate@0x10fe3c0> swap_prev: storing buffer (nil) in prev
0:00:00.142498857  1076  0x10ec5c0 DEBUG              videorate gstvideorate.c:563:gst_video_rate_reset:<GstVideoRate@0x10fe6f0> resetting internal variables
0:00:00.142558191  1076  0x10ec5c0 LOG                videorate gstvideorate.c:671:gst_video_rate_swap_prev:<GstVideoRate@0x10fe6f0> swap_prev: storing buffer (nil) in prev
0:00:00.198065044  1076  0x10ec5c0 ERROR           GST_PIPELINE grammar.y:617:gst_parse_perform_link: could not link videorate2 to pngenc0

----------------------------------------------------------------------------------------------

Now when using the desired "__SOURCE__" = "imxv4l2src" thats what happens for above framerate settings:

__FRAMERATE__=   " videorate drop-only=true max-rate= 10 "  works fine

__FRAMERATE__=   " videorate drop-only=true max-rate= 1 " aka close to what I desire gives the following error:

0:00:02.052936041  1232   0x6a5090 LOG                videorate gstvideorate.c:653:gst_video_rate_flush_prev:<videorate0> old is best, dup, pushing buffer outgoing ts 0:00:00.400000000
0:00:02.146247057  1232   0x6a5090 ERROR                imxv4l2 gstimxv4l2.c:1563:gst_imx_v4l2_find_buffer: Can't find the buffer 0x45100000.
0:00:02.146391726  1232   0x6a5090 ERROR             imxv4l2src gstimxv4l2src.c:631:gst_imx_v4l2src_acquire_buffer:<source> Queue buffer 0x74b06b68 failed.
0:00:02.146513394  1232   0x6a5090 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<source> error: Internal data flow error.
0:00:02.146569061  1232   0x6a5090 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<source> error: streaming task paused, reason error (-5)
0:00:02.146958399  1232   0x6a5090 DEBUG              videorate gstvideorate.c:755:gst_video_rate_sink_event:<videorate0> Got EOS
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2Src:source: Internal data flow error.
Additional debug info:
/jenkins/workspace/MDevice_Multibranch_rc_v1.1-IMWRTTOUOSNT5UGOVXMW3LATAWM6UV37YLJC3KJFBLYJVMX2TSYA/yocto_project/build_test/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.6.0-r0/gstreamer-1.6.0/libs/gst/base/gstbasesrc.c(2943): gst_base_src_loop (): /GstPipeline:pipeline0/GstImxV4l2Src:source:
streaming task paused, reason error (-5)
0:00:02.147277735  1232   0x6a4c00 DEBUG              videorate gstvideorate.c:1124:gst_video_rate_transform_ip:<videorate1> got buffer with timestamp 0:00:01.206030355
Execution ended after 0:00:01.505231404
0:00:02.147375070  1232   0x6a4c00 LOG                videorate gstvideorate.c:671:gst_video_rate_swap_prev:<videorate1> swap_prev: storing buffer 0x74b068e8 in prev
Setting pipeline to PAUSED ...

In the first case  (framerate = 10 ) I can detect that TOP CPU-usage for the pipe is very high and actually there are way less pngs created per second than the defined 10, so my guess is that once my fps defined are below the maximum pngs/sec the CPU is capable of the above error occurs. 

__FRAMERATE__=   " videorate drop-only=true ! video/x-raw,framerate=X " [X>1] same as with the videotestsrc

__FRAMERATE__=   " videorate drop-only=true ! video/x-raw,framerate=1/2 " works perfectly for about 2-20 seconds, when finally it crashes with the following

0:00:23.032327854  1279  0x15bcc60 DEBUG              videorate gstvideorate.c:1124:gst_video_rate_transform_ip:<videorate1> got buffer with timestamp 0:00:22.088522467
0:00:23.032538190  1279  0x15bcc60 LOG                videorate gstvideorate.c:671:gst_video_rate_swap_prev:<videorate1> swap_prev: storing buffer 0x75408528 in prev
0:00:23.032738525  1279  0x15bcc30 ERROR                imxv4l2 gstimxv4l2.c:1563:gst_imx_v4l2_find_buffer: Can't find the buffer 0x45300000.
0:00:23.032866193  1279  0x15bcc30 ERROR             imxv4l2src gstimxv4l2src.c:631:gst_imx_v4l2src_acquire_buffer:<source> Queue buffer 0x75408528 failed.
0:00:23.033049195  1279  0x15bcc30 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<source> error: Internal data flow error.
0:00:23.033113529  1279  0x15bcc30 WARN                 basesrc gstbasesrc.c:2943:gst_base_src_loop:<source> error: streaming task paused, reason error (-5)
0:00:23.033483867  1279  0x15bcc30 DEBUG              videorate gstvideorate.c:755:gst_video_rate_sink_event:<videorate0> Got EOS
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2Src:source: Internal data flow error.
Additional debug info:
/jenkins/workspace/MDevice_Multibranch_rc_v1.1-IMWRTTOUOSNT5UGOVXMW3LATAWM6UV37YLJC3KJFBLYJVMX2TSYA/yocto_project/build_test/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/gstreamer1.0/1.6.0-r0/gstreamer-1.6.0/libs/gst/base/gstbasesrc.c(2943): gst_base_src_loop (): /GstPipeline:pipeline0/GstImxV4l2Src:source:
streaming task paused, reason error (-5)
Execution ended after 0:00:22.354271400
Setting pipeline to PAUSED ...

Additionally when using the above pipe without the queue for the png-tee-branch the pngs get created every 2 seconds as they should, the pipe doesn't break, but

the live-image is stuttering exactly every 2 seconds which is intolerable for the application.
-----------------------------------------------

My question would be if there is a known issue concerning the imxv4l2src in connection with queues and framerate-changes, or if I'm just missing something within my pipe.

I'm grateful for every help and hoping that my attached logs help finding the issue.

Thanks in advance
Philipp

0 Kudos
2 Replies

664 Views
joanxie
NXP TechSupport
NXP TechSupport

what yocto version do you use? I suggest that you can upgrade to the latest version, which fix many bugs from old version, then test it, if has the same issue, pls let me know it.

0 Kudos

664 Views
__pka
Contributor I

DISTRO = "poky"
DISTRO_NAME = "Poky (Yocto Project Reference Distro)"
DISTRO_VERSION = "2.0.1"
DISTRO_CODENAME = "jethro"
SDK_VENDOR = "-pokysdk"
SDK_VERSION := "${@'${DISTRO_VERSION}'.replace('snapshot-${DATE}','snapshot')}"

Currently we're running 2.0.1, I'll test whether a update may fix our issue. Thanks for the advice and have a great weekend.

0 Kudos