Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD2D5C2D0EE for ; Thu, 26 Mar 2020 08:28:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9C919207FC for ; Thu, 26 Mar 2020 08:28:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WPuUm1D8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727792AbgCZI2r (ORCPT ); Thu, 26 Mar 2020 04:28:47 -0400 Received: from mail-lj1-f196.google.com ([209.85.208.196]:39825 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727751AbgCZI2q (ORCPT ); Thu, 26 Mar 2020 04:28:46 -0400 Received: by mail-lj1-f196.google.com with SMTP id i20so5458355ljn.6 for ; Thu, 26 Mar 2020 01:28:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=mTsg/k3T0RBYLp/O6KmyTIl2SHP8mSvBsvX2HycEfC8=; b=WPuUm1D8PLIutfQxvZDsYq02yN30wXwnJM94AVzerPESuci6fUO7DQJt4FkmDECGxL cO/Rh9y66uV9rO/8pYuZq2ip6PiRNMTiOKoVWPmnbuSt3G72EyFzx2UjWDAprIt+M+dA ILdj2PL8snxcjnyTv8GVP+WGnFEiKlslzzq+BSz/5TwcKrNXGrduX+ajHJg+2d9IqpCy 5dxdxMs+yOJYJ/yO/TrJgthiWJXBcGypvErqKR0mXKoqwNE8fe8TcRzWIsTmYDdCcf2f dTuiR8KqQAejbC15LDOmeEUgmorsjQhs3t29QbO/A9hHuDxy+NrK8SqqL8eoprKJaJox LBew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=mTsg/k3T0RBYLp/O6KmyTIl2SHP8mSvBsvX2HycEfC8=; b=gyinrxJZ3D6OU2wBWuFTgra12DxSXGl5mFW9dNet12tLVW2Fqp//7dJ/4hDYev+COD xlk28tH4S90HYA+BWsqicueJYiw/9wwK6W4NxF0Ya1tg/W2UgWtfu6MM1SQ4LM3Llg3A /UVeBeqPc+nb7GC8+p1X258jANWS4LHi3gF/YI9+Ri/0dMffw0CoOTAVsJG00U511H05 DxzEcucP8hInSeCAsXYkiBvEsW1qSF+Wh3EsjffhFPhPn0Ndz7LlhTW+acZQ4HKVnWvQ 6PwZikb36OnFrlZ65lkGdFMfEahenFCPMxf0lOtK7XA3FTE2zEUcyIJe4nTTqAP0c9m4 a/Tg== X-Gm-Message-State: ANhLgQ040MYYCIoNpzvylkNZnR/vIiD1csXAs1xhzEYFXXepjzBjBpTR Gna9ERSipnpbJAm17h/Vy0f3d/m73FA= X-Google-Smtp-Source: APiQypIoNJzvYZB25rdb4PBPxvTh9mAJBmpKzfx/ZJNz0tJCf8fl7Mcg/JPAb6HXv8RltbdK4q2rmw== X-Received: by 2002:a05:651c:1061:: with SMTP id y1mr4186192ljm.285.1585211322009; Thu, 26 Mar 2020 01:28:42 -0700 (PDT) Received: from [192.168.7.22] ([217.148.211.220]) by smtp.gmail.com with ESMTPSA id l21sm1061643lfh.63.2020.03.26.01.28.41 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 26 Mar 2020 01:28:41 -0700 (PDT) To: linux-media@vger.kernel.org From: =?UTF-8?B?0JzQuNGF0LDQudC70L7QsiDQkNC70LXQutGB0LXQuSDQkNC90LDRgtC+0Ls=?= =?UTF-8?B?0YzQtdCy0LjRhw==?= Subject: IMX219 MIPI Sensor (meda-tree) with vaniila I.MX6Q media drivers Message-ID: <30c5947f-a026-66a9-75f2-d2531cc73a1e@gmail.com> Date: Thu, 26 Mar 2020 11:28:41 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.6.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi! We build custom CPU Module with NXP/Freescale IMX6QuadPlus CPU.I use latest stable kernel from kernel.org. This time kernel version 5.5.11. Also I connect to I.MX MIPI cameras from RaspberryPI (Rev 2.1 with Sony IMX219). For IMX219 used actual driver from [1]. Usersapce based on Gentoo Linux, have media-utils version 1.2.1, v4l2-utils version 1.18.0, gstreamer version 1.14.5 with v4l2 plugins. Also Wayland version 1.17 based graphics with XWayland. Camera write in DTB: ==== cut: DTB fragments ==== / { [skiped] imx219_clk: camera-clk { compatible = "fixed-clock"; #clock-cells = <0>; clock-frequency = <24000000>; }; imx219_1v2_reg: cam1v2_regulator { compatible = "regulator-fixed"; regulator-name = "IMX219_1V2"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1200000>; vin-supply = <&p3v3_reg>; regulator-always-on; }; imx219_1v8_reg: cam1v8_regulator { compatible = "regulator-fixed"; regulator-name = "IMX219_1V8"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; vin-supply = <&p3v3_reg>; regulator-always-on; }; imx219_2v8_reg: cam2v8_regulator { compatible = "regulator-fixed"; regulator-name = "IMX219_2V8"; regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; vin-supply = <&p3v3_reg>; regulator-always-on; }; [skiped] csi_i2c: i2c-mux@1 { /* CSI camera */ #address-cells = <1>; #size-cells = <0>; reg = <1>; sensor@10 { /* Raspberry Camera V2 */ compatible = "sony,imx219"; reg = <0x10>; #address-cells = <1>; #size-cells = <0>; clocks = <&imx219_clk>; clock-names = "xclk"; DOVDD-supply = <&imx219_1v8_reg>; /* 1.8v */ AVDD-supply = <&imx219_2v8_reg>; /* 2.8v */ DVDD-supply = <&imx219_1v2_reg>; /* 1.2v */ port { csi_sensor_out: endpoint { remote-endpoint = <&csi_port_in>; link-frequencies = /bits/ 64 <456000000>; clock-lanes = <0>; data-lanes = <1 2>; }; }; }; }; [skiped] &mipi_csi { status = "okay"; port@0 { reg = <0>; csi_port_in: endpoint { remote-endpoint = <&csi_sensor_out>; clock-lanes = <0>; data-lanes = <1 2>; }; }; }; [skiped] ==== cut: DTB fragments ==== I use script for init connected camera ==== cut: Camera init script === #!/bin/bash # sensor output format and resolutions # RaspberryPI Camera rev 2.1 (Sony I.MX219) I_FORMAT=SRGGB10_1X10 I_RESOLUTION=1920x1080 CROP=(0,0)/640x480 # capture format and resolution O_FORMAT=AYUV32 O_RESOLUTION=640x480 # viewport format and resolution V_FORMAT=AYUV32 V_RESOLUTION=640x480 # Reset all media links media-ctl -r # Sersor to IPU and PRP path # RaspberryPI Camera rev 2.1 (Sony I.MX219) media-ctl -l "'imx219 9-0010':0 -> 'imx6-mipi-csi2':0[1]" media-ctl -l "'imx6-mipi-csi2':2 -> 'ipu1_csi1':0[1]" media-ctl -l "'ipu1_csi1':1 -> 'ipu1_ic_prp':0[1]" # media-ctl -l "'ipu1_csi1':2 -> 'ipu1_csi1 capture':0[1]" # /dev/video3 (unused, unprocessed) # IPU to capture media-ctl -l "'ipu1_ic_prp':1 -> 'ipu1_ic_prpenc':0[1]" media-ctl -l "'ipu1_ic_prpenc':1 -> 'ipu1_ic_prpenc capture':0[1]" # /dev/video1 # IPU to viewport media-ctl -l "'ipu1_ic_prp':2 -> 'ipu1_ic_prpvf':0[1]" media-ctl -l "'ipu1_ic_prpvf':1 -> 'ipu1_ic_prpvf capture':0[1]" # /dev/video2 # RaspberryPI Camera rev 2.1 (Sony I.MX219) media-ctl -V "'imx219 9-0010':0 [fmt:${I_FORMAT}/${I_RESOLUTION} field:none]" media-ctl -V "'imx6-mipi-csi2':2 [fmt:${I_FORMAT}/${I_RESOLUTION} field:none]" media-ctl -V "'ipu1_csi1':0 [crop:${CROP}]" media-ctl -V "'ipu1_csi1':1 [fmt:${I_FORMAT}/${O_RESOLUTION} field:none]" media-ctl -V "'ipu1_ic_prp':1 [fmt:${O_FORMAT}/${O_RESOLUTION} field:none]" media-ctl -V "'ipu1_ic_prpenc':1 [fmt:${O_FORMAT}/${O_RESOLUTION} field:none]" media-ctl -V "'ipu1_ic_prp':2 [fmt:${V_FORMAT}/${V_RESOLUTION} field:none]" media-ctl -V "'ipu1_ic_prpvf':1 [fmt:${V_FORMAT}/${V_RESOLUTION} field:none]" ==== cut: Camera init script === I try start system with V2.1 camera and start capture frames: [...] # ./camera_init.sh # gst-launch-1.0 -v v4l2src device=/dev/video2 ! fakesink Setting pipeline to PAUSED ... Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = video/x-raw, format=(string)YUY2, framerate=(fraction)30000/1001, width=(int)640, height=(int)480, colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive /GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = video/x-raw, format=(string)YUY2, framerate=(fraction)30000/1001, width=(int)640, height=(int)480, colorimetry=(string)2:4:7:1, interlace-mode=(string)progressive New clock: GstSystemClock ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to allocate required memory. Additional debug info: /var/tmp/portage/media-plugins/gst-plugins-v4l2-1.14.5/work/gst-plugins-good-1.14.5/sys/v4l2/gstv4l2src.c(656): gst_v4l2src_decide_allocation (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Buffer pool activation failed Execution ended after 0:00:00.014952667 Setting pipeline to PAUSED ... Setting pipeline to READY ... Setting pipeline to NULL ... Freeing pipeline ... # media-ctl -p Media controller API version 5.5.13 Media device information ------------------------ driver imx-media model imx-media serial bus info hw revision 0x0 driver version 5.5.13 Device topology [...] - entity 15: ipu1_ic_prp (3 pads, 5 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev2 pad0: Sink [fmt:AYUV8_1X32/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] <- "ipu1_csi0":1 [] <- "ipu1_vdic":2 [] <- "ipu1_csi1":1 [ENABLED] pad1: Source [fmt:AYUV8_1X32/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "ipu1_ic_prpenc":0 [ENABLED] pad2: Source [fmt:AYUV8_1X32/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "ipu1_ic_prpvf":0 [ENABLED] - entity 19: ipu1_ic_prpenc (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev3 pad0: Sink [fmt:AYUV8_1X32/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] <- "ipu1_ic_prp":1 [ENABLED] pad1: Source [fmt:AYUV8_1X32/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range] -> "ipu1_ic_prpenc capture":0 [ENABLED] - entity 22: ipu1_ic_prpenc capture (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video1 pad0: Sink <- "ipu1_ic_prpenc":1 [ENABLED] - entity 28: ipu1_ic_prpvf (2 pads, 2 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev4 pad0: Sink [fmt:AYUV8_1X32/640x480@1001/30000 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] <- "ipu1_ic_prp":2 [ENABLED] pad1: Source [fmt:AYUV8_1X32/640x480@1001/30000 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:lim-range] -> "ipu1_ic_prpvf capture":0 [ENABLED] - entity 31: ipu1_ic_prpvf capture (1 pad, 1 link) type Node subtype V4L flags 0 device node name /dev/video2 pad0: Sink <- "ipu1_ic_prpvf":1 [ENABLED] - entity 47: ipu1_csi1 (3 pads, 4 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev5 pad0: Sink [fmt:SRGGB10_1X10/1920x1080@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range crop.bounds:(0,0)/1920x1080 crop:(0,0)/640x480 compose.bounds:(0,0)/640x480 compose:(0,0)/640x480] <- "imx6-mipi-csi2":2 [ENABLED] pad1: Source [fmt:SRGGB10_1X10/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "ipu1_ic_prp":0 [ENABLED] -> "ipu1_vdic":0 [] pad2: Source [fmt:SRGGB10_1X10/640x480@1/30 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "ipu1_csi1 capture":0 [] [...] - entity 121: imx6-mipi-csi2 (5 pads, 5 links) type V4L2 subdev subtype Unknown flags 0 device node name /dev/v4l-subdev12 pad0: Sink [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] <- "imx219 9-0010":0 [ENABLED] pad1: Source [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "ipu1_csi0_mux":0 [] pad2: Source [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "ipu1_csi1":0 [ENABLED] pad3: Source [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "ipu2_csi0":0 [] pad4: Source [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "ipu2_csi1_mux":0 [] [...] - entity 135: imx219 9-0010 (1 pad, 1 link) type V4L2 subdev subtype Sensor flags 0 device node name /dev/v4l-subdev15 pad0: Source [fmt:SRGGB10_1X10/1920x1080 field:none colorspace:srgb xfer:srgb ycbcr:601 quantization:full-range] -> "imx6-mipi-csi2":0 [ENABLED] localhost ~ # dmesg -c [...] [ 51.941858] ipu1_ic_prpvf: pipeline start failed with -32 localhost ~ # I think EPIPE (-32) caused by link between pad1 ipu1_csi1 (fmt:SRGGB10_1X10/640x480@1/30) and pad0 ipu1_ic_prp (fmt:AYUV8_1X32/640x480@1/30) - format mismatch. But I don't know how fix this trouble. Theory, I also have RaspberryPI camera rev 1.3 with OmniVision OV5647 camera. Unfortunately, she did not work either. Anybody can help me? [1] https://git.linuxtv.org/media_tree.git/tree/drivers/media/i2c/imx219.c