Start_acquisition doesnt work properly if camera_acquisition is called first

If arv_camera_acquisition() (single image acquisition) is called before arv_camera_start_acquisition(), the buffers are always null when trying

buffer = arv_stream_try_pop_buffer(stream);

and frame rate is 0.

Minimal reproducible example:

Just take “arvexample.c” and add the code from “arvacquisitiontest.c” in the main function

int main (int argc, char **argv)
        ApplicationData data;
        ArvCamera *camera;
        ArvStream *stream;
        GError *error = NULL;

        int i;
        data.buffer_count = 0;

        /* Instantiation of the first available camera */
        camera = arv_camera_new (NULL, &error);

        // Code from arvacquisitiontest.c
        // ======================================== //
        // ArvCamera *camera;  // We already have a camera
        ArvBuffer *buffer;

        // camera = arv_camera_new (argc > 1 ? argv[1] : NULL, NULL);  // We already instantiated
        buffer = arv_camera_acquisition (camera, 0, NULL);

        if (ARV_IS_BUFFER (buffer))
                printf ("Image successfully acquired\n");
                printf ("Failed to acquire a single image\n");

        g_clear_object (&buffer);
        // ======================================== //

        if (ARV_IS_CAMERA (camera)) {
            // more code follows

It seems to be the case that calling arv_camera_acquisition() blocks the aravis stream internally somehow… Any help is appreciated.


Thanks for your report. I have the same issue with a Basler camera.

Please open an issue on github, it will be easier to track it there.


1 Like

arv_camera_acquisition() puts the camera in SingleFrame acquisition mode. If you want to do a continuous acquisition after a call to this function, you have to put back the camera in Continuous acquisition mode.

My issue with the Basler camera is another one, probably due to a faulty firmware.


1 Like