Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp658230ima; Wed, 24 Oct 2018 07:18:08 -0700 (PDT) X-Google-Smtp-Source: AJdET5cyWTOIwGforoq4xbLXbh+HwzBarA1DQEtpmOk9pEdEQVRn1dF7S/pukGi+Tf/aeqZbOz01 X-Received: by 2002:a62:a93:: with SMTP id 19-v6mr2788058pfk.121.1540390688102; Wed, 24 Oct 2018 07:18:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540390688; cv=none; d=google.com; s=arc-20160816; b=H/KamIwXeTDMAABBSIujN5G2ra87F2Ia7975mxhJJOCCWiwoaJTYQ3RjFfuyqxdMoC GtGKtm5fnPBUDWv4cFzst3vT3sFGAWX2LPGRu1t9neHBO8Alr8PDZ6YaAQdw9VIPQjcC aB1JZim6wsSkTDg9hAtGLOOvS95bBFr/JQaN8wRQMqN62pl4VDIq1l+uuyfWqcaO2uuk GtwCZSLVV0asgNcO+/TsLvdmyqknm+qSM4bldM6x6EI+U62qYAiQmnz9sn1NUAKBL3Md pU9DDiyapbNuWTXyq/Y2VYfoRV+B7In7IUst3BqdGo4numLJBv9KFmoDNnaaQci6jDgj JETQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SU8HEqkQxqBlgg1Rw1a2f9rM0UwRZkLlkQ2yHtl4QG8=; b=ibW0XulR7vrwY6D9eHuYQUZRVyfFROek2tV1H1Wz7pwpxXdndm2GP7EePe1EAMIGXA tl6zZeXm9eaUpPly+4DWDsvFjUH46b0L294hukwshXgeYK9frXdAUGR8jWl3+O+Pzvqx DCg66/krh2BfCEsIljR877Eml+rRrKTQvy9VU35TuA6X7oIXTJk992A93oUlD7Hzb8/f ApVn2PqHi/IIzcVUxnVwOj82ORQcb3Nqbs9nTfqC20j9T367AaDmtUvGO+pqHOkGDI2R c9cqYqS3/VuuhHtlVCMC5p/1sC7vxAf+kydeXTb22Eup8UXQELDSIsE53RtfJBf3eptE GzKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G57+umnF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7-v6si3058908pgn.441.2018.10.24.07.17.51; Wed, 24 Oct 2018 07:18:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G57+umnF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726839AbeJXWpg (ORCPT + 99 others); Wed, 24 Oct 2018 18:45:36 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:40464 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726497AbeJXWpg (ORCPT ); Wed, 24 Oct 2018 18:45:36 -0400 Received: by mail-ed1-f66.google.com with SMTP id r1-v6so5200271edd.7; Wed, 24 Oct 2018 07:17:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SU8HEqkQxqBlgg1Rw1a2f9rM0UwRZkLlkQ2yHtl4QG8=; b=G57+umnF6Shl/a4vNsd4zRg+tFNza0QVeTZsvfRN1GO3dCW2C2yjSBNclVAJzQVTMZ +c0EhVdhC1N0cW6DI1bgQLdW+HKMaw7ea+GG5+uz24h/535U9RZzYF2pTuluQgQB5/XI QnhLIhqBNsRuF06ZJ2P4OwukJMJaJ3GyK7XOMCbTqPUZM59+MImoXHBBKjI/fgDj4fSE /z3Is6UbMe9oMA6hcETxm8ozGOwa6/EbPHJt088C4khF9vtxIzzxHVSTOL20BXnJuEhg 8WOSjFjsrLVI8f2lAJ85pkuMHtjZfc1zWFdBWEPOSeUZCo2J86sUj0V+lEFQrx9vLDix ClKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SU8HEqkQxqBlgg1Rw1a2f9rM0UwRZkLlkQ2yHtl4QG8=; b=NU9UwiYcBZ0sSDR+xQGN43h8yaZv+tv8SX5xrTDRzrTTuolpozPIMjfFAHcp0Ksn38 xN+vxBRGjg35Vxuj4RpxuKuARGYN3S/rxulrKFJ7AZEbmIz1GlSmuQtYmKCmlxzPVS3L K0su4d3MkLMOdbRt0QZHoNUbTk4YKOSt6IH6RmTMOvgO+b92aBkpRLffmVq1ta60Du4R IKK2t68yjXecqCOGe1f36c3fSExXNswHvvZT8BLUCKwit1XxOR5XLx9ZEgRLPgAAY4eC w66zc+QFhkchvQcwP1I+S1PJyj6uVIl4wN8MP67mPnibViC0k5Dbi7yrGvpi4Av+oLz1 iZQA== X-Gm-Message-State: AGRZ1gJjnD6HoGZ/ZA94bbfOfbSqt6W4PtLqAJ9m/+0Q0qy467FbTeQW NSLFKOiwtiOTx3EFQlrBIiQ5SQ5MXM40Qs76JTE= X-Received: by 2002:a17:906:6a13:: with SMTP id o19-v6mr1454020ejr.99.1540390636613; Wed, 24 Oct 2018 07:17:16 -0700 (PDT) MIME-Version: 1.0 References: <20181022113306.GB2867@w540> <20181023230259.GA3766@w540> <20181024140820.GB3766@w540> In-Reply-To: <20181024140820.GB3766@w540> From: Adam Ford Date: Wed, 24 Oct 2018 09:17:04 -0500 Message-ID: Subject: Re: i.MX6 MIPI-CSI2 OV5640 Camera testing on Mainline Linux To: jacopo@jmondi.org Cc: steve_longerbeam@mentor.com, Fabio Estevam , Jagan Teki , p.zabel@pengutronix.de, Fabio Estevam , gstreamer-devel@lists.freedesktop.org, linux-media@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 24, 2018 at 9:08 AM jacopo mondi wrote: > > Hi Adam, > > On Wed, Oct 24, 2018 at 08:53:41AM -0500, Adam Ford wrote: > > On Tue, Oct 23, 2018 at 6:03 PM jacopo mondi wrote: > > > > > > Hi Adam, > > > > > > On Tue, Oct 23, 2018 at 12:54:12PM -0500, Adam Ford wrote: > > > > On Tue, Oct 23, 2018 at 12:39 PM Steve Longerbeam > > > > wrote: > > > > > > > > > > > > > > > On 10/23/18 10:34 AM, Adam Ford wrote: > > > > > > On Tue, Oct 23, 2018 at 11:36 AM Steve Longerbeam > > > > > > wrote: > > > > > >> Hi Adam, > > > > > >> > > > > > >> On 10/23/18 8:19 AM, Adam Ford wrote: > > > > > >>> On Mon, Oct 22, 2018 at 7:40 AM Fabio Estevam wrote: > > > > > >>>> Hi Adam, > > > > > >>>> > > > > > >>>> On Mon, Oct 22, 2018 at 9:37 AM Adam Ford wrote: > > > > > >>>> > > > > > >>>>> Thank you! This tutorial web site is exactly what I need. The > > > > > >>>>> documentation page in Linux touched on the media-ctl links, but it > > > > > >>>>> didn't explain the syntax or the mapping. This graphical > > > > > >>>>> interpretation really helps it make more sense. > > > > > >>>> Is capturing working well on your i.MX6 board now? > > > > > >>> Fabio, > > > > > >>> > > > > > >>> Unfortunately, no. I built the rootfs based on Jagan's instructions > > > > > >>> at https://openedev.amarulasolutions.com/display/ODWIKI/i.CoreM6+1.5 > > > > > >>> > > > > > >>> I tried building both the 4.15-RC6 kernel, a 4.19 kernel and a 4.14 LTS kernel. > > > > > >>> > > > > > >>> Using the suggested method of generating the graphical display of the > > > > > >>> pipeline options, I am able to enable various pipeline options > > > > > >>> connecting different /dev/videoX options tot he camera. I have tried > > > > > >>> both the suggested method above as well as the instructions found in > > > > > >>> Documentation/media/v4l-drivers/imx.rst for their respective kernels, > > > > > >>> and I have tried multiple options to capture through > > > > > >>> ipu1_csi1_capture, ipu2_csi1_capture, and ip1_ic_prepenc capture, and > > > > > >>> all yield a broken pipe. > > > > > >>> > > > > > >>> libv4l2: error turning on stream: Broken pipe > > > > > >>> ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could > > > > > >>> not read from resource. > > > > > >>> Additional debug info: > > > > > >>> gstv4l2bufferpool.c(1064): gst_v4l2_buffer_pool_poll (): > > > > > >>> /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: > > > > > >>> poll error 1: Broken pipe (32) > > > > > >>> > > > > > >>> I can hear the camera click when I start gstreamer and click again > > > > > >>> when it stops trying to stream. > > > > > >>> > > > > > >>> dmesg indicates a broken pipe as well.. > > > > > >>> > > > > > >>> [ 2419.851502] ipu2_csi1: pipeline start failed with -32 > > > > > >>> > > > > > >>> might you have any suggestions? > > > > > >> > > > > > >> This -EPIPE error might mean you have a mis-match of resolution, pixel > > > > > >> format, or field type between one of the source->sink pad links. You can > > > > > >> find out which pads have a mis-match by enabling dynamic debug in the > > > > > >> kernel function __media_pipeline_start. > > > > > > Following Jagan's suggestion, I tried to make sure all the resolution > > > > > > and pixel formats were set the same between each source and sink. > > > > > > > > > > > > media-ctl --set-v4l2 "'ov5640 2-0010':0[fmt:UYVY2X8/640x480 > > > > > > field:none]" > > > > > > media-ctl --set-v4l2 "'imx6-mipi-csi2':1[fmt:UYVY2X8/640x480 > > > > > > field:none]" > > > > > > media-ctl --set-v4l2 "'ipu1_csi0_mux':2[fmt:UYVY2X8/640x480 > > > > > > field:none]" > > > > > > media-ctl --set-v4l2 "'ipu1_csi0':2[fmt:AYUV32/640x480 field:none]" > > > > > > > > > > > >> Also make sure you are attempting to stream from the correct /dev/videoN. > > > > > > I have graphically plotted the pipeline using media-ctl --print-dot > > > > > > and I can see the proper video is routed, but your dynamic debug > > > > > > suggestion yielded something: > > > > > > > > > > > > imx-media capture-subsystem: link validation failed for 'ov5640 > > > > > > 2-0010':0 -> 'imx6-mipi-csi2':0, error -32 > > > > > > > > > > > > > > > It's what I expected, you have a format mismatch between those pads. > > > > > > > > Is the mismatch something I am doing wrong with: > > > > > > > > media-ctl --set-v4l2 "'ov5640 2-0010':0[fmt:UYVY2X8/640x480 field:none]" > > > > media-ctl --set-v4l2 "'imx6-mipi-csi2':2[fmt:UYVY2X8/640x480 field:none]" > > > > > > > > > > Could you try to verify the actual format configured on the sensor? > > > (media-ctl --get-v4l2 "'ov5640 2-0010':0"). > > > > > > Depending on the driver version you are running, you might be affected > > > by different regressions. > > > > > > > or is there something else I need to do? I just used Jagan's suggestion. > > > > > > I suggest you to update the driver version to the last one available > > > in the media-tree master, or at least try to backport the following > > > commit: > > > fb98e29 media: ov5640: fix mode change regression > > > > > > If it turns out the format and mode configured on the sensor do not > > > match the one you want. > > > > > > Thanks > > > > That got me past one hurdle. Wtih your help, I was able to confirm > > the mis-match of the modes between the sensor and the csi1 source. I > > applied the patch as you suggested, but now I get a new error. > > > > [ 295.294370] imx6-mipi-csi2: LP-11 timeout, phy_state = 0x00000230 > > [ 295.300681] ipu1_csi0: pipeline start failed with -110 > > > > > > Here you go: > bad1774 media: ov5640: Fix timings setup code > aa4bb8b media: ov5640: Re-work MIPI startup sequence > > Please update your ov5640 driver to the last version available on > linux-media master repository. There have been a looot of developments > and fixes recently (and I would be happy to know if they have helped > you) > > > I am going to go through various patches to the imx framework and > > ov5640 driver to see if I can find the solution, but if you have > > suggestions as to which fixes are appropriate, I'll test those. If I > > Just get what's on linux-media master tree. > > > can get this working, would it make sense for me to submit some > > requests with kernel-stable to backport some of these commits to 4.19 > > and if applicable, 4.14 too? > > Sure it will (even if I'm not familiar with the procedure used to tag > patches to be applied to stable. I would just apply everything that's > on the latest media tree) > > Keep us posted! Thank you everyone for your help. I pulled the linux-media master and built it, and it works perfectly from what I can tell. I'll go through the patch list and see what's back-port-able to 4.19. I noticed that just copying the ov5640.c driver breaks the build on 4.19.0, so I'm going to focus on just patches labeled 'fix' on both the ov5640 for now. I appreciate everyone's help, and Iearned a lot about the v4l system in the process. adam > j > > > > adam > > > j > > > > > > > adam > > > > > > > > > > Steve > > > > > > > > > > > > > > > > > > > > > > I am assume this means the interface between the camera and the csi2 > > > > > > isn't working. I am going to double check the power rails and the > > > > > > clocks. i can hear it click when activated and deactivated, so > > > > > > something is happening. > > > > > > > > > > > > adam > > > > > > > > > > > >> Steve > > > > > >>