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: camera application with camera module

Genius 5785 points
Part Number: AM5728
Other Parts Discussed in Thread: TMDSEVM572X, TMDSCM572X,

Tool/software: Linux

Hello,

I have TMDSEVM572X and TMDSCM572X(camera module) and use PSDK v3.2.0.5.

When I run the camera application as below, Qt window starts up on the LCD, but the capture image of the camera module is not displayed. Then the following error is displayed on the console. Please let me know if you have some advice to me.

root@am57xx-evm:~# /usr/share/qt5/examples/multimediawidgets/camera/camera
Using Wayland-EGL
wlpvr: PVR Services Initialised
Unable to query the parameter info: "Invalid argument"
Unable to query the parameter info: "Invalid argument"
Unable to query the parameter info: "Invalid argument"
Unable to query the parameter info: "Invalid argument"
Unable to query the parameter info: "Invalid argument"
Unable to query the parameter info: "Invalid argument"
[  365.449195] vip 48990000.vip: dma_alloc_coherent of size 12582912 failed
CameraBin error: "Failed to allocate required memory."
CameraBin error: "Internal data flow error."

When I push icons of Matrix GUI, the capture image of the camera module is displayed correctly on the LCD, so the camera module is fine.
Camera -> Dual Camera Demo -> Run

Also, if I remove the camera module and connect USB camera, the camera application runs correctly and the capture image of USB camera is displayed on the LCD.

root@am57xx-evm:~# /usr/share/qt5/examples/multimediawidgets/camera/camera
[   57.986264] usb 1-1.1: reset high-speed USB device number 3 using xhci-hcd
Using Wayland-EGL
wlpvr: PVR Services Initialised

Regards,
Kazu

  • Hi Kazu,

    I tested this on my board, and it seems to work. Here is the console output:

    root@am57xx-evm:/usr/share/qt5/examples/multimediawidgets/camera# ./camera

    [   95.732131] omap_hwmod: mmu0_dsp2: _wait_target_disable failed

    [   95.738053] omap-iommu 41501000.mmu: 41501000.mmu: version 3.0

    [   95.744146] omap-iommu 41502000.mmu: 41502000.mmu: version 3.0

    [   95.758325] omap_hwmod: mmu0_dsp1: _wait_target_disable failed

    [   95.764227] omap-iommu 40d01000.mmu: 40d01000.mmu: version 3.0

    [   95.770184] omap-iommu 40d02000.mmu: 40d02000.mmu: version 3.0

    Using Wayland-EGL

    wlpvr: PVR Services Initialised

    Unable to query the parameter info: "Invalid argument"

    Unable to query the parameter info: "Invalid argument"

    Unable to query the parameter info: "Invalid argument"

    Unable to query the parameter info: "Invalid argument"

    Unable to query the parameter info: "Invalid argument"

    Unable to query the parameter info: "Invalid argument"

    [   99.246072] vip 48990000.vip: dma_alloc_coherent of size 6291456 failed

    [  108.015327] omap_hwmod: mmu1_dsp1: _wait_target_disable failed

    [  108.027998] omap_hwmod: mmu1_dsp2: _wait_target_disable failed

    [  108.040624] omap_hwmod: mmu0_dsp1: _wait_target_disable failed

    [  108.053439] omap_hwmod: mmu0_dsp2: _wait_target_disable failed

    And I can see the camera window on the AM572x EVM display:

    Can you check the camera module is well connected on the cammera board, sometimes the connection between the two is not good (press the cable against the connector). 

    Best Regards, 
    Yordan

  • Hello Yordan,

    Thank you for your quick reply. I don't know why the Qt camera application doesn't work with my camera module. Anyway, I also check the operation using gstreamer.

    I connect the camera module and a USB camera to AM5728 GP-EVM.

    root@am57xx-evm:~#
    root@am57xx-evm:~# v4l2-ctl --list-devices
    wbcap (platform:omapwb-cap):
    /dev/video11

    omapwb-m2m (platform:omapwb-m2m):
    /dev/video10

    vip (platform:vip):
    /dev/video1

    vpe (platform:vpe):
    /dev/video0

    USB 2.0 PC Camera (usb-xhci-hcd.1.auto-1.2):
    /dev/video2

    root@am57xx-evm:~#

    With the following command, the image captured by the camera module is displayed on the LCD.

    root@am57xx-evm:~#
    root@am57xx-evm:~# gst-launch-1.0 -v v4l2src device=/dev/video1 io-mode=4 ! 'video/x-raw, format=YUY2, width=640, height=480, framerate=30/1' ! vpe ! queue ! waylandsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstVpe:vpe0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstVpe:vpe0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)bt601\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstWaylandSink:waylandsink0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstVpe:vpe0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstWaylandSink:waylandsink0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"

    However, USB camera capture fails as below.

    root@am57xx-evm:~#
    root@am57xx-evm:~# gst-launch-1.0 -v v4l2src device=/dev/video2 io-mode=4 ! 'video/x-raw, format=YUY2, width=640, height=480, framerate=30/1' ! vpe ! queue ! waylandsink
    Setting pipeline to PAUSED ...
    Pipeline is live and does not need PREROLL ...
    Setting pipeline to PLAYING ...
    New clock: GstSystemClock
    /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)1:4:7:1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)1:4:7:1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstVpe:vpe0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstWaylandSink:waylandsink0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstVpe:vpe0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)1:4:7:1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)YUY2\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ interlace-mode\=\(string\)progressive\,\ colorimetry\=\(string\)1:4:7:1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstVpe:vpe0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"[ 209.990500] contiguous chunk is too small 4096/614400 b

    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:src: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstWaylandSink:waylandsink0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    /GstPipeline:pipeline0/GstQueue:queue0.GstPad:sink: caps = "video/x-raw\,\ format\=\(string\)NV12\,\ width\=\(int\)640\,\ height\=\(int\)480\,\ pixel-aspect-ratio\=\(fraction\)1/1\,\ framerate\=\(fraction\)30/1"
    ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
    Additional debug info:
    ../../../../gstreamer-1.6.3/libs/gst/base/gstbasesrc.c(2943): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
    streaming task paused, reason error (-5)
    Execution ended after 0:00:01.019431021
    Setting pipeline to PAUSED ...
    Setting pipeline to READY ...
    Setting pipeline to NULL ...
    Freeing pipeline ...
    root@am57xx-evm:~#

    I guess it's needed to alter gstremer's command, but how should I do?

    Regards,
    Kazu

  • Hello,


    Regarding gstreamer I would recommend you to add --gst-debug=3 to your pipeline to obtain more debug prints.

    I would suggest you to check this thread also:
    e2e.ti.com/.../2034142

    and this wiki page for gstreamer exmaples:
    processors.wiki.ti.com/.../Processor_Training:_Multimedia

    BR
    Margarita
  • Hello Margarita,

    Sorry for the late reply. I refer to E2E thread from you, I applied the patch and remaked uvcvideo.ko, then my problem was solved. Thank you.

    Regards,
    Kazu

  • Hello,

    I am glad that this issue is solved.

    BR
    Margarita