From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no 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 D476FC433DB for ; Fri, 12 Mar 2021 14:53:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C8C564FB3 for ; Fri, 12 Mar 2021 14:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231749AbhCLOwp (ORCPT ); Fri, 12 Mar 2021 09:52:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231365AbhCLOwN (ORCPT ); Fri, 12 Mar 2021 09:52:13 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3532EC061761 for ; Fri, 12 Mar 2021 06:52:13 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id u4so46224434lfs.0 for ; Fri, 12 Mar 2021 06:52:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ragnatech-se.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to; bh=hlEw1Xot5u2w1fN40js7k7EDbK0sTmplIEEflk8aU0Q=; b=cnzCQ/jxU7qf2PPfmYs7LqkhRlFklYmkHiDvmnW4ujY9pSwva+neQVJIo4VEFZS5qB U2NIROtas0BzlHEl61CR2cSREwuZ7CPf6twCCEwnX9FYOHn2qv/HMrYiCcML82ISRvm5 v77/ayZdDB7Ue7t4MffqN3MC4iGoo7B/IG9950nG5qaI+Nu+FHs9vwi1hoD9S/EwUO+/ zI12OxGpryJPaYVbFKVS7j7DBBVuAD4Xhk2zCGbj+gAXLzHNITDmsEV2U4lnQ3xuMNcO aFpoKV6lpAyf4l+3RjtyEb81dF4kBjbN16WPAr47xxDTjiDRGrB2mrmh5cHZqvHF1PYU Btrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=hlEw1Xot5u2w1fN40js7k7EDbK0sTmplIEEflk8aU0Q=; b=czhj24/yRgdFYcZX2P+lkCHBv5bMdhw+1Wdk65C0wLsSgdI6140vaFkJljZcyoA42Q UW+HXQoyy0AIcC4V/cA3u3Rj/2p6dnqzVQmBkqHA+8skEbQ7/r9LZnoqBqGlovTidF+w pdUtFfS6Tu5CtVGkzdiiU/JzifChzc0lLF4ycUleJJs0GvTJ3oDU88nwKe7MYe8xVlEZ DQO8NDbyyemY+IwtYdPU9QLdAvq+A4i0kZMreLhgTGBvDIZjVgU5NFix7pNM9r69F74q FSxvo/G4UQ0nLoj/DeH2mRIXpVyZO4VWyBMpJJezu/1wMLN00GvjLmBg7hm8+D2X3ECu 5C1w== X-Gm-Message-State: AOAM532q9I2PLGuLxJcXOD5VmmWZ7+Lqm7j56reJGkCL5RPuh7LrbfwI Biv7sbsEersfxBxWeSyDyjRh/w== X-Google-Smtp-Source: ABdhPJwgDGL72PQtOx4n699k2fW6gFapgUeT52bAdk5MIng5cH5PL4LKjVVugwhaH7Mhrq0HZOr74A== X-Received: by 2002:a05:6512:31c9:: with SMTP id j9mr5706252lfe.185.1615560731604; Fri, 12 Mar 2021 06:52:11 -0800 (PST) Received: from localhost (h-209-203.A463.priv.bahnhof.se. [155.4.209.203]) by smtp.gmail.com with ESMTPSA id p21sm1742806lfu.227.2021.03.12.06.52.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Mar 2021 06:52:11 -0800 (PST) Date: Fri, 12 Mar 2021 15:52:10 +0100 From: Niklas =?iso-8859-1?Q?S=F6derlund?= To: Adam Ford Cc: Linux-Renesas , linux-media , mani@kernel.org Subject: Re: Renesas RZ/G2M + Sony IMX290 Camera questions/issues Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Hi Adam, There are many possibility's that result in an -EPIPE when validating formats and unfortunately V4L2 is not always as very helpfull when diagnosing the problem. What I usually do is to, 1. Inspect rvin_mc_validate_format() in drivers/media/platform/rcar-vin/rcar-dma.c This will give you a clear view of how the format between the CSI-2 and VIN is validated. 2. Increase the log level for drivers/media/v4l2-core/v4l2-subdev.c specially for v4l2_subdev_link_validate_default(). This will give you insight into all formats from the CSI-2 receiver towards the camera. By doing these two things you will see in the system log which part of the format validation that is missmatched. There is also a wiki page for capture using R-Car VIN that may be helpful for you. https://elinux.org/R-Car/Tests:rcar-vin On 2021-03-12 08:28:41 -0600, Adam Ford wrote: > I have an IMX290 camera connected to an RZ/G2M SoC via the 4-channel CSI. > > &csi40 { > status = "okay"; > > ports { > port@0 { > reg = <0>; > csi40_in: endpoint { > clock-lanes = <0>; > data-lanes = <1 2 3 4>; > remote-endpoint = <&imx290_ep>; > }; > }; > }; > }; > > On the I2C bus, I have > > imx290: camera-sensor@1a { > compatible = "sony,imx290"; > reg = <0x1a>; > reset-gpios = <&gpio_exp2 0 GPIO_ACTIVE_LOW>; > clocks = <&versaclock6_bb 1>; > clock-names = "xclk"; > clock-frequency = <37125000>; > vdddo-supply = <®_cam0_en0>; > vdda-supply = <®_cam0_en1>; > vddd-supply = <®_cam0_en0>; > > port { > imx290_ep: endpoint { > data-lanes = <1 2 3 4>; > link-frequencies = /bits/ 64 <148500000 222750000>; > remote-endpoint = <&csi40_in>; > }; > }; > }; > > I configure the pipeline with: > > media-ctl -l "'rcar_csi2 feaa0000.csi2':1 -> 'VIN0 output':0[1]" > > I also have tried configuring the video formats in several different ways > > media-ctl --set-v4l2 "'imx290 2-001a':0[fmt:SRGGB12_1X12/1920x1080 field:none]" > media-ctl --set-v4l2 "'rcar_csi2 > feaa0000.csi2':0[fmt:SRGGB12_1X12/1920x1080 field:none]" > media-ctl --set-v4l2 "'rcar_csi2 > feaa0000.csi2':1[fmt:SRGGB12_1X12/1920x1080 field:none]" > > or > > media-ctl --set-v4l2 "'rcar_csi2 > feaa0000.csi2':0[fmt:UYVY8_2X8/1920x1080 field:none]" > media-ctl --set-v4l2 "'rcar_csi2 > feaa0000.csi2':1[fmt:UYVY8_2X8/1920x1080 field:none]" > media-ctl --set-v4l2 "'imx290 2-001a':0[fmt:UYVY8_2X8/1920x1080 field:non > > but no matter what I do when I attempt to stream, I get a broken pipe, > even when I use fakesink as the target. > > root@beacon-rzg2h:~# GST_DEBUG=2 gst-launch-1.0 -v v4l2src > device=/dev/video1 ! video/x-raw,width=1920,height=1080 ! fakesink > Setting pipeline to PAUSED ... > Pipeline is live and does not need PREROLL ... > Setting pipeline to PLAYING ... > New clock: GstSystemClock > 0:00:03.727500390 501 0x10efd4f0 ERROR v4l2src > gstv4l2src.c:337:gst_v4l2src_get_input_size_info: Cropcap > fail, CROPCAP has not supported > /GstPipeline:pipeline0/GstV4l2Src:v4l2src0.GstPad:src: caps = > video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, > framerate=(fraction)100/1, interlace-mode=(s1 > /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:src: caps = > video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, > framerate=(fraction)100/1, interlace-m1 > /GstPipeline:pipeline0/GstFakeSink:fakesink0.GstPad:sink: caps = > video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, > framerate=(fraction)100/1, interlace-mode1 > /GstPipeline:pipeline0/GstCapsFilter:capsfilter0.GstPad:sink: caps = > video/x-raw, width=(int)1920, height=(int)1080, format=(string)YUY2, > framerate=(fraction)100/1, interlace-1 > 0:00:03.737388309 501 0x10efd4f0 WARN v4l2bufferpool > gstv4l2bufferpool.c:870:gst_v4l2_buffer_pool_start: > Uncertain or not enough buffers, enad > 0:00:03.740266641 501 0x10efd4f0 ERROR v4l2bufferpool > gstv4l2bufferpool.c:757:gst_v4l2_buffer_pool_streamon: > error with STREAMON 32 (Broken pi) > 0:00:03.740474842 501 0x10efd4f0 WARN v4l2bufferpool > gstv4l2bufferpool.c:1188:gst_v4l2_buffer_pool_poll: error: > poll error 1: Broken pipe (32) > 0:00:03.740693123 501 0x10efd4f0 WARN v4l2src > gstv4l2src.c:1020:gst_v4l2src_create: error: Failed to > allocate a buffer > 0:00:03.740791643 501 0x10efd4f0 WARN basesrc > gstbasesrc.c:2939:gst_base_src_loop: error: Internal data > stream error. > 0:00:03.740822843 501 0x10efd4f0 WARN basesrc > gstbasesrc.c:2939:gst_base_src_loop: error: streaming > stopped, reason error (-5) > ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Could > not read from resource. > Additional debug info: > ../../../git/sys/v4l2/gstv4l2bufferpool.c(1188): > gst_v4l2_buffer_pool_poll (): > /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: > poll error 1: Broken pipe (32) > Execution ended after 0:00:00.013644415 > Setting pipeline to PAUSED ... > Setting pipeline to READY ... > 0:00:03.741392965 501 0x10ec96c0 WARN v4l2bufferpool > gstv4l2bufferpool.c:1042:gst_v4l2_buffer_pool_stop: > some buffers are still outstanding > 0:00:03.741428005 501 0x10ec96c0 WARN bufferpool > gstbufferpool.c:567:gst_buffer_pool_set_active: > stop failed > 0:00:03.743868095 501 0x10ec96c0 ERROR v4l2bufferpool > gstv4l2bufferpool.c:757:gst_v4l2_buffer_pool_streamon: > error with STREAMON 32 (Broken pi) > 0:00:03.744090576 501 0x10ec96c0 WARN v4l2bufferpool > gstv4l2bufferpool.c:1042:gst_v4l2_buffer_pool_stop: > some buffers are still outstanding > 0:00:03.744123936 501 0x10ec96c0 WARN bufferpool > gstbufferpool.c:567:gst_buffer_pool_set_active: > stop failed > 0:00:03.744152376 501 0x10ec96c0 WARN v4l2bufferpool > gstv4l2bufferpool.c:1042:gst_v4l2_buffer_pool_stop: > some buffers are still outstanding > 0:00:03.744178296 501 0x10ec96c0 WARN bufferpool > gstbufferpool.c:567:gst_buffer_pool_set_active: > stop failed > Setting pipeline to NULL ... > Total time: 0.013650 seconds > Freeing pipeline ... > > > I was hoping someone might have a suggestion as to what I might be missing. > Ideally, I'd like to get two IMX290 cameras operational with one in > 4-lane mode and one in 2-lane mode. > > Might anyone have any suggestions? According to the media-ctl > --print-dot, the pipeline appears correct, but there is clearly > something I am missing. > > thanks for any suggestions, > > adam -- Regards, Niklas Söderlund