Multicam adapter live view and buffer warning

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Multicam adapter live view and buffer warning

Noah Young
I have two Orca Flash 4 v2s that I am trying to run through the multicamera adapter with the goal of displaying a live composite image. I can snap a single frame and I see a different image in each of two channels. But when I go to live view I am seeing one image updating, and the other is a fixed still frame. Both cameras are set to trigger internally.

When I load up a configuration with the multicam adapter set up, I get a warning about insufficient circular buffer memory. I have 64GB on my machine and have reserved 12GB for the circular buffer, so I'm not sure why this is happening.

System:
Windows 10 64-bit
Micromanager 2, gamma1, nightly from a few days ago.

Noah Young
PhD candidate, Deisseroth Lab
Stanford University


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Multicam adapter live view and buffer warning

Stuurman, Nico
HI Noah,
> I have two Orca Flash 4 v2s that I am trying to run through the
> multicamera adapter with the goal of displaying a live composite
> image. I can snap a single frame and I see a different image in each
> of two channels. But when I go to live view I am seeing one image
> updating, and the other is a fixed still frame. Both cameras are set
> to trigger internally.

I can reproduce this bug.  Will look into it.  This always used to be a
problem, in part because the multi-camera device is kind of a hack...

> When I load up a configuration with the multicam adapter set up, I get
> a warning about insufficient circular buffer memory. I have 64GB on my
> machine and have reserved 12GB for the circular buffer, so I'm not
> sure why this is happening.

Not sure what is happening here.  When exactly do you get this warning? 
When you load the configuration file?  What is the exact error test?

Best,


Nico



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Multicam adapter live view and buffer warning

Noah Young
I get the circular buffer error right after loading a configuration. The configuration has only the two DCAM adapters and the multicam adapter.

image.png

What do you suspect is going on with the live view?

On Mon, Mar 11, 2019 at 3:04 PM Stuurman, Nico <[hidden email]> wrote:
HI Noah,
> I have two Orca Flash 4 v2s that I am trying to run through the
> multicamera adapter with the goal of displaying a live composite
> image. I can snap a single frame and I see a different image in each
> of two channels. But when I go to live view I am seeing one image
> updating, and the other is a fixed still frame. Both cameras are set
> to trigger internally.

I can reproduce this bug.  Will look into it.  This always used to be a
problem, in part because the multi-camera device is kind of a hack...

> When I load up a configuration with the multicam adapter set up, I get
> a warning about insufficient circular buffer memory. I have 64GB on my
> machine and have reserved 12GB for the circular buffer, so I'm not
> sure why this is happening.

Not sure what is happening here.  When exactly do you get this warning? 
When you load the configuration file?  What is the exact error test?

Best,


Nico



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Multicam adapter live view and buffer warning

Stuurman, Nico
Hi Noah,

I get the circular buffer error right after loading a configuration. The configuration has only the two DCAM adapters and the multicam adapter.

image.png

Interesting.  In your configuration, which camera is the "default" camera (step 3 of the hardware configuration wizard)?  Try setting it to one of the two real cameras, and switch to the multicam later on.

What do you suspect is going on with the live view?

The screen updating code is very complex.  The code has to go out of its way to try not to request too many updates.  You can find the relevant code here: https://github.com/nicost/micro-manager/blob/ViewerPlusCV/mmstudio/src/main/java/org/micromanager/internal/SnapLiveManager.java

Luckily, I can reproduce the problem with the democamera.  I want to try to change the code so that a redraw is only requested after both new images have been found (rather than redrawing for each individual image).  Will take a bit of effort to get this right, and I don't have that much time...

Best,

Nico




_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Multicam adapter live view and buffer warning

Stuurman, Nico
Hi Noah and others,
>
>> What do you suspect is going on with the live view?

This bug is now fixed.  See:
https://github.com/nicost/micro-manager/commit/00d87117ad54a9dff299cdcbf29dbedafe5547c1

The main problem was that the display would only update if the sequence
number of the image was higher than the previous one. Since multi-camera
images have different sequence numbers for the two channels, this would
almost never happen and the second channel would never be updated.

This fix should be in tonight's 2.0-gamma build.

Best,


Nico



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Multicam adapter live view and buffer warning

Noah Young
Thanks Nico for getting a patch up so quickly! The latest nightly does in fact fix the live view bug for me and I can now see both channels refreshing together.

Your suggestion to set a single cameras as the default and switch to the multicam adapter once the config loads did in fact remove the circular buffer error. I would still consider this a bug, but the workaround works well for me.

On Wed, Mar 13, 2019 at 2:21 PM Stuurman, Nico <[hidden email]> wrote:
Hi Noah and others,
>
>> What do you suspect is going on with the live view?

This bug is now fixed.  See:
https://github.com/nicost/micro-manager/commit/00d87117ad54a9dff299cdcbf29dbedafe5547c1

The main problem was that the display would only update if the sequence
number of the image was higher than the previous one. Since multi-camera
images have different sequence numbers for the two channels, this would
almost never happen and the second channel would never be updated.

This fix should be in tonight's 2.0-gamma build.

Best,


Nico



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: Multicam adapter live view and buffer warning

Stuurman, Nico
Hi Noah,

> Your suggestion to set a single cameras as the default and switch to
> the multicam adapter once the config loads did in fact remove the
> circular buffer error. I would still consider this a bug, but the
> workaround works well for me.

The error message is confusing.  However, you (or your configuration)
set a default camera with a size of 0 x 0 pixels and then you ask the
circular buffer to be initialized (the circular buffer needs to know the
image size to pre-allocate memory).  So, what is the poor code supposed
to do (surely provide a better error message, but there is no way it can
initialize the circular buffer)?  I think (but have not tested) that if
you set no camera at all as the default camera, all will be good as
well.  So, this may be considered a bug, but it is way too easy to avoid...

Best,


Nico


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general