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.

gstreamer single frame capture on DM368+MT9P031

My custom DM368 is up and running DVSDK4.01; the MT9P031 is registered properly and I see /dev/video0 is there.

But I don't know how to verify the hardware is working properly.

If I run " gst-launch v4l2src ! video/x-raw-yuv, width=320, height=240 ! ffmpegcolorspace ! pngenc ! filesink location=test.png", it will get stuck at

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
INFO:
v4l2_dm365_ipipe.c(249): gst_v4l2_dm365_resizer_init (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to set norm for device '/dev/video0'.
Additional debug info:
v4l2_calls.c(739): gst_v4l2_set_norm (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Invalid argument
WARNING: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Video input device did not accept new frame rate setting.
Additional debug info:
v4l2src_calls.c(342): gst_v4l2src_set_capture (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
system error: Invalid argument
Setting pipeline to PLAYING ...
New clock: GstSystemClock

I can use the same command to capture image from UVC camera successfully.

I did run the "loadmodules.sh" first, and tried both 1 and 0 for dm365_imp.oper_mode, but it doesn't fix the resizer error.

  • I rebooted the system, reloaded the kernel modules. Now I got different error:

    v4l2 v4l2_calls.c:739:gst_v4l2_set_norm:<v4l2src0> warning: Failed to set norm for device '/dev/video0'.
    v4l2 v4l2_calls.c:739:gst_v4l2_set_norm:<v4l2src0> warning: system error: Invalid argument

    ...

    v4l2src gstv4l2src.c:631:gst_v4l2src_get_caps:<v4l2src0> probed caps: 0xa0000
    libv4l2: error setting pixformat: Invalid argument
    v4l2 gstv4l2object.c:2082:gst_v4l2_object_set_format:<v4l2src0> error: Device '/dev/video0' cannot capture at 2176x1536
    v4l2 gstv4l2object.c:2082:gst_v4l2_object_set_format:<v4l2src0> error: Call to S_FMT failed for UYVY @ 2176x1536: Invalid argument

    ....

  • Here's the output from v4l2-ctl -d /dev/video0 --all


    Driver Info:
        Driver name   : vpfe-capture
        Card type     : DM365 EVM
        Bus info      : VPFE
        Driver version: 1
        Capabilities  : 0x04000001
            Video Capture
            Streaming
    Format Video Output:
        Width/Height  : 720/480
        Pixel Format  : 'UYVY'
        Field         : Interlaced
        Bytes per Line: 1440
        Size Image    : 691200
        Colorspace    : Unknown (00000000)
    Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 2048, Height 1536
        Default     : Left 0, Top 0, Width 2048, Height 1536
        Pixel Aspect: 1/1
    Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 2048, Height 1536
        Default     : Left 0, Top 0, Width 2048, Height 1536
        Pixel Aspect: 1/1
    Crop: Left 0, Top 0, Width 720, Height 480
    Video input : 0 (Camera: ok)
    Streaming Parameters Video Capture:
        Capabilities     : timeperframe
        Frames per second: invalid (0/0)
        Read buffers     : 0

     

    Which I feel is not right, but I don't have reference point. The EVM I have is DM365IPNC, it doesn't show the capture device under /dev somehow.

    During the boot process, it shows mt9p031 registered.

  • When starting gst-launch, the first error I noticed is

    vpfe-capture: couldn't set pix format in ccdc

    The format is valid V4L2_PIX_FMT_SBGGR16, but ccdc_cfg.if_type=0 when ccdc_set_pixel_format() is called.

    Looking around the source code, it appears it should be initialized by vpfe_s_input(), but it's never called.

  • v4l2src element may needs a patch.

  • If I run "v4l2-ctl -i 0", the error of "can not set pixel format" will be  gone.

    But the pipeline will hang at "New clock: GstSystemClock" forever.

    Today, I just got a DM36x EVM, I tried to run gst-launch -v v4l2src --gst-debug-level=2 input-src=CAMERA num
    -buffers=1 ! video/x-raw-yuv,width=320,height=240 ! filesink location='test.bin'

    And it is the same: hang at "New clock: GstSystemClock"

  • Did you manage to have it working?

     

    Best regards,

    Guillaume