[ntp:questions] Problem with CHU Audio Driver on FreeBSD

Steve Kostecke kostecke at ntp.org
Wed Sep 9 21:33:11 UTC 2009

The AGC in my CHU Audio Refclock has never worked correctly for me.

The problem is that when ntpd is started the AGC level (as shown in the
output generated by -dd, as well as in the clockstats file) ramps up to
255 (i.e. 100%) and stays there.

I have watched the -dd output with the volume at 100%, 50%, and 0% (the
radio volume is controlled by the radio initialization routine in ntpd
and the level is hardcoded and I have to recompile ntpd to change the

I've tried all manner of configuration varients and none of them make a

My radio is connected to the mic input on my sound card.

I am able to receive CHU during periods when the reception is good.

The kit is:

* Soekris net4801
* Commell MP-878S Mini-PCI Audio Adapter
* TenTec RX-320D Receiver
* FreeBSD 5.3 Release
* ntp-dev-4.2.5p188

audio-pcm from the ./utils directory shows:

input:   </dev/audio0> 3
control: </dev/mixer0> 4
devmask: 0x31ff recmask: 0x1c8 recsrc: 0x80
Devmask: vol, bass, treble, synth, pcm, speaker, line, mic, cd, igain,
Recmask: synth, line, mic, cd
RecSrc:  mic
play_size 128, rec_size 128
play_rate 8000, rec_rate 8000, play_format 0x1, rec_format 0x1
Play format: MU_LAW 
Rec format:  MU_LAW 

The sound card is recognized by the kernel:

$ dmesg | grep pcm
pcm0: <Avance Logic ALS4000> port 0xe400-0xe47f irq 11 at device 14.0 on pci0

In /dev I have:

crw-rw-rw-   1 root  wheel      30,   4 Jul 30 12:30 audio0.0
wrw-rw-rw-   1 root  wheel      30, 0x00010004 Jul 30 12:30 audio0.1
lrwxr-xr-x   1 root  wheel            8 Sep  9 17:29 chu_audio -> audio0.0
crw-rw-rw-   1 root  wheel      30,   0 Jul 30 12:30 mixer0
cr--r--r--  1 root  wheel      30,   6 Jul 30 12:30 sndstat

'cat /dev/sndstat' shows:

FreeBSD Audio Driver (newpcm)
Installed devices:
pcm0: <Avance Logic ALS4000> at io 0xe400 irq 11  (1p/1r/0v channels
duplex default)


driftfile /var/db/ntp.drift
statsdir  /var/log/ntpstats/
logfile   /var/log/messages

statistics loopstats peerstats clockstats
filegen loopstats file loopstats type day enable
filegen peerstats file peerstats type day enable
filegen clockstats file clockstats type day enable

# CHU Audio
server mode 2 prefer
fudge time1 0.0044592 flag4 1


idev /dev/audio0.0
cdev /dev/mixer0
agc mic
monitor vol

Steve Kostecke <kostecke at ntp.org>
NTP Public Services Project - http://support.ntp.org/

More information about the questions mailing list