[ntp:questions] New to group: radio/audio interest
Alan Corey
ab1jx at devio.us
Wed May 9 03:39:33 UTC 2012
I must admit I find NTP fascinating, depending on my mood. About 20 years
ago I had written something that attempted to measure the drift in my
computer's clock based on daily *manual* settings while listening to WWV or
CHU. Room temperature was the biggest factor. I'm still interested in the
audio WWV and CHU reference clocks. I don't own a GPS and I live in the
boonies where the only internet connection is dialup. I'm 57, retired,
partially disabled, and I like programming. I'm also a ham, but not very
active. I've got a bio at http://www.qrz.com/db/ab1jx and a small homepage
at http://ab1jx.webs.com.
My current project is to get the wwv and chu clocks working under OpenBSD.
I either don't have any audio getting to my refclock_wwv still or
wwv_receive isn't getting called. I got audio settings close at least by
sticking (void) system("audioctl -a") in audio_info() to dump the settings out
then putting this in audio_init:
#else /* not PCM_STYLE_SOUND */
AUDIO_INITINFO(&info); /* makes a mess */
#if (!defined(__OpenBSD__))
info.play.gain = AUDIO_MAX_GAIN;
info.play.port = AUDIO_SPEAKER;
#else /* is OpenBSD */
info.record.encoding = AUDIO_ENCODING_ULAW; // default: slinear_le
info.record.sample_rate = 8000; // default: 48000, has to be 8000
info.record.channels = 1; /* default is 2 */
#endif
Then today I got serial port control of my radio (Icom IC-7000) working by
opening it like this:
#if defined (__OpenBSD__)
fd = tty_open(device,O_RDWR | O_NOCTTY | O_NDELAY, 0777);
#else
fd = tty_open(device, O_RDWR, 0777);
#endif
Now I can turn on the radio, set it to some frequency, then when I start
ntpd it jumps right to 15 MHz
So I'm gradually getting closer, but I'm running out of ideas. I stick in
little msyslog messages to check on things, but I can't get anything in
wwv_receive to respond. I can get responses from wwv_start() and
wwv_newgame() but that's about it. And I don't see what's supposed to call
it.
The complexity of this daunts me. Just today I figured out: A struct peer
has a pointer to a struct refclockproc which has a pointer to
a struct refclockio which has a pointer to wwv_receive(). When I dig too
deep I can't see the forest for the trees and I keep making little notes
files all over the place.
I have clockstats enabled but nothing ever appears there. I can boot the
same computer into Linux and ntpd works, so I've been comparing, and I use
the same ntp.conf file.
Alan
More information about the questions
mailing list