From patchwork Wed Jun 22 11:52:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Machek X-Patchwork-Id: 34753 Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bFgpy-0008H6-OM; Wed, 22 Jun 2016 12:00:54 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-7) with esmtp id 1bFgpv-0005Px-20; Wed, 22 Jun 2016 14:00:53 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752435AbcFVMAD (ORCPT + 1 other); Wed, 22 Jun 2016 08:00:03 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:37929 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751543AbcFVMAA (ORCPT ); Wed, 22 Jun 2016 08:00:00 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id 57629823C5; Wed, 22 Jun 2016 13:52:19 +0200 (CEST) Date: Wed, 22 Jun 2016 13:52:18 +0200 From: Pavel Machek To: Laurent Pinchart Cc: Sakari Ailus , Hans Verkuil , pali.rohar@gmail.com, sre@kernel.org, kernel list , linux-arm-kernel , linux-omap@vger.kernel.org, tony@atomide.com, khilman@kernel.org, aaro.koskinen@iki.fi, ivo.g.dimitrov.75@gmail.com, patrikbachan@gmail.com, serge@hallyn.com, tuukkat76@gmail.com, mchehab@osg.samsung.com, linux-media@vger.kernel.org Subject: Re: camera application for testing (was Re: v4l subdevs without big device) Message-ID: <20160622115218.GA27606@amd> References: <20160428084546.GA9957@amd> <20160429221359.GA29297@amd> <20160501140831.GH26360@valkosipuli.retiisi.org.uk> <1500395.gQ70N9eqVS@avalon> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1500395.gQ70N9eqVS@avalon> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.6.22.115715 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, KNOWN_FREEWEB_URI 0.05, MSGID_ADDED_BY_MTA 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_2000_2999 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, INVALID_MSGID_NO_FQDN 0, IN_REP_TO 0, LEGITIMATE_NEGATE 0, MSG_THREAD 0, MULTIPLE_RCPTS_RND 0, REFERENCES 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __BOUNCE_CHALLENGE_SUBJ 0, __BOUNCE_NDR_SUBJ_EXEMPT 0, __CD 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __CT 0, __CT_TEXT_PLAIN 0, __FORWARDED_MSG 0, __FRAUD_MONEY_CURRENCY 0, __FRAUD_MONEY_CURRENCY_DOLLAR 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILING_LIST 0, __HTTPS_URI 0, __IN_REP_TO 0, __KNOWN_FREEWEB_URI2 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __MULTIPLE_URI_TEXT 0, __REFERENCES 0, __SANE_MSGID 0, __SUBJ_ALPHA_NEGATE 0, __TO_MALFORMED_2 0, __URI_IN_BODY 0, __URI_NS , __URI_WITH_PATH 0, __USER_AGENT 0' Hi! > > I think libv4l itself has algorithms to control at least some of these. It > > relies on the image data so the CPU time consumption will be high. > > > > AFAIR Laurent has also worked on implementing some algorithms that use the > > histogram and some of the statistics. Add him to cc list. > > http://git.ideasonboard.org/omap3-isp-live.git > > That's outdated and might not run or compile anymore. The code is > more of a Lets see, it compiles with this hack: index 6f3ffbe..935f41d 100644 Let me investigate some more. > proof of concept implementation, but it could be used as a starting point. > With an infinite amount of free time I'd love to work on an open-source > project for computational cameras, integrating it with libv4l. For the record, I pushed my code to https://gitlab.com/pavelm/fcam-dev Best regards, Pavel --- a/isp/v4l2.c +++ b/isp/v4l2.c @@ -292,7 +292,7 @@ struct v4l2_device *v4l2_open(const char *devname) * driver (>= v3.19) will set both CAPTURE and OUTPUT in the * capabilities field. */ - capabilities = cap.device_caps ? : cap.capabilities; + capabilities = /* cap.device_caps ? : */ cap.capabilities; if (capabilities & V4L2_CAP_VIDEO_CAPTURE) dev->type = V4L2_BUF_TYPE_VIDEO_CAPTURE; I can try to run it, but I guess I'll need kernel with camera support. pavel@n900:/my/omap3-isp-live$ LD_LIBRARY_PATH=isp ./snapshot media_open: Can't open media device /dev/media0 error: unable to open media device /dev/media0 Segmentation fault (core dumped) I tried again on kernel with camera: pavel@n900:/my/omap3-isp-live$ LD_LIBRARY_PATH=isp ./snapshot error: unable to locate sensor. Segmentation fault (core dumped) pavel@n900:/my/omap3-isp-live$ Here's the fix for coredump: diff --git a/isp/subdev.c b/isp/subdev.c index 9b36234..c74514e 100644 --- a/isp/subdev.c +++ b/isp/subdev.c @@ -75,6 +75,8 @@ int v4l2_subdev_open(struct media_entity *entity) void v4l2_subdev_close(struct media_entity *entity) { + if (!entity) + return; if (entity->fd == -1) return;