Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARV_BUFFER_STATUS_TIMEOUT #31

Open
mersadsh opened this issue Feb 2, 2024 · 8 comments
Open

ARV_BUFFER_STATUS_TIMEOUT #31

mersadsh opened this issue Feb 2, 2024 · 8 comments

Comments

@mersadsh
Copy link

mersadsh commented Feb 2, 2024

Hi
I have the 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:

  • Increasing MTU both with " sudo ip link set dev enp0s31f6 mtu 9000" and "GevSCPSPacketSize" from the launch file.
  • Increasing:
    sudo sysctl -w net.core.rmem_max=33554432
    sudo sysctl -w net.core.wmem_max=33554432
    sudo sysctl -w net.core.rmem_default=33554432
    sudo sysctl -w net.core.wmem_default=33554432

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

I appreciate it if you could help me.

@bmegli
Copy link
Collaborator

bmegli commented Feb 2, 2024

Do you have those errors

?

The network code in this fork and aravis versions are different.

@mersadsh
Copy link
Author

mersadsh commented Feb 2, 2024

Thanks for your response.
I am using the Fraunhofer code and aravis verion of 0.8.22

@mersadsh
Copy link
Author

mersadsh commented Feb 2, 2024

I also tried this fork with aravis version 0.8.29.
Now the problem with higher MTU of 2000 for resolution of 2736x1824 is solved.

But still receiving the warning for the resolution of 5472x3648.

[ WARN] [1706877082.970255286]: (cam1 (and possibly subframes)) Frame error: ARV_BUFFER_STATUS_TIMEOUT

@bmegli
Copy link
Collaborator

bmegli commented Feb 2, 2024

What framerate are you trying to run at?

Assuming:

  • 5472x3648 resolution
  • 2 bytes per pixel, BPP (may be even worse, depends what pixel format you use)
  • 10 FPS

5472 × 3648 × 2 BPP × 10 FPS ÷ 1024 ÷ 1024 × 8 ~= 3045.9375 Mbps

  • first 1024 division to get data in KB
  • second 1024 division to get data in MB
  • multiply by 8 to get data in Mb

I am not sure if you are working with USB or GigEV camera

You would need 3 Gbps link to pull data. If using GigEthernet vision your link is most likely gigabit ethernet (1 Gbps)

If above assumptions are true your would be able to get at most 2-3 fps with uncompressed data using gigabit (1 Gbps) link.

3 fps may be already a stretch as 1 Gbps link speed is theoretical.

Try lowering FPS and and check if it helps.


Please also double check

  • your link speed and camera link speed
  • pixel format you are using
    • using more efficient pixel format wire representation may help
    • cameras often support more than one pixel format

@bmegli
Copy link
Collaborator

bmegli commented Feb 5, 2024

sudo sysctl -w net.core.rmem_max=33554432

Also the network buffer sizes you are using may be too small

5472 × 3648 × 2 BPP = 39923712 which is greater than 33554432

This means that even single picture may be larger than the buffer size you set.

@mersadsh
Copy link
Author

mersadsh commented Feb 6, 2024

I am using GigEV camera, and the link speed as you said is 1 Gbps.

  • 5472x3648 resolution
  • Pixel format is Mono8 which uses 1 byte per pixel (Also tried Mono12Packed and Mono16)
  • FPS is 6 (Also tried 2 and 4)
  • increased the net.core.rmem_max and net.core.rmem_default to 10x more (450000000)
  • Also instead of 3 cameras now I am trying just one camera.

The weird thing is that I get this waning for any resolution more than (2736x1824)!

@mersadsh
Copy link
Author

mersadsh commented Feb 9, 2024

I have finally fixed the problem.

The problem stemmed from the fact that the two parameters, BinningVertical and BinningHorizontal, were set to 2x2. By changing them to 1x1, I have achieved image resolution of 5472x3648 and a frame rate of 6 FPS.

Now, I am able to open each camera separately in Rviz. However, when attempting to have all three cameras open simultaneously and display images in Rviz, I encounter the same buffer error. Despite this error, the images of all three cameras are still displayed correctly.

Also sometimes, I receive the message 'Control to aravis device lost.' I appreciate it if you could tell me that if it is normal due to the high amount of data being transferred by three cameras?

Thanks for your time.

@bmegli
Copy link
Collaborator

bmegli commented Feb 9, 2024

Despite this error, the images of all three cameras are still displayed correctly

When you see this error you probably skip frame from camera due to errors

So may still have working system but some frames may be dropped


5472x3648*6=119771136 Bps ~= 114 MBps ~= 931 Mbps

So for 3 cameras at the same time you would be able to use at most 2 fps for each

Also you may easily exceed bandwidth this way sometimes (think of 3 cameras transmitting at Gb speed at the same time)

You may try setting interpacket delay through GigEV vision (I think it is GevSCPD) or use other tricks for devices to cooperate better.

Some random link that may point you in the right direction
http://www.sanxo.eu/content/techtips/TechTip_GEV_BandwidthCtl_EN.pdf

You may get some idea of link problem errors using netstat (I think I added some notes in readme)

Also larger MTU will help when pushing bandwidth to limits


So for 3 cameras you would be able to use at most 2 fps for each

Unless you are using setup like:

  • 10 Gb port on host
  • switch with 10 Gb uplink connected to host
  • and Gb links connected to each camera

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants