[{"id":38407,"web_url":"https://patchwork.libcamera.org/comment/38407/","msgid":"<acQLP196OJFa-vc4@zed>","date":"2026-03-25T16:39:22","subject":"Re: [PATCH v1 1/4] libcamera: v4l2_device: Ensure consistent control\n\ttypes","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Barnabás\n\nOn Wed, Mar 25, 2026 at 10:26:56AM +0100, Barnabás Pőcze wrote:\n> While `setControls()` uses the specific types, `updateControls()` converts\n> everything to 32-bit integers (except 64-bit integers). This causes, for\n> example, that a 16-bit unsigned integer is retrieved as `int32_t` even\n> though there is a specific libcamera control type for it. What's even\n> more surprising is that setting such a control requires a `ControlValue`\n> with `uint16_t`, but when `setControls()` updates the list to contain\n> the actually applied values, it will now have type `int32_t`.\n\nI think this boils down the fact struct v4l2_ext_control has only\n\n\tunion {\n\t\t__s32 value;\n\t\t__s64 value64;\n\nfor non-matrix controls.\n\nThe v4l2-ctrl framework populates \"value\" for all control types which\nare < V4L2_CTRL_TYPE_INTEGER64.\n\n\n>\n> So make sure that `updateControls()` uses the appropriate type.\n>\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>  src/libcamera/v4l2_device.cpp | 25 ++++++++++++++++---------\n>  1 file changed, 16 insertions(+), 9 deletions(-)\n>\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index 67bbaa037..e0099cb7a 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -823,19 +823,26 @@ void V4L2Device::updateControls(ControlList *ctrls,\n>  \t\tASSERT(iter != controls_.end());\n>\n>  \t\tswitch (iter->first->type()) {\n> +\t\tcase ControlTypeByte:\n> +\t\t\tvalue.set<uint8_t>(v4l2Ctrl.value);\n> +\t\t\tbreak;\n> +\t\tcase ControlTypeUnsigned16:\n> +\t\t\tvalue.set<uint16_t>(v4l2Ctrl.value);\n> +\t\t\tbreak;\n> +\t\tcase ControlTypeInteger32:\n> +\t\t\tvalue.set<int32_t>(v4l2Ctrl.value);\n> +\t\t\tbreak;\n> +\t\tcase ControlTypeUnsigned32:\n> +\t\t\tvalue.set<uint32_t>(v4l2Ctrl.value);\n> +\t\t\tbreak;\n\nHowever, since we have types for the libcamera controls, I would say\nthat unless I'm missing something obvious it is fine to cast to the\nactual libcamera control size even if it shouldn't practically change\nanything ?\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n   j\n>  \t\tcase ControlTypeInteger64:\n>  \t\t\tvalue.set<int64_t>(v4l2Ctrl.value64);\n>  \t\t\tbreak;\n> -\n>  \t\tdefault:\n> -\t\t\t/*\n> -\t\t\t * Note: this catches the ControlTypeInteger32 case.\n> -\t\t\t *\n> -\t\t\t * \\todo To be changed when support for string controls\n> -\t\t\t * will be added.\n> -\t\t\t */\n> -\t\t\tvalue.set<int32_t>(v4l2Ctrl.value);\n> -\t\t\tbreak;\n> +\t\t\tLOG(V4L2, Error)\n> +\t\t\t\t<< \"Control \" << utils::hex(id)\n> +\t\t\t\t<< \" has unsupported type\";\n> +\t\t\tcontinue;\n>  \t\t}\n>\n>  \t\tctrls->set(id, value);\n> --\n> 2.53.0\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 62041BE086\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 25 Mar 2026 16:39:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 82F7F6283E;\n\tWed, 25 Mar 2026 17:39:26 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ECD6A6274D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Mar 2026 17:39:24 +0100 (CET)","from ideasonboard.com (net-93-65-100-155.cust.vodafonedsl.it\n\t[93.65.100.155])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C7F5F10BE;\n\tWed, 25 Mar 2026 17:38:06 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"NI8ra/zh\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1774456686;\n\tbh=jzkv9PgeiLtg0YrQCJ3UrUFp6k+Uui9z3zJY4rSvXIg=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=NI8ra/zhco6OwSYILBjWb/UX6P+Bq0wtHy4ZSk/qpoRPuid8lWkbXOcpKQxlpC72+\n\tD+JX0Oux6UbfDVyhOCxhjOqhIfcIHXCtnggIOdLrbHENqRsXjhPyrLH4DfDkWD46tN\n\tJgBF5lOPSpAF12M0D6+7T3VpZNUAtsXcFNBVkDZ8=","Date":"Wed, 25 Mar 2026 17:39:22 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1 1/4] libcamera: v4l2_device: Ensure consistent control\n\ttypes","Message-ID":"<acQLP196OJFa-vc4@zed>","References":"<20260325092659.79453-1-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20260325092659.79453-1-barnabas.pocze@ideasonboard.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>"}},{"id":38410,"web_url":"https://patchwork.libcamera.org/comment/38410/","msgid":"<acQTA-OxG7PeHHiv@zed>","date":"2026-03-25T16:56:34","subject":"Re: [PATCH v1 4/4] libcamera: v4l2_device: setControls(): Do not\n\tfall back to int32_t","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Barnabás\n\nOn Wed, Mar 25, 2026 at 10:26:59AM +0100, Barnabás Pőcze wrote:\n> When setting a control, if its type is not explicitly supported, do not fall\n> back to int32_t as that is unlikely to be correct and will abort the program.\n> Instead print an error and return -ENOTSUP.\n\nIf I understand correctly all v4l2-control types matched to libcamera\ncontrol types in  V4L2Device::v4l2CtrlType() are now handled.\n\n>\n> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n> ---\n>  src/libcamera/v4l2_device.cpp | 7 ++++---\n>  1 file changed, 4 insertions(+), 3 deletions(-)\n>\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index 426664b83..6ad1d178e 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -394,9 +394,10 @@ int V4L2Device::setControls(ControlList *ctrls, const V4L2Request *request)\n>  \t\t}\n>\n>  \t\tdefault:\n> -\t\t\t/* \\todo To be changed to support strings. */\n\nThis mention strings, but strigs are deflected to ControlTypeNone in\nV4L2Device::v4l2CtrlType()\n\n> -\t\t\tv4l2Ctrl.value = value.get<int32_t>();\n\nand this wasn't correct.\n\n> -\t\t\tbreak;\n> +\t\t\tLOG(V4L2, Error)\n> +\t\t\t\t<< \"Control \" << utils::hex(id)\n> +\t\t\t\t<< \" has unsupported type\";\n> +\t\t\treturn -ENOTSUP;\n\nWill it break some users ? It shouldn't because of the above reasoning\naround the v4l2-ctrl-to-libcamera-ctrl type translation\n\nReviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n\nThanks\n  j\n>  \t\t}\n>  \t}\n>\n> --\n> 2.53.0\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 34FA9BD87C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 25 Mar 2026 16:56:40 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 82F8462846;\n\tWed, 25 Mar 2026 17:56:39 +0100 (CET)","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 8D8036283E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Mar 2026 17:56:37 +0100 (CET)","from ideasonboard.com (net-93-65-100-155.cust.vodafonedsl.it\n\t[93.65.100.155])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 2F8BF10BE;\n\tWed, 25 Mar 2026 17:55:19 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"jfBnG+NA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1774457719;\n\tbh=VexXj8S0/ltJ7ATSgeb3pYg6TsNN3W+UrfRHsZzCQ34=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=jfBnG+NAFWdLxWxNNc/+9oHM5FLqon59SGFtyNu51jDCKUXZnzd8j/RtS3xvE3Boj\n\t2QHeBLcypPS3ZF130t4aAPspffSMjWN6LvypraRjTKL/xgSzz7Voo6PvK7eUnmZ9eF\n\tXZSWHdeFpKq4MlZN3eBJ6Ek7PqDPJXluy5HRygBY=","Date":"Wed, 25 Mar 2026 17:56:34 +0100","From":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","To":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Subject":"Re: [PATCH v1 4/4] libcamera: v4l2_device: setControls(): Do not\n\tfall back to int32_t","Message-ID":"<acQTA-OxG7PeHHiv@zed>","References":"<20260325092659.79453-1-barnabas.pocze@ideasonboard.com>\n\t<20260325092659.79453-4-barnabas.pocze@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20260325092659.79453-4-barnabas.pocze@ideasonboard.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>"}},{"id":38425,"web_url":"https://patchwork.libcamera.org/comment/38425/","msgid":"<dcc3b024-8f0e-44cd-aef2-2e084938cbd1@ideasonboard.com>","date":"2026-03-27T07:47:06","subject":"Re: [PATCH v1 1/4] libcamera: v4l2_device: Ensure consistent control\n\ttypes","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 03. 25. 17:39 keltezéssel, Jacopo Mondi írta:\n> Hi Barnabás\n> \n> On Wed, Mar 25, 2026 at 10:26:56AM +0100, Barnabás Pőcze wrote:\n>> While `setControls()` uses the specific types, `updateControls()` converts\n>> everything to 32-bit integers (except 64-bit integers). This causes, for\n>> example, that a 16-bit unsigned integer is retrieved as `int32_t` even\n>> though there is a specific libcamera control type for it. What's even\n>> more surprising is that setting such a control requires a `ControlValue`\n>> with `uint16_t`, but when `setControls()` updates the list to contain\n>> the actually applied values, it will now have type `int32_t`.\n> \n> I think this boils down the fact struct v4l2_ext_control has only\n> \n> \tunion {\n> \t\t__s32 value;\n> \t\t__s64 value64;\n> \n> for non-matrix controls.\n> \n> The v4l2-ctrl framework populates \"value\" for all control types which\n> are < V4L2_CTRL_TYPE_INTEGER64.\n> \n> \n>>\n>> So make sure that `updateControls()` uses the appropriate type.\n>>\n>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n>> ---\n>>   src/libcamera/v4l2_device.cpp | 25 ++++++++++++++++---------\n>>   1 file changed, 16 insertions(+), 9 deletions(-)\n>>\n>> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n>> index 67bbaa037..e0099cb7a 100644\n>> --- a/src/libcamera/v4l2_device.cpp\n>> +++ b/src/libcamera/v4l2_device.cpp\n>> @@ -823,19 +823,26 @@ void V4L2Device::updateControls(ControlList *ctrls,\n>>   \t\tASSERT(iter != controls_.end());\n>>\n>>   \t\tswitch (iter->first->type()) {\n>> +\t\tcase ControlTypeByte:\n>> +\t\t\tvalue.set<uint8_t>(v4l2Ctrl.value);\n>> +\t\t\tbreak;\n>> +\t\tcase ControlTypeUnsigned16:\n>> +\t\t\tvalue.set<uint16_t>(v4l2Ctrl.value);\n>> +\t\t\tbreak;\n>> +\t\tcase ControlTypeInteger32:\n>> +\t\t\tvalue.set<int32_t>(v4l2Ctrl.value);\n>> +\t\t\tbreak;\n>> +\t\tcase ControlTypeUnsigned32:\n>> +\t\t\tvalue.set<uint32_t>(v4l2Ctrl.value);\n>> +\t\t\tbreak;\n> \n> However, since we have types for the libcamera controls, I would say\n> that unless I'm missing something obvious it is fine to cast to the\n> actual libcamera control size even if it shouldn't practically change\n> anything ?\n\nIt does change things, e.g. now `getControls()` will return controls\nwith potentially smaller integer types, not just int32_t and int64_t.\nBut as far as I could check every `getControls()` call, this does not\naffect any existing code.\n\n\n> \n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> \n> Thanks\n>     j\n>>   \t\tcase ControlTypeInteger64:\n>>   \t\t\tvalue.set<int64_t>(v4l2Ctrl.value64);\n>>   \t\t\tbreak;\n>> -\n>>   \t\tdefault:\n>> -\t\t\t/*\n>> -\t\t\t * Note: this catches the ControlTypeInteger32 case.\n>> -\t\t\t *\n>> -\t\t\t * \\todo To be changed when support for string controls\n>> -\t\t\t * will be added.\n>> -\t\t\t */\n>> -\t\t\tvalue.set<int32_t>(v4l2Ctrl.value);\n>> -\t\t\tbreak;\n>> +\t\t\tLOG(V4L2, Error)\n>> +\t\t\t\t<< \"Control \" << utils::hex(id)\n>> +\t\t\t\t<< \" has unsupported type\";\n>> +\t\t\tcontinue;\n>>   \t\t}\n>>\n>>   \t\tctrls->set(id, value);\n>> --\n>> 2.53.0\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 27CD5BDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Mar 2026 07:47:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5269062895;\n\tFri, 27 Mar 2026 08:47:11 +0100 (CET)","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 DD2616274D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Mar 2026 08:47:09 +0100 (CET)","from [192.168.33.24] (185.221.143.129.nat.pool.zt.hu\n\t[185.221.143.129])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 731411783;\n\tFri, 27 Mar 2026 08:45:50 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"otaViLD7\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1774597550;\n\tbh=KiVaTCbc6lIg5npboJws74ZsWA8UpsMElzoVE1gA3Fk=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=otaViLD7zUEGGGQKtgDsSJOmSpDjMSGZeDUxf+OKQ6plyiuSP5ePegJiAQThPran2\n\tnnLAiZDPFWK5+ZDQyKaNQLS3FXQBI0u67SmxDbxjekKkg4Q5V9X4ntcVuD27nG7oOC\n\tbRG4ANZtPKXkxpLfFZm/L3Be5YaK2x4Ixf1VIwkg=","Message-ID":"<dcc3b024-8f0e-44cd-aef2-2e084938cbd1@ideasonboard.com>","Date":"Fri, 27 Mar 2026 08:47:06 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1 1/4] libcamera: v4l2_device: Ensure consistent control\n\ttypes","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20260325092659.79453-1-barnabas.pocze@ideasonboard.com>\n\t<acQLP196OJFa-vc4@zed>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<acQLP196OJFa-vc4@zed>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":38428,"web_url":"https://patchwork.libcamera.org/comment/38428/","msgid":"<43c58381-a85b-4269-8e84-f1dd9c25f417@ideasonboard.com>","date":"2026-03-27T07:47:31","subject":"Re: [PATCH v1 4/4] libcamera: v4l2_device: setControls(): Do not\n\tfall back to int32_t","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"2026. 03. 25. 17:56 keltezéssel, Jacopo Mondi írta:\n> Hi Barnabás\n> \n> On Wed, Mar 25, 2026 at 10:26:59AM +0100, Barnabás Pőcze wrote:\n>> When setting a control, if its type is not explicitly supported, do not fall\n>> back to int32_t as that is unlikely to be correct and will abort the program.\n>> Instead print an error and return -ENOTSUP.\n> \n> If I understand correctly all v4l2-control types matched to libcamera\n> control types in  V4L2Device::v4l2CtrlType() are now handled.\n> \n>>\n>> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>\n>> ---\n>>   src/libcamera/v4l2_device.cpp | 7 ++++---\n>>   1 file changed, 4 insertions(+), 3 deletions(-)\n>>\n>> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n>> index 426664b83..6ad1d178e 100644\n>> --- a/src/libcamera/v4l2_device.cpp\n>> +++ b/src/libcamera/v4l2_device.cpp\n>> @@ -394,9 +394,10 @@ int V4L2Device::setControls(ControlList *ctrls, const V4L2Request *request)\n>>   \t\t}\n>>\n>>   \t\tdefault:\n>> -\t\t\t/* \\todo To be changed to support strings. */\n> \n> This mention strings, but strigs are deflected to ControlTypeNone in\n> V4L2Device::v4l2CtrlType()\n> \n>> -\t\t\tv4l2Ctrl.value = value.get<int32_t>();\n> \n> and this wasn't correct.\n> \n>> -\t\t\tbreak;\n>> +\t\t\tLOG(V4L2, Error)\n>> +\t\t\t\t<< \"Control \" << utils::hex(id)\n>> +\t\t\t\t<< \" has unsupported type\";\n>> +\t\t\treturn -ENOTSUP;\n> \n> Will it break some users ? It shouldn't because of the above reasoning\n> around the v4l2-ctrl-to-libcamera-ctrl type translation\n\nAs far I can tell, it shouldn't. Because as you said everything that is\nhandled in `v4l2CtrlType()` should be handled here as well. And other\ntypes would have aborted the process in `value.get<int32_t>()` that\nwas previously here.\n\n\n> \n> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>\n> \n> Thanks\n>    j\n>>   \t\t}\n>>   \t}\n>>\n>> --\n>> 2.53.0\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 01AC7BDCBD\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Mar 2026 07:47:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A9F2762C35;\n\tFri, 27 Mar 2026 08:47:33 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id ED36962B91\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Mar 2026 08:47:31 +0100 (CET)","from [192.168.33.24] (185.221.143.129.nat.pool.zt.hu\n\t[185.221.143.129])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A1B2E1783;\n\tFri, 27 Mar 2026 08:46:12 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"fhfTRG9w\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1774597572;\n\tbh=D8t6G3KqbJ1/Gr8buMu0vMbMNyXes1iiO8HQgpWrwzE=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=fhfTRG9woHKxFUTZ02jliqAV8ygqTws164MVS/huM0TMQO2AUl1yrFtdM7cmPu8e9\n\t8eHkMX0iJKqu2tqpJXwT3XVbX9SlRWp2Ea/eCm/zJc1k4rGLa8Hw2gnVFF20hVI+ev\n\tnMA2H2hbdJ7WlEm6b18JF+lpXfIEf45Y6+gXTXUw=","Message-ID":"<43c58381-a85b-4269-8e84-f1dd9c25f417@ideasonboard.com>","Date":"Fri, 27 Mar 2026 08:47:31 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH v1 4/4] libcamera: v4l2_device: setControls(): Do not\n\tfall back to int32_t","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20260325092659.79453-1-barnabas.pocze@ideasonboard.com>\n\t<20260325092659.79453-4-barnabas.pocze@ideasonboard.com>\n\t<acQTA-OxG7PeHHiv@zed>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<acQTA-OxG7PeHHiv@zed>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]