SK-AM62: CSI OV5640 camera GST-Launch preview failed. Error: "Failed to set pipeline to PAUSED."

Part Number: SK-AM62


I encountered a failure in previewing the 5640 version when upgrading the SDK to 11_01_05_03. The relevant log information is as follows. I would like to know how to solve this problem.

root@am62xx-evm:~# v4l2-ctl --list-devices
j721e-csi2rx (platform:30102000.ticsi2rx):
/dev/video0
/dev/video1
/dev/video2
/dev/video3
/dev/media0

root@am62xx-evm:~# v4l2-ctl -d /dev/video0 --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture

[0]: 'YUYV' (YUYV 4:2:2)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[1]: 'UYVY' (UYVY 4:2:2)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[2]: 'YVYU' (YVYU 4:2:2)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[3]: 'VYUY' (VYUY 4:2:2)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[4]: 'BA81' (8-bit Bayer BGBG/GRGR)
Size: Stepwise 16x1 - 16384x16384 with step 16/1
[5]: 'GBRG' (8-bit Bayer GBGB/RGRG)
Size: Stepwise 16x1 - 16384x16384 with step 16/1
[6]: 'GRBG' (8-bit Bayer GRGR/BGBG)
Size: Stepwise 16x1 - 16384x16384 with step 16/1
[7]: 'RGGB' (8-bit Bayer RGRG/GBGB)
Size: Stepwise 16x1 - 16384x16384 with step 16/1
[8]: 'GREY' (8-bit Greyscale)
Size: Stepwise 16x1 - 16384x16384 with step 16/1
[9]: 'BG10' (10-bit Bayer BGBG/GRGR)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[10]: 'GB10' (10-bit Bayer GBGB/RGRG)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[11]: 'BA10' (10-bit Bayer GRGR/BGBG)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[12]: 'RG10' (10-bit Bayer RGRG/GBGB)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[13]: 'RGI0' (10-bit Bayer RGBG/GIrGIr)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[14]: 'GRI0' (10-bit Bayer GRGB/IrGIrG)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[15]: 'BGI0' (10-bit Bayer BGRG/GIrGIr)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[16]: 'GBI0' (10-bit Bayer GBGR/IrGIrG)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[17]: 'GIR0' (10-bit Bayer GIrGIr/RGBG)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[18]: 'IGR0' (10-bit Bayer IrGIrG/GRGB)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[19]: 'GIB0' (10-bit Bayer GIrGIr/BGRG)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[20]: 'IGB0' (10-bit Bayer IrGIrG/GBGR)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[21]: 'BG12' (12-bit Bayer BGBG/GRGR)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[22]: 'GB12' (12-bit Bayer GBGB/RGRG)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[23]: 'BA12' (12-bit Bayer GRGR/BGBG)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[24]: 'RG12' (12-bit Bayer RGRG/GBGB)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[25]: 'RGBR' (16-bit RGB 5-6-5 BE)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[26]: 'Y10 ' (10-bit Greyscale)
Size: Stepwise 8x1 - 8192x16384 with step 8/1
[27]: 'XR24' (32-bit BGRX 8-8-8-8)
Size: Stepwise 4x1 - 4096x16384 with step 4/1
[28]: 'XB24' (32-bit RGBX 8-8-8-8)
Size: Stepwise 4x1 - 4096x16384 with step 4/1
root@am62xx-evm:~#

root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! waylandsink
Setting pipeline to PAUSED ...
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...
root@am62xx-evm:~# gst-launch-1.0 v4l2src device=/dev/video0 io-mode=2 ! video/x-raw,format=YUY2,width=640,height=480,framerate=30/1 ! waylandsink
Setting pipeline to PAUSED ...
Failed to set pipeline to PAUSED.
Setting pipeline to NULL ...
Freeing pipeline ...

