As mentioned in
https://chdk.setepontos.com/index.php?topic=14030.msg143225#msg143225 the normal "fast" implementation of vid_get_viewport_live_fb causes tearing when used for live view.
It should be possible to have an additional function which uses the most recent complete frame instead. This would have slightly higher latency but should look better. There might still be risk of it being updated in PTP transfer, but that it should be fairly rare outside of USB1.0 systems, since it would have to cycle through the whole 3-8 buffers while transfer was in progress.
Annoyingly, I guess this would be active_viewport_buffer - 2 mod whatever, not the trivial viewport_buffers[active_viewport_buffer]
The tearing probably looks worse on cameras / modes with more buffers, on the 8 buffer cams old data could easily be 300+ ms behind.
Previous related discussion
https://chdk.setepontos.com/index.php?topic=11535.10https://chdk.setepontos.com/index.php?topic=8613.310