[{"id":35639,"web_url":"https://patchwork.libcamera.org/comment/35639/","msgid":"<175654926091.2556366.14396151106906960895@ping.linuxembedded.co.uk>","date":"2025-08-30T10:21:00","subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Quoting Matthias Fend (2025-08-28 14:09:38)\n> Define a set of controls to control camera flash devices.\n> \n> Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n> ---\n>  src/libcamera/control_ids_draft.yaml | 69 ++++++++++++++++++++++++++++++++++++\n>  1 file changed, 69 insertions(+)\n> \n> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n> index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..c10b774bfd59b26980475bb9706fffa6961b3b1b 100644\n> --- a/src/libcamera/control_ids_draft.yaml\n> +++ b/src/libcamera/control_ids_draft.yaml\n\nPlease target real controls not draft controls. We should really try to\nremove this draft file...\n\n\n> @@ -294,4 +294,73 @@ controls:\n>          Currently identical to ANDROID_STATISTICS_FACE_IDS.\n>        size: [n]\n>  \n> +  - FlashMode:\n> +      type: int32_t\n> +      direction: inout\n> +      description: |\n> +        Flash mode.\n> +      enum:\n> +        - name: FlashModeNone\n> +          value: 0\n> +          description: |\n> +            None.\n> +        - name: FlashModeFlash\n> +          value: 1\n> +          description: |\n> +            Flash.\n> +        - name: FlashModeTorch\n> +          value: 2\n> +          description: |\n> +            Torch.\n\nAnd I think we could expand all of those descriptions somehow.\n\n> +\n> +  - FlashIntensity:\n> +      type: int32_t\n> +      direction: inout\n> +      description: |\n> +        Flash intensity in mA.\n> +\n> +  - FlashTimeout:\n> +      type: int32_t\n> +      direction: inout\n> +      description: |\n> +        Flash timeout in us.\n> +\n> +  - FlashStrobeSource:\n> +      type: int32_t\n> +      direction: inout\n> +      description: |\n> +        Flash mode.\n\nFlash mode ? Or Flash source?\n\nWith all the descriptions expanded, these can target mainline controls.\nNo need to go to draft.\n\nWe'll need to convey relationships in the documentation too.. like\nperhaps it could be documented how FlashTimeout I suspect interacts only\nwith FlashStrobeSourceSoftware ? ...\n\n\n> +      enum:\n> +        - name: FlashStrobeSourceSoftware\n> +          value: 0\n> +          description: |\n> +            Software.\n> +        - name: FlashStrobeSourceExternal\n> +          value: 1\n> +          description: |\n> +            External.\n> +\n> +  - FlashStrobe:\n> +      type: int32_t\n> +      direction: in\n> +      description: |\n> +        Start/stop flash strobe.\n> +\n> +      enum:\n> +        - name: FlashStrobeStart\n> +          value: 0\n> +          description: |\n> +            Start flash strobe.\n> +\n> +        - name: FlashStrobeStop\n> +          value: 1\n> +          description: |\n> +            Stop flash strobe.\n> +\n> +  - FlashTorchIntensity:\n\nDo we need this in addition to FlashIntensity ?\n\nWill we have different intensity limits depending on the mode between\nflash+torch?\n\n> +      type: int32_t\n> +      direction: inout\n> +      description: |\n> +        Torch intensity in mA.\n\nI guess we get mA from the kernel drivers?\n\n> +\n>  ...\n> \n> -- \n> 2.34.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 25247BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 30 Aug 2025 10:21:06 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 1AD5869322;\n\tSat, 30 Aug 2025 12:21:05 +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 77962613AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 30 Aug 2025 12:21:03 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(cpc89244-aztw30-2-0-cust6594.18-1.cable.virginm.net [86.31.185.195])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 4CE2E157F;\n\tSat, 30 Aug 2025 12:19:57 +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=\"mbJ57MRO\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1756549197;\n\tbh=zSnZ9mh/ekgeqMnZ5z6H36TcJvz1AN967F/nHZLI470=;\n\th=In-Reply-To:References:Subject:From:Cc:To:Date:From;\n\tb=mbJ57MROuWuevzYzUcUqaECI5CbAMGr2khv6yB7x9bCeYwJQoSSN8f6+eDFyMzvif\n\ttExPIOb5at+b9lt6pnpX8hXkL6C6Yl44u8KROBqnPricxqWpLuinuNRPXH+G6Oy3kr\n\tsXPrJ/WPy4yzK0PAFj6T4OfCml10sBX5sR4TGAaQ=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250828-flash-support-v1-1-4c5dc674a05b@emfend.at>","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<20250828-flash-support-v1-1-4c5dc674a05b@emfend.at>","Subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Matthias Fend <matthias.fend@emfend.at>","To":"Matthias Fend <matthias.fend@emfend.at>,\n\tlibcamera-devel@lists.libcamera.org","Date":"Sat, 30 Aug 2025 11:21:00 +0100","Message-ID":"<175654926091.2556366.14396151106906960895@ping.linuxembedded.co.uk>","User-Agent":"alot/0.9.1","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":35647,"web_url":"https://patchwork.libcamera.org/comment/35647/","msgid":"<9799df35-b644-428e-878b-6f6c8c862137@emfend.at>","date":"2025-08-31T15:19:32","subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","submitter":{"id":134,"url":"https://patchwork.libcamera.org/api/people/134/","name":"Matthias Fend","email":"matthias.fend@emfend.at"},"content":"Hi Kieran,\n\nthank you for your feedback.\n\nAm 30.08.2025 um 12:21 schrieb Kieran Bingham:\n> Quoting Matthias Fend (2025-08-28 14:09:38)\n>> Define a set of controls to control camera flash devices.\n>>\n>> Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n>> ---\n>>   src/libcamera/control_ids_draft.yaml | 69 ++++++++++++++++++++++++++++++++++++\n>>   1 file changed, 69 insertions(+)\n>>\n>> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n>> index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..c10b774bfd59b26980475bb9706fffa6961b3b1b 100644\n>> --- a/src/libcamera/control_ids_draft.yaml\n>> +++ b/src/libcamera/control_ids_draft.yaml\n> \n> Please target real controls not draft controls. We should really try to\n> remove this draft file...\n\nOkay. I'll move them.\n\n> \n> \n>> @@ -294,4 +294,73 @@ controls:\n>>           Currently identical to ANDROID_STATISTICS_FACE_IDS.\n>>         size: [n]\n>>   \n>> +  - FlashMode:\n>> +      type: int32_t\n>> +      direction: inout\n>> +      description: |\n>> +        Flash mode.\n>> +      enum:\n>> +        - name: FlashModeNone\n>> +          value: 0\n>> +          description: |\n>> +            None.\n>> +        - name: FlashModeFlash\n>> +          value: 1\n>> +          description: |\n>> +            Flash.\n>> +        - name: FlashModeTorch\n>> +          value: 2\n>> +          description: |\n>> +            Torch.\n> \n> And I think we could expand all of those descriptions somehow.\n\nACK.\n\n> \n>> +\n>> +  - FlashIntensity:\n>> +      type: int32_t\n>> +      direction: inout\n>> +      description: |\n>> +        Flash intensity in mA.\n>> +\n>> +  - FlashTimeout:\n>> +      type: int32_t\n>> +      direction: inout\n>> +      description: |\n>> +        Flash timeout in us.\n>> +\n>> +  - FlashStrobeSource:\n>> +      type: int32_t\n>> +      direction: inout\n>> +      description: |\n>> +        Flash mode.\n> \n> Flash mode ? Or Flash source?\n\nTrue. Seems that all descriptions need some TLC...\n\n> \n> With all the descriptions expanded, these can target mainline controls.\n> No need to go to draft.\n> \n> We'll need to convey relationships in the documentation too.. like\n> perhaps it could be documented how FlashTimeout I suspect interacts only\n> with FlashStrobeSourceSoftware ? ...\n\nFlashTimeout is the maximum permissible flash on-time and is guaranteed \nby the hardware. This applies to both the software and hardware \n(external) triggers. It is also possible to generate shorter flash times \nusing the triggers. The timeout is essentially a protective mechanism \nthat limits the maximum duration.\n\n> \n> \n>> +      enum:\n>> +        - name: FlashStrobeSourceSoftware\n>> +          value: 0\n>> +          description: |\n>> +            Software.\n>> +        - name: FlashStrobeSourceExternal\n>> +          value: 1\n>> +          description: |\n>> +            External.\n>> +\n>> +  - FlashStrobe:\n>> +      type: int32_t\n>> +      direction: in\n>> +      description: |\n>> +        Start/stop flash strobe.\n>> +\n>> +      enum:\n>> +        - name: FlashStrobeStart\n>> +          value: 0\n>> +          description: |\n>> +            Start flash strobe.\n>> +\n>> +        - name: FlashStrobeStop\n>> +          value: 1\n>> +          description: |\n>> +            Stop flash strobe.\n>> +\n>> +  - FlashTorchIntensity:\n> \n> Do we need this in addition to FlashIntensity ?\n> \n> Will we have different intensity limits depending on the mode between\n> flash+torch?\n\nYes, exactly. Depending on the hardware setup, the maximum currents in \nthe two modes can differ. Continuous operation is possible in torch \nmode, which typically allows a lower maximum current (often for thermal \nreasons).\n> \n>> +      type: int32_t\n>> +      direction: inout\n>> +      description: |\n>> +        Torch intensity in mA.\n> \n> I guess we get mA from the kernel drivers?\n\nYes, the API documentation [1] for V4L2_CID_FLASH_INTENSITY says:  \"[..] \nThe unit should be milliamps (mA) if possible. [..]\"\n\nBest regards\n  ~Matthias\n\n[1] \nhttps://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-flash.html\n\n> \n>> +\n>>   ...\n>>\n>> -- \n>> 2.34.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 270F9BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 31 Aug 2025 15:19:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C9B9669322;\n\tSun, 31 Aug 2025 17:19:36 +0200 (CEST)","from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B1C9C613AD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 31 Aug 2025 17:19:34 +0200 (CEST)","from 194-208-208-245.tele.net ([194.208.208.245]:59554\n\thelo=[192.168.0.207])\n\tby lx20.hoststar.hosting with esmtpsa (TLS1.3) tls\n\tTLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.93)\n\t(envelope-from <matthias.fend@emfend.at>)\n\tid 1usjq9-001Xgk-EZ; Sun, 31 Aug 2025 17:19:33 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=emfend.at header.i=@emfend.at\n\theader.b=\"TISNqi3o\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at;\n\ts=mail;\n\th=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References\n\t:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Cc:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=/Q5OEimeRzrxkgANZtz93AxEWoNVhHBpHY1DN/eE2/4=;\n\tb=TISNqi3oln8qQvntVQHyru4sYH\n\tkkZgy/NTH5dbKORVmhxc4Nxul6SueN3iKGM24Ry2Ih2zEjWJwpqJ6HLpbwh0jiqWKBVYKVkeNlz6l\n\tDGL1stdhLLlEr98rwByWDAZEBURMQupTUZMLBj6cqnivkACbsnbi5HVVyvZOPQmYgQQc=;","Message-ID":"<9799df35-b644-428e-878b-6f6c8c862137@emfend.at>","Date":"Sun, 31 Aug 2025 17:19:32 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<20250828-flash-support-v1-1-4c5dc674a05b@emfend.at>\n\t<175654926091.2556366.14396151106906960895@ping.linuxembedded.co.uk>","Content-Language":"de-DE","From":"Matthias Fend <matthias.fend@emfend.at>","In-Reply-To":"<175654926091.2556366.14396151106906960895@ping.linuxembedded.co.uk>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","X-Spam-Score":"","X-Spam-Bar":"","X-Spam-Report":"","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":35655,"web_url":"https://patchwork.libcamera.org/comment/35655/","msgid":"<CAEmqJPopqNhJRsYrzkWzTyFmFb1amFBUMWhsoRNS_vmFe3ngSA@mail.gmail.com>","date":"2025-09-01T08:41:15","subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"Hi,\n\nOn Sun, 31 Aug 2025 at 16:19, Matthias Fend <matthias.fend@emfend.at> wrote:\n>\n> Hi Kieran,\n>\n> thank you for your feedback.\n>\n> Am 30.08.2025 um 12:21 schrieb Kieran Bingham:\n> > Quoting Matthias Fend (2025-08-28 14:09:38)\n> >> Define a set of controls to control camera flash devices.\n> >>\n> >> Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n> >> ---\n> >>   src/libcamera/control_ids_draft.yaml | 69 ++++++++++++++++++++++++++++++++++++\n> >>   1 file changed, 69 insertions(+)\n> >>\n> >> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n> >> index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..c10b774bfd59b26980475bb9706fffa6961b3b1b 100644\n> >> --- a/src/libcamera/control_ids_draft.yaml\n> >> +++ b/src/libcamera/control_ids_draft.yaml\n> >\n> > Please target real controls not draft controls. We should really try to\n> > remove this draft file...\n>\n> Okay. I'll move them.\n>\n> >\n> >\n> >> @@ -294,4 +294,73 @@ controls:\n> >>           Currently identical to ANDROID_STATISTICS_FACE_IDS.\n> >>         size: [n]\n> >>\n> >> +  - FlashMode:\n> >> +      type: int32_t\n> >> +      direction: inout\n> >> +      description: |\n> >> +        Flash mode.\n> >> +      enum:\n> >> +        - name: FlashModeNone\n> >> +          value: 0\n> >> +          description: |\n> >> +            None.\n> >> +        - name: FlashModeFlash\n> >> +          value: 1\n> >> +          description: |\n> >> +            Flash.\n> >> +        - name: FlashModeTorch\n> >> +          value: 2\n> >> +          description: |\n> >> +            Torch.\n> >\n> > And I think we could expand all of those descriptions somehow.\n>\n> ACK.\n>\n> >\n> >> +\n> >> +  - FlashIntensity:\n> >> +      type: int32_t\n> >> +      direction: inout\n> >> +      description: |\n> >> +        Flash intensity in mA.\n> >> +\n> >> +  - FlashTimeout:\n> >> +      type: int32_t\n> >> +      direction: inout\n> >> +      description: |\n> >> +        Flash timeout in us.\n> >> +\n> >> +  - FlashStrobeSource:\n> >> +      type: int32_t\n> >> +      direction: inout\n> >> +      description: |\n> >> +        Flash mode.\n> >\n> > Flash mode ? Or Flash source?\n>\n> True. Seems that all descriptions need some TLC...\n>\n> >\n> > With all the descriptions expanded, these can target mainline controls.\n> > No need to go to draft.\n> >\n> > We'll need to convey relationships in the documentation too.. like\n> > perhaps it could be documented how FlashTimeout I suspect interacts only\n> > with FlashStrobeSourceSoftware ? ...\n>\n> FlashTimeout is the maximum permissible flash on-time and is guaranteed\n> by the hardware. This applies to both the software and hardware\n> (external) triggers. It is also possible to generate shorter flash times\n> using the triggers. The timeout is essentially a protective mechanism\n> that limits the maximum duration.\n>\n> >\n> >\n> >> +      enum:\n> >> +        - name: FlashStrobeSourceSoftware\n> >> +          value: 0\n> >> +          description: |\n> >> +            Software.\n> >> +        - name: FlashStrobeSourceExternal\n> >> +          value: 1\n> >> +          description: |\n> >> +            External.\n> >> +\n> >> +  - FlashStrobe:\n> >> +      type: int32_t\n> >> +      direction: in\n> >> +      description: |\n> >> +        Start/stop flash strobe.\n> >> +\n> >> +      enum:\n> >> +        - name: FlashStrobeStart\n> >> +          value: 0\n> >> +          description: |\n> >> +            Start flash strobe.\n> >> +\n> >> +        - name: FlashStrobeStop\n> >> +          value: 1\n> >> +          description: |\n> >> +            Stop flash strobe.\n> >> +\n> >> +  - FlashTorchIntensity:\n> >\n> > Do we need this in addition to FlashIntensity ?\n> >\n> > Will we have different intensity limits depending on the mode between\n> > flash+torch?\n>\n> Yes, exactly. Depending on the hardware setup, the maximum currents in\n> the two modes can differ. Continuous operation is possible in torch\n> mode, which typically allows a lower maximum current (often for thermal\n> reasons).\n> >\n> >> +      type: int32_t\n> >> +      direction: inout\n> >> +      description: |\n> >> +        Torch intensity in mA.\n> >\n> > I guess we get mA from the kernel drivers?\n>\n> Yes, the API documentation [1] for V4L2_CID_FLASH_INTENSITY says:  \"[..]\n> The unit should be milliamps (mA) if possible. [..]\"\n\nShould we consider changing this to, say, a percentage?  The IPA can\nhandle conversion from this to mA when setting the V4L2 ctrl.  That\nway, applications do not have to do anything different when dealing\nwith different devices with different limits.\n\nRegards,\nNaush\n\n>\n> Best regards\n>   ~Matthias\n>\n> [1]\n> https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-flash.html\n>\n> >\n> >> +\n> >>   ...\n> >>\n> >> --\n> >> 2.34.1\n> >>\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 489D4BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Sep 2025 08:41:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5AF026931D;\n\tMon,  1 Sep 2025 10:41:55 +0200 (CEST)","from mail-vs1-xe31.google.com (mail-vs1-xe31.google.com\n\t[IPv6:2607:f8b0:4864:20::e31])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DDEDC613AC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Sep 2025 10:41:52 +0200 (CEST)","by mail-vs1-xe31.google.com with SMTP id\n\tada2fe7eead31-52a2bc2c968so84989137.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 01 Sep 2025 01:41:52 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"BQMhfHlx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1756716112; x=1757320912;\n\tdarn=lists.libcamera.org; \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=urEdlXrQgFFQR3Uyxyd6bk0t71nivbYJ12mPlFl+fvY=;\n\tb=BQMhfHlxET/JXSOr20YZNAR7lPrUjowmGvG5EbEt63+gfRlALsk+tDih2aScWtn3Os\n\tOWo7Qn8u2QuY2EKuzLaK76LUGvBQEv2prIsNGTa0Xmzgxnj7xz8G5kqaDONA9Bp1eNBO\n\tWrUQE8d8MwaHrVcsxGyqGndSCoNqrKzYeI+3bFUwaeiNEBTZaZ4dh5yJPDVebBO9uz/E\n\ttdN4kLOp2o9CY513SEVK1IE7NtCbwt6cyjwu6qXu7ZwkZqGjWRRnf7DmkRE+M7ebm+Gj\n\ti1QgDUpHXVwnEPJ7Y8UeSp2GIOFukwinKMmH7YqF6zumFeg2PVSEkKwT08NWwxa8WUGQ\n\tE2IA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1756716112; x=1757320912;\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=urEdlXrQgFFQR3Uyxyd6bk0t71nivbYJ12mPlFl+fvY=;\n\tb=G8GJN3qrsBxwXPEOGsHVS/LzWhgP+RGHwbiH6umw9F/gIW7GSXq5BDpFlMLpzFOW57\n\t5NdLSGADl3EbCgAoYjrvPqCpnIcWyWvuxyJLIg3Lpt866JEYVZ8AxSkvkX6gAZ1uigfZ\n\tUNsXCXMyqJlozih7GH9lp/BOiMFjDmyU72zEpPeXQRZ0TvsGE+JK0Uc1dApYI4JymRdn\n\t7USatVR28mtW2E1jkWs+UhUsa3Mi6NLE5PNQHn3sBrg/TtmG/19j1wP/KPvxfmziPpfF\n\tIphKJUQ3vxd9yeSTPmGNLqOH7ycYblGM34JUjHtEJhn/H+yrxCmgJ9ZCJI8cTz8HWoLM\n\t1Y0w==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCU30z8jSRpqklZYj+6ze19rXJJnryy3AKxcj3oxq7cd7IbmIU+iW8nteQKfgjQuAadtiQO5ookLa2vCk36Z3P4=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YzIOeiqX6RW93tr3lozRNYP86PceOV9X5uuTntncsPWEjs7MDcS\n\tI3kxEiH785Icx4Xy315fJmgKkL23a72UcOVwPeFQEWWB0LIxxhCaJJb0Ir29zQZcbwivynlsVYS\n\tnT3ce9qPFK0GhtMoP5BRisPYOUANMX85uUcvq5wk5HA==","X-Gm-Gg":"ASbGncvk0jcp8GQWOVIcdWnU8C78Ej29LCGdmNyA+QuQGH/lHqjO1nqJB/UAXValqEf\n\tHQmLFfAVuWyYcikTwwxb91SrKc5WIkHf71SwyEFS+lCWJTq98lFY3geOlhQirZ0L989ruB3GZ6X\n\tT+q3Sck80eJvr6cwBH8QQcqP7+eyziiVofwZUJWxefEDbbl2y3phc2so0SJlgW9N0NkNQwWgBQZ\n\t2jxjToghtZRo24mQjTBgvYthkeIhCQMO+lZ7VU=","X-Google-Smtp-Source":"AGHT+IH1fpEK66mSzr2UByTBcmrjQfHsS0S794mlVE7Y9DcSxAI3t+Jyv0HbCHGCVsqwd8kLwZ7f3pv9DhSEceEzSQs=","X-Received":"by 2002:a05:6102:32c1:b0:519:f3b6:a19f with SMTP id\n\tada2fe7eead31-52a31186607mr1038129137.1.1756716111623;\n\tMon, 01 Sep 2025 01:41:51 -0700 (PDT)","MIME-Version":"1.0","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<20250828-flash-support-v1-1-4c5dc674a05b@emfend.at>\n\t<175654926091.2556366.14396151106906960895@ping.linuxembedded.co.uk>\n\t<9799df35-b644-428e-878b-6f6c8c862137@emfend.at>","In-Reply-To":"<9799df35-b644-428e-878b-6f6c8c862137@emfend.at>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Mon, 1 Sep 2025 09:41:15 +0100","X-Gm-Features":"Ac12FXzKjJiNwdlgDyK76GnZnpwIjGd6nUctGwIhrAeGgsVIt49JrzMnSU7QfdM","Message-ID":"<CAEmqJPopqNhJRsYrzkWzTyFmFb1amFBUMWhsoRNS_vmFe3ngSA@mail.gmail.com>","Subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","To":"Matthias Fend <matthias.fend@emfend.at>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","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":35656,"web_url":"https://patchwork.libcamera.org/comment/35656/","msgid":"<CAHW6GYKy3Tv4=Mt92WnHPHvZHSnYR3P31TCjpFE+QOLEUxC5Yw@mail.gmail.com>","date":"2025-09-01T09:31:49","subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi\n\nThanks for posting some proposals for flash control.\n\nOn Mon, 1 Sept 2025 at 09:41, Naushir Patuck <naush@raspberrypi.com> wrote:\n>\n> Hi,\n>\n> On Sun, 31 Aug 2025 at 16:19, Matthias Fend <matthias.fend@emfend.at> wrote:\n> >\n> > Hi Kieran,\n> >\n> > thank you for your feedback.\n> >\n> > Am 30.08.2025 um 12:21 schrieb Kieran Bingham:\n> > > Quoting Matthias Fend (2025-08-28 14:09:38)\n> > >> Define a set of controls to control camera flash devices.\n> > >>\n> > >> Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n> > >> ---\n> > >>   src/libcamera/control_ids_draft.yaml | 69 ++++++++++++++++++++++++++++++++++++\n> > >>   1 file changed, 69 insertions(+)\n> > >>\n> > >> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n> > >> index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..c10b774bfd59b26980475bb9706fffa6961b3b1b 100644\n> > >> --- a/src/libcamera/control_ids_draft.yaml\n> > >> +++ b/src/libcamera/control_ids_draft.yaml\n> > >\n> > > Please target real controls not draft controls. We should really try to\n> > > remove this draft file...\n> >\n> > Okay. I'll move them.\n> >\n> > >\n> > >\n> > >> @@ -294,4 +294,73 @@ controls:\n> > >>           Currently identical to ANDROID_STATISTICS_FACE_IDS.\n> > >>         size: [n]\n> > >>\n> > >> +  - FlashMode:\n> > >> +      type: int32_t\n> > >> +      direction: inout\n> > >> +      description: |\n> > >> +        Flash mode.\n> > >> +      enum:\n> > >> +        - name: FlashModeNone\n> > >> +          value: 0\n> > >> +          description: |\n> > >> +            None.\n> > >> +        - name: FlashModeFlash\n> > >> +          value: 1\n> > >> +          description: |\n> > >> +            Flash.\n> > >> +        - name: FlashModeTorch\n> > >> +          value: 2\n> > >> +          description: |\n> > >> +            Torch.\n> > >\n> > > And I think we could expand all of those descriptions somehow.\n> >\n> > ACK.\n\nYes, obviously more explanation is needed. I wasn't clear whether the\n\"flash\" flash mode is targeting firing the flash for a still image\ncapture. Do there need to be some options so that an application can\nask for a pre-flash?\n\nPre-flash can be relatively complicated as there are different ways to\ndo it, and it may require specific support in the AGC/AEC algorithm.\nThe AGC/AEC might be deciding exactly when to trigger it, and then\ndoing calculations by comparing frames with/without the flash in order\nto calculate the optimal level for the final capture. Just want to be\nsure we're thinking ahead about these possibilities!\n\n >\n> >\n> > >\n> > >> +\n> > >> +  - FlashIntensity:\n> > >> +      type: int32_t\n> > >> +      direction: inout\n> > >> +      description: |\n> > >> +        Flash intensity in mA.\n\nI'm dubious about using mA here, it feels a bit close to the hardware\nto me! Would a percentage of the maximum be more application friendly?\n\nThen there might also be (for example) a camera property that gives\nyou some idea of the absolute brightness (in lux?) of the flash at\nmaximum intensity.\n\n> > >> +\n> > >> +  - FlashTimeout:\n> > >> +      type: int32_t\n> > >> +      direction: inout\n> > >> +      description: |\n> > >> +        Flash timeout in us.\n> > >> +\n> > >> +  - FlashStrobeSource:\n> > >> +      type: int32_t\n> > >> +      direction: inout\n> > >> +      description: |\n> > >> +        Flash mode.\n> > >\n> > > Flash mode ? Or Flash source?\n> >\n> > True. Seems that all descriptions need some TLC...\n> >\n> > >\n> > > With all the descriptions expanded, these can target mainline controls.\n> > > No need to go to draft.\n> > >\n> > > We'll need to convey relationships in the documentation too.. like\n> > > perhaps it could be documented how FlashTimeout I suspect interacts only\n> > > with FlashStrobeSourceSoftware ? ...\n> >\n> > FlashTimeout is the maximum permissible flash on-time and is guaranteed\n> > by the hardware. This applies to both the software and hardware\n> > (external) triggers. It is also possible to generate shorter flash times\n> > using the triggers. The timeout is essentially a protective mechanism\n> > that limits the maximum duration.\n> >\n> > >\n> > >\n> > >> +      enum:\n> > >> +        - name: FlashStrobeSourceSoftware\n> > >> +          value: 0\n> > >> +          description: |\n> > >> +            Software.\n> > >> +        - name: FlashStrobeSourceExternal\n> > >> +          value: 1\n> > >> +          description: |\n> > >> +            External.\n> > >> +\n> > >> +  - FlashStrobe:\n> > >> +      type: int32_t\n> > >> +      direction: in\n> > >> +      description: |\n> > >> +        Start/stop flash strobe.\n> > >> +\n> > >> +      enum:\n> > >> +        - name: FlashStrobeStart\n> > >> +          value: 0\n> > >> +          description: |\n> > >> +            Start flash strobe.\n> > >> +\n> > >> +        - name: FlashStrobeStop\n> > >> +          value: 1\n> > >> +          description: |\n> > >> +            Stop flash strobe.\n> > >> +\n> > >> +  - FlashTorchIntensity:\n> > >\n> > > Do we need this in addition to FlashIntensity ?\n> > >\n> > > Will we have different intensity limits depending on the mode between\n> > > flash+torch?\n> >\n> > Yes, exactly. Depending on the hardware setup, the maximum currents in\n> > the two modes can differ. Continuous operation is possible in torch\n> > mode, which typically allows a lower maximum current (often for thermal\n> > reasons).\n> > >\n> > >> +      type: int32_t\n> > >> +      direction: inout\n> > >> +      description: |\n> > >> +        Torch intensity in mA.\n> > >\n> > > I guess we get mA from the kernel drivers?\n> >\n> > Yes, the API documentation [1] for V4L2_CID_FLASH_INTENSITY says:  \"[..]\n> > The unit should be milliamps (mA) if possible. [..]\"\n>\n> Should we consider changing this to, say, a percentage?  The IPA can\n> handle conversion from this to mA when setting the V4L2 ctrl.  That\n> way, applications do not have to do anything different when dealing\n> with different devices with different limits.\n\nAgree - see my remarks above!\n\n>\n> Regards,\n> Naush\n>\n> >\n> > Best regards\n> >   ~Matthias\n\nThanks!\n\nDavid\n\n> >\n> > [1]\n> > https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-flash.html\n> >\n> > >\n> > >> +\n> > >>   ...\n> > >>\n> > >> --\n> > >> 2.34.1\n> > >>\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 4A15BBD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Sep 2025 09:32:04 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 011A469331;\n\tMon,  1 Sep 2025 11:32:03 +0200 (CEST)","from mail-qk1-x733.google.com (mail-qk1-x733.google.com\n\t[IPv6:2607:f8b0:4864:20::733])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 36668613AC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Sep 2025 11:32:02 +0200 (CEST)","by mail-qk1-x733.google.com with SMTP id\n\taf79cd13be357-7f6f367a1f0so497968385a.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 01 Sep 2025 02:32:02 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"hK8F51+/\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1756719121; x=1757323921;\n\tdarn=lists.libcamera.org; \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=pPJMhFFdpZwi3gn240AGNCUyK0L3GFhTtJVJZZvvZFs=;\n\tb=hK8F51+/sPRqfZBIvbzUUMDfNjO6y4Pj4V9TTQrynSNYr8HW0XJeybP8aIfhYUV5R6\n\trY0maQ+PQgK5oQeVM7x49MFBbbzxiR6yIHJ8NQbNMLRJgSEkkzfrDuVNhXbTVslrzmyP\n\twyy6Z7Ew+eKw4FKKRPxOlCYbBARlwi8sNZM0/igVE7FfZtqk4sODAAMmOLcsxGOR1UrD\n\tbDw+vHZGhs8GpB45+1MpdPYoqUgw9ivlml/8z4HZffC+9PNFWRPeIBP9VLXfDfPpwJYi\n\tY2PK5aHvnQZU59oHCadLQcnbgfhwnQDoiw2j2kKBJqUl7vfLzd1Q/A6kFCMQu9CoaAdw\n\t0izQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1756719121; x=1757323921;\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=pPJMhFFdpZwi3gn240AGNCUyK0L3GFhTtJVJZZvvZFs=;\n\tb=isBYsJq9+PYkapHQsye7li90lELd88phQWdL5qRwU3ShEAvz4i5dVlsgtoCrfqwalY\n\tXDhadI3TOWgIgXfEcT77o5ehQA+zUCwkA822Zk3dBNAWHnD5El7TPAYeCYIB6AMC+MTX\n\tZWODWfe3ebLXeO4t3ZGOEWrM1REzuLvZkAz5jsr3EP5SSwa3jtqDN5Rev6d8uURRTU/P\n\thCMhqWwePXbS5fPXfSj+WzvmdCFc02olc5YnzeJf5cFHy2VMxBDJ2NC4P6h5xUfAmSod\n\tbtSmIKUyxJzBwjjV9H+RY8NBIrRofmqgBAhE3teP61j39DnNlZYMNYHjRUKbqYXWi1ck\n\tVmvA==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCXRr0S1kgNX9bfyS8VXhRyKYXmPYAD2BdYvCcn4yRsS/l0ILo3m3e7oKEdK2JupZPT3OeQbfLI7aPUxKp5V3yg=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YwYmLGeovjkRuIMcDGVMScbk+w756JF93EiKT772wVmMoIj37P/\n\tvThCeyJa6WbGbXlXYNxNTjGQA54o5zwp64HasEL3cJyG1ohbq+IEhw0pDLYAQP6rH2cBz8aRTOt\n\to/SdeBjY3PTJ7rCnE/KCvNSgh/7b4xJxqd5OA6oN28A==","X-Gm-Gg":"ASbGncs6f0ymY+RKJSHphz0DQ332neOj/Y5QDCv5Kx25JsIHRr8ZX18V168p8GDBrie\n\tM98MYj9ZHS1/ZNylAYLCaS+OONky7vnVaNCBLaVbZWcySnURY5iMQ9N7nYgZQAnXCDips5O2txj\n\tSdDGMf0zz5N7mH0wATlBUAkpARGiAou+ln1vJUtiZ8Q1cHRmcyuQ1Q5Y83iMss5eK7rNvQgHvrR\n\tbwULgKoElNLa0KDDqqfg5B9wB6nDQAw7rLQTN9miQKadju03aqXD0QwQeS/IzeyaIPEhe2Fhs9i\n\tG7HjwNzMFmJC2j9T0yY+","X-Google-Smtp-Source":"AGHT+IE2dDD6IFHUQJaiumlbYkwYHo7hqfAwPvE1WqE7SyKWFdHdln7yfOCOCm+fMwoRF+0pFS7RbVQN01m3HkMHBAw=","X-Received":"by 2002:a05:620a:258f:b0:7e9:f1b1:ad92 with SMTP id\n\taf79cd13be357-7ff27b22f3dmr728013185a.23.1756719120728;\n\tMon, 01 Sep 2025 02:32:00 -0700 (PDT)","MIME-Version":"1.0","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<20250828-flash-support-v1-1-4c5dc674a05b@emfend.at>\n\t<175654926091.2556366.14396151106906960895@ping.linuxembedded.co.uk>\n\t<9799df35-b644-428e-878b-6f6c8c862137@emfend.at>\n\t<CAEmqJPopqNhJRsYrzkWzTyFmFb1amFBUMWhsoRNS_vmFe3ngSA@mail.gmail.com>","In-Reply-To":"<CAEmqJPopqNhJRsYrzkWzTyFmFb1amFBUMWhsoRNS_vmFe3ngSA@mail.gmail.com>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Mon, 1 Sep 2025 10:31:49 +0100","X-Gm-Features":"Ac12FXxYjNM3iMyWEA1LzeMTLDr0VNX-NsApF1-XF7Q8hosgIbjYzsxiFlx-jVM","Message-ID":"<CAHW6GYKy3Tv4=Mt92WnHPHvZHSnYR3P31TCjpFE+QOLEUxC5Yw@mail.gmail.com>","Subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Matthias Fend <matthias.fend@emfend.at>, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","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":35659,"web_url":"https://patchwork.libcamera.org/comment/35659/","msgid":"<65df3aa1-adc7-4589-b11b-889d1e84a123@emfend.at>","date":"2025-09-01T10:32:35","subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","submitter":{"id":134,"url":"https://patchwork.libcamera.org/api/people/134/","name":"Matthias Fend","email":"matthias.fend@emfend.at"},"content":"Hi Naushir,\n\nthanks for your comments.\n\nAm 01.09.2025 um 10:41 schrieb Naushir Patuck:\n> Hi,\n> \n> On Sun, 31 Aug 2025 at 16:19, Matthias Fend <matthias.fend@emfend.at> wrote:\n>>\n>> Hi Kieran,\n>>\n>> thank you for your feedback.\n>>\n>> Am 30.08.2025 um 12:21 schrieb Kieran Bingham:\n>>> Quoting Matthias Fend (2025-08-28 14:09:38)\n>>>> Define a set of controls to control camera flash devices.\n>>>>\n>>>> Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n>>>> ---\n>>>>    src/libcamera/control_ids_draft.yaml | 69 ++++++++++++++++++++++++++++++++++++\n>>>>    1 file changed, 69 insertions(+)\n>>>>\n>>>> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n>>>> index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..c10b774bfd59b26980475bb9706fffa6961b3b1b 100644\n>>>> --- a/src/libcamera/control_ids_draft.yaml\n>>>> +++ b/src/libcamera/control_ids_draft.yaml\n>>>\n>>> Please target real controls not draft controls. We should really try to\n>>> remove this draft file...\n>>\n>> Okay. I'll move them.\n>>\n>>>\n>>>\n>>>> @@ -294,4 +294,73 @@ controls:\n>>>>            Currently identical to ANDROID_STATISTICS_FACE_IDS.\n>>>>          size: [n]\n>>>>\n>>>> +  - FlashMode:\n>>>> +      type: int32_t\n>>>> +      direction: inout\n>>>> +      description: |\n>>>> +        Flash mode.\n>>>> +      enum:\n>>>> +        - name: FlashModeNone\n>>>> +          value: 0\n>>>> +          description: |\n>>>> +            None.\n>>>> +        - name: FlashModeFlash\n>>>> +          value: 1\n>>>> +          description: |\n>>>> +            Flash.\n>>>> +        - name: FlashModeTorch\n>>>> +          value: 2\n>>>> +          description: |\n>>>> +            Torch.\n>>>\n>>> And I think we could expand all of those descriptions somehow.\n>>\n>> ACK.\n>>\n>>>\n>>>> +\n>>>> +  - FlashIntensity:\n>>>> +      type: int32_t\n>>>> +      direction: inout\n>>>> +      description: |\n>>>> +        Flash intensity in mA.\n>>>> +\n>>>> +  - FlashTimeout:\n>>>> +      type: int32_t\n>>>> +      direction: inout\n>>>> +      description: |\n>>>> +        Flash timeout in us.\n>>>> +\n>>>> +  - FlashStrobeSource:\n>>>> +      type: int32_t\n>>>> +      direction: inout\n>>>> +      description: |\n>>>> +        Flash mode.\n>>>\n>>> Flash mode ? Or Flash source?\n>>\n>> True. Seems that all descriptions need some TLC...\n>>\n>>>\n>>> With all the descriptions expanded, these can target mainline controls.\n>>> No need to go to draft.\n>>>\n>>> We'll need to convey relationships in the documentation too.. like\n>>> perhaps it could be documented how FlashTimeout I suspect interacts only\n>>> with FlashStrobeSourceSoftware ? ...\n>>\n>> FlashTimeout is the maximum permissible flash on-time and is guaranteed\n>> by the hardware. This applies to both the software and hardware\n>> (external) triggers. It is also possible to generate shorter flash times\n>> using the triggers. The timeout is essentially a protective mechanism\n>> that limits the maximum duration.\n>>\n>>>\n>>>\n>>>> +      enum:\n>>>> +        - name: FlashStrobeSourceSoftware\n>>>> +          value: 0\n>>>> +          description: |\n>>>> +            Software.\n>>>> +        - name: FlashStrobeSourceExternal\n>>>> +          value: 1\n>>>> +          description: |\n>>>> +            External.\n>>>> +\n>>>> +  - FlashStrobe:\n>>>> +      type: int32_t\n>>>> +      direction: in\n>>>> +      description: |\n>>>> +        Start/stop flash strobe.\n>>>> +\n>>>> +      enum:\n>>>> +        - name: FlashStrobeStart\n>>>> +          value: 0\n>>>> +          description: |\n>>>> +            Start flash strobe.\n>>>> +\n>>>> +        - name: FlashStrobeStop\n>>>> +          value: 1\n>>>> +          description: |\n>>>> +            Stop flash strobe.\n>>>> +\n>>>> +  - FlashTorchIntensity:\n>>>\n>>> Do we need this in addition to FlashIntensity ?\n>>>\n>>> Will we have different intensity limits depending on the mode between\n>>> flash+torch?\n>>\n>> Yes, exactly. Depending on the hardware setup, the maximum currents in\n>> the two modes can differ. Continuous operation is possible in torch\n>> mode, which typically allows a lower maximum current (often for thermal\n>> reasons).\n>>>\n>>>> +      type: int32_t\n>>>> +      direction: inout\n>>>> +      description: |\n>>>> +        Torch intensity in mA.\n>>>\n>>> I guess we get mA from the kernel drivers?\n>>\n>> Yes, the API documentation [1] for V4L2_CID_FLASH_INTENSITY says:  \"[..]\n>> The unit should be milliamps (mA) if possible. [..]\"\n> \n> Should we consider changing this to, say, a percentage?  The IPA can\n> handle conversion from this to mA when setting the V4L2 ctrl.  That\n> way, applications do not have to do anything different when dealing\n> with different devices with different limits.\n\nYes, perhaps. That would also be easy to implement.\nHowever, it is also practical if the value has a real, usable unit. With \nmilliamps, at least it is clear what that means. With a percentage, the \nquestion arises again of what. A percentage of the maximum current \n(which is how large) or a percentage of the maximum luminous flux (what \ndoes not have to be equivalent to the current) ?\nHaving the sensor gain in dB or the exposure time in seconds is somehow \nalso more helpful than in percent.\nIf an application wants to implement a generic slider with percent \nvalues, for example, it wouldn't be really difficult to simply multiply \nthe maximum current value by it.\n\nTherefore, in my opinion, the absolute current makes sense somehow. But \nI'm happy to be convinced otherwise :)\n\nThanks\n  ~Matthias\n\n> \n> Regards,\n> Naush\n> \n>>\n>> Best regards\n>>    ~Matthias\n>>\n>> [1]\n>> https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-flash.html\n>>\n>>>\n>>>> +\n>>>>    ...\n>>>>\n>>>> --\n>>>> 2.34.1\n>>>>\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 33508BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Sep 2025 10:32:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 275E769325;\n\tMon,  1 Sep 2025 12:32:39 +0200 (CEST)","from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5BDBE69318\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Sep 2025 12:32:38 +0200 (CEST)","from 194-208-208-245.tele.net ([194.208.208.245]:60805\n\thelo=[192.168.0.207])\n\tby lx20.hoststar.hosting with esmtpsa (TLS1.3) tls\n\tTLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.93)\n\t(envelope-from <matthias.fend@emfend.at>)\n\tid 1ut1q0-005A8W-8d; Mon, 01 Sep 2025 12:32:36 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=emfend.at header.i=@emfend.at\n\theader.b=\"NFL/0cEk\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at;\n\ts=mail;\n\th=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References\n\t:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=yVeOLniwgyn3j2LzR0PL9xAydxzKPQG4f1tJGTSZAXM=;\n\tb=NFL/0cEknqtjDdVXvJ93b52mTi\n\tH12gb7OFMb+gsTaPzERvUDSY1zBIpRs2ls1yqQskc3rFgjbMTLDfyEncP4yfW7iZMNufGMS6yVXmS\n\tNQVmI+MhT1BLz6aK9xWH89M22UsXsJYbQ9EH68whuBc+4x2WXm3iS8ciZKFkk+1QEvh4=;","Message-ID":"<65df3aa1-adc7-4589-b11b-889d1e84a123@emfend.at>","Date":"Mon, 1 Sep 2025 12:32:35 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<20250828-flash-support-v1-1-4c5dc674a05b@emfend.at>\n\t<175654926091.2556366.14396151106906960895@ping.linuxembedded.co.uk>\n\t<9799df35-b644-428e-878b-6f6c8c862137@emfend.at>\n\t<CAEmqJPopqNhJRsYrzkWzTyFmFb1amFBUMWhsoRNS_vmFe3ngSA@mail.gmail.com>","Content-Language":"de-DE","From":"Matthias Fend <matthias.fend@emfend.at>","In-Reply-To":"<CAEmqJPopqNhJRsYrzkWzTyFmFb1amFBUMWhsoRNS_vmFe3ngSA@mail.gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","X-Spam-Score":"","X-Spam-Bar":"","X-Spam-Report":"","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":35660,"web_url":"https://patchwork.libcamera.org/comment/35660/","msgid":"<6b066a5a-b397-4611-b880-fdc3bb919d1a@emfend.at>","date":"2025-09-01T10:40:47","subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","submitter":{"id":134,"url":"https://patchwork.libcamera.org/api/people/134/","name":"Matthias Fend","email":"matthias.fend@emfend.at"},"content":"Hi David,\n\nthanks for your feedback.\n\nAm 01.09.2025 um 11:31 schrieb David Plowman:\n> Hi\n> \n> Thanks for posting some proposals for flash control.\n> \n> On Mon, 1 Sept 2025 at 09:41, Naushir Patuck <naush@raspberrypi.com> wrote:\n>>\n>> Hi,\n>>\n>> On Sun, 31 Aug 2025 at 16:19, Matthias Fend <matthias.fend@emfend.at> wrote:\n>>>\n>>> Hi Kieran,\n>>>\n>>> thank you for your feedback.\n>>>\n>>> Am 30.08.2025 um 12:21 schrieb Kieran Bingham:\n>>>> Quoting Matthias Fend (2025-08-28 14:09:38)\n>>>>> Define a set of controls to control camera flash devices.\n>>>>>\n>>>>> Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n>>>>> ---\n>>>>>    src/libcamera/control_ids_draft.yaml | 69 ++++++++++++++++++++++++++++++++++++\n>>>>>    1 file changed, 69 insertions(+)\n>>>>>\n>>>>> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n>>>>> index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..c10b774bfd59b26980475bb9706fffa6961b3b1b 100644\n>>>>> --- a/src/libcamera/control_ids_draft.yaml\n>>>>> +++ b/src/libcamera/control_ids_draft.yaml\n>>>>\n>>>> Please target real controls not draft controls. We should really try to\n>>>> remove this draft file...\n>>>\n>>> Okay. I'll move them.\n>>>\n>>>>\n>>>>\n>>>>> @@ -294,4 +294,73 @@ controls:\n>>>>>            Currently identical to ANDROID_STATISTICS_FACE_IDS.\n>>>>>          size: [n]\n>>>>>\n>>>>> +  - FlashMode:\n>>>>> +      type: int32_t\n>>>>> +      direction: inout\n>>>>> +      description: |\n>>>>> +        Flash mode.\n>>>>> +      enum:\n>>>>> +        - name: FlashModeNone\n>>>>> +          value: 0\n>>>>> +          description: |\n>>>>> +            None.\n>>>>> +        - name: FlashModeFlash\n>>>>> +          value: 1\n>>>>> +          description: |\n>>>>> +            Flash.\n>>>>> +        - name: FlashModeTorch\n>>>>> +          value: 2\n>>>>> +          description: |\n>>>>> +            Torch.\n>>>>\n>>>> And I think we could expand all of those descriptions somehow.\n>>>\n>>> ACK.\n> \n> Yes, obviously more explanation is needed. I wasn't clear whether the\n> \"flash\" flash mode is targeting firing the flash for a still image\n> capture. Do there need to be some options so that an application can\n> ask for a pre-flash?\n> \n> Pre-flash can be relatively complicated as there are different ways to\n> do it, and it may require specific support in the AGC/AEC algorithm.\n> The AGC/AEC might be deciding exactly when to trigger it, and then\n> doing calculations by comparing frames with/without the flash in order\n> to calculate the optimal level for the final capture. Just want to be\n> sure we're thinking ahead about these possibilities!\n\nIf I understand correctly, there are no sequences for still image \ncapture yet, right?\nThis means that the application has to trigger the algorithms (AE, AWB, \nAF, etc.), wait until all settings are complete or stable, and then take \na picture.\nTherefore, the application would also have to take care of controlling \nthe flash—with everything that goes with it.\n\nI see the controls that are then used for such sequences at a higher \nlevel and independent of these flash controls.\n\nAdmittedly, I certainly lack the necessary overall overview to \nparticipate in such strategic decisions in a qualified manner.\n\n> \n>   >\n>>>\n>>>>\n>>>>> +\n>>>>> +  - FlashIntensity:\n>>>>> +      type: int32_t\n>>>>> +      direction: inout\n>>>>> +      description: |\n>>>>> +        Flash intensity in mA.\n> \n> I'm dubious about using mA here, it feels a bit close to the hardware\n> to me! Would a percentage of the maximum be more application friendly?\n> \n> Then there might also be (for example) a camera property that gives\n> you some idea of the absolute brightness (in lux?) of the flash at\n> maximum intensity.\n> \n>>>>> +\n>>>>> +  - FlashTimeout:\n>>>>> +      type: int32_t\n>>>>> +      direction: inout\n>>>>> +      description: |\n>>>>> +        Flash timeout in us.\n>>>>> +\n>>>>> +  - FlashStrobeSource:\n>>>>> +      type: int32_t\n>>>>> +      direction: inout\n>>>>> +      description: |\n>>>>> +        Flash mode.\n>>>>\n>>>> Flash mode ? Or Flash source?\n>>>\n>>> True. Seems that all descriptions need some TLC...\n>>>\n>>>>\n>>>> With all the descriptions expanded, these can target mainline controls.\n>>>> No need to go to draft.\n>>>>\n>>>> We'll need to convey relationships in the documentation too.. like\n>>>> perhaps it could be documented how FlashTimeout I suspect interacts only\n>>>> with FlashStrobeSourceSoftware ? ...\n>>>\n>>> FlashTimeout is the maximum permissible flash on-time and is guaranteed\n>>> by the hardware. This applies to both the software and hardware\n>>> (external) triggers. It is also possible to generate shorter flash times\n>>> using the triggers. The timeout is essentially a protective mechanism\n>>> that limits the maximum duration.\n>>>\n>>>>\n>>>>\n>>>>> +      enum:\n>>>>> +        - name: FlashStrobeSourceSoftware\n>>>>> +          value: 0\n>>>>> +          description: |\n>>>>> +            Software.\n>>>>> +        - name: FlashStrobeSourceExternal\n>>>>> +          value: 1\n>>>>> +          description: |\n>>>>> +            External.\n>>>>> +\n>>>>> +  - FlashStrobe:\n>>>>> +      type: int32_t\n>>>>> +      direction: in\n>>>>> +      description: |\n>>>>> +        Start/stop flash strobe.\n>>>>> +\n>>>>> +      enum:\n>>>>> +        - name: FlashStrobeStart\n>>>>> +          value: 0\n>>>>> +          description: |\n>>>>> +            Start flash strobe.\n>>>>> +\n>>>>> +        - name: FlashStrobeStop\n>>>>> +          value: 1\n>>>>> +          description: |\n>>>>> +            Stop flash strobe.\n>>>>> +\n>>>>> +  - FlashTorchIntensity:\n>>>>\n>>>> Do we need this in addition to FlashIntensity ?\n>>>>\n>>>> Will we have different intensity limits depending on the mode between\n>>>> flash+torch?\n>>>\n>>> Yes, exactly. Depending on the hardware setup, the maximum currents in\n>>> the two modes can differ. Continuous operation is possible in torch\n>>> mode, which typically allows a lower maximum current (often for thermal\n>>> reasons).\n>>>>\n>>>>> +      type: int32_t\n>>>>> +      direction: inout\n>>>>> +      description: |\n>>>>> +        Torch intensity in mA.\n>>>>\n>>>> I guess we get mA from the kernel drivers?\n>>>\n>>> Yes, the API documentation [1] for V4L2_CID_FLASH_INTENSITY says:  \"[..]\n>>> The unit should be milliamps (mA) if possible. [..]\"\n>>\n>> Should we consider changing this to, say, a percentage?  The IPA can\n>> handle conversion from this to mA when setting the V4L2 ctrl.  That\n>> way, applications do not have to do anything different when dealing\n>> with different devices with different limits.\n> \n> Agree - see my remarks above!\n\nSee also my comment in response to Naushir.\n\nThanks\n  ~Matthias\n\n> \n>>\n>> Regards,\n>> Naush\n>>\n>>>\n>>> Best regards\n>>>    ~Matthias\n> \n> Thanks!\n> \n> David\n> \n>>>\n>>> [1]\n>>> https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-flash.html\n>>>\n>>>>\n>>>>> +\n>>>>>    ...\n>>>>>\n>>>>> --\n>>>>> 2.34.1\n>>>>>\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 BB14DBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Sep 2025 10:40:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 96C2E69323;\n\tMon,  1 Sep 2025 12:40:52 +0200 (CEST)","from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 75D4569318\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Sep 2025 12:40:50 +0200 (CEST)","from 194-208-208-245.tele.net ([194.208.208.245]:57851\n\thelo=[192.168.0.207])\n\tby lx20.hoststar.hosting with esmtpsa (TLS1.3) tls\n\tTLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.93)\n\t(envelope-from <matthias.fend@emfend.at>)\n\tid 1ut1xw-005Juo-AI; Mon, 01 Sep 2025 12:40:49 +0200"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=emfend.at header.i=@emfend.at\n\theader.b=\"M2hJ9b/2\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=emfend.at;\n\ts=mail;\n\th=Content-Transfer-Encoding:Content-Type:In-Reply-To:From:References\n\t:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To:Content-ID:\n\tContent-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc\n\t:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe:\n\tList-Post:List-Owner:List-Archive;\n\tbh=5TTqC6x9vmx7JELh+2FuDKHh6bxBak3IgWW4+tD5VKA=;\n\tb=M2hJ9b/2pFLP7UuOlRiLd9Hk9M\n\thJ3/B9C04ZNuSKMbcXbXnxPbh/7EIsQ8hPy3oWwMqRChxd0ALXMVNpYCTmIdnCF9LXEae2OGlRK6K\n\tYEdoGn7B0fO+noul5U++Lqr/ekuoQUq6ifRvHV9chTgwmJ0uttXZFJfdloTUeb9CkbHE=;","Message-ID":"<6b066a5a-b397-4611-b880-fdc3bb919d1a@emfend.at>","Date":"Mon, 1 Sep 2025 12:40:47 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","To":"David Plowman <david.plowman@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>,\n\tlibcamera-devel@lists.libcamera.org","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<20250828-flash-support-v1-1-4c5dc674a05b@emfend.at>\n\t<175654926091.2556366.14396151106906960895@ping.linuxembedded.co.uk>\n\t<9799df35-b644-428e-878b-6f6c8c862137@emfend.at>\n\t<CAEmqJPopqNhJRsYrzkWzTyFmFb1amFBUMWhsoRNS_vmFe3ngSA@mail.gmail.com>\n\t<CAHW6GYKy3Tv4=Mt92WnHPHvZHSnYR3P31TCjpFE+QOLEUxC5Yw@mail.gmail.com>","Content-Language":"de-DE","From":"Matthias Fend <matthias.fend@emfend.at>","In-Reply-To":"<CAHW6GYKy3Tv4=Mt92WnHPHvZHSnYR3P31TCjpFE+QOLEUxC5Yw@mail.gmail.com>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-Spam-Score":"","X-Spam-Bar":"","X-Spam-Report":"","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":35675,"web_url":"https://patchwork.libcamera.org/comment/35675/","msgid":"<CAHW6GYJoA7zjo_=tsZpgcnygGNEbttG1-eFy6QCF93z=0KmP6A@mail.gmail.com>","date":"2025-09-01T14:13:23","subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","submitter":{"id":42,"url":"https://patchwork.libcamera.org/api/people/42/","name":"David Plowman","email":"david.plowman@raspberrypi.com"},"content":"Hi Matthias\n\nOn Mon, 1 Sept 2025 at 11:40, Matthias Fend <matthias.fend@emfend.at> wrote:\n>\n> Hi David,\n>\n> thanks for your feedback.\n>\n> Am 01.09.2025 um 11:31 schrieb David Plowman:\n> > Hi\n> >\n> > Thanks for posting some proposals for flash control.\n> >\n> > On Mon, 1 Sept 2025 at 09:41, Naushir Patuck <naush@raspberrypi.com> wrote:\n> >>\n> >> Hi,\n> >>\n> >> On Sun, 31 Aug 2025 at 16:19, Matthias Fend <matthias.fend@emfend.at> wrote:\n> >>>\n> >>> Hi Kieran,\n> >>>\n> >>> thank you for your feedback.\n> >>>\n> >>> Am 30.08.2025 um 12:21 schrieb Kieran Bingham:\n> >>>> Quoting Matthias Fend (2025-08-28 14:09:38)\n> >>>>> Define a set of controls to control camera flash devices.\n> >>>>>\n> >>>>> Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n> >>>>> ---\n> >>>>>    src/libcamera/control_ids_draft.yaml | 69 ++++++++++++++++++++++++++++++++++++\n> >>>>>    1 file changed, 69 insertions(+)\n> >>>>>\n> >>>>> diff --git a/src/libcamera/control_ids_draft.yaml b/src/libcamera/control_ids_draft.yaml\n> >>>>> index 03309eeac34fa76eee4bb5d1c87d6467b890c9a7..c10b774bfd59b26980475bb9706fffa6961b3b1b 100644\n> >>>>> --- a/src/libcamera/control_ids_draft.yaml\n> >>>>> +++ b/src/libcamera/control_ids_draft.yaml\n> >>>>\n> >>>> Please target real controls not draft controls. We should really try to\n> >>>> remove this draft file...\n> >>>\n> >>> Okay. I'll move them.\n> >>>\n> >>>>\n> >>>>\n> >>>>> @@ -294,4 +294,73 @@ controls:\n> >>>>>            Currently identical to ANDROID_STATISTICS_FACE_IDS.\n> >>>>>          size: [n]\n> >>>>>\n> >>>>> +  - FlashMode:\n> >>>>> +      type: int32_t\n> >>>>> +      direction: inout\n> >>>>> +      description: |\n> >>>>> +        Flash mode.\n> >>>>> +      enum:\n> >>>>> +        - name: FlashModeNone\n> >>>>> +          value: 0\n> >>>>> +          description: |\n> >>>>> +            None.\n> >>>>> +        - name: FlashModeFlash\n> >>>>> +          value: 1\n> >>>>> +          description: |\n> >>>>> +            Flash.\n> >>>>> +        - name: FlashModeTorch\n> >>>>> +          value: 2\n> >>>>> +          description: |\n> >>>>> +            Torch.\n> >>>>\n> >>>> And I think we could expand all of those descriptions somehow.\n> >>>\n> >>> ACK.\n> >\n> > Yes, obviously more explanation is needed. I wasn't clear whether the\n> > \"flash\" flash mode is targeting firing the flash for a still image\n> > capture. Do there need to be some options so that an application can\n> > ask for a pre-flash?\n> >\n> > Pre-flash can be relatively complicated as there are different ways to\n> > do it, and it may require specific support in the AGC/AEC algorithm.\n> > The AGC/AEC might be deciding exactly when to trigger it, and then\n> > doing calculations by comparing frames with/without the flash in order\n> > to calculate the optimal level for the final capture. Just want to be\n> > sure we're thinking ahead about these possibilities!\n>\n> If I understand correctly, there are no sequences for still image\n> capture yet, right?\n> This means that the application has to trigger the algorithms (AE, AWB,\n> AF, etc.), wait until all settings are complete or stable, and then take\n> a picture.\n> Therefore, the application would also have to take care of controlling\n> the flash—with everything that goes with it.\n\nNot 100% sure what you mean by \"sequences for still image capture\",\nbut you're right it's worth thinking about what happens with all these\nalgorithms and how things will be driven.\n\nIn this respect it's the \"pre-flash\" case for still image capture\nthat's most interesting. It will have to be closely integrated with\nAGC/AEC which will want to meter a \"no flash\" frame and then a \"with\nflash\" frame. The \"with flash\" frame needs to be completely\nilluminated, meaning the flash was turned on before the first pixel\neven starts being exposed.\n\n(Note I think we will need per frame metadata that tells us whether\nthe flash was \"off\", \"on\" - wholly illuminating every pixel, or\n\"in-between\".)\n\nAll this possibly affects which flash \"modes\" are useful in practice,\nso there's probably more to think about there too.\n\n>\n> I see the controls that are then used for such sequences at a higher\n> level and independent of these flash controls.\n\nYes, I think this is probably the case if we can figure all these controls out!\n\n>\n> Admittedly, I certainly lack the necessary overall overview to\n> participate in such strategic decisions in a qualified manner.\n>\n> >\n> >   >\n> >>>\n> >>>>\n> >>>>> +\n> >>>>> +  - FlashIntensity:\n> >>>>> +      type: int32_t\n> >>>>> +      direction: inout\n> >>>>> +      description: |\n> >>>>> +        Flash intensity in mA.\n> >\n> > I'm dubious about using mA here, it feels a bit close to the hardware\n> > to me! Would a percentage of the maximum be more application friendly?\n> >\n> > Then there might also be (for example) a camera property that gives\n> > you some idea of the absolute brightness (in lux?) of the flash at\n> > maximum intensity.\n> >\n> >>>>> +\n> >>>>> +  - FlashTimeout:\n> >>>>> +      type: int32_t\n> >>>>> +      direction: inout\n> >>>>> +      description: |\n> >>>>> +        Flash timeout in us.\n> >>>>> +\n> >>>>> +  - FlashStrobeSource:\n> >>>>> +      type: int32_t\n> >>>>> +      direction: inout\n> >>>>> +      description: |\n> >>>>> +        Flash mode.\n> >>>>\n> >>>> Flash mode ? Or Flash source?\n> >>>\n> >>> True. Seems that all descriptions need some TLC...\n> >>>\n> >>>>\n> >>>> With all the descriptions expanded, these can target mainline controls.\n> >>>> No need to go to draft.\n> >>>>\n> >>>> We'll need to convey relationships in the documentation too.. like\n> >>>> perhaps it could be documented how FlashTimeout I suspect interacts only\n> >>>> with FlashStrobeSourceSoftware ? ...\n> >>>\n> >>> FlashTimeout is the maximum permissible flash on-time and is guaranteed\n> >>> by the hardware. This applies to both the software and hardware\n> >>> (external) triggers. It is also possible to generate shorter flash times\n> >>> using the triggers. The timeout is essentially a protective mechanism\n> >>> that limits the maximum duration.\n> >>>\n> >>>>\n> >>>>\n> >>>>> +      enum:\n> >>>>> +        - name: FlashStrobeSourceSoftware\n> >>>>> +          value: 0\n> >>>>> +          description: |\n> >>>>> +            Software.\n> >>>>> +        - name: FlashStrobeSourceExternal\n> >>>>> +          value: 1\n> >>>>> +          description: |\n> >>>>> +            External.\n> >>>>> +\n> >>>>> +  - FlashStrobe:\n> >>>>> +      type: int32_t\n> >>>>> +      direction: in\n> >>>>> +      description: |\n> >>>>> +        Start/stop flash strobe.\n> >>>>> +\n> >>>>> +      enum:\n> >>>>> +        - name: FlashStrobeStart\n> >>>>> +          value: 0\n> >>>>> +          description: |\n> >>>>> +            Start flash strobe.\n> >>>>> +\n> >>>>> +        - name: FlashStrobeStop\n> >>>>> +          value: 1\n> >>>>> +          description: |\n> >>>>> +            Stop flash strobe.\n> >>>>> +\n> >>>>> +  - FlashTorchIntensity:\n> >>>>\n> >>>> Do we need this in addition to FlashIntensity ?\n> >>>>\n> >>>> Will we have different intensity limits depending on the mode between\n> >>>> flash+torch?\n> >>>\n> >>> Yes, exactly. Depending on the hardware setup, the maximum currents in\n> >>> the two modes can differ. Continuous operation is possible in torch\n> >>> mode, which typically allows a lower maximum current (often for thermal\n> >>> reasons).\n> >>>>\n> >>>>> +      type: int32_t\n> >>>>> +      direction: inout\n> >>>>> +      description: |\n> >>>>> +        Torch intensity in mA.\n> >>>>\n> >>>> I guess we get mA from the kernel drivers?\n> >>>\n> >>> Yes, the API documentation [1] for V4L2_CID_FLASH_INTENSITY says:  \"[..]\n> >>> The unit should be milliamps (mA) if possible. [..]\"\n> >>\n> >> Should we consider changing this to, say, a percentage?  The IPA can\n> >> handle conversion from this to mA when setting the V4L2 ctrl.  That\n> >> way, applications do not have to do anything different when dealing\n> >> with different devices with different limits.\n> >\n> > Agree - see my remarks above!\n>\n> See also my comment in response to Naushir.\n\nYes, to be fair, I don't feel super-strongly so long as applications\nhave the information they really need. This probably means knowing\nwhat the real physical effect of the maximum flash is (in terms of\nlight produced), and being able to calculate a proportion of it that\ngives you a linear response.\n\nSo that you could, for example, ask for 50% illumination, which\nincreases pixel brightness by only half the maximum compared to no\nflash at all. (Note that this may require calibration of the driver\ncurrent vs. illumination response, so maybe \"flash_helpers\" as well as\n\"cam_helpers\"??)\n\nDavid\n\n>\n> Thanks\n>   ~Matthias\n>\n> >\n> >>\n> >> Regards,\n> >> Naush\n> >>\n> >>>\n> >>> Best regards\n> >>>    ~Matthias\n> >\n> > Thanks!\n> >\n> > David\n> >\n> >>>\n> >>> [1]\n> >>> https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/ext-ctrls-flash.html\n> >>>\n> >>>>\n> >>>>> +\n> >>>>>    ...\n> >>>>>\n> >>>>> --\n> >>>>> 2.34.1\n> >>>>>\n> >>>\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 D3A4BBEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  1 Sep 2025 14:13:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6E88F69332;\n\tMon,  1 Sep 2025 16:13:37 +0200 (CEST)","from mail-qk1-x733.google.com (mail-qk1-x733.google.com\n\t[IPv6:2607:f8b0:4864:20::733])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CABF669323\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  1 Sep 2025 16:13:35 +0200 (CEST)","by mail-qk1-x733.google.com with SMTP id\n\taf79cd13be357-7fac9e5206bso497259885a.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 01 Sep 2025 07:13:35 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"aI73CKd9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1756736015; x=1757340815;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=UhVmkJFM7i6cIFxfGfQiE5EYzju7f7cIrNYRwo8FGX4=;\n\tb=aI73CKd9misCWmoOw7nF6sUVDa6IGuBP9A0E0aYjmvA5YifLZSj4ltARng36YN97z6\n\teJQtfF6152PzkhrA8Hfv6XMtWBPDlpT7Mo/9y2PNMCXMx1B2pgzkWuvJg+MpLm2Mn0DM\n\tph99gckogK1sc1i7ILm7sllqt4G2sGRN9ryGO4Y8kxUGcKyESEdwFkobhEfUvMuY3Cda\n\t4etZHKtOXflezayTqdU6pF1Ls7LLXBwf+dG9pV45Deohvl11oH/4JRFqvD6AltRgfP7H\n\tzJhaaD7oKTJyGNizo+CkGMZnytOMyGY7Tc5aqp1EMFgwmELa9tQ3X7vTxu0hXdkD3F07\n\tCcaA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1756736015; x=1757340815;\n\th=content-transfer-encoding:cc:to:subject:message-id:date:from\n\t:in-reply-to:references:mime-version:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=UhVmkJFM7i6cIFxfGfQiE5EYzju7f7cIrNYRwo8FGX4=;\n\tb=TV3ijzkXrKjYWS614uLX4Lh8W8P8QatD9xCIUrnEC9ohaId46JEJ+0WHKFVnsiKHsG\n\tOuLlWo4TJvgkaZlAlsE3f0wj0/rianhqyXMnv9SYL22CujexVgeCQABee6cyt/Xfbw+1\n\thPwJEup2caN/hGiN7KbvdNTxoAjnNqlQIDfTwyzrZSqmw2cAja86sCcxb0ll+th4DfoD\n\taWtKRO439w2Yc6NtZbp7XDBfp+iVz8+53pGFG5pagzc2gKqSjjJstOEHSiWbbMzQcQTJ\n\tFieFOKnuVWpTJToCilydsZKH/gBZJXMKXnwAEJNLQa46EzcBjkixcqxFX0H150fiDJHT\n\tHH8w==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCUn18qcSfloav2sANus3DMiQX6moN1Lcd79vt+2I9ZVI8gqVGgZ78XQlDpv0HmwKbApBmGgWBxor4PGzOAZWK8=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YypV59J0+aVy+tN1zy76juPxbeVFgu8P5L4p3TlstwXxf0g3woD\n\tWgPk+qETee5ldWt+bUjsLkbOxUWuGubQQ38n5DpZfDvwLFIn3zb21jQwVnjBUkIVj3mRac69X6Y\n\tEWb2aE5LnYjxRrN1y/X6TdJ4ucT0p7E17mHfHAsw5Lg==","X-Gm-Gg":"ASbGnctG+O9btEn1ls8U1+Pr6jc1BKsOcgRJKZTcfubACRG3wBUAG6IbRy1lmzYT2E/\n\t/ZQ/wD+GUVy8DZtsTKXPGTuf0yRN4zjOpkLZXbScYTjxeftIcksK6RZ54oGPVhhweKuldUQQ+6M\n\tUcALLRzVENFfv1CzxJGNLuUUZ5DVfQudiT0zcnps5p6H5AGq/EakwBOWakRkhY7J3C6Jkjmngzb\n\tMeSf6wG4YeAq5T894XD9inXbGiMnbxxlplbaMTWInee0Z/lQ7ucUBH0+S0tbX691iZc/B7dGqgx\n\tpvgsmqLD56nZBOBg3mds","X-Google-Smtp-Source":"AGHT+IGaXCI76BvpANPmeyqsvoF9V01Lk+bHcu+3ZrXuV6++WlskvRSMCMmOID9eH0xJu8IJpBuTRW/LJW5G6spjr+g=","X-Received":"by 2002:a05:620a:4402:b0:801:7e2c:32d8 with SMTP id\n\taf79cd13be357-8017e3b77c1mr528170585a.30.1756736014497;\n\tMon, 01 Sep 2025 07:13:34 -0700 (PDT)","MIME-Version":"1.0","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<20250828-flash-support-v1-1-4c5dc674a05b@emfend.at>\n\t<175654926091.2556366.14396151106906960895@ping.linuxembedded.co.uk>\n\t<9799df35-b644-428e-878b-6f6c8c862137@emfend.at>\n\t<CAEmqJPopqNhJRsYrzkWzTyFmFb1amFBUMWhsoRNS_vmFe3ngSA@mail.gmail.com>\n\t<CAHW6GYKy3Tv4=Mt92WnHPHvZHSnYR3P31TCjpFE+QOLEUxC5Yw@mail.gmail.com>\n\t<6b066a5a-b397-4611-b880-fdc3bb919d1a@emfend.at>","In-Reply-To":"<6b066a5a-b397-4611-b880-fdc3bb919d1a@emfend.at>","From":"David Plowman <david.plowman@raspberrypi.com>","Date":"Mon, 1 Sep 2025 15:13:23 +0100","X-Gm-Features":"Ac12FXxm-aQFhxM8UA2Ojxmg-TYdX9dMZd1Zgob8eiZGg1q-Ksxi1mWWanqv9HM","Message-ID":"<CAHW6GYJoA7zjo_=tsZpgcnygGNEbttG1-eFy6QCF93z=0KmP6A@mail.gmail.com>","Subject":"Re: [PATCH 1/5] libcamera: control_ids_draft: Add flash controls","To":"Matthias Fend <matthias.fend@emfend.at>","Cc":"Naushir Patuck <naush@raspberrypi.com>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>, \n\tlibcamera-devel@lists.libcamera.org","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","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>"}}]