[{"id":35690,"web_url":"https://patchwork.libcamera.org/comment/35690/","msgid":"<175689751801.1721288.658818454466928732@ping.linuxembedded.co.uk>","date":"2025-09-03T11:05:18","subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","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:37)\n> This series brings initial support for v4l2 flash devices.\n> \n> With these patches, v4l2 flash devices can be controlled by applications\n> via libcamera controls. Applications therefore only require one API and do\n> not have to worry about details such as finding the appropriate v4l2 flash\n> device.\n> \n> The controls are currently quite transparent and no advanced flash\n> sequences (pre-flash, AGC precorrection, etc.) are supported.\n> \n> This functionality should be easy to integrate into the various pipeline\n> handlers and is implemented as an example for the RKSIP1 pipeline.\n\nJust to bridge the kernel side and libcamera side - there's a current\nseries in progress that could impact this one :\n\n - https://lore.kernel.org/all/20250901-ov9282-flash-strobe-v7-0-d58d5a694afc@linux.dev/\n\nThis series adds two new v4l2 controls:\n- V4L2_CID_FLASH_DURATION: \"Strobe duration\": This control enables\n  setting a desired flash/strobe length/duration in µs.\n- V4L2_CID_FLASH_HW_STROBE_SIGNAL: \"Hardware strobe signal\": This\n  control enables the hardware strobe output signal of a v4l2 device.\n\nAs a first user of these new controls add basic flash/strobe support\nfor ov9282 sensors using their \"hardware strobe output\". The duration\ncalculation is only interpolated from various measurements, as no\ndocumentation was found.\n\nFurther flash/strobe-related controls as well as a migration to v4l2-cci\nhelpers for ov9282 will likely be implemented in future series.\n\nAll register addresses/values are based on the OV9281 datasheet v1.53\n(january 2019). This series was tested using an ov9281 VisionComponents\ncamera module.\n\nSigned-off-by: Richard Leitner <richard.leitner@linux.dev>\n\nthat might add parts that would be relevant in this series.\n\n--\nKieran\n\n\n> \n> Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n> ---\n> Matthias Fend (5):\n>       libcamera: control_ids_draft: Add flash controls\n>       libcamera: Add support for camera flash devices\n>       Documentation: Add flash driver requirements\n>       libcamera: Add flash helpers for pipeline handlers\n>       rkisp1: Add support for camera flash devices\n> \n>  Documentation/documentation-contents.rst      |   1 +\n>  Documentation/flash_driver_requirements.rst   |  40 +++++\n>  Documentation/index.rst                       |   1 +\n>  Documentation/meson.build                     |   1 +\n>  include/libcamera/internal/camera_flash.h     |  75 ++++++++\n>  include/libcamera/internal/camera_sensor.h    |   2 +\n>  include/libcamera/internal/flash_control.h    |  23 +++\n>  src/libcamera/camera_flash.cpp                | 248 ++++++++++++++++++++++++++\n>  src/libcamera/control_ids_draft.yaml          |  69 +++++++\n>  src/libcamera/flash_control.cpp               | 103 +++++++++++\n>  src/libcamera/meson.build                     |   2 +\n>  src/libcamera/pipeline/rkisp1/rkisp1.cpp      |   5 +\n>  src/libcamera/sensor/camera_sensor_legacy.cpp |  13 ++\n>  src/libcamera/sensor/camera_sensor_raw.cpp    |  13 ++\n>  14 files changed, 596 insertions(+)\n> ---\n> base-commit: d54e5537ca0909339bb6950f3a565c9077406a3c\n> change-id: 20250827-flash-support-dd67b41a82b9\n> \n> Best regards,\n> -- \n> Matthias Fend <matthias.fend@emfend.at>\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 D0630BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Sep 2025 11:05:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 95BC569339;\n\tWed,  3 Sep 2025 13:05:32 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F379D69332\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Sep 2025 13:05:20 +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 1A2338D4;\n\tWed,  3 Sep 2025 13:04:12 +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=\"UYSIHJVh\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1756897452;\n\tbh=ebviRkvspeJQHhKASJAHVoJjXJYyoeXvN00w6eJJ3w4=;\n\th=In-Reply-To:References:Subject:From:To:Cc:Date:From;\n\tb=UYSIHJVhrHtSRoXnVfs45gpxPirCPFmPctydUm22cbR0wFd37NVkJnt+r6YyL0Zwh\n\tEhQ9sddIFJXsJkdgmaggd01GbigET93WDI3g4SfI3p035+lNdS6tdmdXs054t10w8v\n\txXfRn7LfsQUvEgfo1NHln6vs6JW5gK06yNbcAgGE=","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>","Subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"Matthias Fend <matthias.fend@emfend.at>,\n\tlibcamera-devel@lists.libcamera.org","Cc":"Matthias Fend <matthias.fend@emfend.at>, richard.leitner@linux.dev","Date":"Wed, 03 Sep 2025 12:05:18 +0100","Message-ID":"<175689751801.1721288.658818454466928732@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":35691,"web_url":"https://patchwork.libcamera.org/comment/35691/","msgid":"<zcgcq5j4l6q6k6k6zkhpebjfomuvbapedcaw2b2mfynkagf66g@gtzqu4hracx3>","date":"2025-09-03T11:50:07","subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","submitter":{"id":240,"url":"https://patchwork.libcamera.org/api/people/240/","name":"Richard Leitner","email":"richard.leitner@linux.dev"},"content":"Hi Kieran,\n\nOn Wed, Sep 03, 2025 at 12:05:18PM +0100, Kieran Bingham wrote:\n> Quoting Matthias Fend (2025-08-28 14:09:37)\n> > This series brings initial support for v4l2 flash devices.\n> > \n> > With these patches, v4l2 flash devices can be controlled by applications\n> > via libcamera controls. Applications therefore only require one API and do\n> > not have to worry about details such as finding the appropriate v4l2 flash\n> > device.\n> > \n> > The controls are currently quite transparent and no advanced flash\n> > sequences (pre-flash, AGC precorrection, etc.) are supported.\n> > \n> > This functionality should be easy to integrate into the various pipeline\n> > handlers and is implemented as an example for the RKSIP1 pipeline.\n> \n> Just to bridge the kernel side and libcamera side - there's a current\n> series in progress that could impact this one :\n\nThanks for setting up this link between kernel and libcamera. I wasn't\naware there's simultaneous work on flash control in libcamera. But of\ncourse that's great to see :)\n\nKieran, Matthias, please feel free to share your thoughts/feedback on\nthe kernel series.\n\nApart from this series I have a few more flash/strobe related patches\nin my downstream tree, which I will send as soon as this one got\nmerged. One thing that might me interesting to you is the strobe shift\nfunctionality. It enables shifting the point of time the strobe\nstarts relatively (before and after) the exposure start.\n\nregards;rl\n\nP.S.: If the libcamera-devel mailing list had been included in the\npublic-inbox at https://lore.kernel.org/, I likely would have found it\nmyself. Perhaps that's a possibility for the future? ;)\n\n> \n>  - https://lore.kernel.org/all/20250901-ov9282-flash-strobe-v7-0-d58d5a694afc@linux.dev/\n> \n> This series adds two new v4l2 controls:\n> - V4L2_CID_FLASH_DURATION: \"Strobe duration\": This control enables\n>   setting a desired flash/strobe length/duration in µs.\n> - V4L2_CID_FLASH_HW_STROBE_SIGNAL: \"Hardware strobe signal\": This\n>   control enables the hardware strobe output signal of a v4l2 device.\n> \n> As a first user of these new controls add basic flash/strobe support\n> for ov9282 sensors using their \"hardware strobe output\". The duration\n> calculation is only interpolated from various measurements, as no\n> documentation was found.\n> \n> Further flash/strobe-related controls as well as a migration to v4l2-cci\n> helpers for ov9282 will likely be implemented in future series.\n> \n> All register addresses/values are based on the OV9281 datasheet v1.53\n> (january 2019). This series was tested using an ov9281 VisionComponents\n> camera module.\n> \n> Signed-off-by: Richard Leitner <richard.leitner@linux.dev>\n> \n> that might add parts that would be relevant in this series.\n> \n> --\n> Kieran\n> \n> \n> > \n> > Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n> > ---\n> > Matthias Fend (5):\n> >       libcamera: control_ids_draft: Add flash controls\n> >       libcamera: Add support for camera flash devices\n> >       Documentation: Add flash driver requirements\n> >       libcamera: Add flash helpers for pipeline handlers\n> >       rkisp1: Add support for camera flash devices\n> > \n> >  Documentation/documentation-contents.rst      |   1 +\n> >  Documentation/flash_driver_requirements.rst   |  40 +++++\n> >  Documentation/index.rst                       |   1 +\n> >  Documentation/meson.build                     |   1 +\n> >  include/libcamera/internal/camera_flash.h     |  75 ++++++++\n> >  include/libcamera/internal/camera_sensor.h    |   2 +\n> >  include/libcamera/internal/flash_control.h    |  23 +++\n> >  src/libcamera/camera_flash.cpp                | 248 ++++++++++++++++++++++++++\n> >  src/libcamera/control_ids_draft.yaml          |  69 +++++++\n> >  src/libcamera/flash_control.cpp               | 103 +++++++++++\n> >  src/libcamera/meson.build                     |   2 +\n> >  src/libcamera/pipeline/rkisp1/rkisp1.cpp      |   5 +\n> >  src/libcamera/sensor/camera_sensor_legacy.cpp |  13 ++\n> >  src/libcamera/sensor/camera_sensor_raw.cpp    |  13 ++\n> >  14 files changed, 596 insertions(+)\n> > ---\n> > base-commit: d54e5537ca0909339bb6950f3a565c9077406a3c\n> > change-id: 20250827-flash-support-dd67b41a82b9\n> > \n> > Best regards,\n> > -- \n> > Matthias Fend <matthias.fend@emfend.at>\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 B15B9BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  3 Sep 2025 11:51:53 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id EC1B169339;\n\tWed,  3 Sep 2025 13:51:52 +0200 (CEST)","from out-181.mta1.migadu.com (out-181.mta1.migadu.com\n\t[IPv6:2001:41d0:203:375::b5])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6C82F69332\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  3 Sep 2025 13:50:11 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=linux.dev header.i=@linux.dev\n\theader.b=\"CyyhxWBK\"; dkim-atps=neutral","Date":"Wed, 3 Sep 2025 13:50:07 +0200","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;\n\tt=1756900210;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=5ov1s3LEtisjSy3FmvCAGdnOQ/jZzZZfevVAQwxcHK0=;\n\tb=CyyhxWBKMQJQDSxpq4KtXeZ3V+JoOUE7+OSAdMC8DP5UEF7wk0hie2Mkt2mktHhNzIRTkC\n\tPC0djmcIypRC+bG8ARNbQo2WIv/sQOuy/HeNgEaLeBKg5L3f6MckXh6CCXwPwhx2uVOmvd\n\tO/bsd4a3vhZH9G/COqIXyeKv4hhC//I=","X-Report-Abuse":"Please report any abuse attempt to abuse@migadu.com and\n\tinclude these headers.","From":"Richard Leitner <richard.leitner@linux.dev>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"Matthias Fend <matthias.fend@emfend.at>, \n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","Message-ID":"<zcgcq5j4l6q6k6k6zkhpebjfomuvbapedcaw2b2mfynkagf66g@gtzqu4hracx3>","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<175689751801.1721288.658818454466928732@ping.linuxembedded.co.uk>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<175689751801.1721288.658818454466928732@ping.linuxembedded.co.uk>","X-Migadu-Flow":"FLOW_OUT","X-Mailman-Approved-At":"Wed, 03 Sep 2025 13:51:51 +0200","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":35694,"web_url":"https://patchwork.libcamera.org/comment/35694/","msgid":"<92a0f26c-e65c-4f6c-beb1-4bc41c119076@emfend.at>","date":"2025-09-04T06:42:28","subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","submitter":{"id":134,"url":"https://patchwork.libcamera.org/api/people/134/","name":"Matthias Fend","email":"matthias.fend@emfend.at"},"content":"Hi all,\n\nAm 03.09.2025 um 13:50 schrieb Richard Leitner:\n> Hi Kieran,\n> \n> On Wed, Sep 03, 2025 at 12:05:18PM +0100, Kieran Bingham wrote:\n>> Quoting Matthias Fend (2025-08-28 14:09:37)\n>>> This series brings initial support for v4l2 flash devices.\n>>>\n>>> With these patches, v4l2 flash devices can be controlled by applications\n>>> via libcamera controls. Applications therefore only require one API and do\n>>> not have to worry about details such as finding the appropriate v4l2 flash\n>>> device.\n>>>\n>>> The controls are currently quite transparent and no advanced flash\n>>> sequences (pre-flash, AGC precorrection, etc.) are supported.\n>>>\n>>> This functionality should be easy to integrate into the various pipeline\n>>> handlers and is implemented as an example for the RKSIP1 pipeline.\n>>\n>> Just to bridge the kernel side and libcamera side - there's a current\n>> series in progress that could impact this one :\n> \n> Thanks for setting up this link between kernel and libcamera. I wasn't\n> aware there's simultaneous work on flash control in libcamera. But of\n> course that's great to see :)\n> \n> Kieran, Matthias, please feel free to share your thoughts/feedback on\n> the kernel series.\n> \n> Apart from this series I have a few more flash/strobe related patches\n> in my downstream tree, which I will send as soon as this one got\n> merged. One thing that might me interesting to you is the strobe shift\n> functionality. It enables shifting the point of time the strobe\n> starts relatively (before and after) the exposure start.\n\nIn general, I don't see any major problem with adding further controls here.\nBut what is currently not supported is simply adding flash-specific v4l2 \ncontrols to a camera sensor driver.\n\nThe current implementation searches for a MEDIA_ENT_F_FLASH subdevice. \nThis means that only the V4L2_CID_FLASH_* controls offered by such \ncorresponding subdevices are used.\n\nCurrently, I am only aware of three drivers that use V4L2_CID_FLASH_* \ncontrols without being a MEDIA_ENT_F_FLASH subdevice:\nmedia/usb/gspca/sn9c20x.c\nmedia/i2c/vd55g1.c\nmedia/i2c/vd56g3.c\n\nThe ov9282 could now become another one.\n\nIf a sensor also has some kind of flash controller integrated, I see two \npossibilities:\n\na) The driver creates two subdevices (MEDIA_ENT_F_CAM_SENSOR and \nMEDIA_ENT_F_FLASH).\n\nb) libcamera implements a special solution and also searches the sensors \nfor potential flash controls. Instead of a minimum requirement for the \nimplemented controls, the controls that are found would simply be \noffered to the user. If a real flash controller is also present, the \ncontrols of both subdevices are combined and then assigned accordingly. \nThe question is what to do if a control is offered by both subdevices.\n\nIt's probably not difficult to guess that I would prefer option a) ;)\n\nBest regards\n  ~Matthias\n\n> \n> regards;rl\n> \n> P.S.: If the libcamera-devel mailing list had been included in the\n> public-inbox at https://lore.kernel.org/, I likely would have found it\n> myself. Perhaps that's a possibility for the future? ;)\n> \n>>\n>>   - https://lore.kernel.org/all/20250901-ov9282-flash-strobe-v7-0-d58d5a694afc@linux.dev/\n>>\n>> This series adds two new v4l2 controls:\n>> - V4L2_CID_FLASH_DURATION: \"Strobe duration\": This control enables\n>>    setting a desired flash/strobe length/duration in µs.\n>> - V4L2_CID_FLASH_HW_STROBE_SIGNAL: \"Hardware strobe signal\": This\n>>    control enables the hardware strobe output signal of a v4l2 device.\n>>\n>> As a first user of these new controls add basic flash/strobe support\n>> for ov9282 sensors using their \"hardware strobe output\". The duration\n>> calculation is only interpolated from various measurements, as no\n>> documentation was found.\n>>\n>> Further flash/strobe-related controls as well as a migration to v4l2-cci\n>> helpers for ov9282 will likely be implemented in future series.\n>>\n>> All register addresses/values are based on the OV9281 datasheet v1.53\n>> (january 2019). This series was tested using an ov9281 VisionComponents\n>> camera module.\n>>\n>> Signed-off-by: Richard Leitner <richard.leitner@linux.dev>\n>>\n>> that might add parts that would be relevant in this series.\n>>\n>> --\n>> Kieran\n>>\n>>\n>>>\n>>> Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n>>> ---\n>>> Matthias Fend (5):\n>>>        libcamera: control_ids_draft: Add flash controls\n>>>        libcamera: Add support for camera flash devices\n>>>        Documentation: Add flash driver requirements\n>>>        libcamera: Add flash helpers for pipeline handlers\n>>>        rkisp1: Add support for camera flash devices\n>>>\n>>>   Documentation/documentation-contents.rst      |   1 +\n>>>   Documentation/flash_driver_requirements.rst   |  40 +++++\n>>>   Documentation/index.rst                       |   1 +\n>>>   Documentation/meson.build                     |   1 +\n>>>   include/libcamera/internal/camera_flash.h     |  75 ++++++++\n>>>   include/libcamera/internal/camera_sensor.h    |   2 +\n>>>   include/libcamera/internal/flash_control.h    |  23 +++\n>>>   src/libcamera/camera_flash.cpp                | 248 ++++++++++++++++++++++++++\n>>>   src/libcamera/control_ids_draft.yaml          |  69 +++++++\n>>>   src/libcamera/flash_control.cpp               | 103 +++++++++++\n>>>   src/libcamera/meson.build                     |   2 +\n>>>   src/libcamera/pipeline/rkisp1/rkisp1.cpp      |   5 +\n>>>   src/libcamera/sensor/camera_sensor_legacy.cpp |  13 ++\n>>>   src/libcamera/sensor/camera_sensor_raw.cpp    |  13 ++\n>>>   14 files changed, 596 insertions(+)\n>>> ---\n>>> base-commit: d54e5537ca0909339bb6950f3a565c9077406a3c\n>>> change-id: 20250827-flash-support-dd67b41a82b9\n>>>\n>>> Best regards,\n>>> -- \n>>> Matthias Fend <matthias.fend@emfend.at>\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 AE760BEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Sep 2025 06:42:35 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 8B967613A8;\n\tThu,  4 Sep 2025 08:42:34 +0200 (CEST)","from lx20.hoststar.hosting (lx20.hoststar.hosting [168.119.41.54])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 63158613A8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Sep 2025 08:42:32 +0200 (CEST)","from 194-208-208-245.tele.net ([194.208.208.245]:54709\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 1uu3fx-003V5D-Np; Thu, 04 Sep 2025 08:42:30 +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=\"BRs8loDF\"; 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=4eamBCqZ6NJ2acRpdye0LcMf7Wrq+rOYosD4xHsxeZQ=;\n\tb=BRs8loDFwOSdFtI7j7AhBKqMvT\n\tqQddfi9R3nJFBdHSSflaqJ8CNjg+VcuZJq6li3WKrK4HyvWh9rf+EATvUR+o+fTokItZcs/ql90uh\n\tNqopXrl6y7QsNuwB6FDzvbdvmlXP6KMwJhu5SDY4AJzC4JpZUhSdBh8UCDAPJ6Jfh3hw=;","Message-ID":"<92a0f26c-e65c-4f6c-beb1-4bc41c119076@emfend.at>","Date":"Thu, 4 Sep 2025 08:42:28 +0200","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","To":"Richard Leitner <richard.leitner@linux.dev>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<175689751801.1721288.658818454466928732@ping.linuxembedded.co.uk>\n\t<zcgcq5j4l6q6k6k6zkhpebjfomuvbapedcaw2b2mfynkagf66g@gtzqu4hracx3>","Content-Language":"de-DE","From":"Matthias Fend <matthias.fend@emfend.at>","In-Reply-To":"<zcgcq5j4l6q6k6k6zkhpebjfomuvbapedcaw2b2mfynkagf66g@gtzqu4hracx3>","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":35696,"web_url":"https://patchwork.libcamera.org/comment/35696/","msgid":"<cqgudih467noec4nyc6pfwdu4ohe2ub2thi2hjgscxfkomdtza@7fd5q3hzzbjr>","date":"2025-09-04T08:51:03","subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","submitter":{"id":240,"url":"https://patchwork.libcamera.org/api/people/240/","name":"Richard Leitner","email":"richard.leitner@linux.dev"},"content":"Hi Matthias,\n\nlooping in Sakari, Laurent and Dave as they are the main reviewers of the\nkernel series.\n\nOn Thu, Sep 04, 2025 at 08:42:28AM +0200, Matthias Fend wrote:\n> Hi all,\n> \n> Am 03.09.2025 um 13:50 schrieb Richard Leitner:\n> > Hi Kieran,\n> > \n> > On Wed, Sep 03, 2025 at 12:05:18PM +0100, Kieran Bingham wrote:\n> > > Quoting Matthias Fend (2025-08-28 14:09:37)\n> > > > This series brings initial support for v4l2 flash devices.\n> > > > \n> > > > With these patches, v4l2 flash devices can be controlled by applications\n> > > > via libcamera controls. Applications therefore only require one API and do\n> > > > not have to worry about details such as finding the appropriate v4l2 flash\n> > > > device.\n> > > > \n> > > > The controls are currently quite transparent and no advanced flash\n> > > > sequences (pre-flash, AGC precorrection, etc.) are supported.\n> > > > \n> > > > This functionality should be easy to integrate into the various pipeline\n> > > > handlers and is implemented as an example for the RKSIP1 pipeline.\n> > > \n> > > Just to bridge the kernel side and libcamera side - there's a current\n> > > series in progress that could impact this one :\n> > \n> > Thanks for setting up this link between kernel and libcamera. I wasn't\n> > aware there's simultaneous work on flash control in libcamera. But of\n> > course that's great to see :)\n> > \n> > Kieran, Matthias, please feel free to share your thoughts/feedback on\n> > the kernel series.\n> > \n> > Apart from this series I have a few more flash/strobe related patches\n> > in my downstream tree, which I will send as soon as this one got\n> > merged. One thing that might me interesting to you is the strobe shift\n> > functionality. It enables shifting the point of time the strobe\n> > starts relatively (before and after) the exposure start.\n> \n> In general, I don't see any major problem with adding further controls here.\n> But what is currently not supported is simply adding flash-specific v4l2\n> controls to a camera sensor driver.\n> \n> The current implementation searches for a MEDIA_ENT_F_FLASH subdevice. This\n> means that only the V4L2_CID_FLASH_* controls offered by such corresponding\n> subdevices are used.\n> \n> Currently, I am only aware of three drivers that use V4L2_CID_FLASH_*\n> controls without being a MEDIA_ENT_F_FLASH subdevice:\n> media/usb/gspca/sn9c20x.c\n> media/i2c/vd55g1.c\n> media/i2c/vd56g3.c\n> \n> The ov9282 could now become another one.\n> \n> If a sensor also has some kind of flash controller integrated, I see two\n> possibilities:\n> \n> a) The driver creates two subdevices (MEDIA_ENT_F_CAM_SENSOR and\n> MEDIA_ENT_F_FLASH).\n> \n> b) libcamera implements a special solution and also searches the sensors for\n> potential flash controls. Instead of a minimum requirement for the\n> implemented controls, the controls that are found would simply be offered to\n> the user. If a real flash controller is also present, the controls of both\n> subdevices are combined and then assigned accordingly. The question is what\n> to do if a control is offered by both subdevices.\n> \n> It's probably not difficult to guess that I would prefer option a) ;)\n\nThanks for your feedback! I definitely got your point, but I'm uncertain\nwhether a MEDIA_ENT_F_FLASH subdevice is the most appropriate \"container\"\nfor this flash/strobe case.\n\nThe ov9282 sensor provides only a configurable strobe signal output.\nIt doesn't contain an actual flash/LED driver or light source. It's\nessentially a \"strobe/flash signal source\" rather than a \"flash device\".\n\nTherefore from a system perspective, the sensor's strobe output would\ntypically connect to an external flash controller or LED driver. The\nsensor itself doesn't control the actual light emission, it just provides\nthe signal.\n\nSo this raises some questions to me:\n\n1) Should a \"strobe signal source\" be contained in MEDIA_ENT_F_CAM_SENSOR\n   or MEDIA_ENT_F_FLASH?\n\n2) Would it make sense to create a separate subdevice type for such\n   \"strobe signal sources\"?\n\n3) Are there any ohter subdevices that provide similar \"signal\n   generation\" functionality (for e.g. strobe/flash, focus, mechanical\n   shutter, stabilizer, ...)? Understanding how these are or would be\n   classified could provide some common ground for our case.\n\nI may be missing some important libcamera context here, as I'm no user\nof it (yet?)... sorry for that ;)\n\nregards;rl\n\n> \n> Best regards\n>  ~Matthias\n> \n> > \n> > regards;rl\n> > \n> > P.S.: If the libcamera-devel mailing list had been included in the\n> > public-inbox at https://lore.kernel.org/, I likely would have found it\n> > myself. Perhaps that's a possibility for the future? ;)\n> > \n> > > \n> > >   - https://lore.kernel.org/all/20250901-ov9282-flash-strobe-v7-0-d58d5a694afc@linux.dev/\n> > > \n> > > This series adds two new v4l2 controls:\n> > > - V4L2_CID_FLASH_DURATION: \"Strobe duration\": This control enables\n> > >    setting a desired flash/strobe length/duration in µs.\n> > > - V4L2_CID_FLASH_HW_STROBE_SIGNAL: \"Hardware strobe signal\": This\n> > >    control enables the hardware strobe output signal of a v4l2 device.\n> > > \n> > > As a first user of these new controls add basic flash/strobe support\n> > > for ov9282 sensors using their \"hardware strobe output\". The duration\n> > > calculation is only interpolated from various measurements, as no\n> > > documentation was found.\n> > > \n> > > Further flash/strobe-related controls as well as a migration to v4l2-cci\n> > > helpers for ov9282 will likely be implemented in future series.\n> > > \n> > > All register addresses/values are based on the OV9281 datasheet v1.53\n> > > (january 2019). This series was tested using an ov9281 VisionComponents\n> > > camera module.\n> > > \n> > > Signed-off-by: Richard Leitner <richard.leitner@linux.dev>\n> > > \n> > > that might add parts that would be relevant in this series.\n> > > \n> > > --\n> > > Kieran\n> > > \n> > > \n> > > > \n> > > > Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n> > > > ---\n> > > > Matthias Fend (5):\n> > > >        libcamera: control_ids_draft: Add flash controls\n> > > >        libcamera: Add support for camera flash devices\n> > > >        Documentation: Add flash driver requirements\n> > > >        libcamera: Add flash helpers for pipeline handlers\n> > > >        rkisp1: Add support for camera flash devices\n> > > > \n> > > >   Documentation/documentation-contents.rst      |   1 +\n> > > >   Documentation/flash_driver_requirements.rst   |  40 +++++\n> > > >   Documentation/index.rst                       |   1 +\n> > > >   Documentation/meson.build                     |   1 +\n> > > >   include/libcamera/internal/camera_flash.h     |  75 ++++++++\n> > > >   include/libcamera/internal/camera_sensor.h    |   2 +\n> > > >   include/libcamera/internal/flash_control.h    |  23 +++\n> > > >   src/libcamera/camera_flash.cpp                | 248 ++++++++++++++++++++++++++\n> > > >   src/libcamera/control_ids_draft.yaml          |  69 +++++++\n> > > >   src/libcamera/flash_control.cpp               | 103 +++++++++++\n> > > >   src/libcamera/meson.build                     |   2 +\n> > > >   src/libcamera/pipeline/rkisp1/rkisp1.cpp      |   5 +\n> > > >   src/libcamera/sensor/camera_sensor_legacy.cpp |  13 ++\n> > > >   src/libcamera/sensor/camera_sensor_raw.cpp    |  13 ++\n> > > >   14 files changed, 596 insertions(+)\n> > > > ---\n> > > > base-commit: d54e5537ca0909339bb6950f3a565c9077406a3c\n> > > > change-id: 20250827-flash-support-dd67b41a82b9\n> > > > \n> > > > Best regards,\n> > > > -- \n> > > > Matthias Fend <matthias.fend@emfend.at>\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 592ABBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Sep 2025 08:51:15 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id CF3B269334;\n\tThu,  4 Sep 2025 10:51:13 +0200 (CEST)","from out-172.mta1.migadu.com (out-172.mta1.migadu.com\n\t[95.215.58.172])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DB2AA69330\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Sep 2025 10:51:10 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=linux.dev header.i=@linux.dev\n\theader.b=\"bvec7k2Y\"; dkim-atps=neutral","Date":"Thu, 4 Sep 2025 10:51:03 +0200","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1;\n\tt=1756975870;\n\th=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n\tto:to:cc:cc:mime-version:mime-version:content-type:content-type:\n\tcontent-transfer-encoding:content-transfer-encoding:\n\tin-reply-to:in-reply-to:references:references;\n\tbh=9jOu5kBhXfSKCZQT3HkWPmsKMREVAJ0aF73VSAXiZCg=;\n\tb=bvec7k2Yjl5eeQzRWjPitR9kSDNG3vHl7ngSTRJhnqzkrzNGEG+vuP+oQu5D+W5Pf90V8j\n\t7tSEyj5fwpbxzvq65XQsQgvSdHkhpIl50EoWlaPOYSs77F8ANwgJY6Mum+fsQgSLYzTIwg\n\tNsZxbezyU8PlckqyjWhn+/49ft3RfBY=","X-Report-Abuse":"Please report any abuse attempt to abuse@migadu.com and\n\tinclude these headers.","From":"Richard Leitner <richard.leitner@linux.dev>","To":"Matthias Fend <matthias.fend@emfend.at>","Cc":"Kieran Bingham <kieran.bingham@ideasonboard.com>, \n\tSakari Ailus <sakari.ailus@linux.intel.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>, \n\tDave Stevenson <dave.stevenson@raspberrypi.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","Message-ID":"<cqgudih467noec4nyc6pfwdu4ohe2ub2thi2hjgscxfkomdtza@7fd5q3hzzbjr>","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<175689751801.1721288.658818454466928732@ping.linuxembedded.co.uk>\n\t<zcgcq5j4l6q6k6k6zkhpebjfomuvbapedcaw2b2mfynkagf66g@gtzqu4hracx3>\n\t<92a0f26c-e65c-4f6c-beb1-4bc41c119076@emfend.at>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<92a0f26c-e65c-4f6c-beb1-4bc41c119076@emfend.at>","X-Migadu-Flow":"FLOW_OUT","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":35698,"web_url":"https://patchwork.libcamera.org/comment/35698/","msgid":"<CAPY8ntAzDq1e=5J-m_BY=MHr+OBNOB1jeaZTNtjs1UZpkmgdXA@mail.gmail.com>","date":"2025-09-04T18:31:45","subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","submitter":{"id":27,"url":"https://patchwork.libcamera.org/api/people/27/","name":"Dave Stevenson","email":"dave.stevenson@raspberrypi.com"},"content":"Hi Matthias and Richard\n\nOn Thu, 4 Sept 2025 at 09:51, Richard Leitner <richard.leitner@linux.dev> wrote:\n>\n> Hi Matthias,\n>\n> looping in Sakari, Laurent and Dave as they are the main reviewers of the\n> kernel series.\n>\n> On Thu, Sep 04, 2025 at 08:42:28AM +0200, Matthias Fend wrote:\n> > Hi all,\n> >\n> > Am 03.09.2025 um 13:50 schrieb Richard Leitner:\n> > > Hi Kieran,\n> > >\n> > > On Wed, Sep 03, 2025 at 12:05:18PM +0100, Kieran Bingham wrote:\n> > > > Quoting Matthias Fend (2025-08-28 14:09:37)\n> > > > > This series brings initial support for v4l2 flash devices.\n> > > > >\n> > > > > With these patches, v4l2 flash devices can be controlled by applications\n> > > > > via libcamera controls. Applications therefore only require one API and do\n> > > > > not have to worry about details such as finding the appropriate v4l2 flash\n> > > > > device.\n> > > > >\n> > > > > The controls are currently quite transparent and no advanced flash\n> > > > > sequences (pre-flash, AGC precorrection, etc.) are supported.\n> > > > >\n> > > > > This functionality should be easy to integrate into the various pipeline\n> > > > > handlers and is implemented as an example for the RKSIP1 pipeline.\n> > > >\n> > > > Just to bridge the kernel side and libcamera side - there's a current\n> > > > series in progress that could impact this one :\n> > >\n> > > Thanks for setting up this link between kernel and libcamera. I wasn't\n> > > aware there's simultaneous work on flash control in libcamera. But of\n> > > course that's great to see :)\n> > >\n> > > Kieran, Matthias, please feel free to share your thoughts/feedback on\n> > > the kernel series.\n> > >\n> > > Apart from this series I have a few more flash/strobe related patches\n> > > in my downstream tree, which I will send as soon as this one got\n> > > merged. One thing that might me interesting to you is the strobe shift\n> > > functionality. It enables shifting the point of time the strobe\n> > > starts relatively (before and after) the exposure start.\n> >\n> > In general, I don't see any major problem with adding further controls here.\n> > But what is currently not supported is simply adding flash-specific v4l2\n> > controls to a camera sensor driver.\n> >\n> > The current implementation searches for a MEDIA_ENT_F_FLASH subdevice. This\n> > means that only the V4L2_CID_FLASH_* controls offered by such corresponding\n> > subdevices are used.\n> >\n> > Currently, I am only aware of three drivers that use V4L2_CID_FLASH_*\n> > controls without being a MEDIA_ENT_F_FLASH subdevice:\n> > media/usb/gspca/sn9c20x.c\n> > media/i2c/vd55g1.c\n> > media/i2c/vd56g3.c\n> >\n> > The ov9282 could now become another one.\n> >\n> > If a sensor also has some kind of flash controller integrated, I see two\n> > possibilities:\n> >\n> > a) The driver creates two subdevices (MEDIA_ENT_F_CAM_SENSOR and\n> > MEDIA_ENT_F_FLASH).\n> >\n> > b) libcamera implements a special solution and also searches the sensors for\n> > potential flash controls. Instead of a minimum requirement for the\n> > implemented controls, the controls that are found would simply be offered to\n> > the user. If a real flash controller is also present, the controls of both\n> > subdevices are combined and then assigned accordingly. The question is what\n> > to do if a control is offered by both subdevices.\n> >\n> > It's probably not difficult to guess that I would prefer option a) ;)\n>\n> Thanks for your feedback! I definitely got your point, but I'm uncertain\n> whether a MEDIA_ENT_F_FLASH subdevice is the most appropriate \"container\"\n> for this flash/strobe case.\n>\n> The ov9282 sensor provides only a configurable strobe signal output.\n> It doesn't contain an actual flash/LED driver or light source. It's\n> essentially a \"strobe/flash signal source\" rather than a \"flash device\".\n>\n> Therefore from a system perspective, the sensor's strobe output would\n> typically connect to an external flash controller or LED driver. The\n> sensor itself doesn't control the actual light emission, it just provides\n> the signal.\n\nIndeed, the ov9282 patch would correspond to the\nFlashStrobeSourceExternal mode described in the controls. It is not in\nitself a flash driver.\n\n> So this raises some questions to me:\n>\n> 1) Should a \"strobe signal source\" be contained in MEDIA_ENT_F_CAM_SENSOR\n>    or MEDIA_ENT_F_FLASH?\n>\n> 2) Would it make sense to create a separate subdevice type for such\n>    \"strobe signal sources\"?\n>\n> 3) Are there any ohter subdevices that provide similar \"signal\n>    generation\" functionality (for e.g. strobe/flash, focus, mechanical\n>    shutter, stabilizer, ...)? Understanding how these are or would be\n>    classified could provide some common ground for our case.\n\nAn external strobe signal source is almost always going to be from the sensor.\n\nOV9282 works quite nicely with flashes as it is a global shutter sensor.\n\nRolling shutter sensors have far more complications unless they either:\n- also have an mechanical shutter so that the array can be treated as\nhaving a global reset and readout.\n- or it's an LED flash that is kept on from at least the start of\nexposure of the first line to the end of readout of the last line.\n\nDavid and Naush have more experience in the mechanics of synchronising\nflashes, shutters, and readout than I do, so I'll defer to them for\nthe niggles.\n\n  Dave\n\n> I may be missing some important libcamera context here, as I'm no user\n> of it (yet?)... sorry for that ;)\n>\n> regards;rl\n>\n> >\n> > Best regards\n> >  ~Matthias\n> >\n> > >\n> > > regards;rl\n> > >\n> > > P.S.: If the libcamera-devel mailing list had been included in the\n> > > public-inbox at https://lore.kernel.org/, I likely would have found it\n> > > myself. Perhaps that's a possibility for the future? ;)\n> > >\n> > > >\n> > > >   - https://lore.kernel.org/all/20250901-ov9282-flash-strobe-v7-0-d58d5a694afc@linux.dev/\n> > > >\n> > > > This series adds two new v4l2 controls:\n> > > > - V4L2_CID_FLASH_DURATION: \"Strobe duration\": This control enables\n> > > >    setting a desired flash/strobe length/duration in 盜.\n> > > > - V4L2_CID_FLASH_HW_STROBE_SIGNAL: \"Hardware strobe signal\": This\n> > > >    control enables the hardware strobe output signal of a v4l2 device.\n> > > >\n> > > > As a first user of these new controls add basic flash/strobe support\n> > > > for ov9282 sensors using their \"hardware strobe output\". The duration\n> > > > calculation is only interpolated from various measurements, as no\n> > > > documentation was found.\n> > > >\n> > > > Further flash/strobe-related controls as well as a migration to v4l2-cci\n> > > > helpers for ov9282 will likely be implemented in future series.\n> > > >\n> > > > All register addresses/values are based on the OV9281 datasheet v1.53\n> > > > (january 2019). This series was tested using an ov9281 VisionComponents\n> > > > camera module.\n> > > >\n> > > > Signed-off-by: Richard Leitner <richard.leitner@linux.dev>\n> > > >\n> > > > that might add parts that would be relevant in this series.\n> > > >\n> > > > --\n> > > > Kieran\n> > > >\n> > > >\n> > > > >\n> > > > > Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n> > > > > ---\n> > > > > Matthias Fend (5):\n> > > > >        libcamera: control_ids_draft: Add flash controls\n> > > > >        libcamera: Add support for camera flash devices\n> > > > >        Documentation: Add flash driver requirements\n> > > > >        libcamera: Add flash helpers for pipeline handlers\n> > > > >        rkisp1: Add support for camera flash devices\n> > > > >\n> > > > >   Documentation/documentation-contents.rst      |   1 +\n> > > > >   Documentation/flash_driver_requirements.rst   |  40 +++++\n> > > > >   Documentation/index.rst                       |   1 +\n> > > > >   Documentation/meson.build                     |   1 +\n> > > > >   include/libcamera/internal/camera_flash.h     |  75 ++++++++\n> > > > >   include/libcamera/internal/camera_sensor.h    |   2 +\n> > > > >   include/libcamera/internal/flash_control.h    |  23 +++\n> > > > >   src/libcamera/camera_flash.cpp                | 248 ++++++++++++++++++++++++++\n> > > > >   src/libcamera/control_ids_draft.yaml          |  69 +++++++\n> > > > >   src/libcamera/flash_control.cpp               | 103 +++++++++++\n> > > > >   src/libcamera/meson.build                     |   2 +\n> > > > >   src/libcamera/pipeline/rkisp1/rkisp1.cpp      |   5 +\n> > > > >   src/libcamera/sensor/camera_sensor_legacy.cpp |  13 ++\n> > > > >   src/libcamera/sensor/camera_sensor_raw.cpp    |  13 ++\n> > > > >   14 files changed, 596 insertions(+)\n> > > > > ---\n> > > > > base-commit: d54e5537ca0909339bb6950f3a565c9077406a3c\n> > > > > change-id: 20250827-flash-support-dd67b41a82b9\n> > > > >\n> > > > > Best regards,\n> > > > > --\n> > > > > Matthias Fend <matthias.fend@emfend.at>\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 344EBBDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  4 Sep 2025 18:32:07 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F334769342;\n\tThu,  4 Sep 2025 20:32:05 +0200 (CEST)","from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com\n\t[IPv6:2607:f8b0:4864:20::1129])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A2A4D692EF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  4 Sep 2025 20:32:03 +0200 (CEST)","by mail-yw1-x1129.google.com with SMTP id\n\t00721157ae682-71d603acc23so13782357b3.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 04 Sep 2025 11:32:03 -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=\"TSU3Aoi+\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1757010722; x=1757615522;\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=ubHu1yTRuGp0SMeHROfMxP7fnlUaEt+0N5h6WJ4jn08=;\n\tb=TSU3Aoi+uYTuF0uymyrdteXoGeGDqh3ZEafa6QcR+PKxfJcVCEcQQP9hyxa6uT+pFT\n\t0WZSRIgl1J15qHbqJuyPydczv3zmeWRWr3ZN/RQpxdFaszreIqa50U+maM0MBVafuIbk\n\tNx3F6bR2dGMNK4tTuxPcJkI3mRmFIFS+1XMwgJisKWowyfMjKE0fc4k/vNIRJOthrSJm\n\tNjBuBkvtikt8ZaidNi2VQf1dTp4cnQ2JC3iYaHddNpsClhMyJ8c1DvAMw1ULVrfVypaq\n\toWFZwW3EWrPDqW8j14RXLkyOfnc3nh355EDVh/9HzpcsgprvUHqM8b5DYRyQaNoao2OR\n\tTxDw==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1757010722; x=1757615522;\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=ubHu1yTRuGp0SMeHROfMxP7fnlUaEt+0N5h6WJ4jn08=;\n\tb=P0KPNKG/CjtjmtNRMhxT3VIb9gaVBkmgTcIsVkW/sZSG+cnuaeL6sPSvl5jg2N6frC\n\tj7rz4jXG3O+HepmXEUEoSz6mEYeAwPS8U3YKWyo0DLmegOBrBV+7XI2BJmgRGBrs2D1M\n\tAJjmnxCx/Yq/UzwEXzKrwoHTWum9TK9Staj7aX3itUwJzlcTe6pHtMLXGQDFpA3Dxvkm\n\t/CnjbERQk98FneLaU9oHIr+okDDhc4aewXy0QnAnmfYFRktmf9jxbGRsWDBuqjGuzm9S\n\tgb2Yp9CUCMjT2y2VXq5O5z6UqJLoC+ehXP7aBpSeqLYrQv8slo6X7f6nP2aBIsFsBYfD\n\tF2Qg==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCWIksF5ZyCMa+BbvbQk61q+avqiOFmNOp0lqECAL3OJqALd4EQC5Th9XsV6TX7xm8Yw7LRHA1R66BqEd5X1F6Y=@lists.libcamera.org","X-Gm-Message-State":"AOJu0YzbP7t582b56IbUp/Ksk7r3IDaTQQWWDXnTorb50fzp+TiC4ipQ\n\tow/PHMTBC6eCEBPA7IBmTW9NYC9bsCkz2DpdXaBzw3S50V+IdpRJxZtf9nWlEoayJZh7KIiULZj\n\teAyp2mB4afnnokqpcR0zUV3PfHIwbosN6rJhqSa8gPg==","X-Gm-Gg":"ASbGncv9QRmQ84IZ//zm3WOQUgmLRLH/drHsH+7QSuen+995gasc6wK/H3H3z3mpSF8\n\tgf96a49LnyqPIrLxKG9aL+HfUl1zVWv+Y/5mnYKTpQt6GhErLN2B4PhiQHjc1kmDfuzGw9EpUN3\n\tfQEhHCirpNEcziNRB9XzUaUuGualRw8xR2RqEnya6EOS/rDSmKdbcYeQp6hTC9zdmaQibdqNaak\n\twXIr2gftBNHxYxle7iwbRX3aZJe8ey1xsGANQ==","X-Google-Smtp-Source":"AGHT+IEnSoqehJZ3xzhMMMfcSjKj46kX8ZrRlqTuUMVAcsv9Bp9sIcXIedIn5emL8GZnLPwHqbzyLpeogcl04WCAKgw=","X-Received":"by 2002:a05:690c:4d88:b0:721:67ba:6f08 with SMTP id\n\t00721157ae682-7227635cd26mr187349417b3.7.1757010722339;\n\tThu, 04 Sep 2025 11:32:02 -0700 (PDT)","MIME-Version":"1.0","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<175689751801.1721288.658818454466928732@ping.linuxembedded.co.uk>\n\t<zcgcq5j4l6q6k6k6zkhpebjfomuvbapedcaw2b2mfynkagf66g@gtzqu4hracx3>\n\t<92a0f26c-e65c-4f6c-beb1-4bc41c119076@emfend.at>\n\t<cqgudih467noec4nyc6pfwdu4ohe2ub2thi2hjgscxfkomdtza@7fd5q3hzzbjr>","In-Reply-To":"<cqgudih467noec4nyc6pfwdu4ohe2ub2thi2hjgscxfkomdtza@7fd5q3hzzbjr>","From":"Dave Stevenson <dave.stevenson@raspberrypi.com>","Date":"Thu, 4 Sep 2025 19:31:45 +0100","X-Gm-Features":"Ac12FXwXF9IsSUh870FtwlXlOMUvNcecIJVmzD_PkQ0gDkz8znBshWJbx0AjDGg","Message-ID":"<CAPY8ntAzDq1e=5J-m_BY=MHr+OBNOB1jeaZTNtjs1UZpkmgdXA@mail.gmail.com>","Subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","To":"Richard Leitner <richard.leitner@linux.dev>","Cc":"Matthias Fend <matthias.fend@emfend.at>, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>, \n\tSakari Ailus <sakari.ailus@linux.intel.com>, \n\tLaurent Pinchart <laurent.pinchart@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>"}},{"id":35699,"web_url":"https://patchwork.libcamera.org/comment/35699/","msgid":"<CAEmqJPq1eu0=bvRLWjP5x2gcyz3+9G5JggMc8_pMx4Vp2jr6zA@mail.gmail.com>","date":"2025-09-05T08:40:52","subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/people/34/","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"content":"On Thu, 4 Sept 2025 at 19:32, Dave Stevenson\n<dave.stevenson@raspberrypi.com> wrote:\n>\n> Hi Matthias and Richard\n>\n> On Thu, 4 Sept 2025 at 09:51, Richard Leitner <richard.leitner@linux.dev> wrote:\n> >\n> > Hi Matthias,\n> >\n> > looping in Sakari, Laurent and Dave as they are the main reviewers of the\n> > kernel series.\n> >\n> > On Thu, Sep 04, 2025 at 08:42:28AM +0200, Matthias Fend wrote:\n> > > Hi all,\n> > >\n> > > Am 03.09.2025 um 13:50 schrieb Richard Leitner:\n> > > > Hi Kieran,\n> > > >\n> > > > On Wed, Sep 03, 2025 at 12:05:18PM +0100, Kieran Bingham wrote:\n> > > > > Quoting Matthias Fend (2025-08-28 14:09:37)\n> > > > > > This series brings initial support for v4l2 flash devices.\n> > > > > >\n> > > > > > With these patches, v4l2 flash devices can be controlled by applications\n> > > > > > via libcamera controls. Applications therefore only require one API and do\n> > > > > > not have to worry about details such as finding the appropriate v4l2 flash\n> > > > > > device.\n> > > > > >\n> > > > > > The controls are currently quite transparent and no advanced flash\n> > > > > > sequences (pre-flash, AGC precorrection, etc.) are supported.\n> > > > > >\n> > > > > > This functionality should be easy to integrate into the various pipeline\n> > > > > > handlers and is implemented as an example for the RKSIP1 pipeline.\n> > > > >\n> > > > > Just to bridge the kernel side and libcamera side - there's a current\n> > > > > series in progress that could impact this one :\n> > > >\n> > > > Thanks for setting up this link between kernel and libcamera. I wasn't\n> > > > aware there's simultaneous work on flash control in libcamera. But of\n> > > > course that's great to see :)\n> > > >\n> > > > Kieran, Matthias, please feel free to share your thoughts/feedback on\n> > > > the kernel series.\n> > > >\n> > > > Apart from this series I have a few more flash/strobe related patches\n> > > > in my downstream tree, which I will send as soon as this one got\n> > > > merged. One thing that might me interesting to you is the strobe shift\n> > > > functionality. It enables shifting the point of time the strobe\n> > > > starts relatively (before and after) the exposure start.\n> > >\n> > > In general, I don't see any major problem with adding further controls here.\n> > > But what is currently not supported is simply adding flash-specific v4l2\n> > > controls to a camera sensor driver.\n> > >\n> > > The current implementation searches for a MEDIA_ENT_F_FLASH subdevice. This\n> > > means that only the V4L2_CID_FLASH_* controls offered by such corresponding\n> > > subdevices are used.\n> > >\n> > > Currently, I am only aware of three drivers that use V4L2_CID_FLASH_*\n> > > controls without being a MEDIA_ENT_F_FLASH subdevice:\n> > > media/usb/gspca/sn9c20x.c\n> > > media/i2c/vd55g1.c\n> > > media/i2c/vd56g3.c\n> > >\n> > > The ov9282 could now become another one.\n> > >\n> > > If a sensor also has some kind of flash controller integrated, I see two\n> > > possibilities:\n> > >\n> > > a) The driver creates two subdevices (MEDIA_ENT_F_CAM_SENSOR and\n> > > MEDIA_ENT_F_FLASH).\n> > >\n> > > b) libcamera implements a special solution and also searches the sensors for\n> > > potential flash controls. Instead of a minimum requirement for the\n> > > implemented controls, the controls that are found would simply be offered to\n> > > the user. If a real flash controller is also present, the controls of both\n> > > subdevices are combined and then assigned accordingly. The question is what\n> > > to do if a control is offered by both subdevices.\n> > >\n> > > It's probably not difficult to guess that I would prefer option a) ;)\n> >\n> > Thanks for your feedback! I definitely got your point, but I'm uncertain\n> > whether a MEDIA_ENT_F_FLASH subdevice is the most appropriate \"container\"\n> > for this flash/strobe case.\n> >\n> > The ov9282 sensor provides only a configurable strobe signal output.\n> > It doesn't contain an actual flash/LED driver or light source. It's\n> > essentially a \"strobe/flash signal source\" rather than a \"flash device\".\n> >\n> > Therefore from a system perspective, the sensor's strobe output would\n> > typically connect to an external flash controller or LED driver. The\n> > sensor itself doesn't control the actual light emission, it just provides\n> > the signal.\n>\n> Indeed, the ov9282 patch would correspond to the\n> FlashStrobeSourceExternal mode described in the controls. It is not in\n> itself a flash driver.\n>\n> > So this raises some questions to me:\n> >\n> > 1) Should a \"strobe signal source\" be contained in MEDIA_ENT_F_CAM_SENSOR\n> >    or MEDIA_ENT_F_FLASH?\n> >\n> > 2) Would it make sense to create a separate subdevice type for such\n> >    \"strobe signal sources\"?\n> >\n> > 3) Are there any ohter subdevices that provide similar \"signal\n> >    generation\" functionality (for e.g. strobe/flash, focus, mechanical\n> >    shutter, stabilizer, ...)? Understanding how these are or would be\n> >    classified could provide some common ground for our case.\n>\n> An external strobe signal source is almost always going to be from the sensor.\n>\n> OV9282 works quite nicely with flashes as it is a global shutter sensor.\n>\n> Rolling shutter sensors have far more complications unless they either:\n> - also have an mechanical shutter so that the array can be treated as\n> having a global reset and readout.\n> - or it's an LED flash that is kept on from at least the start of\n> exposure of the first line to the end of readout of the last line.\n>\n> David and Naush have more experience in the mechanics of synchronising\n> flashes, shutters, and readout than I do, so I'll defer to them for\n> the niggles.\n\nI can confirm there are many (many!) niggles syncing flash devices\nwith sensor readout :)\n\nI'll write out my thoughts and experiences at some point, but as David\nmentioned in a previous email, flash support really wants to include\nthe AGC algorithm considerations as well as the device side (sensor\n<-> flash) operations.\n\nRegards,\nNaush\n\n\n>\n>   Dave\n>\n> > I may be missing some important libcamera context here, as I'm no user\n> > of it (yet?)... sorry for that ;)\n> >\n> > regards;rl\n> >\n> > >\n> > > Best regards\n> > >  ~Matthias\n> > >\n> > > >\n> > > > regards;rl\n> > > >\n> > > > P.S.: If the libcamera-devel mailing list had been included in the\n> > > > public-inbox at https://lore.kernel.org/, I likely would have found it\n> > > > myself. Perhaps that's a possibility for the future? ;)\n> > > >\n> > > > >\n> > > > >   - https://lore.kernel.org/all/20250901-ov9282-flash-strobe-v7-0-d58d5a694afc@linux.dev/\n> > > > >\n> > > > > This series adds two new v4l2 controls:\n> > > > > - V4L2_CID_FLASH_DURATION: \"Strobe duration\": This control enables\n> > > > >    setting a desired flash/strobe length/duration in 盜.\n> > > > > - V4L2_CID_FLASH_HW_STROBE_SIGNAL: \"Hardware strobe signal\": This\n> > > > >    control enables the hardware strobe output signal of a v4l2 device.\n> > > > >\n> > > > > As a first user of these new controls add basic flash/strobe support\n> > > > > for ov9282 sensors using their \"hardware strobe output\". The duration\n> > > > > calculation is only interpolated from various measurements, as no\n> > > > > documentation was found.\n> > > > >\n> > > > > Further flash/strobe-related controls as well as a migration to v4l2-cci\n> > > > > helpers for ov9282 will likely be implemented in future series.\n> > > > >\n> > > > > All register addresses/values are based on the OV9281 datasheet v1.53\n> > > > > (january 2019). This series was tested using an ov9281 VisionComponents\n> > > > > camera module.\n> > > > >\n> > > > > Signed-off-by: Richard Leitner <richard.leitner@linux.dev>\n> > > > >\n> > > > > that might add parts that would be relevant in this series.\n> > > > >\n> > > > > --\n> > > > > Kieran\n> > > > >\n> > > > >\n> > > > > >\n> > > > > > Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n> > > > > > ---\n> > > > > > Matthias Fend (5):\n> > > > > >        libcamera: control_ids_draft: Add flash controls\n> > > > > >        libcamera: Add support for camera flash devices\n> > > > > >        Documentation: Add flash driver requirements\n> > > > > >        libcamera: Add flash helpers for pipeline handlers\n> > > > > >        rkisp1: Add support for camera flash devices\n> > > > > >\n> > > > > >   Documentation/documentation-contents.rst      |   1 +\n> > > > > >   Documentation/flash_driver_requirements.rst   |  40 +++++\n> > > > > >   Documentation/index.rst                       |   1 +\n> > > > > >   Documentation/meson.build                     |   1 +\n> > > > > >   include/libcamera/internal/camera_flash.h     |  75 ++++++++\n> > > > > >   include/libcamera/internal/camera_sensor.h    |   2 +\n> > > > > >   include/libcamera/internal/flash_control.h    |  23 +++\n> > > > > >   src/libcamera/camera_flash.cpp                | 248 ++++++++++++++++++++++++++\n> > > > > >   src/libcamera/control_ids_draft.yaml          |  69 +++++++\n> > > > > >   src/libcamera/flash_control.cpp               | 103 +++++++++++\n> > > > > >   src/libcamera/meson.build                     |   2 +\n> > > > > >   src/libcamera/pipeline/rkisp1/rkisp1.cpp      |   5 +\n> > > > > >   src/libcamera/sensor/camera_sensor_legacy.cpp |  13 ++\n> > > > > >   src/libcamera/sensor/camera_sensor_raw.cpp    |  13 ++\n> > > > > >   14 files changed, 596 insertions(+)\n> > > > > > ---\n> > > > > > base-commit: d54e5537ca0909339bb6950f3a565c9077406a3c\n> > > > > > change-id: 20250827-flash-support-dd67b41a82b9\n> > > > > >\n> > > > > > Best regards,\n> > > > > > --\n> > > > > > Matthias Fend <matthias.fend@emfend.at>\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 F293ABEFBE\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  5 Sep 2025 08:41:32 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ACA2569333;\n\tFri,  5 Sep 2025 10:41:31 +0200 (CEST)","from mail-ua1-x935.google.com (mail-ua1-x935.google.com\n\t[IPv6:2607:f8b0:4864:20::935])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 32577613A8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  5 Sep 2025 10:41:29 +0200 (CEST)","by mail-ua1-x935.google.com with SMTP id\n\ta1e0cc1a2514c-8987c2aaf58so56131241.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 05 Sep 2025 01:41:29 -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=\"b/FQaPDn\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1757061688; x=1757666488;\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=qlaD3dZZuSjOBM2QtC55LjoTVrwBkU3zz1p2bUbWu0g=;\n\tb=b/FQaPDn8Xkb1lBvAoiFQ0L+5DMxFkCPMJOCtP+BpN1cvPlanCvjYShu69AR0fnLQZ\n\toSgKvFbqanRhRIwnP7PKJRAg46vTSb66k5EtfpN4MMdLghaoBSW5ikzGHtm4Lu/oxQI6\n\t4lTNNvEvM+azdewp4+uagrFue/QeKF3eXXTRybwar7RlbnR6yUsqeZZsZhcbk2jT4NHW\n\tI28clOseQuo6a7JGWocFKSAvUPvAxjuoIR2QrsvjsKJ0Aw7TEKBs7FMMunCk6Gxg8D8y\n\tno1T1zD0bwIGIa0Lc7ctBNwSuDBKp0yftn7bvxitL/E+s+bbT5cgb+af8ErDJM6RvbtF\n\teNlA==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1757061688; x=1757666488;\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=qlaD3dZZuSjOBM2QtC55LjoTVrwBkU3zz1p2bUbWu0g=;\n\tb=n8SOfdiXWp5HQQlTRw0gawQ3iK6Vm6sxX+gRh7dZLvBR+Cg1WxXoyulNewzc2LNj8A\n\tcyL7XBW8XKV/Axoo1Oj7CCOKnQxGxx/WR4c9QvxSkGj6vPLMa4kzUccqzCtWhBEVWB8H\n\t6ghBF3E+Ngsz98oe7pX7pP/VIaNt12IWj4U+QjJHaCHSoGQQZzck4588Z+af+qnwKXH8\n\tmB+0yHHZtmEWu72dF8Wsmi7bkdbnEmw0MezDCdFm9NLEtfg7FPZXpF7DqQRA05Sfo9Xb\n\tdK4UT+x/cKU3hCreWjtNT/WouKFRSdltxlUdsmW6mC0Q+tM/FJHVt0a0zk7VuIzyYr6Q\n\tfpvA==","X-Forwarded-Encrypted":"i=1;\n\tAJvYcCWoR0krheBurDZfMwhcDsOMnfTaMu3++U4KB3SZt6oHDbkcsE+5yVwevBkN1QktK7QQJWmrYm3ZMK8HtXcHix0=@lists.libcamera.org","X-Gm-Message-State":"AOJu0Yxr6iAYvEE7cApyGIefzD4oQT0fO+xfmLrBfcL4dRMrFgATv4gk\n\tFg+f5Oj3rijnbazoVe+l3xeaOBqszIw8+4L/9nD9HP3F+TFvCDVfxMAQOMJe3oyT8LjelMsvTY9\n\tYIqrhXdSisNzzMePGTRHyiAlKgifSPLjGHpYyNtheXQ==","X-Gm-Gg":"ASbGncsgE9R50GbuhMrHJvsUGRJDa+Egdlm46Aq8t72aw/gUjF2ljmx4LpBQmq0qyui\n\t8qyUhuWPvnicSzCBySZtrtJPjuc+/HOvg7uo6lk5TKW4a1eC45XMLwpCuI7AzMChKOOCyfjf8Qr\n\twV/qIXKggnG49+VIzOgbwWb5baSvhZHBsKS2x6LLzDh/wpTyNk4ksQF99C+5HbWp5nrn6a0Xj6C\n\tA1yRlRSvEoYq4GToRoJdpgIw30xaV0wKD9syFY=","X-Google-Smtp-Source":"AGHT+IGjHnu95plddTYjVsDhMtnEw29eSGtnLa4H4z/m2Z+od0yN4na2yT5WkYxBekmc7QfpTtQqQuE6K8AuMrwpDoY=","X-Received":"by 2002:a05:6102:8025:b0:535:af8c:ba29 with SMTP id\n\tada2fe7eead31-535af8cbcdamr1158658137.7.1757061687782;\n\tFri, 05 Sep 2025 01:41:27 -0700 (PDT)","MIME-Version":"1.0","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<175689751801.1721288.658818454466928732@ping.linuxembedded.co.uk>\n\t<zcgcq5j4l6q6k6k6zkhpebjfomuvbapedcaw2b2mfynkagf66g@gtzqu4hracx3>\n\t<92a0f26c-e65c-4f6c-beb1-4bc41c119076@emfend.at>\n\t<cqgudih467noec4nyc6pfwdu4ohe2ub2thi2hjgscxfkomdtza@7fd5q3hzzbjr>\n\t<CAPY8ntAzDq1e=5J-m_BY=MHr+OBNOB1jeaZTNtjs1UZpkmgdXA@mail.gmail.com>","In-Reply-To":"<CAPY8ntAzDq1e=5J-m_BY=MHr+OBNOB1jeaZTNtjs1UZpkmgdXA@mail.gmail.com>","From":"Naushir Patuck <naush@raspberrypi.com>","Date":"Fri, 5 Sep 2025 09:40:52 +0100","X-Gm-Features":"Ac12FXzFO2hDrdd6w8JCbUdtXguVlr1rIeuXf6S56SFLLWP0XkGsICa9Nt6k94E","Message-ID":"<CAEmqJPq1eu0=bvRLWjP5x2gcyz3+9G5JggMc8_pMx4Vp2jr6zA@mail.gmail.com>","Subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","To":"Dave Stevenson <dave.stevenson@raspberrypi.com>","Cc":"Richard Leitner <richard.leitner@linux.dev>,\n\tMatthias Fend <matthias.fend@emfend.at>, \n\tKieran Bingham <kieran.bingham@ideasonboard.com>, \n\tSakari Ailus <sakari.ailus@linux.intel.com>, \n\tLaurent Pinchart <laurent.pinchart@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>"}},{"id":35716,"web_url":"https://patchwork.libcamera.org/comment/35716/","msgid":"<20250907204526.GC4105@pendragon.ideasonboard.com>","date":"2025-09-07T20:45:26","subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Diving in this discussion after reviewing the kernel series from\nRichard.\n\nOn Fri, Sep 05, 2025 at 09:40:52AM +0100, Naushir Patuck wrote:\n> On Thu, 4 Sept 2025 at 19:32, Dave Stevenson wrote:\n> > On Thu, 4 Sept 2025 at 09:51, Richard Leitner wrote:\n> > > On Thu, Sep 04, 2025 at 08:42:28AM +0200, Matthias Fend wrote:\n> > > > Am 03.09.2025 um 13:50 schrieb Richard Leitner:\n> > > > > On Wed, Sep 03, 2025 at 12:05:18PM +0100, Kieran Bingham wrote:\n> > > > > > Quoting Matthias Fend (2025-08-28 14:09:37)\n> > > > > > > This series brings initial support for v4l2 flash devices.\n> > > > > > >\n> > > > > > > With these patches, v4l2 flash devices can be controlled by applications\n> > > > > > > via libcamera controls. Applications therefore only require one API and do\n> > > > > > > not have to worry about details such as finding the appropriate v4l2 flash\n> > > > > > > device.\n> > > > > > >\n> > > > > > > The controls are currently quite transparent and no advanced flash\n> > > > > > > sequences (pre-flash, AGC precorrection, etc.) are supported.\n> > > > > > >\n> > > > > > > This functionality should be easy to integrate into the various pipeline\n> > > > > > > handlers and is implemented as an example for the RKSIP1 pipeline.\n> > > > > >\n> > > > > > Just to bridge the kernel side and libcamera side - there's a current\n> > > > > > series in progress that could impact this one :\n> > > > >\n> > > > > Thanks for setting up this link between kernel and libcamera. I wasn't\n> > > > > aware there's simultaneous work on flash control in libcamera. But of\n> > > > > course that's great to see :)\n> > > > >\n> > > > > Kieran, Matthias, please feel free to share your thoughts/feedback on\n> > > > > the kernel series.\n> > > > >\n> > > > > Apart from this series I have a few more flash/strobe related patches\n> > > > > in my downstream tree, which I will send as soon as this one got\n> > > > > merged. One thing that might me interesting to you is the strobe shift\n> > > > > functionality. It enables shifting the point of time the strobe\n> > > > > starts relatively (before and after) the exposure start.\n> > > >\n> > > > In general, I don't see any major problem with adding further controls here.\n> > > > But what is currently not supported is simply adding flash-specific v4l2\n> > > > controls to a camera sensor driver.\n> > > >\n> > > > The current implementation searches for a MEDIA_ENT_F_FLASH subdevice. This\n> > > > means that only the V4L2_CID_FLASH_* controls offered by such corresponding\n> > > > subdevices are used.\n> > > >\n> > > > Currently, I am only aware of three drivers that use V4L2_CID_FLASH_*\n> > > > controls without being a MEDIA_ENT_F_FLASH subdevice:\n> > > > media/usb/gspca/sn9c20x.c\n> > > > media/i2c/vd55g1.c\n> > > > media/i2c/vd56g3.c\n> > > >\n> > > > The ov9282 could now become another one.\n> > > >\n> > > > If a sensor also has some kind of flash controller integrated, I see two\n> > > > possibilities:\n> > > >\n> > > > a) The driver creates two subdevices (MEDIA_ENT_F_CAM_SENSOR and\n> > > > MEDIA_ENT_F_FLASH).\n> > > >\n> > > > b) libcamera implements a special solution and also searches the sensors for\n> > > > potential flash controls. Instead of a minimum requirement for the\n> > > > implemented controls, the controls that are found would simply be offered to\n> > > > the user. If a real flash controller is also present, the controls of both\n> > > > subdevices are combined and then assigned accordingly. The question is what\n> > > > to do if a control is offered by both subdevices.\n> > > >\n> > > > It's probably not difficult to guess that I would prefer option a) ;)\n> > >\n> > > Thanks for your feedback! I definitely got your point, but I'm uncertain\n> > > whether a MEDIA_ENT_F_FLASH subdevice is the most appropriate \"container\"\n> > > for this flash/strobe case.\n> > >\n> > > The ov9282 sensor provides only a configurable strobe signal output.\n> > > It doesn't contain an actual flash/LED driver or light source. It's\n> > > essentially a \"strobe/flash signal source\" rather than a \"flash device\".\n> > >\n> > > Therefore from a system perspective, the sensor's strobe output would\n> > > typically connect to an external flash controller or LED driver. The\n> > > sensor itself doesn't control the actual light emission, it just provides\n> > > the signal.\n> >\n> > Indeed, the ov9282 patch would correspond to the\n> > FlashStrobeSourceExternal mode described in the controls. It is not in\n> > itself a flash driver.\n\nThat's right, so I don't think it should expose a flash subdevice. The\nsensor driver shouldn't expose a strobe source control either, that\nshould be exposed by the flash controller driver.\n\n> > > So this raises some questions to me:\n> > >\n> > > 1) Should a \"strobe signal source\" be contained in MEDIA_ENT_F_CAM_SENSOR\n> > >    or MEDIA_ENT_F_FLASH?\n\nOnly in the flash controller in my opinion.\n\n> > > 2) Would it make sense to create a separate subdevice type for such\n> > >    \"strobe signal sources\"?\n\nI don't see a need for that.\n\n> > > 3) Are there any ohter subdevices that provide similar \"signal\n> > >    generation\" functionality (for e.g. strobe/flash, focus, mechanical\n> > >    shutter, stabilizer, ...)? Understanding how these are or would be\n> > >    classified could provide some common ground for our case.\n> >\n> > An external strobe signal source is almost always going to be from the sensor.\n> >\n> > OV9282 works quite nicely with flashes as it is a global shutter sensor.\n> >\n> > Rolling shutter sensors have far more complications unless they either:\n> > - also have an mechanical shutter so that the array can be treated as\n> > having a global reset and readout.\n> > - or it's an LED flash that is kept on from at least the start of\n> > exposure of the first line to the end of readout of the last line.\n> >\n> > David and Naush have more experience in the mechanics of synchronising\n> > flashes, shutters, and readout than I do, so I'll defer to them for\n> > the niggles.\n> \n> I can confirm there are many (many!) niggles syncing flash devices\n> with sensor readout :)\n> \n> I'll write out my thoughts and experiences at some point, but as David\n> mentioned in a previous email, flash support really wants to include\n> the AGC algorithm considerations as well as the device side (sensor\n> <-> flash) operations.\n\nI agree. I think the API proposed in this series is too low level. I\nwould like something more application-friendly, making it possible to\nwrite portable applications that wouldn't require knowledge of which\nhardware they run on.\n\n> > > I may be missing some important libcamera context here, as I'm no user\n> > > of it (yet?)... sorry for that ;)\n> > >\n> > > > > P.S.: If the libcamera-devel mailing list had been included in the\n> > > > > public-inbox at https://lore.kernel.org/, I likely would have found it\n> > > > > myself. Perhaps that's a possibility for the future? ;)\n\nI'm planning to add a public-inbox instance for libcamera, but I wasn't\nconsidering getting it exposed through lore.kernel.org. libcamera isn't\na kernel project, so it would feel a bit like opening pandora's box and\nasking for Konstantin to mirror all userspace mailing lists.\n\n> > > > > >   - https://lore.kernel.org/all/20250901-ov9282-flash-strobe-v7-0-d58d5a694afc@linux.dev/\n> > > > > >\n> > > > > > This series adds two new v4l2 controls:\n> > > > > > - V4L2_CID_FLASH_DURATION: \"Strobe duration\": This control enables\n> > > > > >    setting a desired flash/strobe length/duration in 盜.\n> > > > > > - V4L2_CID_FLASH_HW_STROBE_SIGNAL: \"Hardware strobe signal\": This\n> > > > > >    control enables the hardware strobe output signal of a v4l2 device.\n> > > > > >\n> > > > > > As a first user of these new controls add basic flash/strobe support\n> > > > > > for ov9282 sensors using their \"hardware strobe output\". The duration\n> > > > > > calculation is only interpolated from various measurements, as no\n> > > > > > documentation was found.\n> > > > > >\n> > > > > > Further flash/strobe-related controls as well as a migration to v4l2-cci\n> > > > > > helpers for ov9282 will likely be implemented in future series.\n> > > > > >\n> > > > > > All register addresses/values are based on the OV9281 datasheet v1.53\n> > > > > > (january 2019). This series was tested using an ov9281 VisionComponents\n> > > > > > camera module.\n> > > > > >\n> > > > > > Signed-off-by: Richard Leitner <richard.leitner@linux.dev>\n> > > > > >\n> > > > > > that might add parts that would be relevant in this series.\n> > > > > >\n> > > > > > > Signed-off-by: Matthias Fend <matthias.fend@emfend.at>\n> > > > > > > ---\n> > > > > > > Matthias Fend (5):\n> > > > > > >        libcamera: control_ids_draft: Add flash controls\n> > > > > > >        libcamera: Add support for camera flash devices\n> > > > > > >        Documentation: Add flash driver requirements\n> > > > > > >        libcamera: Add flash helpers for pipeline handlers\n> > > > > > >        rkisp1: Add support for camera flash devices\n> > > > > > >\n> > > > > > >   Documentation/documentation-contents.rst      |   1 +\n> > > > > > >   Documentation/flash_driver_requirements.rst   |  40 +++++\n> > > > > > >   Documentation/index.rst                       |   1 +\n> > > > > > >   Documentation/meson.build                     |   1 +\n> > > > > > >   include/libcamera/internal/camera_flash.h     |  75 ++++++++\n> > > > > > >   include/libcamera/internal/camera_sensor.h    |   2 +\n> > > > > > >   include/libcamera/internal/flash_control.h    |  23 +++\n> > > > > > >   src/libcamera/camera_flash.cpp                | 248 ++++++++++++++++++++++++++\n> > > > > > >   src/libcamera/control_ids_draft.yaml          |  69 +++++++\n> > > > > > >   src/libcamera/flash_control.cpp               | 103 +++++++++++\n> > > > > > >   src/libcamera/meson.build                     |   2 +\n> > > > > > >   src/libcamera/pipeline/rkisp1/rkisp1.cpp      |   5 +\n> > > > > > >   src/libcamera/sensor/camera_sensor_legacy.cpp |  13 ++\n> > > > > > >   src/libcamera/sensor/camera_sensor_raw.cpp    |  13 ++\n> > > > > > >   14 files changed, 596 insertions(+)\n> > > > > > > ---\n> > > > > > > base-commit: d54e5537ca0909339bb6950f3a565c9077406a3c\n> > > > > > > change-id: 20250827-flash-support-dd67b41a82b9","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 D84B8BDB13\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  7 Sep 2025 20:45:50 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9B93369353;\n\tSun,  7 Sep 2025 22:45:49 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B97EF6934F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun,  7 Sep 2025 22:45:47 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(230.215-178-91.adsl-dyn.isp.belgacom.be [91.178.215.230])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id A91F919E7; \n\tSun,  7 Sep 2025 22:44:35 +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=\"fgjgwKX7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1757277875;\n\tbh=FCHY3L3ESIeTUZWkdgqzGcdVkmM/cRzan95cVEEjwyM=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=fgjgwKX71RZpc6EdnBZmBdNdo5hl7cxnPwMEL41vhub6Q36WyrY3EiXIqZLF2fwdn\n\tE2hgkCHHe+fvbnxlx0RO9OoMmB+eYykL8+H46PfCGGpBo858Evx4rPurB5GtCK1jFu\n\tmHfWuQ7p8bBSL5VPT/uZdHEUfGkVlc6WImpU8Z2E=","Date":"Sun, 7 Sep 2025 22:45:26 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Naushir Patuck <naush@raspberrypi.com>","Cc":"Dave Stevenson <dave.stevenson@raspberrypi.com>,\n\tRichard Leitner <richard.leitner@linux.dev>,\n\tMatthias Fend <matthias.fend@emfend.at>,\n\tKieran Bingham <kieran.bingham@ideasonboard.com>,\n\tSakari Ailus <sakari.ailus@linux.intel.com>,\n\tlibcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH 0/5] Support for v4l2 flash devices","Message-ID":"<20250907204526.GC4105@pendragon.ideasonboard.com>","References":"<20250828-flash-support-v1-0-4c5dc674a05b@emfend.at>\n\t<175689751801.1721288.658818454466928732@ping.linuxembedded.co.uk>\n\t<zcgcq5j4l6q6k6k6zkhpebjfomuvbapedcaw2b2mfynkagf66g@gtzqu4hracx3>\n\t<92a0f26c-e65c-4f6c-beb1-4bc41c119076@emfend.at>\n\t<cqgudih467noec4nyc6pfwdu4ohe2ub2thi2hjgscxfkomdtza@7fd5q3hzzbjr>\n\t<CAPY8ntAzDq1e=5J-m_BY=MHr+OBNOB1jeaZTNtjs1UZpkmgdXA@mail.gmail.com>\n\t<CAEmqJPq1eu0=bvRLWjP5x2gcyz3+9G5JggMc8_pMx4Vp2jr6zA@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<CAEmqJPq1eu0=bvRLWjP5x2gcyz3+9G5JggMc8_pMx4Vp2jr6zA@mail.gmail.com>","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>"}}]