[v2,1/2] libcamera: camera_manager: Non-fatal duplicate id detection
diff mbox series

Message ID 20261028-kbingham-duplicate-id-v2-1-e82448998d88@ideasonboard.com
State New
Headers show
Series
  • libcamera: camera_manager: Non-fatal duplicate id detection
Related show

Commit Message

Kieran Bingham Oct. 28, 2026, 12:02 p.m. UTC
There are some hardware configurations which currently generate a
duplicate camera ID when the camera is on a shared but multiplexed bus.

At present this is somewhat difficult to adapt to ensure a consistent
and unique id.

While this case is undesired, it presently causes libcamera to hit a
Fatal asssertion on real world hardware which then causes pipewire to
close.

This behaviour is even less desirable, and we can easily continue to
operate libcamera without a potentially duplicate camera.

Reduce the Fatal log level to an Error allowing the code to continue
without constructing this duplicate camera.

Reviewed-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/camera_manager.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/src/libcamera/camera_manager.cpp b/src/libcamera/camera_manager.cpp
index 0dd4e0c590a1..9c9073053710 100644
--- a/src/libcamera/camera_manager.cpp
+++ b/src/libcamera/camera_manager.cpp
@@ -210,7 +210,7 @@  void CameraManager::Private::addCamera(std::shared_ptr<Camera> camera)
 
 		for (const std::shared_ptr<Camera> &c : cameras_) {
 			if (c->id() == camera->id()) {
-				LOG(Camera, Fatal)
+				LOG(Camera, Error)
 					<< "Trying to register a camera with a duplicated ID '"
 					<< camera->id() << "'";
 				return;