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

Peter Boettcher boettcher at ll.mit.edu
Wed Oct 1 18:41:27 UTC 2003

shoppa at trailing-edge.com (Tim Shoppa) writes:

> 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.

Would *knowing* the exact latency help?  I think GETIPTR is the OSS
ioctl that grabs the exact byte that is currently being written to the
internal buffers.

Peter Boettcher
boettcher at ll.mit.edu

More information about the questions mailing list