[{"id":37256,"web_url":"https://patchwork.libcamera.org/comment/37256/","msgid":"<fmrcqksh3z4pabmsa4y2onztdrexcztsvhup7pvuilh7bwzrpd@dr5bw52ru3zk>","date":"2025-12-10T15:15:27","subject":"Re: [RFC PATCH v1 0/2] libcamera: pipeline: uvcvideo:\n\tFrameDurationLimits","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, Dec 10, 2025 at 02:37:02PM +0100, Barnabás Pőcze wrote:\n> This patch set tries to add at least some kind of support for setting a frame\n> duration on uvc camera to address https://gitlab.freedesktop.org/camera/libcamera/-/issues/296\n>\n> The mismatches in the kernel and libcamera interfaces are elaborated in the last patch.\n>\n> A couple points remain:\n>\n> (a) Since the frame interval cannot be set during streaming, could this indicate that a\n\nIs this a UVC limitation ? I mean, the protocol doesn't allow that ?\n\n>     \"startup control\" concept would be useful in libcamera, where cameras could mark\n>     certain controls in their `ControlInfoMap` to indicate that they can only be set\n>     when passed to `Camera::start()`?\n\nI recall we had a similar discussion where startup controls have been\nintroduced.\n\nI forgot what other controls this could be applied to honetly\n\n>\n> (B) I originally intended to advertise all available discrete options in the `ControlInfo`.\n>     For example:\n>\n>       $ v4l2-ctl --list-formats-ext\n>       ioctl: VIDIOC_ENUM_FMT\n>       \tType: Video Capture\n>\n>       \t[0]: 'YUYV' (YUYV 4:2:2)\n>       \t\tSize: Discrete 640x480\n>       \t\t\tInterval: Discrete 0.033s (30.000 fps)\n>       \t\t\tInterval: Discrete 0.040s (25.000 fps)\n>       \t\t\tInterval: Discrete 0.050s (20.000 fps)\n>       \t\t\tInterval: Discrete 0.067s (15.000 fps)\n>       \t\t\tInterval: Discrete 0.100s (10.000 fps)\n>       \t\t\tInterval: Discrete 0.200s (5.000 fps)\n>\n>     would produce:\n>\n>       ControlInfo {\n>         .min = { 0.033s },\n>         .max = { 0.200s },\n>         .values = {\n>           { 0.033s, 0.033s },\n>           { 0.040s, 0.040s },\n>           { 0.050s, 0.050s },\n>           { 0.067s, 0.067s },\n>           { 0.100s, 0.100s },\n>           { 0.200s, 0.200s },\n>         },\n>       }\n>\n>     This would be done in order to satisfy two requirements:\n>       * every item in `ControlInfo::values()` should be of the proper shape and type\n>         to be directly applicable as the value of the control;\n>       * the min/max for array like controls (except strings) should denote the min/max\n>         for any single element in the array.\n>\n>     Unfortunately, there is no constructor of `ControlInfo` that achieves this.\n>     Would it be useful to add one?\n\nFor this specific use case, my main concern is not about listing all\npossible values, but the fact that the list of supported intervals\ndepend on the stream size and format, as it's ultimately about the\navailable bus bandwidth I guess.\n\nI wouldn't go too far to support this specific use case without having\nconsidered how to address the API limitation reported in detail in the\nabove mentioned gitlab issue.\n\nWhat do you think ?\n\n>\n>\n> Barnabás Pőcze (2):\n>   libcamera: pipeline: uvcvideo: Report `FrameDuration`\n>   libcamera: pipeline: uvcvideo: Handle `FrameDurationLimits`\n>\n>  include/libcamera/internal/v4l2_videodevice.h |   5 +\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |  72 ++++++++\n>  src/libcamera/v4l2_videodevice.cpp            | 171 ++++++++++++++++++\n>  3 files changed, 248 insertions(+)\n>\n> --\n> 2.52.0","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 E6221C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Dec 2025 15:15:33 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 286AE61486;\n\tWed, 10 Dec 2025 16:15:33 +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 032CB61480\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 16:15:31 +0100 (CET)","from ideasonboard.com (mob-5-90-55-146.net.vodafone.it\n\t[5.90.55.146])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D2BAD153F;\n\tWed, 10 Dec 2025 16:15:29 +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=\"FlNCk2TQ\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765379730;\n\tbh=VB4usS5X/oLnX3he2KX4A3W9v8ADgrtICGfTmGYrkoQ=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=FlNCk2TQRLwmUzXWHBcLkXSKlzrnU7Xg5fnU9mFRqhiDbFJWh8GAg3Es0RJf3NPsb\n\tiIYg5fSSGtvjnS2t2GTcYOIRlacWXFB7DhlPEwZUL606NXqGGMZvouq3EXqXIxdPXM\n\tgQzmpr2xHC8p1tdu4gYQjdiVjgSWbig5UlIckiYg=","Date":"Wed, 10 Dec 2025 16:15:27 +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: [RFC PATCH v1 0/2] libcamera: pipeline: uvcvideo:\n\tFrameDurationLimits","Message-ID":"<fmrcqksh3z4pabmsa4y2onztdrexcztsvhup7pvuilh7bwzrpd@dr5bw52ru3zk>","References":"<20251210133704.2711629-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":"<20251210133704.2711629-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":37267,"web_url":"https://patchwork.libcamera.org/comment/37267/","msgid":"<4f811ea7-14f7-44e4-b073-2de3fb708bfd@ideasonboard.com>","date":"2025-12-10T16:55:45","subject":"Re: [RFC PATCH v1 0/2] libcamera: pipeline: uvcvideo:\n\tFrameDurationLimits","submitter":{"id":216,"url":"https://patchwork.libcamera.org/api/people/216/","name":"Barnabás Pőcze","email":"barnabas.pocze@ideasonboard.com"},"content":"Hi\n\n2025. 12. 10. 16:15 keltezéssel, Jacopo Mondi írta:\n> Hi Barnabás\n> \n> On Wed, Dec 10, 2025 at 02:37:02PM +0100, Barnabás Pőcze wrote:\n>> This patch set tries to add at least some kind of support for setting a frame\n>> duration on uvc camera to address https://gitlab.freedesktop.org/camera/libcamera/-/issues/296\n>>\n>> The mismatches in the kernel and libcamera interfaces are elaborated in the last patch.\n>>\n>> A couple points remain:\n>>\n>> (a) Since the frame interval cannot be set during streaming, could this indicate that a\n> \n> Is this a UVC limitation ? I mean, the protocol doesn't allow that ?\n\nAs far as I'm aware yes.\n\n\n> \n>>      \"startup control\" concept would be useful in libcamera, where cameras could mark\n>>      certain controls in their `ControlInfoMap` to indicate that they can only be set\n>>      when passed to `Camera::start()`?\n> \n> I recall we had a similar discussion where startup controls have been\n> introduced.\n> \n> I forgot what other controls this could be applied to honetly\n> \n>>\n>> (B) I originally intended to advertise all available discrete options in the `ControlInfo`.\n>>      For example:\n>>\n>>        $ v4l2-ctl --list-formats-ext\n>>        ioctl: VIDIOC_ENUM_FMT\n>>        \tType: Video Capture\n>>\n>>        \t[0]: 'YUYV' (YUYV 4:2:2)\n>>        \t\tSize: Discrete 640x480\n>>        \t\t\tInterval: Discrete 0.033s (30.000 fps)\n>>        \t\t\tInterval: Discrete 0.040s (25.000 fps)\n>>        \t\t\tInterval: Discrete 0.050s (20.000 fps)\n>>        \t\t\tInterval: Discrete 0.067s (15.000 fps)\n>>        \t\t\tInterval: Discrete 0.100s (10.000 fps)\n>>        \t\t\tInterval: Discrete 0.200s (5.000 fps)\n>>\n>>      would produce:\n>>\n>>        ControlInfo {\n>>          .min = { 0.033s },\n>>          .max = { 0.200s },\n>>          .values = {\n>>            { 0.033s, 0.033s },\n>>            { 0.040s, 0.040s },\n>>            { 0.050s, 0.050s },\n>>            { 0.067s, 0.067s },\n>>            { 0.100s, 0.100s },\n>>            { 0.200s, 0.200s },\n>>          },\n>>        }\n>>\n>>      This would be done in order to satisfy two requirements:\n>>        * every item in `ControlInfo::values()` should be of the proper shape and type\n>>          to be directly applicable as the value of the control;\n>>        * the min/max for array like controls (except strings) should denote the min/max\n>>          for any single element in the array.\n>>\n>>      Unfortunately, there is no constructor of `ControlInfo` that achieves this.\n>>      Would it be useful to add one?\n> \n> For this specific use case, my main concern is not about listing all\n> possible values, but the fact that the list of supported intervals\n> depend on the stream size and format, as it's ultimately about the\n> available bus bandwidth I guess.\n> \n> I wouldn't go too far to support this specific use case without having\n> considered how to address the API limitation reported in detail in the\n> above mentioned gitlab issue.\n> \n> What do you think ?\n\nI believe the lack of this limits the usability somewhat since one cannot\nenumerate the discrete frame durations and instead of only gets a min/max,\nbut it is certainly not required.\n\n\n> \n>>\n>>\n>> Barnabás Pőcze (2):\n>>    libcamera: pipeline: uvcvideo: Report `FrameDuration`\n>>    libcamera: pipeline: uvcvideo: Handle `FrameDurationLimits`\n>>\n>>   include/libcamera/internal/v4l2_videodevice.h |   5 +\n>>   src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  |  72 ++++++++\n>>   src/libcamera/v4l2_videodevice.cpp            | 171 ++++++++++++++++++\n>>   3 files changed, 248 insertions(+)\n>>\n>> --\n>> 2.52.0","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 89CA3C3257\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 10 Dec 2025 16:55:52 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B289E614A6;\n\tWed, 10 Dec 2025 17:55:51 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4EDCF61499\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 10 Dec 2025 17:55:50 +0100 (CET)","from [192.168.33.37] (185.221.143.114.nat.pool.zt.hu\n\t[185.221.143.114])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7DC836DC;\n\tWed, 10 Dec 2025 17:55:47 +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=\"iqmaUx7n\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1765385747;\n\tbh=2qU+uuTgBsKMFAp2fkQCD7c64lqHiLHA9CE0xt5ZnPg=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=iqmaUx7nUPnYX2aCGxWEeJFNMxgNk3qlConT4/2T/xH2mK7sKI1ADICP3uJrLAqFW\n\tyO+SLbREASEMyQk9m5XnGEgI3bgikW4iVQ60kp0VvNtvG9AYsdW8vaLI6+KlvLRK2H\n\tWd3R5MVKkr1ikUTsDLfucYLgEUNwmLqxIXyePDro=","Message-ID":"<4f811ea7-14f7-44e4-b073-2de3fb708bfd@ideasonboard.com>","Date":"Wed, 10 Dec 2025 17:55:45 +0100","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [RFC PATCH v1 0/2] libcamera: pipeline: uvcvideo:\n\tFrameDurationLimits","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","References":"<20251210133704.2711629-1-barnabas.pocze@ideasonboard.com>\n\t<fmrcqksh3z4pabmsa4y2onztdrexcztsvhup7pvuilh7bwzrpd@dr5bw52ru3zk>","From":"=?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= <barnabas.pocze@ideasonboard.com>","Content-Language":"en-US, hu-HU","In-Reply-To":"<fmrcqksh3z4pabmsa4y2onztdrexcztsvhup7pvuilh7bwzrpd@dr5bw52ru3zk>","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>"}}]