[{"id":26905,"web_url":"https://patchwork.libcamera.org/comment/26905/","msgid":"<qpxqdzkz4qhh4a7emxqm6y4e3r5vt6hltjvw25xcv2htvcudus@y5z3moqbwktg>","date":"2023-04-19T09:45:16","subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"Hi Kieran\n\nOn Wed, Apr 19, 2023 at 09:58:18AM +0100, Kieran Bingham via libcamera-devel wrote:\n> It can be beneficial to allow reporting the devices used by a camera to\n> facilitate de-duplication of resources when handling cameras from a\n> centralised infrastructure such as PipeWire.\n>\n\nThis series allows to retrieve the list of dev_t a libcamera::Camera\nhandles by using a camera properties.\n\nThe CameraManager class however maintains a camerasByDevnum_ map that\nassociates a dev_t with the Camera it is owned by. It would be trivial\nto reverse the map. Have you considered that ? Getting dev_t from the\nmanager seems more natural than doing so from the Camera (and would\navoid the additional template specialization for dev_t you don't like)\n\n\n> Expose a new property on all cameras which reports a list of dev_t\n> values representing devices used by the camera.\n>\n> Pipelines supported by media-controller will automatically register an\n> entry for any video node present in the media graphs registered with the\n> Pipeline Handler.\n>\n> Kieran Bingham (3):\n>   libcamera: controls: Support dev_t in an Integer32 type.\n>   libcamera: properties: Provide a Devices camera property\n>   libcamera: pipeline: Register device numbers with camera\n>\n>  include/libcamera/controls.h       | 5 +++++\n>  src/libcamera/pipeline_handler.cpp | 8 ++++++++\n>  src/libcamera/property_ids.yaml    | 8 ++++++++\n>  3 files changed, 21 insertions(+)\n>\n> --\n> 2.34.1\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 986BDBE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 19 Apr 2023 09:45:22 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 04476627B1;\n\tWed, 19 Apr 2023 11:45:22 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C75EA627AB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Apr 2023 11:45:19 +0200 (CEST)","from ideasonboard.com (unknown\n\t[IPv6:2001:b07:5d2e:52c9:1cf0:b3bc:c785:4625])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id EE49512F;\n\tWed, 19 Apr 2023 11:45:12 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1681897522;\n\tbh=FDFME1jNUjPbh7DKfL2QrxT1TkNAPJGw+fe64FL55QE=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=MHg5kz5/ROY1YS/p1s9lSHdw5PoLEXM1M6s5fjsetFiVrwPuF00THnXF9XJvtVZiS\n\t0F//q5o5+iMxY6xT2GCNJT9PD/jQiTdF3Q47/i01cWFIKkeKY7LDU+AuYKw6MaeeNv\n\te7BsOl9VW05aFgJYAeDAMuHeL8E7rKNu4BW04Zury6iP1XPbDX9FbG+7HbE7wVMco+\n\tb+zV2FBwR14E6i82rnO8+1+n5w+iS0WoUyJ2qTyN9DIyk/EEOsZlzdCoMLa1f9fEMx\n\tMiWXghFCxQhe2MNBiEUSnKmOGUpHYhkQI40o7n7/yB6wmOT+bCOvv8Y6wulmd/Fx/i\n\t4UwhkTPPpSm2g==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1681897513;\n\tbh=FDFME1jNUjPbh7DKfL2QrxT1TkNAPJGw+fe64FL55QE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=UnGWc+KdZVFbf0yGduhhCckGVcTj4h1jtPYVQmuQQU+sO3OlFTN03n6HqWJeHxBkY\n\tyA4Z2ywQ9LIYiE/Vy0Tl7gWVfTJi5kqJ/EOZj3b5AsMM4lrQDF60Ky77dRfSTdBWCk\n\tgOBuSi2/GDpqHuacEwEHh6uS9bLWk+AYoKBwDRIQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"UnGWc+Kd\"; dkim-atps=neutral","Date":"Wed, 19 Apr 2023 11:45:16 +0200","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<qpxqdzkz4qhh4a7emxqm6y4e3r5vt6hltjvw25xcv2htvcudus@y5z3moqbwktg>","References":"<20230419085821.2682901-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230419085821.2682901-1-kieran.bingham@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26907,"web_url":"https://patchwork.libcamera.org/comment/26907/","msgid":"<f7e756dc-18b0-b292-9915-e4c941748680@ideasonboard.com>","date":"2023-04-19T12:11:39","subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Hi Jacopo\n\nOn 19/04/2023 10:45, Jacopo Mondi wrote:\n> Hi Kieran\n> \n> On Wed, Apr 19, 2023 at 09:58:18AM +0100, Kieran Bingham via libcamera-devel wrote:\n>> It can be beneficial to allow reporting the devices used by a camera to\n>> facilitate de-duplication of resources when handling cameras from a\n>> centralised infrastructure such as PipeWire.\n>>\n> \n> This series allows to retrieve the list of dev_t a libcamera::Camera\n> handles by using a camera properties.\n> \n> The CameraManager class however maintains a camerasByDevnum_ map that\n> associates a dev_t with the Camera it is owned by. It would be trivial\n> to reverse the map. Have you considered that ? Getting dev_t from the\n> manager seems more natural than doing so from the Camera (and would\n> avoid the additional template specialization for dev_t you don't like)\n\nNo I haven't, so that's an interesting point. I'll take a look.\n\nRobert/Wim,\n\nDo you have any specific requirements here? Do you need to be able to \nmap which devices are used by each camera? Or is a single list sufficient?\n\nOr maybe returning a map of camera (id?) to device list is best all round?\n\nMy only thought on the separation is the list would have to be \nre-obtained for hotplugged cameras, while it's available at the 'camera' \nwhen on the object. Conversely, perhaps hotplug is a reason to \ncentralize the whole list as after a camera is removed it would need to \nbe updated anyway.\n\nSo - I'll see if I can add in a call on the Camera Manager that returns \na map of camera id / dev_t.\n\n\n--\nKieran","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 64F10BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 19 Apr 2023 12:11:42 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B0F77627B8;\n\tWed, 19 Apr 2023 14:11:41 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6F799603A1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 19 Apr 2023 14:11:40 +0200 (CEST)","from [192.168.0.32]\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 737CC12F;\n\tWed, 19 Apr 2023 14:11:33 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1681906301;\n\tbh=Y96zXAdB+Y3xwmVOeL7ZebUm62YryyAnTeSwCu1wWIk=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=a98yYPDpan6Qg0394pPndxADByFX+BxXkjXhNzjbNcjQosOVQ+mdPFh3FkeA1dkXO\n\tn1zhOUxZbXw4B/KoHTHP2enEPBzlzGHWOHrIL0UpS8B6LxE07njUQgd5XBEeFZQbst\n\tGAim9M4n9WuqBqMYAHjEb5ncXRdwFL7C9nBhr2KOdoWq5wGvPnTpbAxSUpi/P89+II\n\tJ9TDJ65EfSzJ8vn/tnayNLQVULGQWTQOxMJLuU2OblKVs4yd/RfbGXR+lUa5C7rn33\n\tCj4P/sZdOFfA8kOhMs2FEB/xg3PxWzKOiwnLPY9TYqFwyeDPhY6Xptnb+ICmQg7pzj\n\tQnBar4ugjYaMg==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1681906293;\n\tbh=Y96zXAdB+Y3xwmVOeL7ZebUm62YryyAnTeSwCu1wWIk=;\n\th=Date:Subject:To:Cc:References:From:In-Reply-To:From;\n\tb=LGbWZnSSFOq5bRmr7dfV/OlvGcYVxsJvccfnB01LoMpM2guJLBzaonseCrjJpG8tN\n\tLp9gvs5ZLPMiEWeQjGU9kaGTZIyvtJz4+BVLir/ciqMm9C8ekrPYiaXgUdern62PgW\n\tOojpZvjOMUi4Owq+Rkdzn+uT9C1Su3WXuZVakaOk="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"LGbWZnSS\"; dkim-atps=neutral","Message-ID":"<f7e756dc-18b0-b292-9915-e4c941748680@ideasonboard.com>","Date":"Wed, 19 Apr 2023 13:11:39 +0100","MIME-Version":"1.0","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101\n\tThunderbird/102.9.0","Content-Language":"en-US","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","References":"<20230419085821.2682901-1-kieran.bingham@ideasonboard.com>\n\t<qpxqdzkz4qhh4a7emxqm6y4e3r5vt6hltjvw25xcv2htvcudus@y5z3moqbwktg>","In-Reply-To":"<qpxqdzkz4qhh4a7emxqm6y4e3r5vt6hltjvw25xcv2htvcudus@y5z3moqbwktg>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"7bit","Subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>,\n\tRobert Mader <robert.mader@collabora.com>,\n\tWim Taymans <wtaymans@redhat.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26912,"web_url":"https://patchwork.libcamera.org/comment/26912/","msgid":"<20230420025737.GA26974@pendragon.ideasonboard.com>","date":"2023-04-20T02:57:37","subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Wed, Apr 19, 2023 at 01:11:39PM +0100, Kieran Bingham via libcamera-devel wrote:\n> On 19/04/2023 10:45, Jacopo Mondi wrote:\n> > On Wed, Apr 19, 2023 at 09:58:18AM +0100, Kieran Bingham via libcamera-devel wrote:\n> >> It can be beneficial to allow reporting the devices used by a camera to\n> >> facilitate de-duplication of resources when handling cameras from a\n> >> centralised infrastructure such as PipeWire.\n> > \n> > This series allows to retrieve the list of dev_t a libcamera::Camera\n> > handles by using a camera properties.\n> > \n> > The CameraManager class however maintains a camerasByDevnum_ map that\n> > associates a dev_t with the Camera it is owned by. It would be trivial\n> > to reverse the map. Have you considered that ? Getting dev_t from the\n> > manager seems more natural than doing so from the Camera (and would\n> > avoid the additional template specialization for dev_t you don't like)\n> \n> No I haven't, so that's an interesting point. I'll take a look.\n> \n> Robert/Wim,\n> \n> Do you have any specific requirements here? Do you need to be able to \n> map which devices are used by each camera? Or is a single list sufficient?\n> \n> Or maybe returning a map of camera (id?) to device list is best all round?\n> \n> My only thought on the separation is the list would have to be \n> re-obtained for hotplugged cameras, while it's available at the 'camera' \n> when on the object. Conversely, perhaps hotplug is a reason to \n> centralize the whole list as after a camera is removed it would need to \n> be updated anyway.\n> \n> So - I'll see if I can add in a call on the Camera Manager that returns \n> a map of camera id / dev_t.\n\nThe map we expose through the CameraManager is meant for the V4L2\nadaptation layer only. I'm actually thinking about how we could avoid\nexposing it in the public API. A camera property seems a nicer solution\nfor the problem at hand.","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 7EC40BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Apr 2023 02:57:27 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id ED9F8627B1;\n\tThu, 20 Apr 2023 04:57:26 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D1C1761EB6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Apr 2023 04:57:24 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(133-32-181-51.west.xps.vectant.ne.jp [133.32.181.51])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id C9A809DE;\n\tThu, 20 Apr 2023 04:57:16 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1681959447;\n\tbh=aHZtw04GD+kc1SEUPAkQd6d8uY63bXgTp/o5djXTwsk=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=oODY+iDckle/bRG31EnAes20AFluGJRZKD6Kp0qeBetiGvT2H45giHwsg57DZbnRa\n\t9f25qegNlU3MCW4chUyanU1vJHSrwPocaNHljlmt6B4nFBr+sFesa4V4mYxPGZWKLd\n\tZ/DcQrM9njgv/+Ml3KwcGQTIWwa+KXfYy4mYuxY2wuuXbIakQTojmWoOOI5z0VqXn6\n\tB6aZdlRY1nVcZH3AGdljTHl6m4z1pACCD9Q3vqgB4PPnSyVye+K5pXINXrzusDJN81\n\tSi+f9vsUfLUf7/KKD8ucnhQjmilfnE44wgqKQPKzZLql/4GK9+xD0Om79mx8JrW2Vz\n\t8FEDUF1JhQBBA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1681959437;\n\tbh=aHZtw04GD+kc1SEUPAkQd6d8uY63bXgTp/o5djXTwsk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=r6jtH5dIxIjg6sbug1hzjkEpcJLRJ4RiU4FrMNoxzJI+3b2bK/hQe+O+6dJQ3/3Sw\n\tM/D4+n3hLcS+lH3GRhGrDr6IgjHMT8vXXWEFd9tA+AnLDjUJm1TE20bnMqCCigFRBU\n\t0OCVGJX+XjtF4rjkSXzf9gAsPadu3c+H9Ck9ZTts="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"r6jtH5dI\"; dkim-atps=neutral","Date":"Thu, 20 Apr 2023 05:57:37 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20230420025737.GA26974@pendragon.ideasonboard.com>","References":"<20230419085821.2682901-1-kieran.bingham@ideasonboard.com>\n\t<qpxqdzkz4qhh4a7emxqm6y4e3r5vt6hltjvw25xcv2htvcudus@y5z3moqbwktg>\n\t<f7e756dc-18b0-b292-9915-e4c941748680@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<f7e756dc-18b0-b292-9915-e4c941748680@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>,\n\tRobert Mader <robert.mader@collabora.com>,\n\tWim Taymans <wtaymans@redhat.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26913,"web_url":"https://patchwork.libcamera.org/comment/26913/","msgid":"<3ldg2t7tywxodenvi6yghkf3ladfcr7qwm3m6ccdwou53joxhm@cu73djahohje>","date":"2023-04-20T06:48:14","subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","submitter":{"id":143,"url":"https://patchwork.libcamera.org/api/people/143/","name":"Jacopo Mondi","email":"jacopo.mondi@ideasonboard.com"},"content":"HI Laurent\n\nOn Thu, Apr 20, 2023 at 05:57:37AM +0300, Laurent Pinchart wrote:\n> On Wed, Apr 19, 2023 at 01:11:39PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > On 19/04/2023 10:45, Jacopo Mondi wrote:\n> > > On Wed, Apr 19, 2023 at 09:58:18AM +0100, Kieran Bingham via libcamera-devel wrote:\n> > >> It can be beneficial to allow reporting the devices used by a camera to\n> > >> facilitate de-duplication of resources when handling cameras from a\n> > >> centralised infrastructure such as PipeWire.\n> > >\n> > > This series allows to retrieve the list of dev_t a libcamera::Camera\n> > > handles by using a camera properties.\n> > >\n> > > The CameraManager class however maintains a camerasByDevnum_ map that\n> > > associates a dev_t with the Camera it is owned by. It would be trivial\n> > > to reverse the map. Have you considered that ? Getting dev_t from the\n> > > manager seems more natural than doing so from the Camera (and would\n> > > avoid the additional template specialization for dev_t you don't like)\n> >\n> > No I haven't, so that's an interesting point. I'll take a look.\n> >\n> > Robert/Wim,\n> >\n> > Do you have any specific requirements here? Do you need to be able to\n> > map which devices are used by each camera? Or is a single list sufficient?\n> >\n> > Or maybe returning a map of camera (id?) to device list is best all round?\n> >\n> > My only thought on the separation is the list would have to be\n> > re-obtained for hotplugged cameras, while it's available at the 'camera'\n> > when on the object. Conversely, perhaps hotplug is a reason to\n> > centralize the whole list as after a camera is removed it would need to\n> > be updated anyway.\n> >\n> > So - I'll see if I can add in a call on the Camera Manager that returns\n> > a map of camera id / dev_t.\n>\n> The map we expose through the CameraManager is meant for the V4L2\n> adaptation layer only. I'm actually thinking about how we could avoid\n\nIt's for V4L2 layer only because so far we had no other use cases,\nisn't it ?\n\n> exposing it in the public API. A camera property seems a nicer solution\n> for the problem at hand.\n>\n\nHowever it will require getting hold of all camera intances, fetch and\nread the properties. As Kieran said with hotplug it gets even worse.\nIsn't it better to get it from the manager which maintains an overall\nview of all resources in the system ?\n\n> --\n> Regards,\n>\n> Laurent Pinchart","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 C6B26BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Apr 2023 06:48:20 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 13DE3627C2;\n\tThu, 20 Apr 2023 08:48:20 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 58DDF61EB6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Apr 2023 08:48:18 +0200 (CEST)","from ideasonboard.com (93-61-96-190.ip145.fastwebnet.it\n\t[93.61.96.190])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B9FF175B;\n\tThu, 20 Apr 2023 08:48:10 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1681973300;\n\tbh=KMf2E4P6rrnUrqyIzDbQnqkhzefEoFukuUTg1wp0Z3A=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=vIQlwcvD/Z+hF+X5egKOCv+vE/Q0TfLV2ZyfjnsR3VmQaK+lZChojxpKiPlyby4IB\n\tWojIUGS398jEh0xNg8Tro/sEM4Ag4dJQ4qWl4XeiqVMq5pWDwRtr0ZLJsQOZhpc8A9\n\tTIMG2ARzEXbKxt053qVxQiv/Gsb8UpjM1QAMXQfPgqclJoBws0lm/MEFm1Hz/2bcGp\n\tph3xS26rbL+VZ9h9vbNF8VxqtIR9oT38XEe1dMPyfjR2Wehyfpv6I4Og3+sXnqIAeF\n\t9VMutj4GWXGmAzCOduhFCN+a2hUQLH86Vg5wlPWLluVTMdSYcZfsHTuWHgP792pAOH\n\tAYjaPWL0ILTag==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1681973290;\n\tbh=KMf2E4P6rrnUrqyIzDbQnqkhzefEoFukuUTg1wp0Z3A=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=wME1qQeSSpRyg+POfSWBGDDJwl69/CYJ6C7DQsOjhKJpKC0JBsSa2iZmdFwGcHM3J\n\t5o0ANWb71J9XLV0caunIXw7Aq+oWneZG3e8OE4PAs1zUuJUA0BvHlU6gWGxdLk3S5c\n\tc+u2na5rnPDkH6os7RyD0dCIzDldJXXkn2mycqbU="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"wME1qQeS\"; dkim-atps=neutral","Date":"Thu, 20 Apr 2023 08:48:14 +0200","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<3ldg2t7tywxodenvi6yghkf3ladfcr7qwm3m6ccdwou53joxhm@cu73djahohje>","References":"<20230419085821.2682901-1-kieran.bingham@ideasonboard.com>\n\t<qpxqdzkz4qhh4a7emxqm6y4e3r5vt6hltjvw25xcv2htvcudus@y5z3moqbwktg>\n\t<f7e756dc-18b0-b292-9915-e4c941748680@ideasonboard.com>\n\t<20230420025737.GA26974@pendragon.ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20230420025737.GA26974@pendragon.ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Jacopo Mondi via libcamera-devel <libcamera-devel@lists.libcamera.org>","Reply-To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>,\n\tWim Taymans <wtaymans@redhat.com>,\n\tRobert Mader <robert.mader@collabora.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26914,"web_url":"https://patchwork.libcamera.org/comment/26914/","msgid":"<20230420080857.GE631@pendragon.ideasonboard.com>","date":"2023-04-20T08:08:57","subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"On Thu, Apr 20, 2023 at 08:48:14AM +0200, Jacopo Mondi wrote:\n> On Thu, Apr 20, 2023 at 05:57:37AM +0300, Laurent Pinchart wrote:\n> > On Wed, Apr 19, 2023 at 01:11:39PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > On 19/04/2023 10:45, Jacopo Mondi wrote:\n> > > > On Wed, Apr 19, 2023 at 09:58:18AM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > >> It can be beneficial to allow reporting the devices used by a camera to\n> > > >> facilitate de-duplication of resources when handling cameras from a\n> > > >> centralised infrastructure such as PipeWire.\n> > > >\n> > > > This series allows to retrieve the list of dev_t a libcamera::Camera\n> > > > handles by using a camera properties.\n> > > >\n> > > > The CameraManager class however maintains a camerasByDevnum_ map that\n> > > > associates a dev_t with the Camera it is owned by. It would be trivial\n> > > > to reverse the map. Have you considered that ? Getting dev_t from the\n> > > > manager seems more natural than doing so from the Camera (and would\n> > > > avoid the additional template specialization for dev_t you don't like)\n> > >\n> > > No I haven't, so that's an interesting point. I'll take a look.\n> > >\n> > > Robert/Wim,\n> > >\n> > > Do you have any specific requirements here? Do you need to be able to\n> > > map which devices are used by each camera? Or is a single list sufficient?\n> > >\n> > > Or maybe returning a map of camera (id?) to device list is best all round?\n> > >\n> > > My only thought on the separation is the list would have to be\n> > > re-obtained for hotplugged cameras, while it's available at the 'camera'\n> > > when on the object. Conversely, perhaps hotplug is a reason to\n> > > centralize the whole list as after a camera is removed it would need to\n> > > be updated anyway.\n> > >\n> > > So - I'll see if I can add in a call on the Camera Manager that returns\n> > > a map of camera id / dev_t.\n> >\n> > The map we expose through the CameraManager is meant for the V4L2\n> > adaptation layer only. I'm actually thinking about how we could avoid\n> \n> It's for V4L2 layer only because so far we had no other use cases,\n> isn't it ?\n\nYes, but I also want to avoid new ue cases :-) V4L2 should be an\nimplementation detail that applications shouldn't care about. There are\nsome transitional use cases that we have to support, and I'd like them\nto be exceptions, not a norm.\n\n> > exposing it in the public API. A camera property seems a nicer solution\n> > for the problem at hand.\n> \n> However it will require getting hold of all camera intances, fetch and\n> read the properties. As Kieran said with hotplug it gets even worse.\n> Isn't it better to get it from the manager which maintains an overall\n> view of all resources in the system ?\n\nHotplug is already supported by libcamera, through a signal that\nindicates when a camera is plugged in. You can then get the list of\ndev_t from the camera. If you want to expose that information in a\ndifferent way, you will need a separate hotplug notification to tell\nwhen new dev_t are added or removed.","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 4145BBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Apr 2023 08:08:49 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 801B4627C2;\n\tThu, 20 Apr 2023 10:08:48 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 100CE61EB9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Apr 2023 10:08:46 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(133-32-181-51.west.xps.vectant.ne.jp [133.32.181.51])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id DA90675B;\n\tThu, 20 Apr 2023 10:08:37 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1681978128;\n\tbh=itos3szl48kDHjsqTlVC05YElVV0kAINd66/rewGvCk=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=XGyr9uye2vWcCx5qIZ/87mRCyukjXQ19OeLctKUMgLP5rmDJopBQisBJmsBVh2TDU\n\tGA0AtD/DDFTIvbUYDrY404FQKmgc56tN05j74yRBKbtYUXCDy2q9/B6YFWzWlNjLU2\n\ti9mDmaoQgVK2Es1aiJwDhjaJlCcjRuXlypHQaRwN8zfPd+/zTeu6ycUfhO2wZvT1Y0\n\t2ZN0tsV0hHyObmxZZ+sfuPxAIUZGYi0J4eK7tgvBiJTss1ZE0Ji5HVluctnpbj33p6\n\tbVfk6DAsVXoPOlXSoVdT9q4obpwxP3E6r/SiXCOLV0SwYRD18c5tmpanBdzPRq5VoN\n\tppt3vWF9Efj6w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1681978118;\n\tbh=itos3szl48kDHjsqTlVC05YElVV0kAINd66/rewGvCk=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=cfCx/cIkfucAioNKPW8jM//1L6xEer1dCcac+Iq8qYDtGEXxHDO/oDHMIGIrFg7x5\n\tXS0vGkWx08V3+c6SEjNcXIgWRSXjLnkjCcPA4RNQHjn1dNB48xDVrFcKVAFoNujBnd\n\tZ7bEvNhQTRg4ssYw6Vn3zPnqQuTlKaW9ePFaqpPM="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"cfCx/cIk\"; dkim-atps=neutral","Date":"Thu, 20 Apr 2023 11:08:57 +0300","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>","Message-ID":"<20230420080857.GE631@pendragon.ideasonboard.com>","References":"<20230419085821.2682901-1-kieran.bingham@ideasonboard.com>\n\t<qpxqdzkz4qhh4a7emxqm6y4e3r5vt6hltjvw25xcv2htvcudus@y5z3moqbwktg>\n\t<f7e756dc-18b0-b292-9915-e4c941748680@ideasonboard.com>\n\t<20230420025737.GA26974@pendragon.ideasonboard.com>\n\t<3ldg2t7tywxodenvi6yghkf3ladfcr7qwm3m6ccdwou53joxhm@cu73djahohje>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<3ldg2t7tywxodenvi6yghkf3ladfcr7qwm3m6ccdwou53joxhm@cu73djahohje>","Subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Robert Mader <robert.mader@collabora.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>,\n\tWim Taymans <wtaymans@redhat.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26918,"web_url":"https://patchwork.libcamera.org/comment/26918/","msgid":"<168199094816.2445904.16977461632877073038@Monstersaurus>","date":"2023-04-20T11:42:28","subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"content":"Cc + George who I think may also be looking at this\n\nQuoting Laurent Pinchart (2023-04-20 09:08:57)\n> On Thu, Apr 20, 2023 at 08:48:14AM +0200, Jacopo Mondi wrote:\n> > On Thu, Apr 20, 2023 at 05:57:37AM +0300, Laurent Pinchart wrote:\n> > > On Wed, Apr 19, 2023 at 01:11:39PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > > On 19/04/2023 10:45, Jacopo Mondi wrote:\n> > > > > On Wed, Apr 19, 2023 at 09:58:18AM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > > >> It can be beneficial to allow reporting the devices used by a camera to\n> > > > >> facilitate de-duplication of resources when handling cameras from a\n> > > > >> centralised infrastructure such as PipeWire.\n> > > > >\n> > > > > This series allows to retrieve the list of dev_t a libcamera::Camera\n> > > > > handles by using a camera properties.\n> > > > >\n> > > > > The CameraManager class however maintains a camerasByDevnum_ map that\n> > > > > associates a dev_t with the Camera it is owned by. It would be trivial\n> > > > > to reverse the map. Have you considered that ? Getting dev_t from the\n> > > > > manager seems more natural than doing so from the Camera (and would\n> > > > > avoid the additional template specialization for dev_t you don't like)\n> > > >\n> > > > No I haven't, so that's an interesting point. I'll take a look.\n> > > >\n> > > > Robert/Wim,\n> > > >\n> > > > Do you have any specific requirements here? Do you need to be able to\n> > > > map which devices are used by each camera? Or is a single list sufficient?\n> > > >\n> > > > Or maybe returning a map of camera (id?) to device list is best all round?\n> > > >\n> > > > My only thought on the separation is the list would have to be\n> > > > re-obtained for hotplugged cameras, while it's available at the 'camera'\n> > > > when on the object. Conversely, perhaps hotplug is a reason to\n> > > > centralize the whole list as after a camera is removed it would need to\n> > > > be updated anyway.\n> > > >\n> > > > So - I'll see if I can add in a call on the Camera Manager that returns\n> > > > a map of camera id / dev_t.\n> > >\n> > > The map we expose through the CameraManager is meant for the V4L2\n> > > adaptation layer only. I'm actually thinking about how we could avoid\n> > \n> > It's for V4L2 layer only because so far we had no other use cases,\n> > isn't it ?\n> \n> Yes, but I also want to avoid new ue cases :-) V4L2 should be an\n> implementation detail that applications shouldn't care about. There are\n> some transitional use cases that we have to support, and I'd like them\n> to be exceptions, not a norm.\n> \n> > > exposing it in the public API. A camera property seems a nicer solution\n> > > for the problem at hand.\n> > \n> > However it will require getting hold of all camera intances, fetch and\n> > read the properties. As Kieran said with hotplug it gets even worse.\n> > Isn't it better to get it from the manager which maintains an overall\n> > view of all resources in the system ?\n> \n> Hotplug is already supported by libcamera, through a signal that\n> indicates when a camera is plugged in. You can then get the list of\n> dev_t from the camera. If you want to expose that information in a\n> different way, you will need a separate hotplug notification to tell\n> when new dev_t are added or removed.\n\nI envisaged that upon hotplug, an application can call the camera\nmanager to get the revised complete list on both hotplug and hotunplug.\n\nFor a while I thought otherwise, the application would have to iterate\nall the cameras again to re-fresh the list. However - on hotunplug - the\nCamera object is passed in, so the unplug call already reports which\ndev_t is now being 'released' and could be handled by the app.\n\nSo with:\n\n--- a/src/apps/cam/main.cpp\n+++ b/src/apps/cam/main.cpp\n@@ -187,11 +187,23 @@ int CamApp::parseOptions(int argc, char *argv[])\n void CamApp::cameraAdded(std::shared_ptr<Camera> cam)\n {\n        std::cout << \"Camera Added: \" << cam->id() << std::endl;\n+\n+       std::cout << \" Utilising the following devices: \" << std::endl;\n+       for (auto d : cam->properties()\n+                             .get(properties::Devices)\n+                             .value_or(std::vector<dev_t>{}))\n+               std::cout << \" - \" << d << std::endl;\n }\n\n void CamApp::cameraRemoved(std::shared_ptr<Camera> cam)\n {\n        std::cout << \"Camera Removed: \" << cam->id() << std::endl;\n+\n+       std::cout << \" Utilising the following devices: \" << std::endl;\n+       for (auto d : cam->properties()\n+                             .get(properties::Devices)\n+                             .value_or(std::vector<dev_t>{}))\n+               std::cout << \" - \" << d << std::endl;\n }\n\n void CamApp::captureDone()\n\n\nWe (helpfully) get:\n\n./build/gcc/src/apps/cam/cam -m\n...\nCamera Removed: \\_SB_.PCI0.GP13.XHC0.RHUB.PRT4-4.1:1.0-0525:a4a2\n Utilising the following devices:\n - 20736\n\nCamera Added: \\_SB_.PCI0.GP13.XHC0.RHUB.PRT4-4.1:1.0-0525:a4a2\n Utilising the following devices:\n - 20736\n\n\nSo that leaves my only concern about how we 'store' the dev_t in a\nControlInfo.\n\n--\nKieran\n\n> \n> -- \n> Regards,\n> \n> Laurent Pinchart","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 24032BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Apr 2023 11:42:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 98817603A2;\n\tThu, 20 Apr 2023 13:42:33 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C1919603A0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Apr 2023 13:42:31 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(aztw-30-b2-v4wan-166917-cust845.vm26.cable.virginm.net\n\t[82.37.23.78])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3C078DE6;\n\tThu, 20 Apr 2023 13:42:24 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1681990953;\n\tbh=U62xFvfy/6ysBfM2hrwDPNIk89IVV4Wbr7eZ8qS1aUI=;\n\th=In-Reply-To:References:To:Date:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=u+gWQlnktHky9kPNwI9j+0MPxjRKKPBnl2HYZJqGOIpmgCXRWNM4hkmYVYywUoYng\n\tcbY/2U+utnnUjgVh22k4q7pqLNwOEa2UGV1TjJmNeb7n5SlsBhCsNee0mFJJLNzv3A\n\tcYe3KfuIBYAHWd0Digp1sUgSzgio/u4fv6XiMZJ3DUcPuF8ZdTg5HB8X+YnGW/aW+0\n\tdwxZOvsGFCf7lX8Q+oTyUei2bCakcC3RyKwB8DJ2IUxrYDtsTakwqFTXLAaNpEcN4u\n\teEestoFEMwyKekF9WyCTn2plMkVHiHO4oNkkLEZXhAfenyYaMxv3nWJnnWiC9wo0wk\n\tfPgUs4YB6YDEA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1681990944;\n\tbh=U62xFvfy/6ysBfM2hrwDPNIk89IVV4Wbr7eZ8qS1aUI=;\n\th=In-Reply-To:References:Subject:From:To:Cc:Date:From;\n\tb=IObvE558NyntmaTRboOOab57dYFLC+KQUsajld4u7JcDjHA3f/a1g4RXlrpZgOWfH\n\tCZqxgQRJHB5kKWqsh1HzsGQIRgZ3J/lsc5dTxyD577OFWe9+hPvSZ13AUIQdtVD7Pl\n\tITDDln6XeFGEZCAjDatBdbJxfKwBDqzovj/67SdQ="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"IObvE558\"; dkim-atps=neutral","Content-Type":"text/plain; charset=\"utf-8\"","MIME-Version":"1.0","Content-Transfer-Encoding":"quoted-printable","In-Reply-To":"<20230420080857.GE631@pendragon.ideasonboard.com>","References":"<20230419085821.2682901-1-kieran.bingham@ideasonboard.com>\n\t<qpxqdzkz4qhh4a7emxqm6y4e3r5vt6hltjvw25xcv2htvcudus@y5z3moqbwktg>\n\t<f7e756dc-18b0-b292-9915-e4c941748680@ideasonboard.com>\n\t<20230420025737.GA26974@pendragon.ideasonboard.com>\n\t<3ldg2t7tywxodenvi6yghkf3ladfcr7qwm3m6ccdwou53joxhm@cu73djahohje>\n\t<20230420080857.GE631@pendragon.ideasonboard.com>","To":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>","Date":"Thu, 20 Apr 2023 12:42:28 +0100","Message-ID":"<168199094816.2445904.16977461632877073038@Monstersaurus>","User-Agent":"alot/0.10","Subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"George Kiagiadakis <george.kiagiadakis@collabora.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>,\n\tRobert Mader <robert.mader@collabora.com>,\n\tWim Taymans <wtaymans@redhat.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":26920,"web_url":"https://patchwork.libcamera.org/comment/26920/","msgid":"<20230420134546.GF11005@pendragon.ideasonboard.com>","date":"2023-04-20T13:45:46","subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nOn Thu, Apr 20, 2023 at 12:42:28PM +0100, Kieran Bingham wrote:\n> Cc + George who I think may also be looking at this\n> \n> Quoting Laurent Pinchart (2023-04-20 09:08:57)\n> > On Thu, Apr 20, 2023 at 08:48:14AM +0200, Jacopo Mondi wrote:\n> > > On Thu, Apr 20, 2023 at 05:57:37AM +0300, Laurent Pinchart wrote:\n> > > > On Wed, Apr 19, 2023 at 01:11:39PM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > > > On 19/04/2023 10:45, Jacopo Mondi wrote:\n> > > > > > On Wed, Apr 19, 2023 at 09:58:18AM +0100, Kieran Bingham via libcamera-devel wrote:\n> > > > > >> It can be beneficial to allow reporting the devices used by a camera to\n> > > > > >> facilitate de-duplication of resources when handling cameras from a\n> > > > > >> centralised infrastructure such as PipeWire.\n> > > > > >\n> > > > > > This series allows to retrieve the list of dev_t a libcamera::Camera\n> > > > > > handles by using a camera properties.\n> > > > > >\n> > > > > > The CameraManager class however maintains a camerasByDevnum_ map that\n> > > > > > associates a dev_t with the Camera it is owned by. It would be trivial\n> > > > > > to reverse the map. Have you considered that ? Getting dev_t from the\n> > > > > > manager seems more natural than doing so from the Camera (and would\n> > > > > > avoid the additional template specialization for dev_t you don't like)\n> > > > >\n> > > > > No I haven't, so that's an interesting point. I'll take a look.\n> > > > >\n> > > > > Robert/Wim,\n> > > > >\n> > > > > Do you have any specific requirements here? Do you need to be able to\n> > > > > map which devices are used by each camera? Or is a single list sufficient?\n> > > > >\n> > > > > Or maybe returning a map of camera (id?) to device list is best all round?\n> > > > >\n> > > > > My only thought on the separation is the list would have to be\n> > > > > re-obtained for hotplugged cameras, while it's available at the 'camera'\n> > > > > when on the object. Conversely, perhaps hotplug is a reason to\n> > > > > centralize the whole list as after a camera is removed it would need to\n> > > > > be updated anyway.\n> > > > >\n> > > > > So - I'll see if I can add in a call on the Camera Manager that returns\n> > > > > a map of camera id / dev_t.\n> > > >\n> > > > The map we expose through the CameraManager is meant for the V4L2\n> > > > adaptation layer only. I'm actually thinking about how we could avoid\n> > > \n> > > It's for V4L2 layer only because so far we had no other use cases,\n> > > isn't it ?\n> > \n> > Yes, but I also want to avoid new ue cases :-) V4L2 should be an\n> > implementation detail that applications shouldn't care about. There are\n> > some transitional use cases that we have to support, and I'd like them\n> > to be exceptions, not a norm.\n> > \n> > > > exposing it in the public API. A camera property seems a nicer solution\n> > > > for the problem at hand.\n> > > \n> > > However it will require getting hold of all camera intances, fetch and\n> > > read the properties. As Kieran said with hotplug it gets even worse.\n> > > Isn't it better to get it from the manager which maintains an overall\n> > > view of all resources in the system ?\n> > \n> > Hotplug is already supported by libcamera, through a signal that\n> > indicates when a camera is plugged in. You can then get the list of\n> > dev_t from the camera. If you want to expose that information in a\n> > different way, you will need a separate hotplug notification to tell\n> > when new dev_t are added or removed.\n> \n> I envisaged that upon hotplug, an application can call the camera\n> manager to get the revised complete list on both hotplug and hotunplug.\n> \n> For a while I thought otherwise, the application would have to iterate\n> all the cameras again to re-fresh the list. However - on hotunplug - the\n> Camera object is passed in, so the unplug call already reports which\n> dev_t is now being 'released' and could be handled by the app.\n> \n> So with:\n> \n> --- a/src/apps/cam/main.cpp\n> +++ b/src/apps/cam/main.cpp\n> @@ -187,11 +187,23 @@ int CamApp::parseOptions(int argc, char *argv[])\n>  void CamApp::cameraAdded(std::shared_ptr<Camera> cam)\n>  {\n>         std::cout << \"Camera Added: \" << cam->id() << std::endl;\n> +\n> +       std::cout << \" Utilising the following devices: \" << std::endl;\n> +       for (auto d : cam->properties()\n> +                             .get(properties::Devices)\n> +                             .value_or(std::vector<dev_t>{}))\n> +               std::cout << \" - \" << d << std::endl;\n>  }\n> \n>  void CamApp::cameraRemoved(std::shared_ptr<Camera> cam)\n>  {\n>         std::cout << \"Camera Removed: \" << cam->id() << std::endl;\n> +\n> +       std::cout << \" Utilising the following devices: \" << std::endl;\n> +       for (auto d : cam->properties()\n> +                             .get(properties::Devices)\n> +                             .value_or(std::vector<dev_t>{}))\n> +               std::cout << \" - \" << d << std::endl;\n>  }\n> \n>  void CamApp::captureDone()\n> \n> \n> We (helpfully) get:\n> \n> ./build/gcc/src/apps/cam/cam -m\n> ...\n> Camera Removed: \\_SB_.PCI0.GP13.XHC0.RHUB.PRT4-4.1:1.0-0525:a4a2\n>  Utilising the following devices:\n>  - 20736\n> \n> Camera Added: \\_SB_.PCI0.GP13.XHC0.RHUB.PRT4-4.1:1.0-0525:a4a2\n>  Utilising the following devices:\n>  - 20736\n\nThat's also what I had in mind :-)\n\n> So that leaves my only concern about how we 'store' the dev_t in a\n> ControlInfo.\n\nHow about switching internal storage of all existing dev_t to 64-bit\nintegers ? That will be large enough for all platforms and will avoid\nhaving to add a dev_t type to the control API.","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 2E869BE173\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 20 Apr 2023 13:45:37 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 69C16627C1;\n\tThu, 20 Apr 2023 15:45:36 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5C65D603A0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 20 Apr 2023 15:45:34 +0200 (CEST)","from pendragon.ideasonboard.com\n\t(133-32-181-51.west.xps.vectant.ne.jp [133.32.181.51])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 022309DE;\n\tThu, 20 Apr 2023 15:45:25 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1681998336;\n\tbh=8P5lAhh8lJH6Gkmo8SXdIjl5OpzulesovrAtpGdMCLo=;\n\th=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=XOq/FOEypvLjA0d+WzVkGtErm3tfzyPOD71Zn+zf3FNlC26nCL/rPP9zaRd41x5aJ\n\tBCRD5g/z0EteGZL0kFhTyJuRZ5eurZmcJG393LWi1Ht76IZwQv9NpKBmJkq8ewfR7Z\n\tg8qAVl/+ukXAenDBDqEqxSGjwIiyIRZDyh7Dy+tzFbivUORbtR7Joz0cTuV1UmOF7c\n\tvKgsNarzZT++ZsESbVapo8K4gOUFlsSew6pS3H1Fd9ZPVU4zfSeYUdIXNqjyR4r50U\n\ta6aYJQUMNuY9WTilKk2R707edjlodnJ0WiIUMm+6yC3ZBLrp+vb5OuVbvTh1GtXNfK\n\tgxwQRWTbFDIog==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1681998327;\n\tbh=8P5lAhh8lJH6Gkmo8SXdIjl5OpzulesovrAtpGdMCLo=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Yfdhl8KmsX+OzPd2SVzYFztz3GagC5X2SO25NbvTnRZwDRAEeUe9039nDwj+FhGv4\n\tolm0tfKecOBVo4ja/kaOW4EYQIaduYKqJ13hS81xnhvfeiVPzMf+Y+Ksn/aEKExs0V\n\t3dn/9okAYI3Tgq1ooFqzPFS6zb8g+p1xgCK2K1Yc="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"Yfdhl8Km\"; dkim-atps=neutral","Date":"Thu, 20 Apr 2023 16:45:46 +0300","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Message-ID":"<20230420134546.GF11005@pendragon.ideasonboard.com>","References":"<20230419085821.2682901-1-kieran.bingham@ideasonboard.com>\n\t<qpxqdzkz4qhh4a7emxqm6y4e3r5vt6hltjvw25xcv2htvcudus@y5z3moqbwktg>\n\t<f7e756dc-18b0-b292-9915-e4c941748680@ideasonboard.com>\n\t<20230420025737.GA26974@pendragon.ideasonboard.com>\n\t<3ldg2t7tywxodenvi6yghkf3ladfcr7qwm3m6ccdwou53joxhm@cu73djahohje>\n\t<20230420080857.GE631@pendragon.ideasonboard.com>\n\t<168199094816.2445904.16977461632877073038@Monstersaurus>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<168199094816.2445904.16977461632877073038@Monstersaurus>","Subject":"Re: [libcamera-devel] [PATCH 0/3] libcamera: Add new Camera devices\n\tproperty","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Jacopo Mondi <jacopo.mondi@ideasonboard.com>,\n\tGeorge Kiagiadakis <george.kiagiadakis@collabora.com>,\n\tlibcamera devel <libcamera-devel@lists.libcamera.org>,\n\tRobert Mader <robert.mader@collabora.com>,\n\tWim Taymans <wtaymans@redhat.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]