AnsweredAssumed Answered

ADV7180 driver for IMX6

Question asked by Quentin Reynard on Apr 25, 2019
Latest reply on Apr 25, 2019 by igorpadykov

Hi,


I am trying to use gstreamer with hardware acceleration from IMX core with phyflex-imx6-4 and a proprietary board.

 

The camera I use is the KPC-HD30MB.

 

I built yocto yogurt distribution with the following meta:

  • meta-poky
  • meta-openelbedded/meta-oe
  • meta-openelbedded/meta-networking
  • meta-openelbedded/meta-multimedia
  • meta-gstreamer1.0
  • meta-freescale
  • meta-phytec
  • meta-yogurt
  • meta-rauc

 


I used CORE_IMAGE_EXTRA_INSTALL to add some packages into the distribution:

  • imx-codec
  • imx-vpu
  • imx-vpuwrap
  • libimxvpuapi
  • imx-parser
  • gstreamer1.0 + libav, bad, good, ugly, base, imx

Do I need firmware-imx or imx-gst1.0-plugin (which I have not managed to install) ?

 

  • adv7180 driver is well probed and the I2C address is correctly detected.
  • ipu2_csi1 is used

 

There is an extract of my dts:
    adv7180@20 {
        compatible = "adv,adv7180";
        reg = <0x20>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_ipu2_2>;
        clocks = <&clks IMX6QDL_CLK_CKO>;
        clock-names = "csi_mclk";
        ipu_id = <1>;
        csi_id = <1>;
        mclk = <24000000>;
        mclk_source = <0>;
        cvbs = <1>;
    };
pinctrl_ipu2_2: ipu2grp-2 { /* IPU2_CSI1: 8-bit input */
    fsl,pins = <
    MX6QDL_PAD_EIM_DA1__IPU2_CSI1_DATA08    0x80000000
    MX6QDL_PAD_EIM_DA0__IPU2_CSI1_DATA09    0x80000000
    MX6QDL_PAD_EIM_EB1__IPU2_CSI1_DATA10    0x80000000
    MX6QDL_PAD_EIM_EB0__IPU2_CSI1_DATA11    0x80000000
    MX6QDL_PAD_EIM_A17__IPU2_CSI1_DATA12    0x80000000
    MX6QDL_PAD_EIM_A18__IPU2_CSI1_DATA13    0x80000000
    MX6QDL_PAD_EIM_A19__IPU2_CSI1_DATA14    0x80000000
    MX6QDL_PAD_EIM_A20__IPU2_CSI1_DATA15    0x80000000
    MX6QDL_PAD_EIM_A21__IPU2_CSI1_DATA16    0x80000000
    MX6QDL_PAD_EIM_A22__IPU2_CSI1_DATA17    0x80000000
    MX6QDL_PAD_EIM_A23__IPU2_CSI1_DATA18    0x80000000
    MX6QDL_PAD_EIM_A24__IPU2_CSI1_DATA19    0x80000000
    MX6QDL_PAD_EIM_DA11__IPU2_CSI1_HSYNC    0x80000000
    MX6QDL_PAD_EIM_A16__IPU2_CSI1_PIXCLK    0x80000000
    MX6QDL_PAD_EIM_DA12__IPU2_CSI1_VSYNC    0x80000000
    >;
};

 

The gstreamer pipeline works with a test video with the following command:
> gst-launch-1.0 -v videotestsrc ! video/x-raw ! x264enc ! filesink location=/home/root/capture.mkv

 

When using "imxv4l2videosrc" with device=/dev/video7 instead of "videotestsrc", the pipeline crashes:
> gst-launch-1.0 -v imxv4l2videosrc device=/dev/video7 num-buffers=1 ! video/x-raw ! x264enc ! filesink location=/home/root/pal_capture.mkv

 

Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Additional debug info:
../../../../gstreamer-1.14.1/libs/gst/base/gstbasesrc.c(3452): gst_base_src_start (): /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0:
Failed to start
Setting pipeline to NULL ...
Freeing pipeline ...

 

 

It also crashes with "v4l2src" source:
> gst-launch-1.0 -v v4l2src device=/dev/video7 ! video/x-raw ! x264enc ! filesink location=/home/root/pal_capture.mkv

 

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, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)Y42B, colorimetry=(string)bt601, interlace-mode=(string)progressive
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)Y42B, colorimetry=(string)bt601, interlace-mode=(string)progressive
Redistribute latency...
/GstPipeline:pipeline0/GstX264Enc:x264enc0.GstPad:sink: caps = video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)Y42B, colorimetry=(string)bt601, interlace-mode=(string)progressive
[  148.655166] ipu2_csi1: pipeline start failed with -32
/GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = video/x-raw, width=(int)640, height=(int)480, framerate=(fraction)30/1, format=(string)Y42B, colorimetry=(string)bt601, interlace-mode=(string)progressive
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory.
Additional debug info:
../../../gst-plugins-good-1.14.1/sys/v4l2/gstv4l2src.c(650): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Buffer pool activation failed
Execution ended after 0:00:00.098111334
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

 

 

Do you know which driver I need to use besides the adv7180 driver ?

 

Do you know any test I can run to verify /dev/video7 is the right source (I am not sure of anything anymore) ?

 

Is there a way to set the video channels ipu2_csi1_xxx easily ?

 

Thank you in advance,

 

Quentin.

Outcomes