Yes, you are right. The software could probably be fast enough to sample the LLSYNC signals (a few Hz would be good enough) to adjust the PLL, and we could get rid of HDMI_PLL_ADJ. As it already monitors the frequency of the input signal, it only needs to sample the phase information.Sorgelig wrote:Not sure if we are on the same wave or not, but MiSTer already provides pretty much precise PLL parameters for FPS locking when vsync_adjust option is enabled. It just cannot track the drifting and adjust the clock constantly. So your scaler doesn't need to lock the FPS in wide range as output FPS is already close to input. You just need to track the drifting and fine tune the frequency in tiny range.
1) Tune frequency according to measured input signal period.
2) Measure phase.
3) Set new frequency to cancel phase after a fixed delay.
4) Tune back to base frequency
5) Wait a bit, for fresh measurements.
6) Goto (2), until phase is low enough.
In the demo builds of the scaler, the lower line of the TEST mode shows measured phase and frequencies, and can be used to check clock correction.