I must misunderstand something here. If the primary update task executes every 30ms, that's about 30fps.
No. See the main loop in core/main.c
Spytask tries to run at 20 ms intervals (but of course, it might not if the system is busy), and gui_redraw runs once every 4 spytask iterations. So yes, 80 ms.
We should not be able to see flickering at that rate.
This is not really true. Around 30 FPS is about where animation of similar images appears smooth, but that's not what's happening here.
Isn't that essentially what philmoz's draw_test_guard() & draw_set_guard() code in core/gui_draw.c tries to do?
That tries to detect
when an update is needed, but it doesn't make the update happen sooner than it otherwise would in the 80ms cycle. You could set a flag skip the "every 4th iteration" logic. You could also trigger a redraw with some kind of synchronization object, or directly from whatever task was detecting the need for updates, but spytask does more than drawing, so this might take some work.
Frankly, I don't care if CHDK sucks down almost 100% of the CPU if it fixes flicker
I don't think simply upping the frame rate would help that much, but you could try making gui_redraw run every iteration and see what happens.
- other than when the shutter key is pressed or a script is running. Both easily detected and dealt with. If continuous AF runs slow as a result, so be it.
I don't really agree with this: The Canon UI getting laggy is really annoying, and this already happens on G7X when the Canon and CHDK UIs are fighting. Also, I don't think it's safe assume that the Canon firmware will degrade gracefully (i.e. continuous AF just runs a bit slower) if CHDK hogs the CPU.
Making the UI smooth is a worthy goal, but aside from the D6 specific issues, it's a bit OT for this thread. IMO, to make it really look good, we'd have to actually integrate with the Canon drawing system (probably involving the "controller" system, or maybe something with the GPU code on D6), but if there are other changes that offer a significant improvement without negative side effects, I'd certainly consider them.