• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: HostTime -> real time clock time (NTP time)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HostTime -> real time clock time (NTP time)


  • Subject: Re: HostTime -> real time clock time (NTP time)
  • From: Jeff Moore <email@hidden>
  • Date: Thu, 16 Aug 2001 14:44:54 -0700

on 8/16/01 2:32 PM, James McCartney <email@hidden> wrote:

> UCB CNMAT's Open Sound Control protocol uses an NTP format time stamp to
> time events. I would need to know the absolute real time clock time (NTP
> time) that a sample will be performed.
> How does one convert the AudioTimeStamp mHostTime to a real time clock time?

<CoreAudio/HostTime.h> has routines for querying the clock frequency and to
convert a host time to a time in nanoseconds and back.

From there you are on your own for the most part. Presumably you need to
have an anchor point where you can relate an NTP to to a host time (in nanos
or in absolute units, doesn't really matter which). From the anchor point,
you will also need to do a little dead reckoning to account for the drift
between NTP and the clock on the CPU and the drift between the sample clock
and the host time clock as indicated in the HAL's time stamps.

--

Jeff Moore
Core Audio
Apple


References: 
 >HostTime -> real time clock time (NTP time) (From: James McCartney <email@hidden>)

  • Prev by Date: HostTime -> real time clock time (NTP time)
  • Next by Date: Re: timers
  • Previous by thread: HostTime -> real time clock time (NTP time)
  • Next by thread: Re: timers
  • Index(es):
    • Date
    • Thread