[libcamera-devel] [PATCH v2 0/6] libcamera: Generate unique and stable camera names

Niklas Söderlund niklas.soderlund at ragnatech.se
Tue Jul 28 02:30:52 CEST 2020


Hello,

This series aims to make and enforce unique camera names that are static 
between system resets while keeping them user-friendly and adding more 
information describing where the cameras are located in the system.  
This v2 is a complete rewrite of v1 (libcamera: camera: Add camera ID) 
of this series that centered around bus information instead of this v2 
that focus more on user friendly names. 

The weakness in this series is that not a lot of platforms describe the 
rather new location and rotation properties in their devicetree/ACPI.  
This leads to issues that can be observed below where both cameras on 
the ipu3 and rkisp1 platforms are reported to be located on the front 
while in reality one is located on the front and the other on the back.  
This is not a shortcoming of this series however and will solve itself 
once the platforms gets update firmware or when CameraSensor learns to 
read this information from configuration files (or by some other means).

Patch 3/6 also needs more work to query the device enumerator for the 
sysfs path instead of building a path that assumes the standard naming 
schema. This is a implementation detail and I think it's more important 
to get speedy feedback on the over all approach of the series.

Before this series camera names on different systems looked like this (I 
do not have access to a simple pipeline device):

- ipu3
    ov13858 8-0010
    ov5670 10-0036
- raspberrypi
    imx219
- rkisp1
    ov5695 7-0036
    ov2685 7-003c
- uvcvideo
    Venus USB2.0 Camera: Venus USB2
    Logitech Webcam C930e
- vimc
    VIMC Sensor B

With this series applied camera names on the same systems:

- ipu3
    ov13858 location front (PipelineHandlerIPU3)
    ov5670 location front (PipelineHandlerIPU3)
- raspberrypi
    imx219 location front (PipelineHandlerRPi)
- rkisp1
    ov5695 location front (PipelineHandlerRkISP1)
    ov2685 location front (PipelineHandlerRkISP1)
- uvcvideo
    Venus USB2.0 Camera: Venus USB2 on bus 3:9 (PipelineHandlerUVC)
    Logitech Webcam C930e on bus 3:4 serial 9F8F445E (PipelineHandlerUVC)
- vimc
    Sensor B location front (PipelineHandlerVimc)

Niklas Söderlund (6):
  libcamera: camera: Append pipeline name to camera name
  libcamera: camera: Generate camera name from a CameraSensor
  libcamera: v4l2_device: Add method to lookup device path
  libcamera: media_device: Expose media device serial number
  libcamera: pipeline: uvcvideo: Generate unique camera names
  libcamera: camera_manager: Enforce unique camera names

 include/libcamera/camera.h                    |  5 +++
 include/libcamera/internal/media_device.h     |  2 +
 include/libcamera/internal/v4l2_device.h      |  1 +
 src/libcamera/camera.cpp                      | 42 ++++++++++++++++++-
 src/libcamera/camera_manager.cpp              |  6 +--
 src/libcamera/media_device.cpp                |  7 ++++
 src/libcamera/pipeline/ipu3/ipu3.cpp          | 12 +++---
 .../pipeline/raspberrypi/raspberrypi.cpp      |  3 +-
 src/libcamera/pipeline/rkisp1/rkisp1.cpp      |  2 +-
 src/libcamera/pipeline/simple/simple.cpp      |  2 +-
 src/libcamera/pipeline/uvcvideo/uvcvideo.cpp  | 41 +++++++++++++++++-
 src/libcamera/pipeline/vimc/vimc.cpp          |  4 +-
 src/libcamera/v4l2_device.cpp                 | 24 +++++++++++
 test/camera/buffer_import.cpp                 |  2 +-
 test/camera/capture.cpp                       |  2 +-
 test/camera/configuration_default.cpp         |  2 +-
 test/camera/configuration_set.cpp             |  2 +-
 test/camera/statemachine.cpp                  |  2 +-
 test/controls/control_info_map.cpp            |  2 +-
 test/controls/control_list.cpp                |  2 +-
 test/serialization/serialization_test.h       |  2 +-
 21 files changed, 142 insertions(+), 25 deletions(-)

-- 
2.27.0



More information about the libcamera-devel mailing list