Having difficulty connecting four ZED2 cameras to a Windows 11 PC.
When using one camera at a time or when using the ZED explorer, all cameras open under 10sec. Once in a while it won’t start and require reboot / re-plugging, but overall it is usable.
However it gets more and more difficult adding new cameras.
I wrote a simple script to benchmark this:
import time
import pyzed.sl as sl
def get_connected(echo=False):
connected = sl.Camera.get_device_list()
camera_serials = []
for device in connected:
camera_serials.append(device.serial_number)
if echo:
ic(
device.camera_state,
device.id,
device.path,
device.camera_model,
device.serial_number,
device.input_type
)
time.sleep(1)
return camera_serials
def main():
camera_serials = get_connected()
test_start_time = time.time()
print('--- test camera one by one ---')
for sn in camera_serials:
start_time = time.time()
init_params = sl.InitParameters(
camera_resolution = sl.RESOLUTION.VGA,
camera_fps = 15,
open_timeout_sec = 5.,
)
init_params.set_from_serial_number(sn)
camera = sl.Camera()
status = camera.open(init_params)
elapsed = round(time.time() - start_time, 1)
print(f'{sn}: open {status} in { elapsed }s')
time.sleep(1)
status = camera.close()
print(f'{sn}: close {status}')
time.sleep(1)
print('--- batch open ---')
open_cameras = {}
for sn in camera_serials:
start_time = time.time()
init_params = sl.InitParameters(
camera_resolution = sl.RESOLUTION.VGA,
camera_fps = 15,
open_timeout_sec = 5.,
)
init_params.set_from_serial_number(sn)
camera = sl.Camera()
open_cameras[sn] = camera
status = camera.open(init_params)
elapsed = round(time.time() - start_time, 1)
print(f'{sn}: open {status} in { elapsed }s')
time.sleep(1)
print('--- batch close ---')
for sn in camera_serials:
camera = open_cameras[sn]
status = camera.close()
print(f'{sn}: close {status}')
time.sleep(1)
print(f'--- test completed in { time.time() - test_start_time }s ---')
if __name__ == "__main__":
main()
When we’re lucky we get:
--- test camera one by one ---
20832444: open SUCCESS in 9.9s
20832444: close None
20513324: open SUCCESS in 9.6s
20513324: close None
23551088: open SUCCESS in 9.5s
23551088: close None
22198948: open SUCCESS in 9.3s
22198948: close None
--- batch open ---
20832444: open SUCCESS in 9.4s
20513324: open SUCCESS in 11.1s
23551088: open SUCCESS in 413.2s
22198948: open SUCCESS in 238.3s
More often it just hangs forever (or maybe we haven’t waited long enough), or receive CAMERA NOT DETECTED
after several minutes. Occasionally ctrl-c won’t quit the app and we have to force quit.
In the real app (which use multi-processing) the situation is much worse. When we are very lucky it takes 10-30mins to start; Sometime it says CAMERA NOT DETECTED
after a long wait; Most of the time we cannot tell if it has hanged and decide to quit.
We are using MSI PRO Z790-P WIFI, Intel 13900K, rtx4090, and tried a few PCIe USB extension boards. Tried connecting less cameras (2-3) as well as experimenting with different ports (only motherboard / motherboard + PCIe / only PCIe / all USB3 / USB3+2 / powered hubs / another PC), but nothing really help. With 2 cameras it is ~70% success rate; with 3 cameras less than 30%; with 4 cameras we usually just give up after 15mins.
The PC is running windows 11 Home, cuda 12.1, ZED SDK 4.0.7, Python 3.10.13 (Anaconda)
Any help is much appreciated!