From patchwork Mon Jul 4 22:15:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 16536 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 2F729BE173 for ; Mon, 4 Jul 2022 22:15:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8500A6054A; Tue, 5 Jul 2022 00:15:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1656972951; bh=AiLgy3FWDkkvFYKf1DKAA4MGUu/C56sZ8M9xmjzdFWs=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=nHuz989UA+b5btiY3Vxp9/q5V4jGg29AAOmUuTuItDg8ThUfOdi7kofC58xPN9iPW oimz2t/FrxJe/IueKmyt2kkxLJgQ3e8DubrXCJnvIbq5GN7Q5s5lo0oFXfYiWWxIPl l0oWs7M4x7dDBBG9IWvWJMDDuM1jtVQHKu/zkf/j9+WixsyMX8rvCTf6SyMQIGxjK3 8XVCUroqdCUvmmoa6m4er+tdN2Jx0oDhcS2wyRTAjQ0uHmmpxCTrOLwO4Qp5pd2nbd /AAwDvw9DIPeuwlNaQput4x2Mlbvdj0x6y1iQM/NcttL8x4eOO1pMUbXqXnDhtz7d+ DzN68iLn4s4cA== Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2BC856054A for ; Tue, 5 Jul 2022 00:15:50 +0200 (CEST) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id BE4771C0BFA; Tue, 5 Jul 2022 00:15:49 +0200 (CEST) Date: Tue, 5 Jul 2022 00:15:49 +0200 To: Laurent Pinchart Message-ID: <20220704221548.GB8002@amd> References: <20220701211120.GB18840@duo.ucw.cz> <279b87a6-2209-e4d1-6342-12253258b59f@riseup.net> <9a63e90b-5da6-2915-462e-70b2f61d1867@riseup.net> <20220703155800.GA11658@amd> <70821a87-8ea5-1583-daa3-ce1531977ce7@riseup.net> <20220704161526.GA23964@amd> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Subject: [libcamera-devel] PinePhone needs S_FRAME_INTERVAL X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Pavel Machek via libcamera-devel From: Pavel Machek Reply-To: Pavel Machek Cc: martijn@brixit.nl, libcamera-devel@lists.libcamera.org, jozef@mlich.cz Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Hi! It looks I solved another mystery: Top resolution was not available, and depending on order of commands, sometimes 1280x720 was not available, either. So I took a look into megapixels, and mystery solved -- libcamera is not setting frame intervals at all. AFAICT that needs to happen. PinePhone needs lower fps for top resolution, but an use high fps for lower resolutions... This is obviosly a hack, but we need something like that. Best regards, Pavel commit 66616c78007c08fcd3fde66888c2210a392b184e Author: Pavel Machek Date: Mon Jul 4 23:54:22 2022 +0200 S_FRAME_INTERVAL is needed, or things don't work. index fba90e20..0ee6ac30 100644 --- a/src/libcamera/v4l2_subdevice.cpp +++ b/src/libcamera/v4l2_subdevice.cpp @@ -452,6 +452,21 @@ int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format, Whence whence) { struct v4l2_subdev_format subdevFmt = {}; + + { + struct v4l2_subdev_frame_interval interval = {}; + interval.pad = 0; + interval.interval.numerator = 1; + interval.interval.denominator = 10; + if (int ret = ioctl(VIDIOC_SUBDEV_S_FRAME_INTERVAL, + &interval) == -1) { + LOG(V4L2, Error) + << "Unable to set frame interval on pad " << pad + << ": " << strerror(-ret); + return ret; + } + + } subdevFmt.which = whence == ActiveFormat ? V4L2_SUBDEV_FORMAT_ACTIVE : V4L2_SUBDEV_FORMAT_TRY; subdevFmt.pad = pad;