Grabber multi-process sharing
Beginning with Vision Point 2023.1 (API 6.3.0), a multi-process sharing feature has been introduced and is implemented in CoaXPress frame grabbers starting with firmware version 6. This feature allows:
- Access the same grabber from multiple processes for better control and monitoring.
- Access different cameras from different processes to achieve better compartmentalization of camera and stream control.
To determine if the frame grabber supports this feature, check the Vision Point log files for 'interProcessSharingCapable' that should be set to '0x1'.
Known issues
Links lock
The camera detection process needs to be serialized between processes, meaning an inter-process lock is being held during the detection procedure. Interrupting this flow may result in a failure, indicated by an API error 'FGSTATUS_FAILED_LOCKING_DEVICE'.
Description:
When camera detection starts on a grabber in one process, we cannot know in advance on what links a camera(s) will be detected, so this process needs to operate on all links. To perform this detection procedure all links "locked to the current process". Once detection is finished, and connection topology is discovered all links are "unlocked from the process" and become available for another process
When a process opens a camera (using 'KYFG_CameraOpen()'), only links used by the given camera are locked to the process, while other links remain available to other processes. This make it possible to open other cameras in another processes. 'KYFG_CameraClose()' releases link's lock. Information about detected cameras is shared between processes (via service and a shared memory). So, to answer the question "are there any other APIs that shouldn't be called simultaneously between the separate process?" is: only API that would require access to the same link, which is camera detection and opening mentioned above. If the attempt to call 'KYFG_CameraOpen()' for a camera that is already opened in another process, will also get the error 'FGSTATUS_FAILED_LOCKING_DEVICE'.
Solution:
- Make sure no other process is trying to perform camera detection at the same time. A custom application based of the KAYA SDK should implement an own inter-process synching mechanism to avoid camera concurrent detections.
- Due to a bug in the underlying locking mechanism, a previous lock wasn't released. Try to reset grabber using the following command in system tray menu: