[{"id":31019,"web_url":"https://patchwork.libcamera.org/comment/31019/","msgid":"<20240831005655.GB27958@pendragon.ideasonboard.com>","date":"2024-08-31T00:56:55","subject":"Re: [PATCH v3 0/3] Fix uvcvideo pipelinehandler keeping /dev/video#\n\topen","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hans,\n\nApplied and pushed. Thank you for fixing this longstanding issue.\n\nOn Fri, Aug 30, 2024 at 01:12:04PM +0200, Hans de Goede wrote:\n> Hi all,\n> \n> The uvcvideo pipeline handler always keeps the uvcvideo /dev/video# device\n> for a pipeline open after enumerating the camera.\n> \n> This is a problem for uvcvideo, as keeping the /dev/video# node open stops\n> the underlying USB device and the USB bus controller from being able to\n> enter runtime-suspend causing significant unnecessary power-usage.\n> \n> Here is v3 of my series making the uvcvideo pipeline handler open\n> /dev/video# on acquire and close it on release to fix this.\n> \n> Changes in v3:\n> - s/method/function/ in commit msg\n> - Put MutexLocker locker(data_->openLock_); in a { } context\n>   to reduce the time the lock is held to the minimum time necessary\n> - Add Reviewed-by-s\n> \n> Changes in v2:\n> - Drop the first 2 patches these have already been merged\n> - Add a note to both the doxygen documentation as well as to the commit\n>   messages that opening/closing /dev/video# from acquire()/release()\n>   as done by the uvcvideo pipeline handler is an exception and that this\n>   behavior should not be copied by other pipeline handlers\n> - Other doxygen doc fixes / improvements\n> - Only unlock media devices on acquireDevice() failure if useCount_ == 0\n> - Drop PipelineHandler::lock_, update \"\\context\" in doxygen docs\n> \n> I've pushed this to the software-isp gitlab repo for CI:\n> https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/pipeline-acquireDevice-v2\n> \n> and it has passed CI.\n> \n> Regards,\n> \n> Hans\n> \n> *** BLURB HERE ***\n> \n> Hans de Goede (3):\n>   pipeline_handler: Add acquireDevice() function to mirror existing\n>     releaseDevice()\n>   camera: Use invokeMethod() for pipe_->acquire() and pipe_->release()\n>   uvcvideo: Implement acquireDevice() + releaseDevice()\n> \n>  include/libcamera/internal/pipeline_handler.h |  8 +--\n>  src/libcamera/camera.cpp                      |  6 +-\n>  src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  | 54 ++++++++++++++++-\n>  src/libcamera/pipeline_handler.cpp            | 60 ++++++++++++++-----\n>  4 files changed, 104 insertions(+), 24 deletions(-)","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 7482AC323E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSat, 31 Aug 2024 00:57:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 91B6063471;\n\tSat, 31 Aug 2024 02:57:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E89D63458\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat, 31 Aug 2024 02:57:28 +0200 (CEST)","from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 8546474C;\n\tSat, 31 Aug 2024 02:56:18 +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=\"YbbmBsOk\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725065778;\n\tbh=3BA+vbobP2M/NZS6lq917z+Xa6Q3u4JGONAFazQrxB0=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=YbbmBsOkSlAt5aFt5nLfi9BLz9tt8BxcKUaRCGizwfEXFZhZ2cNRCZVnQqJxeiAw1\n\tw/RfF6AqkdTkaN4KARTciBhxoPISi+eVd56UAEab8YOppVlspq/FvCZFQovoFwgaLv\n\tupTeEbYQa96E9JajtkFMOjtoyapH4PH60RL/eIDU=","Date":"Sat, 31 Aug 2024 03:56:55 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hans de Goede <hdegoede@redhat.com>","Cc":"libcamera-devel@lists.libcamera.org, Milan Zamazal <mzamazal@redhat.com>,\n\tMaxime Ripard <mripard@redhat.com>","Subject":"Re: [PATCH v3 0/3] Fix uvcvideo pipelinehandler keeping /dev/video#\n\topen","Message-ID":"<20240831005655.GB27958@pendragon.ideasonboard.com>","References":"<20240830111207.46455-1-hdegoede@redhat.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20240830111207.46455-1-hdegoede@redhat.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>"}}]