[ntp:questions] Re: Audio refclock+linux+soundcard = yuck

Tim Shoppa shoppa at trailing-edge.com
Wed Oct 1 18:45:05 UTC 2003


Ulrich Windl <Ulrich.Windl at RZ.Uni-Regensburg.DE> wrote in message news:<m3lls7hpbs.fsf at pc5234.klinik.uni-regensburg.de>...
> Usually sound cards have buffers, and to unload the CPU, an
> interrupt is only created if that buffer is mostly full (or
> empty). Maybe you can control the threshold...

I've done some research and the magic word for the day is
"SNDCTL_DSP_SETFRAGMENT".  It sets the size of the individual
ring buffers (as opposed to the size of the sum of all the ring
buffers).  AFAICT this ioctl isn't necessarily uniformly
implemented across the OSS and ALSA drivers (in that the value I
suggest will not necessarily be taken by any given driver) but it's
a start.  Will try to play with it in my Copious Free Time (TM).  (As
a practical matter that means at 2AM some morning).

Even without being able to set that, I *could* just increase the sample
rate by a factor of n and throw away all but every nth sample and
end up with 1/nth the latency.  Not quite as nice as a real ioctl interface
to reduce latency.

While CHU is hard to pick up locally at 7335 (no sign of it at all, but
I definitely remember it being at that spot on the dial when I was a kid) it
seems to be pretty good on 3330 kHz.  I'll have to see if the results apply
uniformly to both refclock_chu and refclock_wwv.

Again, thanks for all the suggestions.

Tim.



More information about the questions mailing list