Photometrics / PyVCAM

Python3.X wrapper for Photometrics and QImaging PVCAM based cameras
MIT License
36 stars 17 forks source link

Frames lost in live mode #35

Open johandinox opened 11 months ago

johandinox commented 11 months ago

Hello!

We are loosing frames in live mode when polling frames with poll_frame(timeout_ms=2e3, oldestFrame=True, copyData=False), even when polling fewer frames than the circular buffer size.

The reason may be the following:

pvc_start_live

sets

camInstance.setAcquisitiontMode(false)

which sets seqMode_ False.

This line

if (!camInstance.seqMode_) {
    camInstance.resetQueue();
}

basically shrinks the queue to a 1-item queue.

If pvc_get_frame is fast enough, these lines

if (oldestFrame) {
    frame = camInstance.frameQueue_.front();
    camInstance.frameQueue_.pop();
} 

get you all the frames, but if it is too slow the 1-item buffer is unforgiving.

Is this intended behavior?

As solution one could 1. not reset the queue 2. get_frames as long as the queue is not empty.

johandinox commented 11 months ago

See fix in fork: https://github.com/Photometrics/PyVCAM/compare/master...danionella:PyVCAM:master

bjudkewitz commented 1 month ago

Can someone take a look at this issue and the PR, please? Maybe @tomhanak @vondrejPM ?

tomhanak commented 1 month ago

We are aware of the PR and thank you for it. We have to first carefully test it with all supported cameras in common scenarios. Unfortunately, I can't promise any date now. In the meantime anybody can use the modified sources from the PR. Thank you for the patience.

bjudkewitz commented 1 month ago

Great, thank you! Fully understood, no time line needed on our end, as we use our fork. I just wanted to make sure the problem description makes sense and the developers are aware of it.