I am seeing an issue with VBlankAttachment on JUCE 8.0.8 running on macOS that seems to affect only very few machines and wanted to reach out to see whether anyone else has seen this:
I updated a plugin to JUCE 8.0.8 a few weeks ago and I got reports from two customers (of thousands) that repaint is broken/frozen on one of their macOS systems. Failing to find a way to reproduce this on any of my macs I sent out test builds.
On the affected machines, the VBlankAttachment seems to never fire its callback, breaking all animated elements of my GUI. I looked at the macOS VBlankAttachment code (juce_PerScreenDisplayLinks_mac.h) and there appears to be a lack of error checking that might be responsible, but it is super hard to debug without having direct access to an affected machine.
There are some jasserts() in the code, but there is no fallback in case setting up the CVDisplayLink fails and the CVTimeStamp is used without checking its kCVTimeStampVideoTimeValid flag. But the problem could also be with the display enumeration.
Doing research on this I read that the timestamps might not work on some machines (using USB DisplayLink or screen casting), but I cannot get things to break on mine. I see that projects like Chromium have some extra checks in place that might be related.
The machines of my affected customers are running 10.11 and 10.15 on Intel CPUs without any fancy displays or display connection types.
Has anyone else seen this problem or own a machine where it happens? As far as I can tell it would manifest as no juce::Animator-based animations working.
This sounds like it’s going to be very difficult to investigate without a way to reproduce it. We could potentially look at where we are ignoring errors etc. but without actually looking at it yet I can imagine it will be difficult to know what we can do in those scenarios. Any more information you or anyone else has will be very useful.
1 Like
Yep, I agree it’s basically hopeless without direct access to a machine that shows the problem.
1 Like
Did it work OK with a previous version of JUCE? In that case a diff between the source code of these two JUCE versions might potentially show where the error is. (It’s also possible you updated Xcode and that’s what caused the issue, or something else that changed that isn’t JUCE.)
2 Likes
I went from JUCE 6 directly to JUCE 8. JUCE 6 didn’t have VBlankAttachment so I used a different approach I coded myself based on CVDisplayLink etc. That one worked on my customer machines.
I’m using the same version of XCode.
But anyway, I’m just hoping someone has seen the same issue. It only showed up once I shipped 8.0.8 based animation code to thousands of customers and the problem appears to be super rare.
I will ask one of my customers to let me run a debug executable I’ll write where all the steps leading to the callback are logged.
1 Like
Maybe get the exact spec of the problem machine, one of us here might happen to have the same one.
In my ongoing investigation I learned that one of the affected machines is an intel mac running 10.15 with a Radeon RX 580 VRAM 8GB GPU.. which certainly is rare and might explain why it behaves differently as it uses an uncommon GPU driver.
Do any of you happen to have such a machine to quickly check VBlankAttachment with the current JUCE8 is working as intended (including correct timestamps)?