Please also take a look. Thank you very much.

  • Hi,

    We have received your post and the investigation will take some time. Thank you for your patience.

  • Thank you very much. Looking forward to your reply. Additionally, I found that using the ti app launch live camera feature allows for previewing. This should indicate that there is probably no major issue with my camera configuration.
    I need the complete command that can ensure stable preview when using the gst command. Thank you.

    If you need me to provide other source codes, please let me know.

  • Hi,

    Could you please check the below command?

    gst-launch-1.0 -v v4l2src device=/dev/video-ov5640-cam0 io-mode=5 ! video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY ! kmssink driver-name=tidss sync=false

  • root@am62xx-evm:~# echo on > /sys/devices/platform/bus@f0000/20000000.i2c/i2c-1/1-003c/power/control
    root@am62xx-evm:~# gst-launch-1.0 -v v4l2src device=/dev/video-ov5640-cam0 io-mode=5 ! video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY ! kmssink driver-name=tidss sync=false
    Setting pipeline to PAUSED ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Cannot identify device '/dev/video-ov5640-cam0'.
    Additional debug info:
    /usr/src/debug/gstreamer1.0-plugins-good/1.22.12/sys/v4l2/v4l2_calls.c(613): gst_v4l2_open (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    system error: No such file or directory
    ERROR: pipeline doesn't want to preroll.
    Failed to set pipeline to PAUSED.
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62xx-evm:~# gst-launch-1.0 -v v4l2src device=/dev/video0 io-mode=5 ! video/x-raw, width=1920, height=1080, framerate=30/1, format=UYVY ! kmssink driver-name=tidss sync=false
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    /GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 1920
    /GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 1080
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt709
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt709
    /GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt709
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)1920, height=(int)1080, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt709
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
    Additional debug info:
    /usr/src/debug/gstreamer1.0-plugins-good/1.22.12/sys/v4l2/gstv4l2src.c(950): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    Buffer pool activation failed
    Execution ended after 0:00:00.031383930
    Setting pipeline to NULL ...
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Additional debug info:
    /usr/src/debug/gstreamer1.0/1.22.12/libs/gst/base/gstbasesrc.c(3134): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason not-negotiated (-4)
    Freeing pipeline ...
    root@am62xx-evm:~# gst-launch-1.0 -v v4l2src device=/dev/video0 io-mode=5 ! video/x-raw, width=640, height=480, framerate=30/1, format=UYVY ! kmssink driver-name=tidss sync=false
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    /GstPipeline:pipeline0/GstKMSSink:kmssink0: display-width = 1920
    /GstPipeline:pipeline0/GstKMSSink:kmssink0: display-height = 1080
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt601
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt601
    /GstPipeline:pipeline0/GstKMSSink:kmssink0.GstPad:sink: caps = video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt601
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)UYVY, interlace-mode=(string)progressive, colorimetry=(string)bt601
    ERROR: from element /GstPipeline:pipeline0/GstKMSSink:kmssink0: GStreamer encountered a general resource error.
    Additional debug info:
    /usr/src/debug/gstreamer1.0-plugins-bad/1.22.12/sys/kms/gstkmssink.c(2032): gst_kms_sink_show_frame (): /GstPipeline:pipeline0/GstKMSSink:kmssink0:
    drmModeSetPlane failed: Permission denied (13)
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
    Execution ended after 0:00:00.139351930
    Additional debug info:
    /usr/src/debug/gstreamer1.0/1.22.12/libs/gst/base/gstbasesrc.c(3134): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming stopped, reason error (-5)
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am62xx-evm:~#

    Thank you for your reply. This seems not to be possible.

  • Hi,

    When using 640*480 resolution you are getting the error,

    kmssink, the "Permission denied" error is almost certainly due to another application—most likely a display server or compositor like Weston—already controlling the graphics hardware resources (the KMS/DRM planes).

    1. Assuming your system is using systemd to manage services, you can stop the Weston display server using the following command:

    systemctl stop weston

    2. Rerun the GStreamer Pipeline. Once the service is stopped, run your successful 640*480 pipeline again:

    also try the same pipeline with alternative sinks waylandsink , autovideosink.

  • Thank you very much. It turns out that I need to turn off Weston in order to use Autovideosink and be able to preview. However, I still have another issue. It seems that I can only preview at a resolution of 640x480, and the colors are a bit too red.
    Please give me some more guidance. Thank you again.