ARV_BUFFER_STATUS_CLEARED on first image shifts system timestamps

At the start of our application using aravis, it happen from time to time that the first frame received from the camera shows a buffer error: ARV_BUFFER_STATUS_CLEARED
And after this, for all the successive images, the timestamp retrieved by arv_buffer_get_system_timestamp() is the timestamp of the previous buffer.
In our system, the camera is hardware triggered so the timestamp might be very old.

In the code, we retrieve the buffer from the new-buffer signal:

ArvBuffer* buffer = arv_stream_try_pop_buffer(m_stream);
    if(arv_buffer_get_status(buffer) == ARV_BUFFER_STATUS_SUCCESS)
        // Handle buffer
        uint64_t arv_buffer_get_system_timestamp(buffer);
        // [...]
        std::cerr << "Frame error: " << arv_buffer_get_status(buffer) << '\n';
    arv_stream_push_buffer(m_stream, buffer);

Do you have an idea how is this possible and how to avoid it?

Aravis: 0.8.26
Camera: Imperx POE-C4110C


The cleared status is probably due to an error during the computation of the number of expected packets for a frame. I have pushed a fix in main that should set the status to PAYLOAD_NOT_SUPPORTED in this case. I don’t know why it happens though. May be a transmission issue, or an error packet. It would help if you could get a wireshark trace when this happens.

Regarding the system timestamp, the value is filled when the leader packet is received. I guess your camera is sending the leader packet when it is ready to acquire, before the trigger signal. Could you confirm this assumption ?


1 Like

I have not timed this but from my experience, the timestamp received is about the trigger time.
I mean, if I do a second trigger 10 minutes after the first one, the second image, without this buffer issue, has a correct timestamp.

Hi Emmanuel,

Thanks a lot for your fix.
The cameras are currently in production so I cannot test too much with them but I will have one next week to do some tests. I hope to manage a Wireshark capture of the issue. I well let you know.