I'm sometimes running long sequences of captures. This looks something like setting a bunch of camera parameters, then capturing 200 frames. Then doing it over and over again.
Here's the helper functions I'm using:
Code: Select all
def set_capture_count(exposure_count):
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitType = CaptureLimitType.FrameLimited
SharpCap.SelectedCamera.CaptureConfig.CaptureLimitCount = exposure_count
return
def do_capture():
while True:
if not SharpCap.SelectedCamera.Capturing :
break
print ("Waiting for capture to complete..")
time.sleep(1)
print ("capturing... ")
SharpCap.SelectedCamera.PrepareToCapture()
SharpCap.SelectedCamera.RunCapture()
while True:
if SharpCap.SelectedCamera.Capturing :
print SharpCap.SelectedCamera.CapturedFrameCount
else:
break
if SharpCap.SelectedCamera.CapturedFrameCount > total_exposures+1:
print ("Capture overrun.....")
SharpCap.SelectedCamera.CancelCapture()
break
# time.sleep((current_exposure_time*1000)+0.1)
time.sleep(1)
Any ideas what's going on here? Shall I try to get verbose logging information when this is happening? (might be hard, based the runtime to reproduce this)
Here's a snip from the log when one of these events are happening:
Code: Select all
Verbose: 11:05:07.8590382 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Completed (returned False) GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.8590382 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Starting GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.8640513 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Completed (returned False) GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.8640513 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Starting GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.8690648 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Completed (returned False) GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.8690648 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Starting GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.8740730 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Completed (returned False) GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.8740730 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Starting GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.8871082 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Completed (returned False) GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.8871082 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Starting GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Debug: 11:05:07.8971352 Thread:#1 SharpCap.Base.BaseImageProvider.BeforeStopCapture() :: Ended
Info: 11:05:07.8971352 Thread:#1 SharpCap.MultiCaptureProvider.SendCaptureEvent(Object sender, CaptureEventArgs e) :: Capture Event : StopCapture
Debug: 11:05:07.8971352 Thread:#1 SharpCap.Models.Application.OnStopCapture() :: Started
Debug: 11:05:07.8971352 Thread:#1 SharpCap.Models.Application.OnStopCapture() :: Ended
Info: 11:05:07.8971352 Thread:#1 SharpCap.ViewModels.SharpCapViewModel.appModel_OnCaptureEvent(Object sender, CaptureEventArgs e) :: StopCapture event received in UI thread
Info: 11:05:07.8981377 Thread:#1 SharpCap.ImageProcessing.AstroTortillaPlateSolver.CygwinBinPathImpl() :: Using Unknown plate solver found at c:\cygwin\bin\
Info: 11:05:07.8981377 Thread:#1 SharpCap.ImageProcessing.AstroTortillaPlateSolver.IsAvailable() :: Plate solver not available
Info: 11:05:07.8991402 Thread:#1 SharpCap.ImageProcessing.AstapPlateSolver.IsAvailable() :: Astap Plate solver not available
Info: 11:05:07.8991402 Thread:#1 SharpCap.ImageProcessing.AstroTortillaPlateSolver.CygwinBinPathImpl() :: Using Unknown plate solver found at c:\cygwin\bin\
Info: 11:05:07.8991402 Thread:#1 SharpCap.ImageProcessing.AstroTortillaPlateSolver.IsAvailable() :: Plate solver not available
Debug: 11:05:07.8991402 Thread:#1 SharpCap.UI.SharpCapForm.OnStopCapture() :: Started
Debug: 11:05:07.8991402 Thread:#1 SharpCap.UI.SharpCapForm.OnStopCapture() :: Ended
Verbose: 11:05:07.9011455 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Completed (returned False) GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.9031512 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Starting GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Debug: 11:05:07.9031512 Thread:#1 SharpCap.Base.CaptureProviderBase`1.StopCapture() :: StopCapture event sent
Info: 11:05:07.9031512 Thread:#1 SharpCap.Base.CaptureProviderBase`1.StopCapture() :: Ended
Info: 11:05:07.9031512 Thread:#1 SharpCap.MultiCaptureProvider.CloseDevice() :: Stopping preview to close device
Info: 11:05:07.9031512 Thread:#1 SharpCap.Base.CaptureProviderBase`1.StopPreview() :: Started
Debug: 11:05:07.9031512 Thread:#1 SharpCap.Base.BaseImageProvider.Stop() :: Started
Debug: 11:05:07.9031512 Thread:#1 SharpCap.Base.CameraProxyBase.StopPreview() :: Started
Verbose: 11:05:07.9181910 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.GetQHYCCDLiveFrame :: Completed (returned False) GetQHYCCDLiveFrame(6036, 4036, 16, 1, 1426128896)
Verbose: 11:05:07.9181910 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.StopLive :: Starting StopLive()
Verbose: 11:05:08.0324940 Thread:Grab Thread#15 SharpCap.Cameras.QHY.Camera.StopLive :: Completed (returned null) StopLive()
Debug: 11:05:08.0685906 Thread:Grab Thread#15 SharpCap.Base.CameraProxyBase.GrabThreadProc() :: Ended
Info: 11:05:08.1232439 Thread:#26 SharpCap.Models.Application.set_TargetName(String value) :: Target name changed to Gain.311-Exp.1000-Temp.-20
Verbose: 11:05:08.1232439 Thread:#26 SharpCap.Base.PropertyControls.BaseValuePropertyControl`3.set_Value(TInterfaceType value) :: Ignoring property set on Exposure because value of 1000 is already the target value of 1000
Verbose: 11:05:08.1242471 Thread:#26 SharpCap.Base.PropertyControls.BaseValuePropertyControl`3.set_Value(TInterfaceType value) :: Ignoring property set on Gain because value of 255 is already the target value of 255
Debug: 11:05:08.1693668 Thread:#1 SharpCap.Base.CameraProxyBase.StopPreview() :: Ended
Debug: 11:05:08.1713721 Thread:#1 SharpCap.Base.BaseImageProvider.Stop() :: Ended
Info: 11:05:08.1733774 Thread:#1 SharpCap.MultiCaptureProvider.SendCaptureEvent(Object sender, CaptureEventArgs e) :: Capture Event : StopPreview
Info: 11:05:08.1914243 Thread:#1 SharpCap.Base.Memory.MappedBufferFactory+MemoryManager.DropStashedFrames() :: Drop stashed frames reclaimed 171282432 bytes of memory.
Info: 11:05:08.1914243 Thread:#1 SharpCap.ViewModels.SharpCapViewModel.appModel_OnCaptureEvent(Object sender, CaptureEventArgs e) :: StopPreview event received in UI thread
Info: 11:05:08.3951888 Thread:#1 SharpCap.Base.CaptureProviderBase`1.StopPreview() :: Ended
Info: 11:05:08.3960924 Thread:#1 SharpCap.Base.CaptureProviderBase`1.CloseDevice() :: Started
Debug: 11:05:08.3960924 Thread:#1 SharpCap.Base.CaptureProviderBase`1.CloseTheImageProvider() :: Started
Debug: 11:05:08.3960924 Thread:#1 SharpCap.Base.BaseImageProvider.Close() :: Started
Verbose: 11:05:08.3960924 Thread:#1 SharpCap.Cameras.QHY.Camera.Dispose :: Starting Dispose()
Verbose: 11:05:08.3960924 Thread:#1 SharpCap.Cameras.QHY.Camera.Dispose :: Completed (returned null) Dispose()
Info: 11:05:08.3960924 Thread:#1 SharpCap.Base.CameraProxyBase.Dispose(Boolean disposing) :: Started
Debug: 11:05:08.3960924 Thread:#1 SharpCap.Base.BaseImageProvider.Close() :: Ended
Debug: 11:05:08.3960924 Thread:#1 SharpCap.Base.CaptureProviderBase`1.CloseTheImageProvider() :: Ended
Debug: 11:05:08.3960924 Thread:#1 SharpCap.Base.SimpleCaptureProvider.OnDeviceClosed() :: Started
Debug: 11:05:08.3960924 Thread:#1 SharpCap.Base.SimpleCaptureProvider.OnDeviceClosed() :: Ended
Info: 11:05:08.3960924 Thread:#1 SharpCap.Base.CaptureProviderBase`1.CloseDevice() :: Ended
Info: 11:05:08.3960924 Thread:#1 SharpCap.MultiCaptureProvider.SendCaptureEvent(Object sender, CaptureEventArgs e) :: Capture Event : DeviceClosed
Info: 11:05:08.3960924 Thread:#1 SharpCap.ViewModels.SharpCapViewModel.appModel_OnCaptureEvent(Object sender, CaptureEventArgs e) :: DeviceClosed event received in UI thread
Info: 11:05:08.4117197 Thread:#1 SharpCap.Base.CaptureProviderBase`1.Dispose(Boolean bDisposing) :: Started
Error: 11:05:08.4117197 Thread:#1 SharpCap.Base.CaptureProviderBase`1.Dispose(Boolean bDisposing) :: Disposing of QHYCaptureProvider
Debug: 11:05:08.4117197 Thread:#1 SharpCap.Base.BaseImageProvider.Dispose(Boolean disposing) :: Started
Debug: 11:05:08.4117197 Thread:#1 SharpCap.Base.BaseImageProvider.Dispose(Boolean disposing) :: Ended
Info: 11:05:08.4117197 Thread:#1 SharpCap.Base.CaptureProviderBase`1.Dispose(Boolean bDisposing) :: Ended
Info: 11:05:08.4117197 Thread:#1 SharpCap.ViewModels.SharpCapViewModel.appModel_OnCaptureEvent(Object sender, CaptureEventArgs e) :: StatusBarUpdate event received in UI thread
Verbose: 11:05:08.7867606 Thread:#1 SharpCap.Cameras.Atik.AtikSdk.ArtemisShutdown :: Starting ArtemisShutdown()
Warning: 11:05:08.8023853 Thread:#1 SharpCap.Base.Utilities.LoggingProxy.HandleMethodCall(IMethodCallMessage methodCall) :: Exception of type 'DllNotFoundException' from Exception from SharpCap.Cameras.Atik.AtikSdk.ArtemisShutdown() : Unable to load DLL 'AtikCameras.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Stack Trace: at SharpCap.Cameras.Atik.AtikSdk.__Internal.ArtemisShutdown()
at SharpCap.Cameras.Atik.AtikSdk.ArtemisShutdown() in C:\Documents\Source Code\SharpCap3.2\src\SharpCap.Cameras.Atik\AtikSdk.cs:line 856
Warning: 11:05:08.8180114 Thread:#1 SharpCap.MultiCaptureProvider.Dispose() :: Exception of type 'DllNotFoundException' from Disposing of device enumerators : Unable to load DLL 'AtikCameras.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Stack Trace:
Server stack trace:
at SharpCap.Cameras.Atik.AtikSdk.__Internal.ArtemisShutdown()
at SharpCap.Cameras.Atik.AtikSdk.ArtemisShutdown() in C:\Documents\Source Code\SharpCap3.2\src\SharpCap.Cameras.Atik\AtikSdk.cs:line 856
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at SharpCap.Cameras.Atik.AtikSdk.ArtemisShutdown()
at SharpCap.Cameras.Atik.AtikDeviceEnumerator.Dispose(Boolean disposing) in C:\Documents\Source Code\SharpCap3.2\src\SharpCap.Cameras.Atik\AtikCaptureProvider.cs:line 36
at SharpCap.Base.SimpleDeviceEnumerator.Dispose() in C:\Documents\Source Code\SharpCap3.2\src\SharpCap.Base\SimpleCaptureProvider.cs:line 245
at SharpCap.MultiCaptureProvider.Dispose() in C:\Documents\Source Code\SharpCap3.2\src\SharpCap\Models\MultiCaptureProvider.cs:line 284