Updating Cocaravis (MacOS test viewer) to 0.8.5

Hi, In my quest to use Aravis on MacOS to develop our in-house tools, I found the project Cocaravis. The last checkin used 0.6. I worked on updating it to 0.8.5 and it now compiles and run. Many of the calls work but some fails with some strange error.

In particular in the following code

- (CoAAcquisitionProperty *)frameRateProperty
{
    if (! arv_camera_is_frame_rate_available(_arvCamera, &global_error))
        return nil;
    
    CoAFrameRateAcquisitionProperty   *frm = [CoAFrameRateAcquisitionProperty new];
    frm.name = aquisitionPropertyNameString[propertyIndexFrameRate];
    frm.camera = self;
    frm.unit = @"fps";
    double  min, max;
    arv_camera_get_frame_rate_bounds(_arvCamera, &min, &max, &global_error);
    frm.min = min;
    frm.max = max;
    frm.currentValue = arv_camera_get_frame_rate(_arvCamera, &global_error);
    frm.valueAuto = autoNotImplemented;
    return frm;
}

The call to arv_camera_get_frame_rate_bounds succeeds but the one to arv_camera_get_frame_rate fails with the message

"GigEVision write_register error (access-denied)"

and the console spews

... arv_gc_float_get_value: assertion 'error == NULL || *error == NULL' failed

Newbie alert. This is my first foray in GigE stuff and the concept of access control of register escapes me. If you have pointers where I can educate myself… they are welcome.

MacOS 10.15.7,
aravis 0.8 installed by brew
FLIR-Blackfly S BFS-PGE-31S4M

Ok, I found some strange logic whereupon reading the frame_rate, it would try to set the frame rate. That is why it generated a “write_register error”, I temporarily patched this.

It seems, however, that the application always get a “write_register error” as when it tries to write a property. I went through all the documentation and cannot find what to do to get write access.

Can anybody help this newbie ?

Hi,

There is an issue in the way you are using GError. First of all, the name global_error doesn’t sound good, I don’t see a good reason to use a globally defined GError. And if a function returns an error, it should be handled immediately and reset. It is a error to give a non NULL GError to a function. Please have a look at the Glib documentation.

As for the register denied access, there is 3 possibilities:

  • The camera is accessed by another project. Check if if your code has gained control access of the device.
  • The register is actually read only.
  • There is a bug in Aravis. In this case please open an issue on github.

Cheers,

Emmanuel.

Thanks.
Pretty sure it’s not a bug in Aravis. Cocaravis has not been updated in more than 2 years, and error handling has been updated in Aravais since then I believe.

I’ll investigate this and update here.

Cordialement…