Skip to content

jltcntp - incorrect 'received' timestamps  #17

Description

@mungewell

Whist monitoring reference clock LTC stream sent to Chrony I see that there is a very definite structure... even whilst the local clock is supposedly locked.
before

Looking at the code it looks like it stamps the 'received' message with the time that the SHM data was assembled (tv.tv_sec), when it should use the time that the audio data was captures AND it should use:
ltc_off_t off_start the approximate sample in the stream corresponding to the start of the LTC frame.

https://github.com/x42/ltc-tools/blob/master/jltcntp.c#L251

            if (!shm->valid)
            {
                struct timeval tv;
                gettimeofday(&tv, NULL);

                shm->clockTimeStampSec = time.tv_sec - offset;
                shm->clockTimeStampUSec = time.tv_usec;
                shm->receiveTimeStampSec = tv.tv_sec;
                shm->receiveTimeStampUSec = tv.tv_usec;

                shm->valid = 1;
            }

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions