ADAravis

author:Mark Rivers, University of Chicago

Overview

This is an areaDetector driver for GenICam cameras using the aravis library.

GenICam is a Generic Interface for Cameras from the European Machine Vision Association (EMVA).

ADAravis is derived from the base class ADGenICam, which handles many of the details of mapping GenICam features to EPICS records. ADAravis is based heavily on the older aravisGigE driver which has been part of areaDetector for many years. ADAravis differs from aravisGigE by using the ADGenICam base class to significantly reduce the amount of code. Many of the ideas in ADGenICam were borrowed from aravisGigE.

As it name implies, ADAravis uses the aravis library. It runs on most Linux systems, and can control any GenICam camera. It cannot be used on Windows because aravis because aravis does not support it.

The aravis package must be built before building ADAravis. Instructions for doing this can be found in the ADGenICam installing aravis documentation.

Prior to using ADAravis with a specific camera model, the XML file must be read from the camera using the arv-tool utility, and the EPICS database file and OPI screens must be generated by running the Python programs in ADGenICam Python scripts.

ADAravis driver

ADGenICam inherits from ADGenICam. It adds the following parameters and EPICS records that are specific to ADAravis.

EPICS record names Record types drvInfo string Description
ARFramesCompleted ai ARAVIS_COMPLETED Number of frames successfully read
ARFramesFailures ai ARAVIS_FAILURES Number failures reading frames
ARFrameUnderruns ai ARAVIS_UNDERRUNS Number of frames underruns, which are frames that are too small
ARMissingPackets longin ARAVIS_MISSING_PKTS Number of missing packets
ARResentPackets longin ARAVIS_RESENT_PKTS Number of resent packets
ARPacketResendEnable mbbo ARAVIS_PKT_RESENT Enable resending packets. Choices are [0:”Never”, 1:”Always”]
ARPacketTimeout longout ARAVIS_PKT_TIMEOUT Delay in us before packet resend request
ARFrameRetention longout ARAVIS_FRAME_RETENTION Frame timeout in us after last packet
ARResetCamera longout ARAVIS_RESET Resets the camera
ARConnectCamera longout ARAVIS_CONNECTION Connects to the camera
ARCheckConnection calcout N.A. Connects to the camera when available
ARLeftShift, ARLeftShift_RBV mbbo/mbbi ARAVIS_LEFTSHIFT Choices are [0:”No”, 1:”Yes”]. If this is set to 1, then 10, 12 and 16 bit images will be left shifted so that a pixel with maximum exposure = 2^16 no matter what the pixel format
ARWImageMode, ARWImageMode_RBV bo/bi ARAVIS_HWIMAGEMODE Use HW register for acquisition modes. Choices are [0:”No”, 1:”Yes”]. Need to check implementation.

IOC startup script

The command to configure an ADAravis camera in the startup script is:

aravisConfig(const char *portName, const char *cameraName, size_t maxMemory, int priority, int stackSize)

portName is the name for the ADAravis port driver

cameraName is the identifier for the camera. It can be the complete camera name returned by arv-tool, for example "Point Grey Research-Blackfly S BFS-PGE-50S5C-18585624", or it can be an IP address for GigE and 10 GigE cameras, for example "164.54.160.117".

maxMemory is the maximum amount of memory the NDArrayPool is allowed to allocate. 0 means unlimited.

priority is the priority of the port thread. 0 means medium priority.

stackSize is the stack size. 0 means medium size.

MEDM screens

The following is the MEDM screen ADAravis.adl when controlling a FLIR Oryx 51S5M 10 Gbit Ethernet camera. ADAravis.adl is very similar to ADGenICam.adl, with a few additional widgets for the PVs that are specific to ADAravis.

Note that each frame is 4.8 MB, and it is collecting 162 frames/s, which is 775 MB/s.

../_images/ADAravis.png

The following is the MEDM screen FLIR_ORX_10g_51S5M-features1.adl when controlling a FLIR Oryx 51S5M 10 Gbit Ethernet camera. This screen was autogenerated by the Python script in ADGenICam, and is specific to this camera model. It is loaded from the “Camera-specific features” related display widget in the above screen.

../_images/ADAravis_features1.png

The following is the second feature screen generated by the Python program described above.

../_images/ADAravis_features2.png

Known issues

  • There is a serious performance problem when reading camera features using the aravis library. This problem is documented in an issue in ADGenICam on Github The time to read all camera features on an FLIR Oryx camera using their Spinnaker SDK is 0.056 s, while it takes 11.8 s with aravis. The problem is that aravis is not caching register values as it should. An issue has been created for this in the aravis repository on Github. This is a serious problem because the ADGenICam base class reads the value of all features when the value of any feature is changed. This means that it takes 11.8 seconds each time any feature is changed on the Oryx, for example, which is not acceptable. Hopefully this problem with aravis will be fixed soon.