[{"id":25711,"web_url":"https://patchwork.libcamera.org/comment/25711/","msgid":"<CAHW6GYKgmWtoNbZ07VevExNYkMqCHxmD3SLQoSdUvSjQeZQbnQ@mail.gmail.com>","date":"2022-11-01T12:25:30","subject":"Re: [libcamera-devel] [PATCH v1 09/10] pipeline: raspberrypi: Add\n\tminimal memory usage config file","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Naush\n\nThanks for the patch!\n\nOn Fri, 14 Oct 2022 at 14:19, Naushir Patuck via libcamera-devel\n<libcamera-devel@lists.libcamera.org> wrote:\n>\n> Add a platform configuration file that allocates the least amount of frame\n> buffer memory possible. This configuration does come with the following\n> compromises:\n>\n> - Startup frame drops are disabled, so the first few frames will not have\n> fully converged AE/AWB/ALSC applied.\n>\n> - Applications must provide ISP Output0 and Unicam Image (if a RAW stream is\n> configured) buffers in requests.\n>\n> - Only 1 Unicam Image buffer will be allocated if a RAW stream is not\n> configured, causing the framerate to be effectively halved.\n\nI wonder how useful this really is with a limitation like this? On the\nother hand, I could imagine it might be more useful in conjunction\nwith, for example, stills capture rather than preview or video. Making\nit camera mode (or better, use-case) specific sounds like a whole new\ncan of worms. Perhaps better not go there right now!\n\nIs there any benefit in a minimal-but-not-framerate-halving version?\nThough we could easily end up with a plethora of configuration files\nthat we would really want to be testing all the time.\n\nAnyway, I shall sit back and wait for the \"I pointed my Pi Zero at\nthis config file so that Picamera2 would work with my\nzillion-megapixel sensor\" bugs  :)\n\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n\nThanks!\nDavid\n\n>\n> To use the configuration on the Raspberry Pi platform, invoke the application\n> with the following prepended to the command line:\n>\n> LIBCAMERA_RPI_CONFIG_FILE=/usr/local/share/libcamera/pipeline/raspberrypi/minimal_memory.json\n>\n> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>\n> ---\n>  .../pipeline/raspberrypi/data/meson.build     |  1 +\n>  .../raspberrypi/data/minimal_mem.json         | 28 +++++++++++++++++++\n>  2 files changed, 29 insertions(+)\n>  create mode 100644 src/libcamera/pipeline/raspberrypi/data/minimal_mem.json\n>\n> diff --git a/src/libcamera/pipeline/raspberrypi/data/meson.build b/src/libcamera/pipeline/raspberrypi/data/meson.build\n> index 232f8b43c5fd..0592fc53877d 100644\n> --- a/src/libcamera/pipeline/raspberrypi/data/meson.build\n> +++ b/src/libcamera/pipeline/raspberrypi/data/meson.build\n> @@ -2,6 +2,7 @@\n>\n>  conf_files = files([\n>      'default.json',\n> +    'minimal_mem.json',\n>  ])\n>\n>  install_data(conf_files,\n> diff --git a/src/libcamera/pipeline/raspberrypi/data/minimal_mem.json b/src/libcamera/pipeline/raspberrypi/data/minimal_mem.json\n> new file mode 100644\n> index 000000000000..fb306aa08f94\n> --- /dev/null\n> +++ b/src/libcamera/pipeline/raspberrypi/data/minimal_mem.json\n> @@ -0,0 +1,28 @@\n> +{\n> +        \"version\": 1.0,\n> +        \"target\": \"bcm2835\",\n> +\n> +        \"pipeline_handler\":\n> +        {\n> +                # The minimum number of internal buffers to be allocated for Unicam.\n> +                # This value must less than or equal to min_total_unicam_buffers.\n> +                \"min_unicam_buffers\": 0,\n> +\n> +                # The minimum total (internal + external) buffer count used for Unicam.\n> +                # The number of internal buffers allocated for Unicam is given by:\n> +                # internal buffer count = max(min_unicam_buffers,\n> +                #                             min_total_unicam_buffers - external buffer count)\n> +                \"min_total_unicam_buffers\": 1,\n> +\n> +                # The number of internal buffers used for ISP Output0.\n> +                \"num_output0_buffers\": 0,\n> +\n> +                # Override any request from the IPA to drop a number of startup frames.\n> +                \"disable_startup_frame_drops\": true,\n> +\n> +                # Always process a pending request with the last captured sensor frame.\n> +                # Note that this might lead to avoidable frame drops during periods\n> +                # of transient heavey CPU loading.\n> +                \"return_newest_frames\": false\n> +        }\n> +}\n> --\n> 2.25.1\n>","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 C9F92BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  1 Nov 2022 12:25:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3692A63031;\n\tTue,  1 Nov 2022 13:25:44 +0100 (CET)","from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com\n\t[IPv6:2607:f8b0:4864:20::102e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 44B7663009\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  1 Nov 2022 13:25:42 +0100 (CET)","by mail-pj1-x102e.google.com with SMTP id\n\tl22-20020a17090a3f1600b00212fbbcfb78so18639315pjc.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 01 Nov 2022 05:25:42 -0700 (PDT)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1667305544;\n\tbh=h0zNsdwvr+Zlm5tzk83ZvR6hRAIa4oTRBh0rVqMrUdU=;\n\th=References:In-Reply-To:Date:To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=zFoSlFdwCEzXL0rqfr6iuLPRPcOXY06xQF5UJyD49BiLzOVOupOMiH4VytS5Yo9RX\n\t022/+KCGHYyUDOfnkMziIfEduhuVFd9FTsqO8Uuw1r+jS0jKcvZ+0AmcYWRSGx6oHX\n\tribH5uww0x57w6wNxYL31ZlXDyD7+wmQEuqu8Wf6CCciMrWMADlh64s7MlWQH8ozdL\n\thYi9hC8Kw2snU9E7W7HQFrpWXDlNFeR1g458J0mvMcbRGtm5c2059b+xAydJgQ8ux4\n\t7ZR5bA6U7bS8OLIVc4njT2tKtYaPeZKXXNeL2nksFWd7WI9/YhpNXb2c7/I1IGHpTl\n\twJWKwIC5eKmWA==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:from:to:cc:subject:date:message-id:reply-to;\n\tbh=bL43aBEgby5PyMj73tLgmZyfHC5VXTOv/YAsiFYn2Sc=;\n\tb=MZ7iJzuIKZiah+cpWkfwsJ21J+AZjKrkAIWF5bLy6fpSG5mxsoT3kym+349VRryy/e\n\tI4nI69BqvyuVFW+D95UNOKChy9siZIgIYMy+SfzInRYvCYywR9tjS2890qeZrrD8OAgJ\n\tMlTWB/9Fw0Qcs7JG45Nb0MRqxQ91SYGdt5vWoE03M6zp6vITd+RtBMvfl7B0J+NQOmHe\n\tY+1VWXPfsvDqKt2Bhcg3bXJ6bnFITRsE1HPOPwC2mqn08rOMU4QQ3lOTHhjGIP9ywHLq\n\tH5MWlNfp8O8+Gw2+sGTwcT0m0rZY14PuLaip6LAV4Feopb/p6lNdCUOQErWBGmOpUCWf\n\tXVJg=="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"MZ7iJzuI\"; dkim-atps=neutral","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=cc:to:subject:message-id:date:from:in-reply-to:references\n\t:mime-version:x-gm-message-state:from:to:cc:subject:date:message-id\n\t:reply-to;\n\tbh=bL43aBEgby5PyMj73tLgmZyfHC5VXTOv/YAsiFYn2Sc=;\n\tb=vl2dq7SDSFlSeTfbkme1Svw6jIiw2SdPfQn11/PKcTKobbMnfN6MHyvixC4z+lp8aL\n\toomy824n1MxCs87uEosV7IYXe6YBU3SzUCXMj4Nvg6AqxWClTi+3eP3HIknKe/5fFs14\n\tcIYuQ7oFT2Iv73Z5qkLMqbOtRUujmQ9na/cFtyWjT/MGeKKF9TxVGZg/8tTNa2fUBnJf\n\tB2bxM/pBPogvqUZJJygkUmoCGgJFcK6Lx5NOgnfYAmlwtT+E1fK6kJnmMhoxTUd4tSBh\n\tINaSmNknymPqTBrNkPBKxK5Dcdy+uE0GKDNwlqaBV3m3zA71mtAUM4oFQ921DZe+Uvip\n\tLixA==","X-Gm-Message-State":"ACrzQf2Enabl9iOPbtWGb2Ayqs8AwpVpaZOxiMflGbJ+lRqGk+SDyt/5\n\tLoLSRnqugdLLViApR8N6V0vPtnXfsVBMyunVLw+rXrp285U=","X-Google-Smtp-Source":"AMsMyM41/Xf9iUpGhiQm0KKUUXsKjgW4ILdrIRNrztWmnHFHaNsbK7IQJ3nCRvxd35bXmetbQqPSXZAOHHOi24CK1TY=","X-Received":"by 2002:a17:902:720a:b0:181:150c:fcc4 with SMTP id\n\tba10-20020a170902720a00b00181150cfcc4mr19701936plb.109.1667305540764;\n\tTue, 01 Nov 2022 05:25:40 -0700 (PDT)","MIME-Version":"1.0","References":"<20221014131846.27169-1-naush@raspberrypi.com>\n\t<20221014131846.27169-10-naush@raspberrypi.com>","In-Reply-To":"<20221014131846.27169-10-naush@raspberrypi.com>","Date":"Tue, 1 Nov 2022 12:25:30 +0000","Message-ID":"<CAHW6GYKgmWtoNbZ07VevExNYkMqCHxmD3SLQoSdUvSjQeZQbnQ@mail.gmail.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH v1 09/10] pipeline: raspberrypi: Add\n\tminimal memory usage config file","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>","From":"David Plowman via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"David Plowman <david.plowman@raspberrypi.com>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]