r1 - 2008-05-27 - 22:56:20 - StevenBjorkYou are here: NTP >  Support Web > ConfiguringNTP > ConfiguringRefclocks > ConfiguringAudioRefclocks
NTP users are strongly urged to take immediate action to ensure that their NTP daemons are not susceptible to being used in distributed denial-of-service (DDoS) attacks. Please also take this opportunity to defeat denial-of-service attacks by implementing Ingress and Egress filtering through BCP38.

ntp-4.2.8p10 was released on 21 March 2017. It addresses 6 medium- and 5 low-severity security issues, 4 informational security topics, 15 bugfixes, and contains other improvements over 4.2.8p9.

Please see the NTP Security Notice for vulnerability and mitigation details.

Are you using Autokey in production? If so, please contact Harlan - he's got some questions for you.
REFACTOR See ConfiguringAudioRefclocksDev for discussion of this topic.

Here's some hints with regards to audio refclock debugging. These drivers include the wwv, irig, and chu reference clocks.

Make sure your audio device is setup ok for your version of os/soundcard. Example, can you play an MP3? If so, that's a good start.

Once you can play sound, try to get input working. I tend to use the "line" input of my sound cards. I built a couple of cables for the input. One simply uses a mono input plug (the audio code handles this, its the left channel). Another cable uses a stereo plug (clipped off a pair of defunct earphones), with both channels wired up to the irig output (or the wwv receiver output).

Plug your stuff together and use your mixer/aumix software to enable the sound "record" function, and see if you can hear anything. You must be able to get record/input working before trying ntpd refclocks.

Once you have your audio hardware tested and cabled up, you can try playing with the ntpd audio refclocks.

The refclock config itself is a bit tricky. I've had to fuss around with the ntp.audio config here to get things going.

Here's what I use for irig and wwv:

# irig b (audio)
# flag2 1 is line port, flag4 1 is verbose stats
#server  version 4
#fudge flag2 1 flag4 1

# wwv radio clock. time1 wwv, time2 wwvh, flag2 0=mike, 1=line. 
#server version 4
#fudge time1 0.0019 time2 0.00773634 flag2 1 flag4 1

Here's my ntp.audio file:

idev    /dev/audio0
cdev    /dev/mixer0
agc     line
monitor vol

Here's a comment I made to myself with regards to a soundblaster live (pci) in a p133/freebsd host:

jane4 (P133) with sb live wants rec 20 and agc rec (which seems to adjust line anyways) but it brings up IRIG

With linux, I configure for ALSA audio fragment size with echo:

echo "ntpd 2 128" > /proc/asound/card0/pcm0c/oss

To actually debug the ntpd audio setup, build an ntp.conf with only the irig/wwv/chu driver, then "ntpd -D2" to get a view of the audio gain adjustments. I see things like this:

audio_gain: gain 139/54
audio_gain: gain 143/56

Note that some os/soundcard combinations simply Do Not Work with input, although their output might work.

The devices I've had working here include a motherboard based C-Media PCI CMI8738, a PCI slot based soundblaster live, an ISA soundblaster awe64 gold, and a PCI slot based sb128 (ENS1371). OS include fbsd 5.3, fbsd 4.7/4.11, linux 2.4.20-NANO, linux 2.6.3 ppskit lite.

Note that a PC in console mode (not running X windows or equivalent), can put a huge latency spike into the ntpd offsets when the console scrolls text down the screen. I suggest that the console not be used when running ntpd, and that you ssh into the computer to perform any configuration. Or you could run a window environment such as X (I'm a twm user myself), as the scrolling inside an xterm is a much less intrusive (to ntpd) operation than scrolling the bare console.

It is best to not use a so-called "desktop" installation of the typical GNU/Linux distribution. These tend to pile on a number of programs that can interfere with ntpd's use of the audio drivers in the OS. If you can be sure that you have your "desktop" well behaved (I.E., not ursurping the audio), then try using ntpd and the audio drivers with your preferred distribution. I have tended to install a bare setup such as CRUX, with no "desktop" installed at all. Another example is a workstation running a redhat7.x (cough) release, but with none of its windowing stuff installed. Instead, I downloaded a more recent xorg X window system setup and compiled it for my particular environment. Both of these installations have run the ntpd audio wwv and irig drivers well.

-- StevenBjork - 27 May 2008

Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
SSL security by CAcert
Get the CAcert Root Certificate
This site is powered by the TWiki collaboration platform
IPv6 Ready
Copyright & 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors. Ideas, requests, problems regarding the site? Send feedback