aravis
aravis copied to clipboard
Return error when control is not acquired
It appears to me that when Aravis fails to acquire control of the camera, it will ignore this error and continue as if control was acquired. This is is visible in this line, where the success return value from arv_gv_device_take_control is ignored.
I ran into permission denied errors when setting the TriggerMode in my application, which appeared to be caused by never having acquired control over the camera (there was another application that had taken control). Instead of producing an error about acquiring control, it was producing permission denied errors about changing TriggerMode.
Is there a valid use case for ignoring errors when acquiring control? Or should it produce an error in that case?
Aravis should not necessarily return an error if it fails to acquire control, as we may want to be able to get read acccess if another client has already taken control.
But I agree the implementation is not as clean as it should.
Thanks for the quick reply. So the suggested approach is to check if control was acquired after setting up a camera and deal with it accordingly (assuming the application requires control)?
Yes. You can use arv_gv_device_is_controller().
I should check how it is handled in GenAPI and try to be consistent with it.
Thanks! That will at-least let us detect the problem!
Maybe it would be nice to have explicit functions to take and give up controller access?
Then we could re-try to acquire controller access without closing and re-creating the camera (or device).
arv_gv_device_[take|leave]_control() ?
Yes, that will do 😅
I was looking at the documentation from the auto-generated Rust bindings, not sure why these are not exposed, but I will look into that myself :)
@EmmanuelP
Hi Emmanuel, does executing arv_gv_device_take_control in the application make the application acquire the control of the camera even if there is another application that had taken control? I am looking for a way to make the current application gain the control of the device even if there is another application that had taken control, is there any suggestion?
Thank you in advance.
It is not possible currently, without the other application leaving its control access. Some devices seem to propose a switchover function, but it is not implemented in aravis (it shoud be possible to use it by setting the appropriate features though). Even with the switchover feature, a cooperation is required between the 2 applications (shared key).
https://support.thinklucid.com/knowledgebase/using-application-switchover-with-lucid-cameras/