From patchwork Wed Jul 9 13:42:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 23776 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 E6526C3237 for ; Wed, 9 Jul 2025 13:42:34 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id E0A4D68EEC; Wed, 9 Jul 2025 15:42:33 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=igalia.com header.i=@igalia.com header.b="WmKCyDUH"; dkim-atps=neutral Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 135CD68E8A for ; Wed, 9 Jul 2025 15:42:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:MIME-Version:Message-ID:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=punazOBrIq+aJ16/QDhVlIQkysQXyIoWN+uPXYYnd8w=; b=WmKCyDUHpzNzxNlOLbqyOiGMVi X75gR+m8rk8hof2mnB0O3pqS670UqtCxsVdMfIVTKPVBNBGZa2zWYT6efq8QaLG4BUstlqZs3QmIO l6CwSiAS99TUwvLz2PMuv/4xUoJ+YF1dMb55Cy1+2S4F5sYdL9TYezhhiuvQUeuPwj7+hfD/dcMJu /69P0SwEaYQX5eHbNuud8ZJ4z18aMo5MYJCAFhueoY7ibulZ1hgnta+nBKb15vkS6rMuLV3WJwG9K ZN6ch2n5a4v1lNKGqm1Abz/qzsDgPHIWs2Z4QudjvxvXXowtx63wcsAMXeEbYgaeUoZozTdnw3o9F 5nqkdgYg==; Received: from [49.36.71.19] (helo=uajain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1uZV4A-00EUOy-P2; Wed, 09 Jul 2025 15:42:31 +0200 From: Umang Jain To: libcamera-devel@lists.libcamera.org Cc: Umang Jain Subject: [PATCH 0/2] libcamera: simple: Enable RPi's unicam+SoftISP Date: Wed, 9 Jul 2025 19:12:27 +0530 Message-ID: <20250709134229.135949-1-uajain@igalia.com> X-Mailer: git-send-email 2.50.0 MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Couple of patches to stream RPi+IMX219 setup with simple pipeline handler and SoftISP. Patch 1/2 fixes up bayer pattern changes on the sensor due to transforms being applied, which then configures the video node correctly. Patch 2/2 enables the unicam driver in simple pipeline handler with SoftISP. Demo/Test: ``` uajain1@uajain:~/libcamera$ LIBCAMERA_LOG_LEVELS=SimplePipeline:0 ./build-soft/src/apps/cam/cam -c1 -swidth=640,height=480 -C [11:19:01.616919614] [1594] INFO IPAManager ipa_manager.cpp:137 libcamera is not installed. Adding '/home/uajain1/libcamera/build-soft/src/ipa' to the IPA search path [11:19:01.632115916] [1594] INFO Camera camera_manager.cpp:326 libcamera v0.5.1+48-e019f6ba [11:19:01.703818520] [1595] DEBUG SimplePipeline simple.cpp:1712 Sensor found for /dev/media0 [11:19:01.705714926] [1595] DEBUG SimplePipeline simple.cpp:479 Found capture device unicam-image [11:19:01.726536697] [1595] DEBUG SimplePipeline simple.cpp:553 Found pipeline: [imx219 10-0010|0] -> [0|unicam-image] [11:19:01.886387895] [1595] INFO IPAProxy ipa_proxy.cpp:151 libcamera is not installed. Loading IPA configuration from '/home/uajain1/libcamera/src/ipa/simple/data' [11:19:01.886763989] [1595] WARN IPAProxy ipa_proxy.cpp:177 Configuration file 'imx219.yaml' not found for IPA module 'simple', falling back to 'uncalibrated.yaml' [11:19:01.889230603] [1595] INFO IPAProxy ipa_proxy.cpp:151 libcamera is not installed. Loading IPA configuration from '/home/uajain1/libcamera/src/ipa/simple/data' [11:19:01.902451281] [1595] DEBUG SimplePipeline simple.cpp:843 Link 'imx219 10-0010'[0] -> 'unicam-image'[0]: configured with format 640x480-SRGGB10_1X10 [11:19:01.903327531] [1595] DEBUG SimplePipeline simple.cpp:694 Adding configuration for 640x480 in pixel formats [ RG10, pRAA ] [11:19:01.905158676] [1595] DEBUG SimplePipeline simple.cpp:843 Link 'imx219 10-0010'[0] -> 'unicam-image'[0]: configured with format 1640x1232-SRGGB10_1X10 [11:19:01.905657322] [1595] DEBUG SimplePipeline simple.cpp:694 Adding configuration for 1640x1232 in pixel formats [ RG10, pRAA ] [11:19:01.907001593] [1595] DEBUG SimplePipeline simple.cpp:843 Link 'imx219 10-0010'[0] -> 'unicam-image'[0]: configured with format 1920x1080-SRGGB10_1X10 [11:19:01.907442843] [1595] DEBUG SimplePipeline simple.cpp:694 Adding configuration for 1920x1080 in pixel formats [ RG10, pRAA ] [11:19:01.908831801] [1595] DEBUG SimplePipeline simple.cpp:843 Link 'imx219 10-0010'[0] -> 'unicam-image'[0]: configured with format 3280x2464-SRGGB10_1X10 [11:19:01.909281020] [1595] DEBUG SimplePipeline simple.cpp:694 Adding configuration for 3280x2464 in pixel formats [ RG10, pRAA ] [11:19:01.910646228] [1595] DEBUG SimplePipeline simple.cpp:843 Link 'imx219 10-0010'[0] -> 'unicam-image'[0]: configured with format 640x480-SRGGB8_1X8 [11:19:01.911075239] [1595] DEBUG SimplePipeline simple.cpp:694 Adding configuration for 640x480 in pixel formats [ RGGB ] [11:19:01.912636072] [1595] DEBUG SimplePipeline simple.cpp:843 Link 'imx219 10-0010'[0] -> 'unicam-image'[0]: configured with format 1640x1232-SRGGB8_1X8 [11:19:01.913076697] [1595] DEBUG SimplePipeline simple.cpp:694 Adding configuration for 1640x1232 in pixel formats [ RGGB ] [11:19:01.914325968] [1595] DEBUG SimplePipeline simple.cpp:843 Link 'imx219 10-0010'[0] -> 'unicam-image'[0]: configured with format 1920x1080-SRGGB8_1X8 [11:19:01.914727687] [1595] DEBUG SimplePipeline simple.cpp:694 Adding configuration for 1920x1080 in pixel formats [ RGGB ] [11:19:01.915933520] [1595] DEBUG SimplePipeline simple.cpp:843 Link 'imx219 10-0010'[0] -> 'unicam-image'[0]: configured with format 3280x2464-SRGGB8_1X8 [11:19:01.916384458] [1595] DEBUG SimplePipeline simple.cpp:694 Adding configuration for 3280x2464 in pixel formats [ RGGB ] [11:19:01.922179510] [1594] DEBUG SimplePipeline simple.cpp:1122 Largest stream size is 3272x2464 [11:19:01.922443208] [1594] DEBUG SimplePipeline simple.cpp:1174 Picked 3280x2464-SRGGB10_1X10 -> 3280x2464-SRGGB10 for max stream size 3272x2464 [11:19:01.923014249] [1594] DEBUG SimplePipeline simple.cpp:1122 Largest stream size is 640x480 [11:19:01.923137843] [1594] DEBUG SimplePipeline simple.cpp:1174 Picked 640x480-SRGGB10_1X10 -> 640x480-SRGGB10 for max stream size 640x480 [11:19:01.923285239] [1594] DEBUG SimplePipeline simple.cpp:1223 Adjusting size from 640x480 to 636x480 Camera configuration adjusted Using camera /base/soc/i2c0mux/i2c@1/imx219@10 as cam0 [11:19:01.923578781] [1594] DEBUG SimplePipeline simple.cpp:1122 Largest stream size is 636x480 [11:19:01.923698312] [1594] DEBUG SimplePipeline simple.cpp:1174 Picked 640x480-SRGGB10_1X10 -> 640x480-SRGGB10 for max stream size 636x480 [11:19:01.923864874] [1594] INFO Camera camera.cpp:1205 configuring streams: (0) 636x480-ABGR8888/Unset [11:19:01.925430812] [1595] DEBUG SimplePipeline simple.cpp:843 Link 'imx219 10-0010'[0] -> 'unicam-image'[0]: configured with format 640x480-SBGGR10_1X10 [11:19:01.929379301] [1595] INFO IPASoft soft_simple.cpp:264 IPASoft: Exposure 4-1759, gain 1-10.6667 (0.0966667) cam0: Capture until user interrupts by SIGINT 40742.019745 (0.00 fps) cam0-stream0 seq: 000000 bytesused: 1221120 40742.053071 (30.01 fps) cam0-stream0 seq: 000001 bytesused: 1221120 40742.086400 (30.00 fps) cam0-stream0 seq: 000002 bytesused: 1221120 40742.186379 (10.00 fps) cam0-stream0 seq: 000005 bytesused: 1221120 40742.319686 (7.50 fps) cam0-stream0 seq: 000009 bytesused: 1221120 40742.419668 (10.00 fps) cam0-stream0 seq: 000012 bytesused: 1221120 40742.552976 (7.50 fps) cam0-stream0 seq: 000016 bytesused: 1221120 40742.652957 (10.00 fps) cam0-stream0 seq: 000019 bytesused: 1221120 40742.786264 (7.50 fps) cam0-stream0 seq: 000023 bytesused: 1221120 40742.886247 (10.00 fps) cam0-stream0 seq: 000026 bytesused: 1221120 40743.019553 (7.50 fps) cam0-stream0 seq: 000030 bytesused: 1221120 40743.119535 (10.00 fps) cam0-stream0 seq: 000033 bytesused: 1221120 40743.252843 (7.50 fps) cam0-stream0 seq: 000037 bytesused: 1221120 40743.352824 (10.00 fps) cam0-stream0 seq: 000040 bytesused: 1221120 40743.486131 (7.50 fps) cam0-stream0 seq: 000044 bytesused: 1221120 40743.586113 (10.00 fps) cam0-stream0 seq: 000047 bytesused: 1221120 40743.719421 (7.50 fps) cam0-stream0 seq: 000051 bytesused: 1221120 40743.819402 (10.00 fps) cam0-stream0 seq: 000054 bytesused: 1221120 ``` Question: Unicam does support packed and unpacked CSI2 pixel formats. Would it be in interest for simple pipeline handler to support the packed formats ? or is it something specific to RPi (and we shouldn't include that in the generic simple pipeline handler) ? Umang Jain (2): libcamera: simple: Detect Bayer pattern change during configure() libcamera: simple: Support RPi's unicam CSI-2 receiver src/libcamera/pipeline/simple/simple.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)