Skip to content

GenericSLM: Sync refresh waiter to connected SLM, not primary monitor - #1004

Merged
marktsuchida merged 1 commit into
micro-manager:mainfrom
Edreva:generic-slm-fixes
Oct 8, 2026
Merged

marktsuchida merged 1 commit into
micro-manager:mainfrom
Edreva:generic-slm-fixes

Conversation

@Edreva

@Edreva Edreva commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Previously RefreshWaiter was associated with the active display driver when it was instantiated, meaning the calls to RefreshWaiter::WaitForVerticalBlank() within GenericSLM::DisplayImage() were polling the primary monitor. Since the SLM is practically never the primary monitor, the image updates would have been timed against an unrelated refresh rate.

Now RefreshWaiter can be bound to a specific monitor by GDI device name via SetMonitor. DirectDrawEnumerateExA is used to identify the correct device via its GDI device name.

@marktsuchida

Copy link
Copy Markdown
Member

Great catch, thanks!

Out of curiosity, did this make a real difference to how an SLM behaves?

@Edreva

Edreva commented Oct 7, 2026

Copy link
Copy Markdown
Contributor Author

For my particular setup (180Hz primary monitor, 60Hz SLM) it has. I add a settling delay after calls to DisplayImage() which previously had to absorb the inconsistency but now I can give it ~20ms less headroom. I imagine the effect would be less pronounced if the refresh rates were more aligned.

@marktsuchida
marktsuchida merged commit d12e66e into micro-manager:main Oct 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants