CvbException: Error getting stream count

Sometimes our application terminates due to this:

terminate called after throwing an instance of 'Cvb::V_1_6::CvbException'
  what():  Error getting stream count.

Any reason for this?

Using a thread for trying to start streaming an image, eg:
mDataStream = genICamDev->Stream<Cvb::ImageStream>();
mDataStream->RegisterManagedFlowSetPool(10);
mDataStream->Start();

Btw, Dalsa-camera Genie Nano-M1920 with CVB 14.00.010 (on Ubuntu 20.04)

Hi @IngFra ,

We probably need the Log Output from the LogGUI with the level “warning” for the default module.

Then we will see what warning or error occurs before this exception.

You should also consider upgrading to CVB 14.01.10 which is much newer and fixed some issues.

Thanx, I will try the latest version 14.01.011…

Meanwhile, got a similar error:
terminate called after throwing an instance of ‘Cvb::V_1_6::CvbException’
what(): Unspecified GenTL error

with the following in the LogGUI:

2026-Apr-15 14:37:53.292285 GEVTL [trace] GCGetPortURLInfo
2026-Apr-15 14:37:53.292293 CVRegistry [info] CTI>GEV.TLDataStream.STEMMER IMAGING.GEVTL.1.2605.726.0: Query manifest URL for file.
2026-Apr-15 14:37:53.292299 BaseDLO [trace] @000x7f029890aef0: Created handle
2026-Apr-15 14:37:53.292324 BaseDLO [trace] @000x7f029890aef0: Disposed interfaces
2026-Apr-15 14:37:53.292330 BaseDLO [trace] @000x7f029890aef0: Disposed handle
2026-Apr-15 14:37:53.292334 CVRegistry [info] CTI>GEV.TLDataStream.STEMMER IMAGING.GEVTL.1.2605.726.0: Processed URL: 'Local:SIDS.xml;2000;78a8'.
2026-Apr-15 14:37:53.292341 BaseDLO [trace] @000x7f02982de2f0: Created handle
2026-Apr-15 14:37:53.292360 BaseDLO [trace] @000x7f029890aef0: Created handle
2026-Apr-15 14:37:53.292400 BaseDLO [trace] @000x7f0298142880: Created handle
2026-Apr-15 14:37:53.292409 BaseDLO [trace] @000x7f029890aef0: Disposed interfaces
2026-Apr-15 14:37:53.292413 BaseDLO [trace] @000x7f029890aef0: Disposed handle
2026-Apr-15 14:37:53.292416 BaseDLO [trace] @000x7f02982de2f0: Disposed interfaces
2026-Apr-15 14:37:53.292420 BaseDLO [trace] @000x7f02982de2f0: Disposed handle
2026-Apr-15 14:37:53.292430 GenApiDLO [trace] CreateNodeMap(Pv NodeMap=<null>)
2026-Apr-15 14:37:53.292436 BaseDLO [trace] @000x7f02981ce970: Created handle
2026-Apr-15 14:37:53.292442 CVFactory.cvfTL.0 [trace] Enter TL => GCGetPortInfo   <hPort = 0x7f0298869688> <InfoCmd = 0xc[PORT_INFO_PORTNAME]> <*Type 0x7f02a3ffd1e0 -> Val 0x985c5340> <pData = 0x7f02987cfab0>  <*iSize = 0x7f02a3ffd1f8 -> Val = 0x400>
2026-Apr-15 14:37:53.292448 GEVTL [trace] GCGetPortInfo
2026-Apr-15 14:37:53.292453 CVFactory.cvfTL.0 [trace] Exit TL => GCGetPortInfo returned 0  
2026-Apr-15 14:37:53.292461 GenApiDLO [trace] NMLoadXMLFile(Pv NodeMap=@7f02981ce970,PKc FileName=@7f02985fced0)
2026-Apr-15 14:37:53.301232 CVFactory.cvfTL.0 [trace] Enter TL => EventGetData   <pE = 0x7f02982de5a8> <pBuffer = 0x7f0280000b60>  <*iSize = 0x7f028effc0c0 -> Val = 0x800> <iTimeout = 0>
2026-Apr-15 14:37:53.301245 GEVTL [trace] EventGetData
2026-Apr-15 14:37:53.301311 CVFactory.cvfTL.0 [trace] Exit TL => EventGetData returned -1011  
2026-Apr-15 14:37:53.301317 CVFactory.cvfTL.0 [trace] Enter TL => GCGetLastError   <ErrorCode = 0xfffffc17> <pErrText = 0>  <*iSize = 0x7f028effc000 -> Val = 0>
2026-Apr-15 14:37:53.301320 CVFactory.cvfTL.0 [trace] Exit TL => GCGetLastError returned 0   <ErrorCode = 0x7f028effbffc> <pErrText = Invalid Buffer>

