areaDetector / ADAravis

areaDetector driver for GenICam cameras using the Aravis library on Linux.
https://areadetector.github.io/master/ADAravis/ADAravis.html
6 stars 8 forks source link

0 size buffers in processBuffer() when capturing 'Single' or 'Multiple' #20

Open daykin opened 1 year ago

daykin commented 1 year ago

Discovered by testing fix for #18 (not related at all, to be clear):

Environment: Arch: linux-x86_64-debug EPICS Base 7.0.7 ADGenICam R1-8, master commit 639aa4f ADAravis R2-3, master commit ebca7d0 Camera: The Imaging Source Europe DMK 33GX174, via gigabit ethernet Additional Plugins: Only NDStdArrays Image plugin for viewing output array in CS-Studio

Steps to reproduce:

  1. Generate xml and database from arv-tool-0.8 genicam per the documentation
  2. Point build system to appropriate EPICS_BASE, ADCORE, GENICAM modules in configure/RELEASE
  3. Add in the ADBase and NDFile settings .req files to aravisApp/Db/aravisCamera_settings.req
  4. Build everything
  5. Start up an IOC, invoking aravisConfig(portName, aravisCameraName)
  6. load in aravisCamera.template (and, by extension, ADGenICam.template and ADBase.template)
  7. load in camera-specific records generated in step 1
  8. Change \$(P)\$(R):DataType to UInt16
  9. RegionSize and PixelFormat remain Mono16, no conversion or shift
  10. GainAuto and ExposureAuto set to 'Continuous'
  11. AcquirePeriod set to 1 second
  12. NumImages set to 100
  13. ImageMode set to 'Multiple'
  14. Acquire

Result: ArraySize_RBV Remains zero. In IOC, the following output occurs: 2023/03/21 15:30:00.404 ADAravis:processBuffer: w: 1920, h: 1200, size: 0, expected_size: 4608000

If ImageMode is set to 'Continuous' the error goes away.

daykin commented 1 year ago

Additional info: Upon starting acquisition in 'single' or 'multiple', the following error occurs: ** (process:2297535): CRITICAL **: 16:02:20.339: arv_gc_integer_get_value: assertion 'error == NULL || *error == NULL' failed

MarkRivers commented 1 year ago

That sounds to me like your camera may not support "single" or "multiple" modes. Open the camera-specific screens and look for the GenICam feature called AcquisitionMode. What choices do you see there?

daykin commented 1 year ago

Ha, I was literally in the process of typing that: This camera does not support any mode besides AcquisitionMode=Continuous. would it be worthwhile to try to add a better check for that?

MarkRivers commented 1 year ago

Returning an error if one attempts to set a non-supported AcquisitionMode and leaving the mode unchanged would be a good idea. There is already some logic that converts Multiple to Continuous for cameras that don't support Multiple:

https://github.com/areaDetector/ADGenICam/blob/639aa4f51fe233e311f22c8f61ed6138b0d5a442/GenICamApp/src/GenICamFeature.cpp#L546

That section of code could be enhanced to do something similar if Single or Multiple or both are unsupported.

I have no way to test that, but I am happy to accept a PR if you want to test it.