Hi,
I was trying to display raw video directly to on board LCD, using a Gstreamer pipeline with kmssink element. The problem is, that if I want a functional pipeline that displays video from a videotestsrc, v4l2src (camera video capture) or filesrc (raw video.yuv for example), I have to use the vpe element between the raw video source and kmssink. I want to run a pipeline that do not uses vpe element, so I can measure video latency of video capture->video display, without introducing another element in my pipeline that could increase the latency I want to measure.
My question is: Why kmssink needs vpe to display video.
The pipelines I am trying to run (The ones the give error are):
1) GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1000 io-mode=1 ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)100/1' ! queue ! kmssink
Output messages:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
** (gst-launch-1.0:1457): CRITICAL **: gst_video_calculate_display_ratio: assertion 'num > 0' failed
0:00:00.287290967 1457 0x11d830 WARN kmssink /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/gstreamer1.0-plugins-bad/1.2.3-r0-arago5/git/sys/kms/gstkmssink.c:90:gst_kms_sink_calculate_aspect_ratio:<kmssink0> error: Error calculating the output display ratio of the video.
ERROR: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: GStreamer error: negotiation problem.
Additional debug info:
/home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/gstreamer1.0-plugins-bad/1.2.3-r0-arago5/git/sys/kms/gstkmssink.c(90): gst_kms_sink_calculate_aspect_ratio (): /GstPipeline:pipeline0/GstKMSSink:kmssink0:
Error calculating the output display ratio of the video.
Execution ended after 0:00:00.189595482
Setting pipeline to PAUSED ...
0:00:00.298240874 1457 0x11d830 WARN kmssink /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/gstreamer1.0-plugins-bad/1.2.3-r0-arago5/git/sys/kms/gstkmssink.c:311:gst_kms_sink_show_frame:<kmssink0> error: drmModeSetPlane failed: Numerical result out of range (34)
Setting pipeline to READY ...
Caught SIGSEGV
2) GST_DEBUG=3 gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)100/1' ! queue ! kmssink
Output messages:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.106554149 1335 0x11d860 WARN v4l2 /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0-plugins-good/1.2.3-r0-arago1/gst-plugins-good-1.2.3/sys/v4l2/gstv4l2bufferpool.c:385:gst_v4l2_buffer_pool_alloc_buffer: Failed EXPBUF: Inappropriate ioctl for device
0:00:00.106654352 1335 0x11d860 WARN bufferpool /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0/1.2.3-r0/gstreamer-1.2.3/gst/gstbufferpool.c:297:do_alloc_buffer:<v4l2bufferpool0> alloc function failed
0:00:00.106691277 1335 0x11d860 WARN bufferpool /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0/1.2.3-r0/gstreamer-1.2.3/gst/gstbufferpool.c:331:default_start:<v4l2bufferpool0> failed to allocate buffer
0:00:00.106724136 1335 0x11d860 ERROR v4l2 /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0-plugins-good/1.2.3-r0-arago1/gst-plugins-good-1.2.3/sys/v4l2/gstv4l2bufferpool.c:609:gst_v4l2_buffer_pool_start:<v4l2bufferpool0> failed to start streaming
0:00:00.106757320 1335 0x11d860 ERROR bufferpool /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0/1.2.3-r0/gstreamer-1.2.3/gst/gstbufferpool.c:491:gst_buffer_pool_set_active:<v4l2bufferpool0> start failed
0:00:00.106789040 1335 0x11d860 ERROR basesrc /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0/1.2.3-r0/gstreamer-1.2.3/libs/gst/base/gstbasesrc.c:2922:gst_base_src_set_allocation:<v4l2src0> failed to activate bufferpool.
0:00:00.106849715 1335 0x11d860 WARN basesrc /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0/1.2.3-r0/gstreamer-1.2.3/libs/gst/base/gstbasesrc.c:2865:gst_base_src_loop:<v4l2src0> error: Internal data flow error.
0:00:00.106885989 1335 0x11d860 WARN basesrc /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0/1.2.3-r0/gstreamer-1.2.3/libs/gst/base/gstbasesrc.c:2865:gst_base_src_loop:<v4l2src0> error: streaming task paused, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
/home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0/1.2.3-r0/gstreamer-1.2.3/libs/gst/base/gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming task paused, reason not-negotiated (-4)
Execution ended after 0:00:00.002438211
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...
3) GST_DEBUG=3 gst-launch-1.0 videotestsrc num-buffers=600 ! 'video/x-raw, format=(string)NV12, width=1280,height=720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1' ! queue ! kmssink scale=false connector=30 -v
Output messages:
Pipeline is PREROLLING ...
0:00:00.098341597 1356 0x11e9b0 FIXME default /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0/1.2.3-r0/gstreamer-1.2.3/gst/gstutils.c:3648:gst_pad_create_stream_id_printf_valist:<videotestsrc0:src> Creating random stream-id, consider implementing a deterministic way of creating a stream-id
/GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, format=(string)NV12, width=(int)1280, height=(int)720, framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive
0:00:00.100787615 1356 0x11e9b0 WARN default /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa15hf-vfp-neon-linux-gnueabi/gstreamer1.0-plugins-base/1.2.3-r0-arago1/gst-plugins-base-1.2.3/gst-libs/gst/video/gstvideopool.c:171:video_buffer_pool_set_config:<videobufferpool0> no caps in config
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
** (gst-launch-1.0:1356): CRITICAL **: gst_video_calculate_display_ratio: assertion 'num > 0' failed
0:00:00.118505106 1356 0x11e980 WARN kmssink /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/gstreamer1.0-plugins-bad/1.2.3-r0-arago5/git/sys/kms/gstkmssink.c:90:gst_kms_sink_calculate_aspect_ratio:<kmssink0> error: Error calculating the output display ratio of the video.
New clock: GstSystemClock
ERROR: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: GStreamer error: negotiation problem.
Additional debug info:
/home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/gstreamer1.0-plugins-bad/1.2.3-r0-arago5/git/sys/kms/gstkmssink.c(90): gst_kms_sink_calculate_aspect_ratio (): /GstPipeline:pipeline0/GstKMSSink:kmssink0:
Error calculating the output display ratio of the video.
Execution ended after 0:00:00.000711830
Setting pipeline to PAUSED ...
0:00:00.131309250 1356 0x11e980 WARN kmssink /home/gtbldadm/processor-sdk-linux-fido-build/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/am57xx_evm-linux-gnueabi/gstreamer1.0-plugins-bad/1.2.3-r0-arago5/git/sys/kms/gstkmssink.c:311:gst_kms_sink_show_frame:<kmssink0> error: drmModeSetPlane failed: Numerical result out of range (34)
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline .
This are some examples of a pipelines that works fine, but using vpe element:
1) gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1000 io-mode=4 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)100/1' ! vpe num-input-buffers=8 ! queue ! kmssink
2) gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1000 io-mode=1 ! 'video/x-raw, format=(string)YUY2, width=(int)1280, height=(int)720, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(string)progressive, framerate=(fraction)100/1' ! vpe num-input-buffers=8 ! queue ! kmssink
3) gst-launch-1.0 videotestsrc num-buffers=600 ! 'video/x-raw,format=(string)NV12,width=1280,height=720,framerate=(fraction)24/1, pixel-aspect-ratio=(fraction)1/1' ! queue ! vpe ! kmssink scale=false connector=30 -v
I would appreciate if some one can help me with this problem, or explain me why vpe element is necessary.
Thanks!