Re: [ntp:questions] Using NTP to calibrate sound app

2013-01-26 Thread David Woolley

no-...@no-place.org wrote:


small packets.  A calibration run would consist of an initial NTP
syncronization with an audio packet, followed by a period of some


What you are describing here isn't, I think, the use of NTP, but the use 
of SNTP.  You seem to be making a measurement, form the server, over a 
short amount of time.  True NTP measures frequency and time and does so 
over time periods long compared with the network and scheduling jitter.



number of minutes during which I will just count audio packets,
followed by a final NTP synchronization with the last audio packet.
By knowing the time difference over some number of audio packets I
hope to calculate the actual audio clock frequency for that device.


The way to do it with NTP is to discipline the main clock frequency, 
over many hours, and then measure the time relative ot the system clock. 
 You may well find that you don't have to measure the sound generator 
frequency because it may use the same crystal as the main clock.


Doing this simply, requires that you have some form of kernel discipline 
for the clock that is able to interpolate between ticks, allowing for 
the frequency correction.


If you try and do SNTP measurements at the start and end of a sort 
period of tone, you will be very susceptible to network delay variations.


Incidentally, given that all phone networks are digital these days, even 
your old method is susceptible to clock errors in the network, although 
I think most networks use atomic time.


___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Using NTP to calibrate sound app

2013-01-26 Thread Rob
no-...@no-place.org no-...@no-place.org wrote:
 Now I am considering an alternate means of performing this calibration
 using NTP.  The iPhone and Android devices deliver audio to my app in
 small packets.  A calibration run would consist of an initial NTP
 syncronization with an audio packet, followed by a period of some
 number of minutes during which I will just count audio packets,
 followed by a final NTP synchronization with the last audio packet.
 By knowing the time difference over some number of audio packets I
 hope to calculate the actual audio clock frequency for that device.

I think the average internet connection from a device like an iPhone
has so much jitter that this approach will not work reasonably well.
(try to ping to an internet server and see what kind of jitter you
have, it usually is terrible over UMTS, WiFi etc)

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Using NTP to calibrate sound app

2013-01-26 Thread Ralph Aichinger
Rob nom...@example.com wrote:
 I think the average internet connection from a device like an iPhone
 has so much jitter that this approach will not work reasonably well.
 (try to ping to an internet server and see what kind of jitter you
 have, it usually is terrible over UMTS, WiFi etc)

iPhones do have a GPS though, and there do exist apps (at least
for Android, supposedly also for the iPhone) that sync time
to this GPS.

/ralph

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Using NTP to calibrate sound app

2013-01-26 Thread Rob
Ralph Aichinger ra...@pangea.at wrote:
 Rob nom...@example.com wrote:
 I think the average internet connection from a device like an iPhone
 has so much jitter that this approach will not work reasonably well.
 (try to ping to an internet server and see what kind of jitter you
 have, it usually is terrible over UMTS, WiFi etc)

 iPhones do have a GPS though, and there do exist apps (at least
 for Android, supposedly also for the iPhone) that sync time
 to this GPS.

I have no knowledge of the internal architecture of the iphone, but
when this GPS receiver is internally connected using an emulated
serial link that transfers NMEA packets, the accuracy of that time
sync also will leave a lot to be desired.  Fine for wristwatch
time, not so good for measurements and calibrations.  For that you
need PPS information, which is usually not provided in designs not
especially made for timekeeping.

When you want accurate measurements, you need to run an ntpd process
on the machine that continually averages the information from the
GPS and disciplines the local clock using a slow loop, and then
perform the measurement relative to this disciplined local clock.
That way you avoid the jitter of individual GPS time readings.

That said, I find it hard to believe that the same measurement cannot
be done relative to the standard iphone local clock with enough
accuracy for the original poster.  Clocks tend to run quite accurately
when compared to the precision required for typical audio applications.

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Using NTP to calibrate sound app

2013-01-26 Thread Maurice Janssen
Maarten Wiltink maar...@kittensandcats.net wrote:
Which is exactly why hardcoding pool.ntp.org _is_ allowable, in my
opinion - and in fact indicated in such a case as this.

In my opinion, it's not.
Please read http://www.pool.ntp.org/en/vendors.html .

-- 
Maurice

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Using NTP to calibrate sound app

2013-01-26 Thread Maarten Wiltink
unruh un...@invalid.ca wrote in message
news:tiLMs.55319$on7.49...@newsfe16.iad...
 On 2013-01-26, no-...@no-place.org no-...@no-place.org wrote:

 [...] I obviously don't want to hard-code for a specific time server
 because things could change after the user gets my app and it is
 unfair to send a whole block of users to the same server.  The
 Server Pool looks promising.  Does pool.ntp.org just behave like a
 Stratum 2 server so I could hard-code that URL into my implementation
 of NTP in my app? ...

