Skip to content

64-bit audio clock values incorrectly split into 32 bit low and high, resulting in data losss #49

Description

@dalkhimov88

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions