Hello,
We have a Hikvision camera and used the Hikvision library’s, but we want to try Aravis because we have some strange behaviour with Hikvision.
So we introduced Aravis in our project and the good news is: it was working in a little bit more than one day. So that’s great. Overall, I am happy to use an open source project instead of closed source Chinese stuff.
So we had a problem and I looked into the code, but I don’t know what to do about it. First a bit about the system: we have a pc with two Hikvision camera’s. The mtu of the network interfaces is 9000, otherwise we get the error mentioned in the title every frame.
We use an external trigger (TriggerSource is Line0, trigger mode is 1, acquisition mode is ARV_ACQUISITION_MODE_CONTINUOUS, AcquisitionFrameRateEnable=true AcquisitionFrameRate=65.0). Those settings worked with the Hikvision driver and seem to work with Aravis as well. The heartbeat timeout (whatever it is) is set to 3000.
The camera’s are triggered 30 - 40 times per second. So we use a stream (created with arv_camera_create_stream
) with two buffers (also tried 8 but that doesn’t change anything, I think 1 should even be enough). Another thread is calling arv_stream_timeout_pop_buffer
, copies the data for processing, pushes the buffer back in the stream and calls arv_stream_timeout_pop_buffer
again.
This works well, but once every few minutes (2 - 7 or so), there is a timeout of the buffer. I turned on the debugging info and the log is:
[GvStream::missing_packet_check] Maximum number of requests reached at dt = 0, n_packet_requests = 94 (335 packets/frame), frame_id = 47982
followed by
[GvStream::check_frame_completion] Timeout for frame 47982 at dt = 216148
We miss 1 - 11 frames or so when this happens.
I also see this sometimes:
packet_type = (null) (0x8011)
content_type = data-block (0x0003)
frame_id = 15615
packet_id = 334
data_size = 0
followed by:
[GvStream::check_frame_completion] Timeout for frame 15615 at dt = 307206
Which also causes some frames missing.
Before creating the stream, I added this:
arv_camera_gv_set_stream_options (camera_, ARV_GV_STREAM_OPTION_NONE);
but that doesn’t seem to help.
I also tried to net resend packages:
g_object_set(stream_, "packet-resend", ARV_GV_STREAM_PACKET_RESEND_NEVER, nullptr);
but that results in having regularly missed frames because of missing packets.
Are there any settings we could try to minimize this problem? Is there maybe a timeout we can set? If we miss so many frames in a row, that’s a problem. We can handle missing 1 frame every few minutes.
What is causing this?
I hope someone can help. Thanks!