Spinaker Runtime Error

1,336 views
Skip to first unread message

Jonathan Newman

unread,
Mar 14, 2019, 4:13:51 PM3/14/19
to Bonsai Users
Hi,

I'm getting the following error when trying to use the Spinnaker node in the latest Bonsai 2.4 preview version.


Untitled.png


I can stream from the camera in SpinView just fine. The JIT debugger produces the following log

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.FileLoadException: A procedure imported by 'SpinnakerNET_v140.dll' could not be loaded.
File name: 'SpinnakerNET_v140.dll'
   at System.Signature.GetSignature(Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType)
   at System.Reflection.RuntimePropertyInfo.get_Signature()
   at System.Reflection.RuntimePropertyInfo.get_PropertyType()
   at Bonsai.Design.WorkflowGraphView.CreateOutputMenuItems(Type type, ToolStripMenuItem ownerItem, GraphNode selectedNode)
   at Bonsai.Design.WorkflowGraphView.contextMenuStrip_Opening(Object sender, CancelEventArgs e)
   at System.Windows.Forms.ToolStripDropDown.OnOpening(CancelEventArgs e)
   at System.Windows.Forms.ToolStripDropDown.SetVisibleCore(Boolean visible)
   at System.Windows.Forms.ToolStripDropDown.Show(Control control, Point position)
   at System.Windows.Forms.ContextMenuStrip.ShowInternal(Control source, Point location, Boolean isKeyboardActivated)
   at System.Windows.Forms.Control.WmContextMenu(Message& m, Control sourceControl)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.UserControl.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)




************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Bonsai
    Assembly Version: 2.4.0.0
    Win32 Version: 2.4.0.3143
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Bonsai.EXE
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Bonsai.Editor
    Assembly Version: 2.4.0.0
    Win32 Version: 2.4.0.3143
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.Editor.2.4.0-preview/lib/net462/Bonsai.Editor.dll
----------------------------------------
Bonsai.Core
    Assembly Version: 2.4.0.0
    Win32 Version: 2.4.0.3138
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.Core.2.4.0-preview/lib/net45/Bonsai.Core.dll
----------------------------------------
System.Reactive.Linq
    Assembly Version: 2.2.5.0
    Win32 Version: 2.2.5.40722
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Rx-Linq.2.2.5/lib/net45/System.Reactive.Linq.dll
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3324.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Reactive.Core
    Assembly Version: 2.2.5.0
    Win32 Version: 2.2.5.40722
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Rx-Core.2.2.5/lib/net45/System.Reactive.Core.dll
----------------------------------------
System.Reactive.Interfaces
    Assembly Version: 2.2.5.0
    Win32 Version: 2.2.5.40722
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Rx-Interfaces.2.2.5/lib/net45/System.Reactive.Interfaces.dll
----------------------------------------
System.Reactive.PlatformServices
    Assembly Version: 2.2.5.0
    Win32 Version: 2.2.5.40722
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Rx-PlatformServices.2.2.5/lib/net45/System.Reactive.PlatformServices.dll
----------------------------------------
System.Xml.Linq
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml.Linq/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.Linq.dll
----------------------------------------
WindowsBase
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
Bonsai.Design
    Assembly Version: 2.4.0.0
    Win32 Version: 2.4.0.3138
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.Design.2.4.0-preview/lib/net45/Bonsai.Design.dll
----------------------------------------
System.ComponentModel.DataAnnotations
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.ComponentModel.DataAnnotations/v4.0_4.0.0.0__31bf3856ad364e35/System.ComponentModel.DataAnnotations.dll
----------------------------------------
System.Data.Services.Client
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Data.Services.Client/v4.0_4.0.0.0__b77a5c561934e089/System.Data.Services.Client.dll
----------------------------------------
Anonymously Hosted DynamicMethods Assembly
    Assembly Version: 0.0.0.0
    Win32 Version: 4.7.3362.0 built by: NET472REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/mscorlib/v4.0_4.0.0.0__b77a5c561934e089/mscorlib.dll