[...]
 And no you definitely should not hard code a site, unless it is one
 controlled by you. [...]
 Note pool.ntp.org does NOT have an IP-- each dns request gives a
 different IP, so you need the name, not an IP.

Which is exactly why hardcoding pool.ntp.org _is_ allowable, in my
opinion - and in fact indicated in such a case as this. Exactly because
(as I suspect you meant) it is not a fixed site, but a symbolic name
that translates to some reasonable site that is available now.

Incidentally, to the OP, it's not a URL. It is a DNS name.

Groetjes,
Maarten Wiltink


___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] p351 fails to build on MSVC++2008EE

2013-01-26 Thread Mischanko, Edward T
Steve,

I see from the web page that Autogen is maintained by Bruce Korb.
Bruce is well aware of the current issues in building NTP with
MSVC++2008/2010EE, so patients is the key word here I guess.
Thanks for the information.

Regards,
Ed

 On 2013-01-25, Mischanko, Edward T edward.mischa...@arcelormittal.com
 wrote:
 
  Who updates autogen and when is it expected?
 
 The AutoGen home-page is:
 
 http://www.gnu.org/software/autogen/
 
 --
 Steve Kostecke koste...@ntp.org
 NTP Public Services Project - http://support.ntp.org/
 
 ___
 questions mailing list
 questions@lists.ntp.org
 http://lists.ntp.org/listinfo/questions
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Updating the leapseconds file -- how to signal ntpd

2013-01-26 Thread Mischanko, Edward T
I know of no way for NTP to know about the new file without restarting NTP
 itself.  The drift file will allow it to come back into sync very quickly,
so the consequences of a restart should be minimal.  NTP reads the leapseconds 
file on start-up, I believe.

Regards,
Ed
 
 I'm using my configuration-management system to distribute a
 leapseconds file for ntpd.  After the system installs the new file,
 what does it need to do for ntpd to recognize that the file has
 changed?  (It is obviously undesirable to simply restart a stratum-1
 ntpd; I'm looking for the mechanism that ntpd expects managers to
 use, if there is any.)
 
 -GAWollman
 
 --
 Garrett A. Wollman| What intellectual phenomenon can be older, or more
 oft
 woll...@bimajority.org| repeated, than the story of a large research
 program
 Opinions not shared by| that impaled itself upon a false central
 assumption
 my employers. | accepted by all practitioners? - S.J. Gould, 1993
 
 ___
 questions mailing list
 questions@lists.ntp.org
 http://lists.ntp.org/listinfo/questions
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Using NTP to calibrate sound app

2013-01-26 Thread Joseph Gwinn
In article 51033f49.215309...@news.eternal-september.org,
 no-...@no-place.org wrote:

 I am an app developer who has a precision audio frequency app for
 iPhone and Android devices.  For my app the nominal crystal oscillator
 accuracy in these devices is not sufficient.  Up until now I have been
 providing frequency calibration in my app by instructing the user to
 call the telephone feed of WWV (NIST) audio (using a separate landline
 phone) and let my app listen to the 500 Hz and 600 Hz tones.  By
 analyzing the audio I can correct for the device's audio system clock
 deviation.  Normally they only need to do this once after the app is
 installed because the stability of these devices is OK once I memorize
 the offset.
 
 Now I am considering an alternate means of performing this calibration
 using NTP.  The iPhone and Android devices deliver audio to my app in
 small packets.  A calibration run would consist of an initial NTP
 syncronization with an audio packet, followed by a period of some
 number of minutes during which I will just count audio packets,
 followed by a final NTP synchronization with the last audio packet.
 By knowing the time difference over some number of audio packets I
 hope to calculate the actual audio clock frequency for that device.
 
 My question is about the NTP procedure I should follow to do this.  I
 obviously don't want to hard-code for a specific time server because
 things could change after the user gets my app and it is unfair to
 send a whole block of users to the same server.  The Server Pool looks
 promising.  Does pool.ntp.org just behave like a Stratum 2 server so I
 could hard-code that URL into my implementation of NTP in my app?  I
 would appreciate any observations on the promise of this approach.

How accurately do you need to calibrate?  What will people use this app 
for?

And how long can this calibration take before users revolt?

Joe Gwinn

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Using NTP to calibrate sound app

2013-01-26 Thread unruh
On 2013-01-26, David Woolley david@ex.djwhome.demon.invalid wrote:
 no-...@no-place.org wrote:

 small packets.  A calibration run would consist of an initial NTP
 syncronization with an audio packet, followed by a period of some

 What you are describing here isn't, I think, the use of NTP, but the use 
 of SNTP.  You seem to be making a measurement, form the server, over a 
 short amount of time.  True NTP measures frequency and time and does so 
 over time periods long compared with the network and scheduling jitter.

 number of minutes during which I will just count audio packets,
 followed by a final NTP synchronization with the last audio packet.
 By knowing the time difference over some number of audio packets I
 hope to calculate the actual audio clock frequency for that device.

 The way to do it with NTP is to discipline the main clock frequency, 
 over many hours, and then measure the time relative ot the system clock. 
   You may well find that you don't have to measure the sound generator 
 frequency because it may use the same crystal as the main clock.

