Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect more than 2 cameras #9

Open
chasef925 opened this issue Jul 17, 2023 · 1 comment
Open

Can't connect more than 2 cameras #9

chasef925 opened this issue Jul 17, 2023 · 1 comment

Comments

@chasef925
Copy link

I have a fairly rudimentary prototype code where I'm attempting to use 4 alvium USB3 cameras. I was able to use 4 cameras using Vimba 6.2. Updating to VmbPy, I can use two cameras just fine, but I get an error when I attempt to acquire images with more than two. This includes running the multithread example. When I run my code, the error trace looks like this:

Traceback (most recent call last):
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/stream.py", line 125, in enter
call_vmb_c('VmbCaptureStart', self.context.stream_handle)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/util/tracer.py", line 131, in wrapper
result = func(*args, **kwargs)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/c_binding/vmb_c.py", line 891, in call_vmb_c
getattr(_lib_instance, func_name)(*args)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/c_binding/vmb_c.py", line 815, in _eval_vmberror
raise VmbCError(result)
vmbpy.c_binding.vmb_common.VmbCError: VmbCError(<VmbError.GenTLUnspecified: -22>)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/stream.py", line 502, in start_streaming
self.__capture_fsm.enter_capturing_mode()
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/stream.py", line 258, in enter_capturing_mode
self.go_to_state(_CaptureFsm.STATE_ORDER[-1])
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/stream.py", line 233, in go_to_state
self.__states[-1].enter() # type: ignore
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/util/tracer.py", line 131, in wrapper
result = func(*args, **kwargs)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/stream.py", line 127, in enter
raise _build_camera_error(self.context.cam, self.context.stream, e) from e
vmbpy.error.VmbCameraError: <VmbError.GenTLUnspecified: -22>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/stream.py", line 132, in exit
call_vmb_c('VmbCaptureEnd', self.context.stream_handle)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/util/tracer.py", line 131, in wrapper
result = func(*args, **kwargs)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/c_binding/vmb_c.py", line 891, in call_vmb_c
getattr(_lib_instance, func_name)(*args)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/c_binding/vmb_c.py", line 815, in _eval_vmberror
raise VmbCError(result)
vmbpy.c_binding.vmb_common.VmbCError: VmbCError(<VmbError.Already: -33>)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "1 cam.py", line 97, in
cam3.start_streaming(handler = frame_callback_3, buffer_count=7, allocation_mode = vmbpy.AllocationMode.AnnounceFrame)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/util/tracer.py", line 131, in wrapper
result = func(*args, **kwargs)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/util/context_decorator.py", line 101, in wrapper
return func(*args, **kwargs)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/util/runtime_type_check.py", line 58, in wrapper
return func(*args, **kwargs)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/camera.py", line 351, in start_streaming
self.__streams[0].start_streaming(handler=handler,
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/util/tracer.py", line 131, in wrapper
result = func(*args, **kwargs)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/util/context_decorator.py", line 101, in wrapper
return func(*args, **kwargs)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/util/runtime_type_check.py", line 58, in wrapper
return func(*args, **kwargs)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/stream.py", line 504, in start_streaming
self.__capture_fsm.leave_capturing_mode()
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/stream.py", line 262, in leave_capturing_mode
self.go_to_state(None)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/stream.py", line 236, in go_to_state
self.__states.pop().exit() # type: ignore
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/util/tracer.py", line 131, in wrapper
result = func(*args, **kwargs)
File "/home/opluser/.local/lib/python3.8/site-packages/vmbpy/stream.py", line 134, in exit
raise _build_camera_error(self.context.cam, self.context.stream, e) from e
vmbpy.error.VmbCameraError: <VmbError.Already: -33>

When I run the multithread example, the output is

2023-07-17 14:55:56,910 | Thread 'MainThread' started.
2023-07-17 14:55:56,910 | Starting vmbpy: 1.0.2 (using VmbC: 1.0.2, VmbImageTransform: 2.0)
2023-07-17 14:55:57,280 | Thread 'FrameProducer(DEV_1AB22C0181B3)' started.
2023-07-17 14:55:57,281 | Thread 'FrameProducer(DEV_1AB22C01DF37)' started.
2023-07-17 14:55:57,283 | Thread 'FrameProducer(DEV_1AB22C01DF39)' started.
2023-07-17 14:55:57,284 | Thread 'FrameConsumer' started.
2023-07-17 14:55:57,584 | <VmbError.GenTLUnspecified: -22>
2023-07-17 14:55:57,585 | Thread 'FrameProducer(DEV_1AB22C01DF37)' terminated.

If I change which cameras are plugged in, there's always a different camera that gets chosen as the odd one out.

I'm currently running Ubuntu 20.04, python 3.8.10, have updated the firmware on the cameras to the latest version, limited the DeviceLinkThroughput, and have increased the usbfs buffer size. Please let me know if there is any additional information that I can provide that may be of use.

@pjmara
Copy link

pjmara commented Mar 20, 2024

Have you had any success? Or did you have to change over to C / C++ impl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants