Hi,
When attempting to use the audio clock values stamped into registers like kVRegTimeStampLastInput1VerticalLo and kVRegTimeStampLastInput1VerticalHi I found that the values are mangled. Quick search of the sdk hints at the issue: when the driver splits the 64-bit audio clock value into two 32 bit values before writing it to the registers, an incorrect bitmask is applied to the value when writing the low register in ntv2driver.c@2393:
// save the interrupt time
audioClock = GetAudioClock(deviceNumber);
WriteRegister(deviceNumber, kVRegTimeStampLastInput1VerticalLo, audioClock & 0xFFFF, NO_MASK, NO_SHIFT);
WriteRegister(deviceNumber, kVRegTimeStampLastInput1VerticalHi, audioClock >> 32, NO_MASK, NO_SHIFT);
It should be:
WriteRegister(deviceNumber, kVRegTimeStampLastInput1VerticalLo, audioClock & 0xFFFFFFFF, NO_MASK, NO_SHIFT);
I am trying to use this value to get extra accurate reading of when exactly the vertical sync last arrived, to be used as reference for other timing signals in my system.
Thank you, Dmitry.