Unfortunately ntpd does NOT change the crystal. It changes the way that
software interprets the output of that crystal (eg do 1
vibrations equal a second or do 1002 vibrations?)

The sound cards are almost certainly hard wired into the crystal, not
software. Ie, the sound system does not, I believe, read the system
clock in order to time the sound output. 


 Doing this simply, requires that you have some form of kernel discipline 
 for the clock that is able to interpolate between ticks, allowing for 
 the frequency correction.

 If you try and do SNTP measurements at the start and end of a sort 
 period of tone, you will be very susceptible to network delay variations.

That will have to be within his error budget. Thus if the network jitter
is 1ms, then he would have to measure for 44 sec to get down to one
cycle per 44000 error (ie +- 1Hz for a 44100 sound )



 Incidentally, given that all phone networks are digital these days, even 
 your old method is susceptible to clock errors in the network, although 
 I think most networks use atomic time.


___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


[ntp:questions] When is the kernel-mode time-stamping used under Windows? Must one add the type 22 driver line?

2013-01-26 Thread David Taylor

Folks,

I've tried to follow this in the code, but it's beyond me, I'm afraid!

Given:
1 - the modified serialpps.sys device driver is installed
2 - the support DLL is present
3 - the environment variable points to the support DLL

is it necessary to add the ATOM driver to the ntp.conf file?  I.e. do 
you /need/ a line such as:


  server  127.127.22.1  minpoll 4

to ensure that the kernel-mode driver is used?  My testing on one 
Windows-8/64 system suggest that the driver is used whether or not a 
type 22 driver is specified, given the conditions above.  I'm not 
complaining about this, just wondering whether anyone may be able to 
confirm that from the source code.


The question arose because adding the line made no improvement to the 
jitter, which initially made me think that the driver was not being 
used, but further tests suggest it's the opposite - that the driver is 
being used whether you asked for it explicitly or not.  Of course, given 
(1)..(3) above does rather suggest you want the kernel-mode, so the 
behaviour makes sense, even if it is a little confusing.


[Yes, FreeBSD and Linux behave differently.]
--
Thanks,
David
Web: http://www.satsignal.eu

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Using NTP to calibrate sound app

2013-01-26 Thread David Woolley

unruh wrote:

On 2013-01-26, David Woolley david@ex.djwhome.demon.invalid wrote:


  You may well find that you don't have to measure the sound generator 
frequency because it may use the same crystal as the main clock.


Unfortunately ntpd does NOT change the crystal. It changes the way that
software interprets the output of that crystal (eg do 1
vibrations equal a second or do 1002 vibrations?)



I was assuming that, if they shared a common crystal, one would simply 
read the ntpd frequency correction to get the frequency correction for 
the audio.


___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Updating the leapseconds file -- how to signal ntpd

2013-01-26 Thread Garrett Wollman
In article n7sdnfngn4pywp7mnz2dnuvz_smdn...@megapath.net,
Hal Murray hal-use...@ip-64-139-1-69.sjc.megapath.net wrote:

I suggest submitting a feature request at
  https://support.ntp.org/bugs/index.cgi
with a link back to the above bug since it will be the same area of code.

Too many hoops to jump through.  Maybe someone who already has an
account at that site can do it.

-GAWollman

-- 
Garrett A. Wollman| What intellectual phenomenon can be older, or more oft
woll...@bimajority.org| repeated, than the story of a large research program
Opinions not shared by| that impaled itself upon a false central assumption
my employers. | accepted by all practitioners? - S.J. Gould, 1993

___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions


Re: [ntp:questions] Updating the leapseconds file -- how to signal ntpd

2013-01-26 Thread Michael Tatarinov
2013/1/27, Garrett Wollman woll...@bimajority.org:
 In article
 CABrG=ZyT9ttE4Mea3yauWPru0euQ8TV4m7KHm0bHSwiYa=+b...@mail.gmail.com,
 Michael Tatarinov  kuk...@gmail.com wrote:
I know only one way.
ntpq -c 'config: leapfile LEAPFILE

 That was what I was looking for!  In my version of ntpq, at least,
 it's spelled ':config' rather than 'config:', but that did it.

 Unfortunately, this still doesn't get me anywhere, because the
 passwd command in ntpq 4.2.6 doesn't take any arguments.  Looks like
 this is fixed in ntp-dev 4.2.7, so I'll have to wait until 4.2.7
 becomes the official stable version.

you can try to use ntpq 4.2.7 with ntpd 4.2.6
___
questions mailing list
questions@lists.ntp.org
http://lists.ntp.org/listinfo/questions