[{"id":31723,"web_url":"https://patchwork.libcamera.org/comment/31723/","msgid":"<01bb8690-e762-4841-af6a-1ae909cc39d9@ideasonboard.com>","date":"2024-10-13T15:50:40","subject":"Re: [PATCH] libcamera: software_isp: Clear frameContexts on Stop()","submitter":{"id":86,"url":"https://patchwork.libcamera.org/api/people/86/","name":"Umang Jain","email":"umang.jain@ideasonboard.com"},"content":"Hi Robert,\n\nOn 13/10/24 5:34 pm, Robert Mader wrote:\n> Like the hardware pipelines do. Otherwise we might hit the following\n> assert: \"Frame context for ... has been overwritten by ...\".\n\nWould you like to mention here briefly, on what use-case you hit this \nassertion.\n>\n> Fixes: 04d171e6 (\"libcamera: software_isp: Call Algorithm::queueRequest\")\n> Signed-off-by: Robert Mader <robert.mader@collabora.com>\n> ---\n>   src/ipa/simple/soft_simple.cpp | 1 +\n>   1 file changed, 1 insertion(+)\n>\n> diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp\n> index b28c7039..ac8847cb 100644\n> --- a/src/ipa/simple/soft_simple.cpp\n> +++ b/src/ipa/simple/soft_simple.cpp\n> @@ -245,6 +245,7 @@ int IPASoftSimple::start()\n>   \n>   void IPASoftSimple::stop()\n>   {\n> +  context_.frameContexts.clear();\n\nLooks good to me but additional hardware pipelines also reset/clear at \nconfigure() time, for e.g.\n\n        /* Clear the IPA context before the streaming session. */\n         context_.configuration = {};\n         context_.activeState = {};\n         context_.frameContexts.clear();\n\nWould it make sense to do it in Soft IPA as well?","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id DC682C32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 13 Oct 2024 15:50:47 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C52C96537B;\n\tSun, 13 Oct 2024 17:50:46 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id EB3066536C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 13 Oct 2024 17:50:44 +0200 (CEST)","from [IPV6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f] (unknown\n\t[IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2C0E44CE;\n\tSun, 13 Oct 2024 17:49:04 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"bVmET0x3\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1728834544;\n\tbh=R+ruttc0/fS3LAJsXNOkIafMIv8pxXsQ5e/fSmZpUck=;\n\th=Date:Subject:To:References:From:In-Reply-To:From;\n\tb=bVmET0x3z+l6G+aMEzVSeUina/VvO7ODA3aAhceAv9k3gl91XjnpVKRazyemtpL/0\n\tO3GNolWF/GqPaW31OT/hTdKgu6rj42bG8ClNOk0R2yU0k9adW1bklWjkaljQ44XS8h\n\t408++gbg2doURXpi9Dp0ZwIxteLQVoazmrg/1ASI=","Message-ID":"<01bb8690-e762-4841-af6a-1ae909cc39d9@ideasonboard.com>","Date":"Sun, 13 Oct 2024 21:20:40 +0530","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] libcamera: software_isp: Clear frameContexts on Stop()","To":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20241013120450.149837-1-robert.mader@collabora.com>","Content-Language":"en-US","From":"Umang Jain <umang.jain@ideasonboard.com>","In-Reply-To":"<20241013120450.149837-1-robert.mader@collabora.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":31725,"web_url":"https://patchwork.libcamera.org/comment/31725/","msgid":"<1710d6b9-996d-4114-8a06-0708436af7f8@collabora.com>","date":"2024-10-13T16:42:35","subject":"Re: [PATCH] libcamera: software_isp: Clear frameContexts on Stop()","submitter":{"id":140,"url":"https://patchwork.libcamera.org/api/people/140/","name":"Robert Mader","email":"robert.mader@collabora.com"},"content":"On 13.10.24 17:50, Umang Jain wrote:\n> Hi Robert,\n>\n> On 13/10/24 5:34 pm, Robert Mader wrote:\n>> Like the hardware pipelines do. Otherwise we might hit the following\n>> assert: \"Frame context for ... has been overwritten by ...\".\n>\n> Would you like to mention here briefly, on what use-case you hit this \n> assertion.\nCan do. Most easily this can be reproduced when switching back and forth \nbetween two cameras using the swISP, e.g. on a phone like the Pixel 3a.\n>>\n>> Fixes: 04d171e6 (\"libcamera: software_isp: Call \n>> Algorithm::queueRequest\")\n>> Signed-off-by: Robert Mader <robert.mader@collabora.com>\n>> ---\n>>   src/ipa/simple/soft_simple.cpp | 1 +\n>>   1 file changed, 1 insertion(+)\n>>\n>> diff --git a/src/ipa/simple/soft_simple.cpp \n>> b/src/ipa/simple/soft_simple.cpp\n>> index b28c7039..ac8847cb 100644\n>> --- a/src/ipa/simple/soft_simple.cpp\n>> +++ b/src/ipa/simple/soft_simple.cpp\n>> @@ -245,6 +245,7 @@ int IPASoftSimple::start()\n>>     void IPASoftSimple::stop()\n>>   {\n>> +  context_.frameContexts.clear();\n>\n> Looks good to me but additional hardware pipelines also reset/clear at \n> configure() time, for e.g.\n>\n>        /* Clear the IPA context before the streaming session. */\n>         context_.configuration = {};\n>         context_.activeState = {};\n>         context_.frameContexts.clear();\n>\n> Would it make sense to do it in Soft IPA as well?\nYeah, good point - looks like cleaning up configuration and activeState \nso far wasn't really required for gain, but will be for the blacklevel.","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 85D45C32F6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 13 Oct 2024 16:42:46 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5C2936537B;\n\tSun, 13 Oct 2024 18:42:45 +0200 (CEST)","from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com\n\t[136.143.188.112])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4D6866536C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 13 Oct 2024 18:42:43 +0200 (CEST)","by mx.zohomail.com with SMTPS id 1728837758248915.9180356115625;\n\tSun, 13 Oct 2024 09:42:38 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=collabora.com\n\theader.i=robert.mader@collabora.com header.b=\"ZENpvAJX\"; \n\tdkim-atps=neutral","ARC-Seal":"i=1; a=rsa-sha256; t=1728837759; cv=none; \n\td=zohomail.com; s=zohoarc; \n\tb=Je3CgZKkRy5R1UkwUhk4NbzGvXM8oNZd4v1xoorRgkrAywyUyV/LjeRjR2Zdo1QKlcV5ul+QNRLTG6xOy54+CHLPWuneU/r2+BkJsIHmCMTz/tcjvfFtRfC4jtNX7kHw1el+w2Lv4YP1v839/GLtJGM0WgddPoXw5bhaC3Sa/vM=","ARC-Message-Signature":"i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; \n\ts=zohoarc; t=1728837759;\n\th=Content-Type:Content-Transfer-Encoding:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To:Cc;\n\tbh=EhnQMjKGxwowizQ/INUa/+uMFYIT6STKpdbT8EG9t1E=; \n\tb=l+SMC+30iF2qhDCbhLnqMinVTzs//HSGLzEdVEk2UOa8t/nMbV1DLBXbDWVVtTfBEqiM/R3eRBILr80gbQlCtxWud2/yngwtorrrpX7mvomMiFcTkRseDt6Nt8IjvRkRNVLCv9NnwlC2WnpuoQRMiKDrOx84EbhqC4IGIpI+6QQ=","ARC-Authentication-Results":"i=1; mx.zohomail.com;\n\tdkim=pass  header.i=collabora.com;\n\tspf=pass  smtp.mailfrom=robert.mader@collabora.com;\n\tdmarc=pass header.from=<robert.mader@collabora.com>","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1728837759;\n\ts=zohomail; d=collabora.com; i=robert.mader@collabora.com;\n\th=Message-ID:Date:Date:MIME-Version:Subject:Subject:To:To:References:From:From:In-Reply-To:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To:Cc;\n\tbh=EhnQMjKGxwowizQ/INUa/+uMFYIT6STKpdbT8EG9t1E=;\n\tb=ZENpvAJXVCR6acYZ9rBruyKvk7OgEe1GTE2MtX2Xi3UlsBFmbSp9KWn78B6z8o7E\n\tTgmI5ag6SnvRcM6uJSjvb5vvYk6ViaMm3ykdPDlz/u/G6CLbLfOEoDH0Rcsp1rmx7iH\n\tSA7UylS8p4arRHdhOAY1o1Y3XO9aKcyaj+zpDB6Y=","Message-ID":"<1710d6b9-996d-4114-8a06-0708436af7f8@collabora.com>","Date":"Sun, 13 Oct 2024 18:42:35 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] libcamera: software_isp: Clear frameContexts on Stop()","To":"Umang Jain <umang.jain@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20241013120450.149837-1-robert.mader@collabora.com>\n\t<01bb8690-e762-4841-af6a-1ae909cc39d9@ideasonboard.com>","Content-Language":"en-US, de-DE","From":"Robert Mader <robert.mader@collabora.com>","In-Reply-To":"<01bb8690-e762-4841-af6a-1ae909cc39d9@ideasonboard.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]