Ringbuffers unlocking when restarting acquisition (CVB 12.01.000)

Hi there

I’m using 32-bit CVB 12.01.000 in C# and am observing interesting behavior with the ringbuffer that I was hoping someone could help explain.

Context: I have my GenICam driver configured to have 50 buffers. Before I start acquiring images, I set the ringbuffer to manual lock mode, i.e. I have to unlock the buffers before they can be use again.

Now I acquire images. At no point do I unlock the buffers. After 50, the ringbuffer is full and no more images can be acquired, even whilst the camera is grabbing, which is to be expected.

Here’s the strange behavior. When I stop grabbing, and then start grabbing again, the camera starts acquiring images again. When I check the buffers, it still says they’re locked. It seems as if when starting the acquisition again, all the buffers are unlocked. Is this intended behavior? If so, why does probing them with IsLocked() return true? If the buffers are unlocked, does this occur when I stop grabbing, or when I start?

Thanks in advance

Hi @Pizza_Sub_Pizza,

yes, this behaviour is intended. When grabbing is stopped, all the buffers are getting unlocked again. And they should also be stated as unlocked actually… at least that’s the case in the latest version 13.02.002, which I have installed on my machine.

Please check again, if the buffers really are still locked after stopping the grab.

Btw: Is there are specific reason why you still use such an old version of :cvb: ?
The latest version can be downloaded here

1 Like

Hi @rtp_derahs

Thanks for the quick response!

Glad to know the behavior is intended, but I have some follow up questions. Even after I stop grabbing, IsLocked() reports that the buffers that were filled are locked, and I just want to check that they should be unlocked? The behavior supports that they’re unlocked, it seems that the test is giving me an incorrect answer.

My second question is about which buffer is filled first. Say I have 50 buffers, B0…B49. If I acquire 5 images and fill B0…B4, and then stop grabbing, which buffer should be filled first when I start grabbing again? B0, B4, or B5? My tests show B0, despite it being reported as locked.

My last question is about whether I can force the ringbuffer to start on a certain index, e.g. B23.

I’m using v12.01 for legacy reasons due to the nature of this project, normally I use v13.

Thanks Again

Maybe there is a bug in your version of :cvb: that leads to a wrong reporting of the locked state… I will check that!

The index of the first image acquired will always be B0.

I can recommend you to have a look at the VCRingBuffer example at %CVB%Tutorial\Image Manager\VC\VCRingBuffer and play around with the different lockmodes.
You better restrict your framerate to 1-2 fps to not lose the overview.

Hi @rtp_derahs

Thanks. This isn’t a big deal, mostly just for curiousity.

And just to clarify, the buffers are unlocked when I stop grabbing right? Not when I start? Even when I’ve set it to manual lock mode?

Appreciate the help!

1 Like

Yes exactly!
I just opened the VCRingBuffer example, and it looks like there it’s the other way round… A short glance at the source code makes me suspect the problem is that the “Locked”-checkboxes get updated, each time a new image is acquired, which isn’t the case after stopping the stream… That should definitely be fixed :smile:

1 Like