# Mismatch in number of images delivered VS FPS of line scan camera

**URL:** <https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734>\
**Category:** Programming Questions\
**Tags:** cpp, acquisition, linescan, genicam, gigevision\
**Created:** [June 29, 2022, 1:29pm UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734 "2022-06-29T13:29:15Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![keerthitheja](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@keerthitheja](https://forum.commonvisionblox.com/u/keerthitheja)\
**Post date:** [June 29, 2022, 1:29pm UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734/1 "2022-06-29T13:29:16Z")

</div>

Dear Team,  
I have a SW4000Q line scan camera which delivers RGB and NIR streams. I noticed strange behavior when operating the camera at maximum resolution. The maximum resolution the camera can handle is 4096x4096. So at this resolution, I can set the line rate to a maximum value of 72 kHz for an exposure time of 10 us. With this settings the FPS of camera comes to around 16 to 17 FPS. Now, using CVB++, I am trying to acquire the images from both the streams for a total of 10 secs. Ideally I would expect the camera to deliver 160 images per stream. But, the camera only delivers around 80 to 90 images per stream. This behavior is not seen at lower resolutions like 2560 x 2048. If I reduce the resolution, for the maximum line rate the FPS goes upto 33. I also see that 330 images per stream getting delivered from the camera which is as expected.

Any help regarding this is appreciated

---

<div class="post-metadata">

**Author:** ![illusive](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/illusive/32/61_2.png) [@illusive](https://forum.commonvisionblox.com/u/illusive)\
**Post date:** [June 29, 2022, 3:48pm UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734/2 "2022-06-29T15:48:24Z")

</div>

Hi @keerthitheja

I am not entirely sure what the cause is, but one thing that strikes me as odd is the transfer rates involved here.

- Your expectation is to transfer 4096 x 4096 @17 fps. Now 4096 x 4096 x 4 = 64 MB per frame. At 16 frames per second we end up at **1 GB per second**. This is roughly the theoretical limit for a 10 GigE connection.
- What you did receive at this resolution is about 9 fps, so roundabout **576 MB per second**.
- Reducing to 2560 x 2048 pixels (20 MB per frame) gets the frame rate up to 33 fps, which is roundabout **660 MB per second**.

So the total transfer rate at reduced resolution is practically more consistent with the 9 fps at full resolution than with the theoretical maximum data rate of 1 GB per second.

Generally speaking, our experience with 10 GigE is the following:

- Under benign circumstances (decent 10 GigE adapter, powerful CPU, good wiring) you can expect to see around 800 to 900 MB per second.
- Not all adapter brands perform equally well (▶ What adapter are you using?)
- Depending on the adapter brand there are a few settings that can be tried out to improve performance (like reducing the reserved bandwidth for video streaming)
- The overall overhead of UDP + GEV can be a bit of a burden for the CPU to handle. With the average i3 or i5 CPU we’ve seen situations where the CPU limits the throughput at something between 50% and 65% of the theoretical limit (▶ what CPU are you using?)

Can you provide a bit more detail on your setup?

---

<div class="post-metadata">

**Author:** ![KVo](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@KVo](https://forum.commonvisionblox.com/u/KVo)\
**Post date:** [June 29, 2022, 5:19pm UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734/3 "2022-06-29T17:19:37Z")

</div>

Hello @keerthitheja,

as already told there are several factors which might limit you maximum framerate and bandwidth.

**1. Hardware Limitations**

First you should be aware about the topology of your mainboard and CPU you are using.

- PCIe version?
- amount of used lanes?
- who is providing the lanes, chipset or CPU?
- system memory type, amount and connections? (DDR4, dual channel, etc.)
- NIC performance settings configured?
- does the amount of buffers suit the current framerate?
- Jumbo Frames configured in driver on the host system?

The following image is showing a very simplified representation of a PC system using Intel Core CPUs.

 ![grafik](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/8/801486c850556122d06286f60ebd84b34aeb1f01.png)

Only the PCIe bus provided by the CPU can deliver appropriate bandwidths for image acquisition. The chipset of some mainboards are providing PCIe lanes as well. But those are most likely very limited in the bandwidth. Some lanes could even share the bandwidth with other lanes also resulting in a reduced bandwidth.  
Because of the used Ethernet protocol CPU utilization could be very high when using 10GigE resulting in packet loss. We are recommending the following settings for the NIC in order to keep CPU load low.

 ![grafik](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/0/0b9db36cfde4df8288e02764067efc32966cfbbd.png)

**1.1 NIC Configuration**

We want to maximize the size of each Ethernet packet carrying image data. The supported packet sizes of the NIC can be found in the settings of the NIC. In order to keep CPU utilization low we have to maximize the size of each Ethernet packet carrying image data (setting: Jumbo Frame).

In addition we have to minimize the amount of interrupts the NIC could perform and therefore disrupt the complete system, even on multicore systems (setting: Interrupt Moderation Rate).

The last very important setting is the amount of receive buffers. We recommend to maximize the amount of receive buffers in the NIC settings.

**1.2 Driver / Camera Configuration**

Up to this point we have just enabled the usage of so called Jumbo Frames. We have to tell the driver on the host system to actually use the large packet size. The image of the CVB GenICamBrowser is showing how to configure the packet size used by the camera.

The packet size must be divisible by four with no remainder. When the NIC is supporting a packet size of 9014 Bytes I would recommend to set the packet size to 8192 Bytes in CVB.

Please be aware of that the packet size can’t be stored in the user settings of the camera. The settings must be stored in the driver settings, e.g.: GenICam.ini file.

**2. Software Limitations**

Beside hardware limitations Windows could also be resonsible to limit you bandwidth. Windows could throttle link bandwidth in order to lower CPU load and prioritize multimedia applications. Please note that this setting is not related to QoS (Quality of Service) mechanism of Windows.

The throttling of the bandwidth can be disabled by using the registry key _ **NetworkThrottlingIndex** _. This key is stored under the following path.

_Computer\HKEY\_LOCAL\_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Multimedia\SystemProfile_

 ![grafik](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/f/f6f90360e980389f47ddcf7ee27b05a79a2ae2c1.png)

For HEX value **0xffffffff** thorttling is diabled. To enable throttling again the HEX value 0xa has to be used.

**3. CVB Statistics**  
CVB could output various statistics helping to determine the bottleneck of the system. The following image is showing the statistics when system performance isn’t sufficient to sustain the frame rate. The driver is receiving corrupt or incomplete images.

e.g.:  
 ![grafik](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/c/cff547ae5eea2813e06184092fe2aca65fa3c679.png)

When the NIC is receiving corrupt images possible reason is a bad Ethernet cable. In this case the packets are already corrupt when received.

Another possible reason for packet loss on the NIC is that all internal buffers have been already used. In this case new received packets have to be discarded.

When using CVB we could get another statistics directly from the acquisition driver. CVB is providing a command line tool in the subfolder “%CVB%\3Hardware\StemmerImaging\Utilities”. Name of the tool is “GevFDDiag.exe”.

e.g.:  
_Device Index: 4_  
_Device Handle: 0000000000000110_  
_Virtual Name: \DEVICE{70E47909-8896-4A83-95B3-1C9B342BAF81}_  
_Device Name: {70E47909-8896-4A83-95B3-1C9B342BAF81}-{3798D586-26C4-43C8-922E-17DB536F3A1B}-0000_  
_Vendor Description: " Aquantia AQtion Network Adapter"_  
_Medium: 802.3_  
_MAC Address: 78-D0-04-2C-65-AD_  
_Link Speed: 0_

_Device Index: 4_  
_SendNetBufferListsExternal: 19170_  
_SendNetBufferListsInternal: 3_  
_SendNetBuffersInternal: 3_  
_ReceiveNetBufferLists: 0_  
_ReceiveNetBuffers: 16077827_  
_ReceiveBytesTotal: 24327660988_  
_ReceiveIP4PacketsTotal: 16076855_  
_ReceiveUDPPacketsTotal: 15914627_  
_ReceiveUDPBytesTotal: 24085072702_  
_ReceiveUDPPacketsDropped: 15914627_  
_ReceiveUDPBytesDropped: 24085072702_

_Device Index: 4_  
_Vendor Description: " Aquantia AQtion Network Adapter"_  
_MAC Address: 78-D0-04-2C-65-AD_  
_OID\_GEN\_SUPPORTED\_LIST = not supported_  
_OID\_GEN\_HARDWARE\_STATUS = 0_  
_OID\_GEN\_MEDIA\_SUPPORTED = 0_  
_OID\_GEN\_MEDIA\_IN\_USE = 0_  
_OID\_GEN\_MAXIMUM\_LOOKAHEAD = 512_  
_OID\_GEN\_MAXIMUM\_FRAME\_SIZE = not supported_  
_OID\_GEN\_LINK\_SPEED = not supported_  
_OID\_GEN\_TRANSMIT\_BUFFER\_SPACE = 16740352_  
_OID\_GEN\_RECEIVE\_BUFFER\_SPACE = 66945060_  
_OID\_GEN\_TRANSMIT\_BLOCK\_SIZE = 16348_  
_OID\_GEN\_RECEIVE\_BLOCK\_SIZE = 16348_  
_OID\_GEN\_VENDOR\_ID = 738513016_  
_OID\_GEN\_VENDOR\_DESCRIPTION = not supported_  
_OID\_GEN\_CURRENT\_PACKET\_FILTER = 11_

_OID\_GEN\_DRIVER\_VERSION = 1586_  
_OID\_GEN\_MAXIMUM\_TOTAL\_SIZE = 16348_

_OID\_GEN\_MAC\_OPTIONS = 717_  
_OID\_GEN\_MEDIA\_CONNECT\_STATUS = not supported_  
_OID\_GEN\_MAXIMUM\_SEND\_PACKETS = 4096_

_OID\_GEN\_XMIT\_OK = 1234954_  
_OID\_GEN\_RCV\_OK = 25270724966_  
_OID\_GEN\_XMIT\_ERROR = 0_  
_OID\_GEN\_RCV\_ERROR = 0_  
_OID\_GEN\_RCV\_NO\_BUFFER = 21474804480_

_OID\_GEN\_DIRECTED\_BYTES\_XMIT = 157086_  
_OID\_GEN\_DIRECTED\_FRAMES\_XMIT = 2454_  
_OID\_GEN\_MULTICAST\_BYTES\_XMIT = 9047_  
_OID\_GEN\_MULTICAST\_FRAMES\_XMIT = 98_  
_OID\_GEN\_BROADCAST\_BYTES\_XMIT = 1069013_  
_OID\_GEN\_BROADCAST\_FRAMES\_XMIT = 16628_  
_OID\_GEN\_DIRECTED\_BYTES\_RCV = 25270725570_  
_OID\_GEN\_DIRECTED\_FRAMES\_RCV = 16656756_  
_OID\_GEN\_MULTICAST\_BYTES\_RCV = 0_  
_OID\_GEN\_MULTICAST\_FRAMES\_RCV = 0_  
_OID\_GEN\_BROADCAST\_BYTES\_RCV = 64_  
_OID\_GEN\_BROADCAST\_FRAMES\_RCV = 1_  
_OID\_GEN\_RCV\_CRC\_ERROR = 0_  
_OID\_GEN\_TRANSMIT\_QUEUE\_LENGTH = 0_  
_OID\_GEN\_GET\_TIME\_CAPS = not supported_  
_OID\_GEN\_GET\_NETCARD\_TIME = not supported_  
_OID\_GEN\_NETCARD\_LOAD = not supported_  
_OID\_GEN\_DEVICE\_PROFILE = not supported_

_OID\_GEN\_RECEIVE\_SCALE\_PARAMETERS = not supported_  
_OID\_GEN\_RECEIVE\_SCALE\_CAPABILITIES = not supported_

We are especially interested in the following counters.

_OID\_GEN\_XMIT\_OK = 1234954_  
_OID\_GEN\_RCV\_OK = 25270724966_  
_OID\_GEN\_XMIT\_ERROR = 0_  
_OID\_GEN\_RCV\_ERROR = 0_  
_OID\_GEN\_RCV\_NO\_BUFFER = 21474804480_

When the counter **OID\_GEN\_RCV\_ERROR** is incremented then the packets are already corrupted on the Ethernet cable. When counter **OID\_GEN\_RCV\_NO\_BUFFER** is incremented then all buffers of the NIC are had been in usage.

**CPU load**

The second most likely reason for packet loss is the CPU itself. Because of the used protocol each packet is causing little CPU load. Please check the CPU usage using **Windows Resource Monitor**.

e.g.:  
 ![grafik](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/b/b4aecd731f2f606730a550f466edf4b8ee70b089.jpeg)

You can also use some third party tools like HWiNFO64 to gather more information’s about the system. A bunch of values concerning RAM and PCIe connection are shown. In addition the speed of the former front side bus which is called Ring Bus on some Intel Core CPUs.

e.g.:

 ![grafik](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/7/7e815113677b182b8a611aa935cf69a0b04e6c3d.png)

The tool is outputting some sensor values as well. The following values indicate if the internal BUS of the CPU or graphics chip is limiting.

e.g.:  
 ![grafik](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/9/99b983642300ae28d4fc183b190c5142247e8d12.png)

**4. Auto negotiation**

NIC and camera are auto negotiating the link speed. Please check the negotiated link speed.

e.g.:  
 ![grafik](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/0/055e97bf9beefb602ff1ede224267c7536e1028a.png)

---

<div class="post-metadata">

**Author:** ![keerthitheja](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@keerthitheja](https://forum.commonvisionblox.com/u/keerthitheja)\
**Post date:** [July 1, 2022, 3:02pm UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734/4 "2022-07-01T15:02:43Z")

</div>

Hi @illusive

> [@illusive](#):
>
> What adapter are you using?)

We are currently using Intel(R) Ethernet Controller X550 10 gigE adapter.

> [@illusive](#):
>
> what CPU are you using?

The CPU we are using is Intel i7-9700TE-CPU @ 1.8 GHz  
We have a total RAM of 32 GB.

---

<div class="post-metadata">

**Author:** ![keerthitheja](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@keerthitheja](https://forum.commonvisionblox.com/u/keerthitheja)\
**Post date:** [July 1, 2022, 3:26pm UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734/5 "2022-07-01T15:26:16Z")

</div>

Hi @KVo and @illusive  
I followed the instructions that you mentioned. I am seeing a strange behavior with the camera when set to maximum resolution of 4096x4096. So, after a power cycle, I can open and close the camera with the default setting in it. When i set the resolution to 4096x4096 and maximum line rate possible, and do the acquisition, the camera behaves normally. But, when I try to open the camera again with the settings inside the camera, the genicam browser tries to open the camera but it fails and the camera stops responding. You can see the camera stays open and there is a cross mark on the camera icon in the configured devices tab.

 ![line_scan](https://canada1.discourse-cdn.com/flex027/uploads/commonvisionblox/original/2X/a/a22985dad27140fae0ce9ec0fc2b012a458116ab.jpeg)

I see this issue occurring only with the GeniCam Browser and CVB (even with CVB++). When I try the same thing with Jai control Tool, the camera opens and closes normally as expected. I have been facing this issue for the past 2 weeks.

@illusive Could this be happening because of the issue I raised here ?

[https://forum.commonvisionblox.com/t/multi-stream-gige-vision-camera-through-put-is-strange/1732?u=keerthitheja](https://forum.commonvisionblox.com/t/multi-stream-gige-vision-camera-through-put-is-strange/1732)

---

<div class="post-metadata">

**Author:** ![c.hartmann](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/c.hartmann/32/247_2.png) [@c.hartmann](https://forum.commonvisionblox.com/u/c.hartmann)\
**Post date:** [July 4, 2022, 7:58am UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734/6 "2022-07-04T07:58:02Z")

</div>

Hi @keerthitheja

this with the LAG setup right? Or without?

---

<div class="post-metadata">

**Author:** ![keerthitheja](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@keerthitheja](https://forum.commonvisionblox.com/u/keerthitheja)\
**Post date:** [July 4, 2022, 7:59am UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734/7 "2022-07-04T07:59:18Z")

</div>

hi @c.hartmann  
This happens with and without LAG setup.

---

<div class="post-metadata">

**Author:** ![MandanaS](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.commonvisionblox.com/mandanas/32/1211_2.png) [@MandanaS](https://forum.commonvisionblox.com/u/MandanaS)\
**Post date:** [July 4, 2022, 8:03am UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734/8 "2022-07-04T08:03:07Z")

</div>

Hi, It is possible to dedicate a specific CPUs to Jai Program, which they usually recommend that. Do you use this setting?  
How many physical CPUs do you have? Is Hyper-threading activated?

---

<div class="post-metadata">

**Author:** ![keerthitheja](https://avatars.discourse-cdn.com/v4/letter/k/839c29/32.png) [@keerthitheja](https://forum.commonvisionblox.com/u/keerthitheja)\
**Post date:** [July 4, 2022, 9:47am UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734/9 "2022-07-04T09:47:05Z")

</div>

Hi @MandanaS  
I have 8 cores in my processor. Currently, i dont think we are dedicating any specific cores to the JAI program. I can try this setting. Let me also check if hyper threading is enabled

---

<div class="post-metadata">

**Author:** ![KVo](https://avatars.discourse-cdn.com/v4/letter/k/eada6e/32.png) [@KVo](https://forum.commonvisionblox.com/u/KVo)\
**Post date:** [July 5, 2022, 8:08am UTC](https://forum.commonvisionblox.com/t/mismatch-in-number-of-images-delivered-vs-fps-of-line-scan-camera/1734/10 "2022-07-05T08:08:34Z")

</div>

@keerthitheja I’m realy sorry for my dellayed reply. Two things are corious in the screenshot showing GenICamBrowser.

1. Camera is already occupied by another process
2. CVB filter driver isn’t present any more. Other screenshots have shown that this driver is installed in general.

First thing to check is if there is a leftover from the previous section in Windows Task Manager. In case ther is no leftover from the previous session you could try deleting the subfolders under _C:\ProgramData\boost\_interprocess_

e.g.:  
_PS C:\ProgramData\boost\_interprocess\> ls_

- Verzeichnis: C:\ProgramData\boost\_interprocess\*

_Mode LastWriteTime Length Name_  
_---- ------------- ------ ----_  
_d----- 29.06.2022 11:17 1656331749_  
_d----- 29.06.2022 15:04 1656490355_  
_d----- 29.06.2022 16:29 1656511441_  
_d----- 30.06.2022 09:27 1656518115_  
_d----- 30.06.2022 12:44 1656585354_  
_d----- 30.06.2022 13:15 1656586183_  
_d----- 30.06.2022 13:40 1656587811_  
_d----- 05.07.2022 09:59 1656945815_

When the problem still persists using **CVB LogGUI** would help greatly. I will cover the LogGUI in a later post if you like.
