CP_LOCK_RAW is either analog or digital inputs depending what is routed. If analog is routed to it and it doesn't lock, try the HDMI inputs. The STDI measure the timing so you can see if the analog input makes sense also.
There are 2 STDI modules. You could route the analog to one and the hdmi to the other, then monitor them both to see what's active with an acceptable format. I don't have a script to do this but other customers have done this.