[aravis] Re: Dropped packets on dual link GigE camera

  • From: Emmanuel Pacaud <emmanuel@xxxxxxxxx>
  • To: aravis@xxxxxxxxxxxxx
  • Date: Fri, 17 Aug 2012 21:47:26 +0200

Hi Tom,

Le mardi 14 août 2012 à 16:30 +0000, tom.cobb@xxxxxxxxxxxxx a écrit :
> When I run with packet resend on, aravis seems to request resent
> packets, which helps some of the time:
> [GvStream::send_packet_request] frame_id = 2497 (6 - 6)
> [GvStream::_process_data_block] Received resent packet 6 for frame 2497
> [GvStream::_process_data_block] Received resent packet 6 for frame 2497

This duplicated line indicates a packet misordering (one packet received
out of order, and the requested resent packet).

> [GvStream::_missing_packet_check] Resend request at dt = 1489, packet id = 
> 12/16
> [GvStream::send_packet_request] frame_id = 2497 (11 - 11)
> [GvStream::_process_data_block] Received resent packet 11 for frame 2497
> 
> and doesn't other times:
> [GvStream::_check_frame_completion] Timeout for frame 0 at dt = 100806
> [GvStream::_close_frame] Close frame 0
> 
> and if I run without packet resend it fails a lot of the time:
> [GvStream::_find_frame_data] Start frame 11
> [GvStream::_find_frame_data] Start frame 12
> [GvStream::_check_frame_completion] Incomplete frame 11
> [GvStream::_close_frame] Close frame 11
> [GvStream::_find_frame_data] Discard late frame 11 (last: 12)
> [GvStream::_find_frame_data] Discard late frame 11 (last: 12)
> 
> From my quick investigations it looks like packets may be coming out
> of order because of the dual links. How resilient is aravis to out of
> order packets? I'm wondering if it might be doing packet resends that
> could be avoided if the packets were reordered before they got to the
> stream thread?

If I recall correctly, on each packet reception, aravis checks if the
previous packets were also received, and sends a resend request
immediately if previous packets are missing.

It's not very efficient with respect to the number of resend request,
but it helps for getting a lower latency.

I guess it should not be that hard to have a timeout before sending
resend requests, which is what is already done for packets still missing
after a resend requests (Have a look at arvgvstream.c line 377).

I'm a bit reluctant to touch this part of aravis code, as without the
GigE Vision specification, it is easy to break it, and aravis misses
regression tests in this area. Anyway, if the number of duplicated
packets becomes too high, it could be interesting to add this timeout.

        Cheers,

                Emmanuel.


Other related posts: