alliedvision / gst-vimbasrc

Official vimbasrc element for use of Vimba with GStreamer
Other
11 stars 9 forks source link

Low framerate on iMX8QM #16

Open VLongobardi opened 1 year ago

VLongobardi commented 1 year ago

I have really low FPS, about 0.1 and even lower, when I use Alvium G1-240c with iMX8QM. I am using the following configuration file: settings.xml.txt And the following Gstreamer command, which doesn't return any kind of error:

gst-launch-1.0 vimbasrc camera=$DEV_ID settingsfile=$CFG ! video/x-raw,format=RGB ! videoconvert ! fpsdisplaysink video-sink=waylandsink text-overlay=false sync=false -v

I also tried to substitute video-sink=waylandsink with video-sink=fakesink in order to not show frames and reduce the load, but the problem persists.

I followed all the NIC configuration, except the jumbo packets one, since the max mtu is 1966 as you can see:

ip -d link list
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
    link/ether 00:04:9f:06:95:16 brd ff:ff:ff:ff:ff:ff promiscuity 0 minmtu 68 maxmtu 1966 addrgenmode eui64 numtxqueues 3 numrxqueues 3 gso_max_size 65536 gso_max_segs 100 parentbus platform parentdev 5b040000.ethernet

Camera is connected to the board with a POE ethernet switch and camera is powered through POW.

I also connected the camera to my pc, with the same configuration file, same connection, same everything, except for the mtu set to 9000 and it reaches a framerate higher than 60. I also tried reduce the mtu to 1500, but I still get 60 FPS.

I also connected a USB camera to the iMX8QM and it was able to handle 30 FPS with no problem. I also run a python script following the asynchronous_grab.py example to compute FPS and the result are the same.

Any ideas?

arunprakash-avt commented 1 year ago

The issue is because of the performance of the GigE port on the iMX8QM. To achieve higher frame rate the jumbo frames on the iMX8QM should be increased to 10000 and the switch should also support jumbo frames.

VLongobardi commented 1 year ago

I just realized that GVSPPacketSize was set to 9190, since I runned GVSPAdjustPacketSize on my pc. I execute the same function on python an it setted to 1500, which is the highest mtu the port of the board can achieve and now it works, even though it is a little bit slower than my pc when I run with full camera resolution setting. Now I have to understand if I can raise mtu to 9190 and how.