Hmm, seems also to happen with CVB version 14.01.011:

22222 2026-Apr-15 16:08:07.027560 GEVTL [trace] EventGetData
22223 2026-Apr-15 16:08:07.027570 GenApiDLO [trace] NDeregisterUpdate(Pv Node=@7fed040fc590,Pv Handle=@7fed0c0bdc80)
22224 2026-Apr-15 16:08:07.027586 BaseDLO [trace] @000x7fed040fc590: Disposed interfaces
22225 2026-Apr-15 16:08:07.027592 GenApiDLO [trace] NDeregisterUpdate(Pv Node=@7fed040fc160,Pv Handle=@7fed0c0bda70)
22226 2026-Apr-15 16:08:07.027605 BaseDLO [trace] @000x7fed040fc160: Disposed interfaces
22227 2026-Apr-15 16:08:07.027609 GenApiDLO [trace] NDeregisterUpdate(Pv Node=@7fed040fbd70,Pv Handle=@7fed0c165d50)
22228 2026-Apr-15 16:08:07.027614 BaseDLO [trace] @000x7fed040fbd70: Disposed interfaces
22229 2026-Apr-15 16:08:07.027626 GenApiDLO [trace] NDeregisterUpdate(Pv Node=@7fed040fb9e0,Pv Handle=@7fed0c165c20)
22230 2026-Apr-15 16:08:07.027631 BaseDLO [trace] @000x7fed040fb9e0: Disposed interfaces
22231 2026-Apr-15 16:08:07.027636 GenApiDLO [trace] NDeregisterUpdate(Pv Node=@7fed040fb5b0,Pv Handle=@7fed0c165a20)
22232 2026-Apr-15 16:08:07.027651 CVFactory.cvfTL.0 [trace] Exit TL => EventGetData returned -1011
22233 2026-Apr-15 16:08:07.027653 BaseDLO [trace] @000x7fed040fb5b0: Disposed interfaces
22234 2026-Apr-15 16:08:07.027661 GenApiDLO [trace] NDeregisterUpdate(Pv Node=@7fed040fb1b0,Pv Handle=@7fed0c165840)
22235 2026-Apr-15 16:08:07.027660 CVFactory.cvfTL.0 [trace] Enter TL => GCGetLastError   <ErrorCode = 0xfffffc17> <pErrText = 0>  <*iSize = 0x7fed24fbd010 -> Val = 0>
22236 2026-Apr-15 16:08:07.027675 BaseDLO [trace] @000x7fed040fb1b0: Disposed interfaces
22237 2026-Apr-15 16:08:07.027676 CVFactory.cvfTL.0 [trace] Exit TL => GCGetLastError returned 0   <ErrorCode = 0x7fed24fbd00c> <pErrText = Invalid Buffer>

Hmm, trying to catch the CvbException from Stream-start but the error seems to be “sticky” and keeps failing…

How to recover from this? (Without restarting the application)

The last error we see hear is an Invalid Buffer. If you keep getting an invalid buffer you cannot recovery from it hear.

We have to find the source of the problem.

Are you doing something special with the camera? Can you give us more information on how you acquire images and how the camera is configured? Is it possible that you can reproduce this outside of your application in a minimal example?

The application is simply taking images from a GenI-camera after “prepping” (above):

            mDataStream = genICamDev->Stream<Cvb::ImageStream>();
            mDataStream->RegisterManagedFlowSetPool(10);
            mDataStream->Start();
...
            tie(image, waitStatus, enumerator) = mDataStream->WaitFor(chrono::milliseconds(int(imageTimeout * 1E3)));

But sometimes get CvbException on Stream-Start()…

On observation:
This GenI-cameras is connected to a Ethernet-switch (and power-cycled ON/OFF frequently) but another GenI-camera is connected directly to a NIC (and power always ON) seems to be without this problem!