FraunhoferIOSB / camera_aravis

A ROS1 driver for GenICam based GigE and USB3 cameras.
Other
22 stars 15 forks source link

ARV_BUFFER_STATUS_TIMEOUT #25

Open MaxBial opened 1 year ago

MaxBial commented 1 year ago

I am using this github repo for my "The Imaging Source" GiGE Cameras (DFK 33 GX249e - 2,3MP and 48 fps). I am getting: [ WARN ] Frame error: ARV_BUFFER_STATUS_TIMEOUT

This happens by using 1 camera at 10 fps. When using multiple cameras, then in addition I am getting afterwards: [ ERROR ] Control to aravis device lost.

When I only decrease the framerate (fps) to around 2-4 fps then everything is running good. I assume that there has to be made only some minor adjustments in the settings/parameters in the code. I think that I have just to increase/decrease the parameter "Timeout-time" or "Buffer-size". Maybe somebody already faced with issue and could tell where in the code or how to change those settings, if this is the issue.

Thanks

Best Regards

Janphr commented 1 year ago

Hey, I'm facing the same problem. Did you solve it? Thanks!

tonyromarock commented 1 year ago

Hi @MaxBial,

did you rule out that this might be a bandwidth issue on your network? We usually increase the mtu size to 9000 on the network card port to avoid any dropped frames (jumbo packets).

How many cameras are you trying to use in parallel? Here it might be necessary to upgrade to a 10Gbit ethernet switch and 10Gbit network card if all camera streams are coming in over the same network card port to your host PC.

In my experience, we didn't have much success in improving our throughput with the timeout-time and buffer-size parameters. You could see if setting all cameras with a different packet-delay improves the use of multiple cameras. This is relevant if all cameras are triggered at the same time.

Let me know if that helped.

boitumeloruf commented 1 year ago

Hi @MaxBial,

when do you get the '[ ERROR ] Control to aravis device lost'?

We recently encountered the same error. But in our case, this happens before any subscriber attaches to the node and, thus, before any big data junks are sent over the network. We have tried increasing the Timeout-Time, with no success. We haven't yet resolved the error but we assume that this might have something to do with the routing as the cameras are currently attached to a subnet with a Mesh-Wifi.

bmegli commented 1 year ago

@MaxBial

[ WARN ] Frame error: ARV_BUFFER_STATUS_TIMEOUT

I am flooded by those also in the following scenario:

So if you change one of them also make sure you change the second.


FWIW, I am on different fork but the code that is potentially causing those problems is shared.


Maybe somebody already faced with issue and could tell where in the code or how to change those settings, if this is the issue.

(DFK 33 GX249e - 2,3MP and 48 fps).

Looking at implementation of camera_aravis

Processing time is mainly:

To diagnose you may:

bmegli commented 1 year ago

The problem was diagnosed here:

At this point this is cause identified, no solution implemented yet.

MaxBial commented 1 year ago

Back in the day I tried to change in the code the parameters for the "timeout-time" and the 2-3 other parameters at the same position in the code. Unfortunately it had only a small impact. For this reason I had to change to a different Camera with different ROS driver implementation.

The things that I noticed by installing the requirements for the new camera were: to set "Receive Thread Priority Override" and "Increase the ring buffer size using the ethtool command." and "Configure the interrupt moderation rate using the ethtool command."

These things were not explicitly required for the camera_aravis driver but I guess maybe it shoulde be?

Best Regards Max

bmegli commented 1 year ago

Transport level optimizations and larger buffers help but here the problem was blocking network communication from running while processing received data.

Solved in a fork today:


This fork is not easy to build in 20.04 + Noetic


But we released packaged version of latest aravis and camera_aravis for Noetic:


As a side note, above fork had some breaking changes compared to this upstream. I am not sure everything will work the same.

And finally our fork will become stale soon as I have implemented almost everything we needed.

Some last optimizations of pixel format conversions we need are pending.

mersadsh commented 9 months ago

Hi I also have the same problem of "[ WARN] (cam1) Frame error: ARV_BUFFER_STATUS_TIMEOUT". With MTU of 2000 and the resolution of 2736x1824, I have the images on Rviz but if I increase the resolution to (like 5472x3648) it throws the Buffer Warning and there is no image.

Things that I have tried until now:

Also the thing is, if I increase the MTU to higher than 2000, this resolution 2736x1824 also doesn't work anymore.

Thanks for your help in advance.

tonyromarock commented 9 months ago

Hi @mersadsh, did you try this using the fork mentioned by @bmegli?

https://github.com/Extend-Robotics/camera_aravis/pull/12

I can imagine this being an issue with processing the received data fast enough.

mersadsh commented 9 months ago

Yes I also tried it with that fork. tried decreasing the FPS and still the same warning for resolutions higher than 2736x1824.