I tested that by fetching from camera and displaying in loop that buffer, which upgraded vid_get_viewport_live_fb() points to gives me smoother than before, video with no tearing. But You are right, testing MD_tune is a good idea.
However I don't know how to make it work. When I run MD_Tune.bas, there's no AF assist and I get no times displayed (only "t cells, trigger N").
I attach the changes I made before recompiling CHDK and uploading to my cam.
The OPT_MD_AF_LED_TUNING build time option should no longer be required.
You should use the MD_Tune.bas script from the CHDK distribution, not any posted in the original thread (I realize the "documentation" link in the wiki is probably a bit confusing).
In chdkptp, does
=set_led(9,1)
turn the AF led on? (9,0) should turn it off.
The stats should appear at the top of the screen, not in the script console. They might fight with other OSD elements, you can turn the OSD off to avoid this.
Anyway, this whole tangent is probably not important, what you have now for the a530 should be as correct as the a540 port is now.
FWIW, I definitely do see tearing on the A540 with the current chdkptp live view code. See attached screenshot. It's not super obvious unless the camera or subject is moving fairly quickly.
edit:
Out of curiosity, I tested on a540
current trunk code gives ~30ms MD, tearing.
using fb[buff] gives ~100ms times, tearing
using fb[(buf+1)%3] gives ~60ms times, no tearing.
This makes sense because PTP code isn't synchronized with the frame updates, so the "current" buffer can switch into the oldest one in the middle of a transfer.