[ntp:questions] New to group: radio/audio interest

Alan Corey ab1jx at devio.us
Thu May 10 03:58:58 UTC 2012


I'm not sure I've got the programming skills to take on much else right 
now and I don't know much about Linux programming.  I'd also like to get 
soundmodem (by Thomas Sailer) working under OpenBSD first.  I'm learning 
on ntp some things that may fix soundmodem.

On the two channel idea, have you considered ground loops as a 
disadvantage?  You'd have to have 2 radios and a computer tied together by 
their grounds, and my radio's ground is earth ground (not a very 
good/short one though).

How much use of this audio stuff do you anticipate going forward?  I'd 
like to propose the idea of linking to hamlib if it's present, which would 
let ntp drive a much wider variety of radios, and give more capabilities 
on each one. I found out the hard way that ntp can't change modes on Icoms 
by having mine set to LSB or USB on a different frequency and ntp didn't 
set it back to AM.  Hamlib's on Sourceforge.

I got my audio working by doing audioctl record.active=1 at a system level
while ntpd was running.  If you look at the audio_info struct in audioio.h
is has 2 member structs of type audio_prinfo, one each for play and record,
so record.active is something that sort of can't be reached.  I can try to
set it in libntp/audio.c but nothing happens.  audioctl is a command-line
program used to display and set audio parameters in OpenBSD and NetBSD and
that showed record wasn't active.  audio.c has no mention of a struct
audio_prinfo, but some other things in there, like choosing mic/line input,
seem to work.

As far as the history goes, audioio.h has been about the same since OpenBSD
2.6, and it came from NetBSD but I don't know what NetBSD version.  That was
the oldest OpenBSD I've used, from 1998.  I put a tarball of 2.6 and 5.0
versions at http://ab1jx.webs.com/toys/ntp/audioio_new_old.tar.bz2

I'm not sure how this works. The header file knows a struct audio_info has 2
struct audio_prinfos in it, but the compiler doesn't seem to let me get to
record.active.  No errors, just nothing happens.  I'm not sure of the best
fix, but audio.c has to know about the audio_prinfo struct somehow.  This
only affects OpenBSD and NetBSD as far as I know.

So audio works, and I get clock stats, but there's still something wrong. 
The radio spends about the same amount of time on each WWV frequency
regardless of the signal at that time of day.  When I boot into Linux ntpd
quickly figures out the best frequency and only rarely visits the others to
check them.  Same hardware, same ntp.conf file.

In the wwv refclock page drivers/driver36.html, is the clockstats field
informationn up to date?  Looking at refclock_wwv.c it looks like it dumps
different fields at different times.  I'm trying to dig out a signal to noise
field.

As far as why I disabled certain ioctls I don't remember except I was
flailing wildly trying to get things to work.  I've had some problems with
segfaults (none today) and a strange "user write of 64 at 0xcfbca6b8 at 1092
failed: 14" error that seems peculiar to recent OpenBSD's when I Google it. 
I suspect that's a file descriptor before the @ and it's always the same and
the 14 is maybe an errno value, but the other numbers change.  The pid is
always ntpd's, and it appears in /var/log/messages and dmesg output.

   Alan



More information about the questions mailing list