----------------------------------------
SVG
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.8
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/SvgNet.1.0.8/lib/net40/SVG.dll
----------------------------------------
Bonsai.Vision
    Assembly Version: 2.4.0.0
    Win32 Version: 2.4.0.3138
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.Vision.2.4.0-preview/lib/net45/Bonsai.Vision.dll
----------------------------------------
OpenCV.Net
    Assembly Version: 3.3.0.0
    Win32 Version: 3.3.0.0
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/OpenCV.Net.3.3.1/lib/net40/OpenCV.Net.dll
----------------------------------------
Bonsai.Vision.Design
    Assembly Version: 2.4.0.0
    Win32 Version: 2.4.0.3138
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.Vision.Design.2.4.0-preview/lib/net45/Bonsai.Vision.Design.dll
----------------------------------------
Bonsai.Design.Visualizers
    Assembly Version: 2.3.0.0
    Win32 Version: 2.3.0.2240
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.Design.Visualizers.2.3.0/lib/net45/Bonsai.Design.Visualizers.dll
----------------------------------------
Bonsai.Dsp.Design
    Assembly Version: 2.4.0.0
    Win32 Version: 2.4.0.3138
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.Dsp.Design.2.4.0-preview/lib/net45/Bonsai.Dsp.Design.dll
----------------------------------------
Bonsai.Dsp
    Assembly Version: 2.4.0.0
    Win32 Version: 2.4.0.3138
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.Dsp.2.4.0-preview/lib/net45/Bonsai.Dsp.dll
----------------------------------------
Bonsai.PointGrey2
    Assembly Version: 1.0.0.0
    Win32 Version: 1.0.0.0
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.PointGrey2.1.0.0/lib/net45/Bonsai.PointGrey2.dll
----------------------------------------
FlyCapture2Managed_v100
    Assembly Version: 2.11.3.425
    Win32 Version: 2, 11, 3, 425
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.PointGrey2.1.0.0/lib/net45/bin/x64/FlyCapture2Managed_v100.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
OpenTK.GLControl
    Assembly Version: 1.1.0.0
    Win32 Version: 1.1.1589.5942
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/OpenTK.GLControl.1.1.1589.5942/lib/NET40/OpenTK.GLControl.dll
----------------------------------------
OpenTK
    Assembly Version: 1.1.0.0
    Win32 Version: 1.1.1589.5942
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/OpenTK.1.1.1589.5942/lib/NET40/OpenTK.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Design
    Assembly Version: 4.0.0.0
    Win32 Version: 4.7.3056.0 built by: NET472REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Design/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Design.dll
----------------------------------------
Bonsai.Spinnaker
    Assembly Version: 0.3.0.0
    Win32 Version: 0.3.0.0
    CodeBase: file:///C:/Users/jon/Desktop/Bonsai-2.4-preview/Packages/Bonsai.Spinnaker.0.3.0/lib/net45/Bonsai.Spinnaker.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.


Untitled.png

Gonçalo Lopes

unread,
Mar 14, 2019, 4:21:10 PM3/14/19
to Jonathan Newman, Bonsai Users
Hey Jon,

This seems like a version mismatch problem. What's your version of Spinnaker? Unfortunately I had to upgrade the Spinnaker dependencies and I'm realizing more and more that these new SDKs are much less forgiving with backwards and forwards compatibility.

Spinnaker 1.20 should work. Also, the best reference for spinnaker problems is this post:

Let me know if you learn anything, it's been helpful to gather information about compatible and incompatible configurations from forum users, since I don't have any spinnaker hardware myself.

--
You received this message because you are subscribed to the Google Groups "Bonsai Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bonsai-users...@googlegroups.com.
Visit this group at https://groups.google.com/group/bonsai-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/bonsai-users/f6370cd1-d8be-4f2a-aff3-cb6ff0390b59%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Jon Newman

unread,
Mar 15, 2019, 11:50:54 AM3/15/19
to Gonçalo Lopes, Bonsai Users
Hi Gonçalo,

Yup that was it. If I port all the extra controls I put into PointGrey2 into the spinnaker module, would you be interested in a PR?

- Jon
--
Jonathan Newman
Postdoctoral Fellow, MIT

Gonçalo Lopes

unread,
Mar 16, 2019, 12:57:13 PM3/16/19
to Jon Newman, Bonsai Users
Hi Jon,

