I have upgraded my project from a 4.2 SDk to a latest 4.3 R2 and have faced performance issue with my USB camera.
On 4.2 I had stable ~8-10 frames per second without any freezes but on 4.3 something was changed: for 2-3 sec I have 8-10 fps, then there is a lag for about 1-2 seconds where I have only 1-2 fps… and so on.
To check my assumption I have reverted back Raptor’s firmware and solution to v 4.2. After that everything works good, without lags.
Any ideas on how to find root cause of these freezes on 4.3 SDK?
As you can see FPS is goog for 6-7 seconds, then freezes for 3-4 seconds and so on.
Follow is the code I used to collect this statistics:
public partial class Program
{
Bitmap b = new Bitmap(160, 120);
// This method is run when the mainboard is powered up or reset.
void ProgramStarted()
{
Debug.EnableGCMessages(true);
camera.CurrentPictureResolution = Camera.PictureResolution.Resolution160x120;
camera.CameraConnected += (s, e) =>
{
Debug.Print("Camera connected");
camera.StartStreaming(b);
};
camera.CameraDisconnected += (s, e) =>
{
Debug.Print("Camera disconnected");
};
camera.BitmapStreamed += (s, e) =>
{
Debug.Print(DateTime.Now.ToString());
};
Debug.Print("Program Started");
}
}
@ Sergey Bokhantsev - I was able to reproduce the issue using the camera Gadgeteer driver, however, if I used the example on https://www.ghielectronics.com/docs/36/usb-host#3127 instead of the Gadgeteer module, it worked fine. Does it work for you?