Direct2D flickering/artifacts on multi-monitor setups

I’d like to report an issue I’ve come across when creating a VST3 plugin with JUCE, with Direct2D rendering, displayed on windows 11.

When using two monitors, I’m seeing flickering, white flash regions, and black vertical line artifacts, under certain conditions.

Conditions are where the monitors are at different refresh rates, e.g. 60Hz and 100Hz, and the VST3 is opened in a DAW on the monitor with the highest refresh rate. The artifacts are present when a continuously-repainting element on a timer is present, and then a rotary or slider control is dragged.

I built a small app to demonstrate the issue, source code zip here:
Test app.zip (6.0 KB)

The test app has an “activity meter” animation, and a slider to control the repaint refresh rate, 5Hz to 1KHz. It is for visual purposes only, it has no audio processing.

A control actively being dragged triggers the problem (tested with RotaryHorizontalVerticalDrag, RotaryVerticalDrag and plain linear slider), when the animation repaint rate is above about 20Hz. Without the control interaction, no amount of background repaint activity ever triggers it (tested up to 1000Hz). If we remove the animation and timer repaint function, the control functions alone do not trigger the problem either, so it seems to be caused by the combination of timer repaints and manual control changes.

This is only happens with Direct2D rendering, not software. The problem does not happen on a single monitor set up (at any refresh rate), nor on a dual monitor set up where the two monitors are at the same refresh rate.

I also switched the activity-bar’s update mechanism from Timer to VBlankAttachment, but this had no effect.

Same behaviour in JUCE version: 9.0.3 (confirmed present in 8.0.15). Tested in Reaper and Audacity, same result. Using i5 processor with Intel UHD 770 graphics (integrated). No VRR/dynamic refresh.

Not sure if this is a genuine bug, or my code is wrong somewhere - any help appreciated.

I had similar issues, flickering screen and contrast changes with Direct-2D. this might be relevant:

https://nvidia.custhelp.com/app/answers/detail/a_id/5157

Many thanks, yes the registry fix for my own use would be a possibility, or I could go to software rendering. In the future I may want to distribute the FX I’m developing, so I’m a hoping a code or JUCE fix might present itself.

I found a solution - there is a fix already on a July forum post for a related issue:

Doesn’t look like its released anywhere yet. Applied the patch and it fixes the issues I had. I’ll post a proper explanation on the above forum post as that’s probably where it should live.