Yeah, I would be interested in having single packages for these, to minimize confusion. Did you add anything else to the PointGrey2 package besides the image consistency check? I'm add to implement suggestions for general features for both PointGrey and Spinnaker so we can cover as many runtime use cases as possible.

The only thing I'm trying to keep to a minimum is configuration, since the range of possible options is huge and it's probably easier to just use the manufacturer GUIs to configure and store config files that can then be read by Bonsai at runtime. That way we avoid maintaining a complex configuration user interface.

Jon Newman

unread,
Mar 16, 2019, 1:57:36 PM3/16/19
to Gonçalo Lopes, Bonsai Users
Yeah, actually I used the spinview thing yesterday and realized that the camera has two slots for saving configurations to flash, so I agree that adding this extra stuff is not a good idea. The most important addition to the pointgrey2 package was the image consistency thing since it could ruin a whole recording session just due to one malformed packet. That's like 1 line of code though.

As far as spinnaker is concerned, I recorded for many hours yesterday and did not have this image consistency issue.  Maybe they actually took care of this in hardware somehow? If so, no package mods are needed.

Gonçalo Lopes

unread,
Mar 16, 2019, 2:51:14 PM3/16/19
to Jon Newman, Bonsai Users
I think the new USB3Vision and Genicam APIs also all have support for reading / saving configuration files to XML, so we can also add that optional feature in relatively easily.
I have also been finding that new camera hardware is more robust to packet loss than previous generations. APIs are a bit more crazy than before, but manageable.

I was thinking that for the PointGrey case, I can probably just catch that exception and drop the image entirely all the time. Technically it's not really different from a dropped-frame, and you can't really guarantee you won't have them, they will happen for a variety of other reasons, and we can pick them out in the frame counter.

Probably best to catch and continue all the time. Have you ever found any errors like these that would be more mission critical (i.e. crash the whole acquisition system?).

Jon Newman

unread,
Mar 16, 2019, 4:38:49 PM3/16/19
to Gonçalo Lopes, Bonsai Users
On Sat, Mar 16, 2019 at 2:51 PM Gonçalo Lopes <goncal...@gmail.com> wrote:
I think the new USB3Vision and Genicam APIs also all have support for reading / saving configuration files to XML, so we can also add that optional feature in relatively easily.
I have also been finding that new camera hardware is more robust to packet loss than previous generations. APIs are a bit more crazy than before, but manageable.

Yeah at least for Spinnaker it seemst be because its now GenIcam compliant the the number of settings in the spec is heinous. 

Yeah, I really like the idea of being able to save my settings. The issue is that if something gets changed, e.g. by another user of the camera or the settings are lost for whatever reason, then you can really screw up your data over days of use. PointGrey2 got around this by clearing all settings and then setting the ones I put into the bonsai gui in accordance with a saved workflow. I agree this is not maintainable, esp given the number of settings that GenICam exposes. 

Annoyingly, it looks like the only way to save an load settings in SpinView is via the flash on the actual camera. I would much prefer to have configuration file on disk that I could upload before the camera starts each time. I could not figure out how to create such a file in SpinView (in 5 minutes of looking).


I was thinking that for the PointGrey case, I can probably just catch that exception and drop the image entirely all the time. Technically it's not really different from a dropped-frame, and you can't really guarantee you won't have them, they will happen for a variety of other reasons, and we can pick them out in the frame counter.

I just made it an option. I think its always good to give the user the choice, but I understand your logic as well. Its also really only seems to be a problem for Gige cams, but I dont really use USB cameras.
 

Probably best to catch and continue all the time. Have you ever found any errors like these that would be more mission critical (i.e. crash the whole acquisition system?).

No, but that's why I think making it an option might be a good idea.

Jon Newman

unread,
Mar 20, 2019, 12:08:32 PM3/20/19
to Gonçalo Lopes, Bonsai Users
For the record, camera parameters can be saved to what appears to be some binary format (probably so they can pump it right into eeprom or flash without parsing) using the "File Access" tab of the SpinView GUI. I suggest that we add a features to the Spinnaker node that allows one of these files to be uploaded to the camera on workflow start. What do you think?

