[PATCH 0/5] Fix uvcvideo pipelinehandler keeping /dev/video# open

Hans de Goede hdegoede at redhat.com
Tue Aug 20 21:50:11 CEST 2024


Hi all,

ATM the uvcvideo pipeline handler always keeps the uvcvideo /dev/video#
node for a pipeline open after enumerating the camera.

This is a problem for uvcvideo, as keeping the /dev/video# node open stops
the underlying USB device and the USB bus controller from being able to
enter runtime-suspend causing significant unnecessary power-usage.

This series makes the uvcvideo pipeline handler open /dev/video# on
acquire and close it on release to fix this.

I've pushed this to the software-isp gitlab repo for CI:
https://gitlab.freedesktop.org/camera/libcamera-softisp/-/commits/pipeline-acquireDevice

Regards,

Hans


Hans de Goede (5):
  pipeline_handler: Fix unlocking media devices too early when there are
    multiple cameras
  pipeline_handler: Call releaseDevice() before unlocking media devices
  pipeline_handler: Add acquireDevice() method to mirror existing
    releaseDevice()
  camera: Use invokeMethod() for pipe_->acquire() and pipe_->release()
  uvcvideo: Implement acquireDevice() + releaseDevice()

 include/libcamera/internal/pipeline_handler.h |  3 +-
 src/libcamera/camera.cpp                      |  6 ++-
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  | 46 ++++++++++++++++++
 src/libcamera/pipeline_handler.cpp            | 48 ++++++++++++++-----
 4 files changed, 89 insertions(+), 14 deletions(-)

-- 
2.46.0



More information about the libcamera-devel mailing list