I use raspiraw with picamV2 to make an automatic tool that takes long exposure pictures (>1s) for light painting.
It works well but I have one frame delay starting at the 2nd frame.
For example for a sequence of 5 frames taken I got these images :
i1 = f1
i2 = dark frame or last frame of the previous sequence ! so useless frame

i3 = f2
i4 = f3
i5 = f4
So, at high frame rate (30fps) it's not a problem because it produces only a 33ms delay and one useless image (the i2) .
But at long exposure (i.e. 1sec) I have 1sec delay between what the sensor takes and what I see !
If I send start register to the sensor earlier compared to the mmal component creation and start, I get directly the useless frame at the beginning image1 (i1) and after all the following is shifted by one image (i.e. i2=f1... so with the delay of 1 image). What does the GPU with this frame in buffer !?
I tried also some trick with the pool of buffer, I can't change the number of buffer in the pool (actually 4) without crash !
And in the mmal log I saw that only 2 buffers are really used out of the 4 created in the pool and sent to the gpu.
For exemple :
Code: Select all
mmal: Create pool of 4 buffers of size 384000
mmal: Sent buffer 0x13ba128
mmal: Sent buffer 0x13ba300
mmal: Sent buffer 0x13ba4d8
mmal: Sent buffer 0x13ba6b0
mmal: Now streaming...
mmal: Buffer 0x13ba128 returned, filled 384000, timestamp 1508538481, flags 0004
mmal: Buffer 0x13ba300 returned, filled 384000, timestamp 1508538481, flags 0084 Image1 = f1
mmal: Buffer 0x13ba4d8 returned, filled 384000, timestamp 1509735898, flags 0004
mmal: Buffer 0x13ba6b0 returned, filled 384000, timestamp 1509735898, flags 0084 Image2 = useless frame
mmal: Buffer 0x13ba128 returned, filled 384000, timestamp 1510933316, flags 0004
mmal: Buffer 0x13ba300 returned, filled 384000, timestamp 1510933316, flags 0084 Image3 = f2
mmal: Buffer 0x13ba4d8 returned, filled 384000, timestamp 1512130734, flags 0004
mmal: Buffer 0x13ba6b0 returned, filled 384000, timestamp 1512130734, flags 0084 Image4 = f3
mmal: Buffer 0x13ba128 returned, filled 384000, timestamp 1513328152, flags 0004
mmal: Buffer 0x13ba300 returned, filled 384000, timestamp 1513328152, flags 0084 Image5 = f4
mmal: Buffer 0x13ba4d8 returned, filled 384000, timestamp 1514525569, flags 0004
mmal: Buffer 0x13ba6b0 returned, filled 384000, timestamp 1514525569, flags 0084 Image6 = f5
Can anyone have a lead about this useless frame and delay ?