Opening multiple ZED X by serial number appears to be unreliable

Hi folks,

Me again, continuing down the path of trying to get 4 ZED X’s working reliably on an AGX Orin running Jetpack 6 with a QUAD capture card I have the camera’s opening reliably, but I’m having issues where there seems to be a bug when opening multiple ZED X GMSL cameras by serial number (and I do specifically mean serial number, not camera ID or anything).

I went through with the ZED Explorer with 1 camera plugged in at a time recording their serial numbers for my front/back/left/right cameras, running sudo systemctl restart nvargus-daemon.service && sudo systemctl restart zed_x_daemon.service and waiting a few seconds in between.

I launched my application that opens all four cameras by serial number, and the frames associated with calling camera.grab() on the camera object configured with the serial number of the front camera from the process above are showing the view from the left camera. Most of the other camera feeds are swapped in a similar way.

Changing my program to open only the front camera by serial number, but leaving the rest of the camera’s plugged in, the front camera still shows the view from the left camera.

Unplugging the rest of the cameras, and running sudo systemctl restart nvargus-daemon.service && sudo systemctl restart zed_x_daemon.service and running my program again (so using the same serial number still) and now it shows the view from the front camera (i.e. the correct camera for the serial number).

TL;DR for the exact same ZED X serial number the camera I open seems to change depending on what cameras are plugged in.

This experiment is repeatable for me, it’s happened on completely separate Orin/4x ZED setups.

As a small addendum the IMU accessed appears to always be the correct one, it doesn’t change when more cameras are plugged in.

I think it has to do with this output from /var/log/syslog, there is a lot of spam involving “CAM: serial no file already exists”. But there’s so much spam from Argus it’s hard to tell what actually matters

Jul 29 18:34:54 ubuntu nvargus-daemon[2080]: === quad_camera_test[2749]: CameraProvider initialized (0xffff90f94390)CAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing again(Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)
Jul 29 18:34:54 ubuntu nvargus-daemon[2080]: (Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)
Jul 29 18:34:54 ubuntu ZEDX_Daemon[1078]: [ "Mon Jul 29 18:34:54 2024" ]  >> Port  0  Opening for ModeliD  8
Jul 29 18:34:55 ubuntu ZEDX_Daemon[1078]: [ "Mon Jul 29 18:34:55 2024" ]  >> Port  0  Running for ModeliD  8
Jul 29 18:34:56 ubuntu systemd[1]: Started Session 7 of User terra.
Jul 29 18:34:57 ubuntu nvargus-daemon[2080]: CAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing again(Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)
Jul 29 18:34:57 ubuntu nvargus-daemon[2080]: (Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)
Jul 29 18:34:57 ubuntu nvargus-daemon[2080]: CAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing again(Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)
Jul 29 18:34:57 ubuntu nvargus-daemon[2080]: (Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)
Jul 29 18:34:57 ubuntu ZEDX_Daemon[1078]: [ "Mon Jul 29 18:34:57 2024" ]  >> Port  1  Opening for ModeliD  8
Jul 29 18:34:58 ubuntu ZEDX_Daemon[1078]: [ "Mon Jul 29 18:34:58 2024" ]  >> Port  1  Running for ModeliD  8
Jul 29 18:34:58 ubuntu kernel: [   98.049875] mttcan c310000.mttcan can0: Bitrate set
Jul 29 18:34:58 ubuntu kernel: [   98.063090] mttcan_controller_config: ctrlmode 0
Jul 29 18:34:58 ubuntu kernel: [   98.063111] mttcan c310000.mttcan can0: Bitrate set
Jul 29 18:34:58 ubuntu kernel: [   98.063179] IPv6: ADDRCONF(NETDEV_CHANGE): can0: link becomes ready
Jul 29 18:35:00 ubuntu systemd[1]: session-7.scope: Deactivated successfully.
Jul 29 18:35:01 ubuntu nvargus-daemon[2080]: CAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing again(Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)
Jul 29 18:35:01 ubuntu nvargus-daemon[2080]: (Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)
Jul 29 18:35:01 ubuntu nvargus-daemon[2080]: message repeated 2 times: [ (Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)]
Jul 29 18:35:01 ubuntu nvargus-daemon[2080]: CAM: serial no file already exists, skips storing againCAM: serial no file already exists, skips storing again(Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)
Jul 29 18:35:01 ubuntu nvargus-daemon[2080]: (Argus) Error AlreadyAllocated: Device 0 (of 1) is in use (in src/api/CameraProviderImpl.cpp, function createCaptureSessionInternal(), line 286)
Jul 29 18:35:01 ubuntu ZEDX_Daemon[1078]: [ "Mon Jul 29 18:35:01 2024" ]  >> Port  2  Opening for ModeliD  8
Jul 29 18:35:02 ubuntu ZEDX_Daemon[1078]: [ "Mon Jul 29 18:35:02 2024" ]  >> Port  2  Running for ModeliD  8
Jul 29 18:35:12 ubuntu ZEDX_Daemon[1078]: [ "Mon Jul 29 18:35:12 2024" ]  >> Port  2  Closing for ModeliD  8
Jul 29 18:35:12 ubuntu ZEDX_Daemon[1078]: [ "Mon Jul 29 18:35:12 2024" ]  >> Port  2  Closing for ModeliD  8
Jul 29 18:35:13 ubuntu ZEDX_Daemon[1078]: [ "Mon Jul 29 18:35:13 2024" ]  >> Port  1  Closing for ModeliD  8
Jul 29 18:35:13 ubuntu ZEDX_Daemon[1078]: [ "Mon Jul 29 18:35:13 2024" ]  >> Port  1  Closing for ModeliD  8

Hi @Waelyn
please write an email to support@stereolabs.com with a full description of the issue

We are facing the exact same issue with multi “Zed X” / “Zed X mini” camera with the quad. The SN and parameters are swapped and thus the outputs seem to be corrupted such as depth is total noise in the ZED_Depth_viewer.
Was there a fix for that?