Gonçalo Lopes

unread,
Mar 20, 2019, 7:41:44 PM3/20/19
to Jon Newman, Bonsai Users
Sounds good. I will have access to another Spinnaker camera in a couple of week's time, most likely. I will try to add these in for next release.

Jonathan Newman

unread,
Mar 20, 2019, 8:01:02 PM3/20/19
to Bonsai Users
Also happy to take a shot and submit PR if you're interested.

Alessandro Di Filippo

unread,
Mar 21, 2019, 10:33:11 AM3/21/19
to Bonsai Users
I don't know if it can help you, but I was able to save my settings in the camera, and put them as default (so that I do not have to set them every time) by saving them as instructed here:
I think you can save them in a proper file, and then load them whenever you want.
I hope it helps. 

elisacl...@gmail.com

unread,
Oct 23, 2020, 11:32:54 AM10/23/20
to Bonsai Users
Hi Gonçalo,

I am getting the same error as shown here, whenever I try to open a script which includes "Spinnaker Capture", usually with the following message:



The last time I used Bonsai was February 2020. This week, I opened this script and it was working fine, but then I had to update some packages (another script wasn't working) - after that, any script that has "Spinnaker Capture" gives me that error message. Because of that, I was fairly certain this was a problem with version compatibility, but I've already tried to do what another user suggested to overcome that and it hasn't fixed it:




Any advice or help would be much appreciated!

Many thanks,
Elisa

elisacl...@gmail.com

unread,
Oct 23, 2020, 11:34:59 AM10/23/20
to Bonsai Users
(The screenshots weren't showing so I just attached them!)
Screenshot 2020-10-23 163351.png
Screenshot 2020-10-23 163410.png

Gonçalo Lopes

unread,
Oct 26, 2020, 8:37:46 PM10/26/20
to elisacl...@gmail.com, Bonsai Users
Hi Elisa,

Can you try with both the 32- and 64-bit version of Bonsai to see if it changes anything? Which driver version have you installed (32- or 64-bit)?

In general to prevent these kinds of clashes I tend to personally use the Zip install of Bonsai and configure one environment for each experiment
(this makes it easier to run multiple experiments side-by-side which might depend on different package versions).

elisacl...@gmail.com

unread,
Oct 29, 2020, 8:21:55 AM10/29/20
to Bonsai Users
Hi Gonçalo, 

It's the 64-bit, which I got from here:


I can't seem to find the 32-bit version anywhere, nor where to download it in the format of a Zip install? Clicking on "Download Bonsai 2.5.1." just downloads the .exe file automatically?

And what do you mean by configuring one environment per experiment? Do you mean installing multiple versions of Bonsai, each of them with slightly different package updates etc based on what you need for each script?

Thanks!
Elisa

Adam Kampff

unread,
Oct 29, 2020, 7:48:00 PM10/29/20
to elisacl...@gmail.com, Elena Dreosti, Bonsai Users
Hi Elisa,
   The "ZIP" installer(s) are here: https://github.com/bonsai-rx/bonsai/releases

If I understand correctly, then you simply need to to "unzip" this file (Bonsai.zip), which creates a folder that contains all of Bonsai (both a 32-bit and 64-bit version: Bonsai.exe and Bonsai64.exe) and the packages it depends on. (Note: you will still need to install any extra packages using the normal "package manager", but they will ONLY be "installed" into this folder.) This is how you create a stand-alone Bonsai environment that does not affect, or depend on, the version of Bonsai you have installed on your Windows PC.

What does it mean to install something anyway? It just means you (or an "installer" program) copy some files to a place that your operating system expects to find them. Windows has a variety of such places and a (somewhat painful) process for keeping them coordinated. The ZIP-installer version of Bonsai ignores (i.e. avoids) this, by putting everything Bonsai needs into one folder. You can simply copy this folder to another location, or even another computer, and it will work just the same. You can even have many different "Bonsais" stored in different folders (a good way to keep around the specific combination of package versions that worked for a particular set of experiments). Yes, it won't show up as a cool icon in your "launch tray/start menu/whatever", but at least you are in control of what is going on.

Cheers,
Adam

Reply all
Reply to author
Forward
0 new messages