From 4d4686299d1de6a4aab8b4f56eb5d13532067ad5 Mon Sep 17 00:00:00 2001 From: Hazen Babcock Date: Sun, 26 Jul 2026 00:38:50 -0400 Subject: [PATCH 1/4] Add Busy() function implementation. --- DeviceAdapters/Aravis/AravisCamera.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/DeviceAdapters/Aravis/AravisCamera.h b/DeviceAdapters/Aravis/AravisCamera.h index 72f3bfb57..fe6d0675b 100644 --- a/DeviceAdapters/Aravis/AravisCamera.h +++ b/DeviceAdapters/Aravis/AravisCamera.h @@ -1,9 +1,9 @@ /* Copyright 2024 Hazen Babcock - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. @@ -53,10 +53,11 @@ class AravisCamera : public CCameraBase ~AravisCamera(); // MMDevice API. - void GetName(char* name) const; + bool Busy() { return false; } + void GetName(char* name) const; int Initialize(); int Shutdown(); - + // MMCamera API. int ClearROI(); int GetBinning() const; @@ -69,7 +70,7 @@ class AravisCamera : public CCameraBase unsigned GetImageHeight() const; unsigned GetNumberOfComponents() const; int GetROI(unsigned& x, unsigned& y, unsigned& xSize, unsigned& ySize); - int IsExposureSequenceable(bool& isSequenceable) const; + int IsExposureSequenceable(bool& isSequenceable) const; int SetBinning(int binSize); void SetExposure(double exp); int SetROI(unsigned x, unsigned y, unsigned xSize, unsigned ySize); @@ -102,7 +103,7 @@ class AravisCamera : public CCameraBase void ArvPixelFormatUpdate(guint32 arvPixelFormat); int ArvStartSequenceAcquisition(); - + private: bool capturing; long counter; From e8226ab4be398488bb5cd2cbc261a9de2f8e0252 Mon Sep 17 00:00:00 2001 From: Hazen Babcock Date: Sun, 26 Jul 2026 00:39:40 -0400 Subject: [PATCH 2/4] Use Aravis 0.8 as this is the stable version. --- m4/mm_libs.m4 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/m4/mm_libs.m4 b/m4/mm_libs.m4 index 5a91f8979..b3703ec40 100644 --- a/m4/mm_libs.m4 +++ b/m4/mm_libs.m4 @@ -74,7 +74,7 @@ AC_DEFUN([MM_LIB_HIDAPI], [ # ARAVIS_LIBS. # AC_DEFUN([MM_LIB_ARAVIS], [ - MM_LIB_WITH_PKG_CONFIG([ARAVIS], [Aravis], [aravis-0.10], [], + MM_LIB_WITH_PKG_CONFIG([ARAVIS], [Aravis], [aravis-0.8], [], [$1], [-laravis], [arv.h], [arv_update_device_list], [$2], [$3]) From ee585d60abd7121179fdd927a91c48fc63ea341c Mon Sep 17 00:00:00 2001 From: Hazen Babcock Date: Sun, 26 Jul 2026 13:30:18 -0400 Subject: [PATCH 3/4] Report aravis buffer in log file as a string. Check if the camera supports auto exposure before trying to disable it. --- DeviceAdapters/Aravis/AravisCamera.cpp | 57 ++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 7 deletions(-) diff --git a/DeviceAdapters/Aravis/AravisCamera.cpp b/DeviceAdapters/Aravis/AravisCamera.cpp index e5a2a70e1..7aad61a2b 100644 --- a/DeviceAdapters/Aravis/AravisCamera.cpp +++ b/DeviceAdapters/Aravis/AravisCamera.cpp @@ -59,7 +59,7 @@ MODULE_API void InitializeModuleData() uint64_t nDevices=0; // Debugging. - //arv_debug_enable("all:1,device"); + // arv_debug_enable("all:1,device"); // Update and get number of aravis compatible cameras. arv_update_device_list(); @@ -191,7 +191,6 @@ void AravisCamera::AcquisitionCallback(ArvStreamCallbackType type, ArvBuffer *cb } } - void AravisCamera::ArvBufferUpdate(ArvBuffer *aBuffer) { int status; @@ -201,8 +200,49 @@ void AravisCamera::ArvBufferUpdate(ArvBuffer *aBuffer) status = arv_buffer_get_status(aBuffer); if (status != 0){ - printf("Error, Aravis buffer status is %d\n", status); - return; + std::stringstream msg; + switch (status) { + case ARV_BUFFER_STATUS_UNKNOWN: + msg << "Aravis Error, Aravis buffer status is 'UNKNOWN'"; + LogMessage(msg.str(), false); + return; + case ARV_BUFFER_STATUS_CLEARED: + msg << "Aravis Error, Aravis buffer status is 'CLEARED'"; + LogMessage(msg.str(), false); + return; + case ARV_BUFFER_STATUS_TIMEOUT: + msg << "Aravis Error, Aravis buffer status is 'TIMEOUT'"; + LogMessage(msg.str(), false); + return; + case ARV_BUFFER_STATUS_MISSING_PACKETS: + msg << "Aravis Error, Aravis buffer status is 'MISSING PACKETS'"; + LogMessage(msg.str(), false); + return; + case ARV_BUFFER_STATUS_WRONG_PACKET_ID: + msg << "Aravis Error, Aravis buffer status is 'WRONG_PACKET_ID'"; + LogMessage(msg.str(), false); + return; + case ARV_BUFFER_STATUS_SIZE_MISMATCH: + msg << "Aravis Error, Aravis buffer status is 'SIZE_MISMATCH'"; + LogMessage(msg.str(), false); + return; + case ARV_BUFFER_STATUS_FILLING: + msg << "Aravis Error, Aravis buffer status is 'FILLING'"; + LogMessage(msg.str(), false); + return; + case ARV_BUFFER_STATUS_ABORTED: + msg << "Aravis Error, Aravis buffer status is 'ABORTED'"; + LogMessage(msg.str(), false); + return; + case ARV_BUFFER_STATUS_PAYLOAD_NOT_SUPPORTED: + msg << "Aravis Error, Aravis buffer status is 'PAYLOAD_NOT_SUPPORTED'"; + LogMessage(msg.str(), false); + return; + default: + msg << "Aravis Error, Aravis buffer status is 'UNKNOWN_STATUS'"; + LogMessage(msg.str(), false); + return; + } } // Pixel format updates. @@ -530,9 +570,12 @@ int AravisCamera::Initialize() ArvCheckError(gerror); ArvPixelFormatUpdate(arvPixelFormat); - // Turn off auto exposure. - arv_camera_set_exposure_time_auto(arv_cam, ARV_AUTO_OFF, &gerror); - ArvCheckError(gerror); + // Turn off auto exposure (if available). + if(arv_camera_is_exposure_auto_available(arv_cam, &gerror)){ + ArvCheckError(gerror); + arv_camera_set_exposure_time_auto(arv_cam, ARV_AUTO_OFF, &gerror); + ArvCheckError(gerror); + } // Get current exposure time. ArvGetExposure(); From 1e346b77bf5ab5d830552a9cd27831d989f593c9 Mon Sep 17 00:00:00 2001 From: Hazen Babcock Date: Sun, 26 Jul 2026 15:19:51 -0400 Subject: [PATCH 4/4] Correct expected Aravis version. --- DeviceAdapters/Aravis/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/DeviceAdapters/Aravis/README.md b/DeviceAdapters/Aravis/README.md index c12088a24..4ae17dccb 100644 --- a/DeviceAdapters/Aravis/README.md +++ b/DeviceAdapters/Aravis/README.md @@ -1,7 +1,7 @@ ## About -These device adapters add support for the [Aravis Project](https://github.com/AravisProject). The adapters have been developed and tested on 64-bit Linux with Aravis-0.10. +These device adapters add support for the [Aravis Project](https://github.com/AravisProject). The adapters have been developed and tested on 64-bit Linux with Aravis-0.8. ### Note -For the cameras used to test this driver there were two choices for the same camera at hardware configuration, and only one of the two choices worked as expected. \ No newline at end of file +For the cameras used to test this driver there were two choices for the same camera at hardware configuration, and only one of the two choices worked as expected.