Audio source/sink buffer

Hi all,

I’ve put together a simple program that shifts the frequency of an
input down so that 252kHz comes out at 12kHz. It seems to be working,
but it’s very prone to buffer underruns and overruns. The slightest bit
of activity on the computer breaks up the output. Is there any way to
buffer the data from the audio sink, insulate things a bit?

The input is from a BT878 chip @ 896000sps, the output is to a sound
card @ 56000sps (actually 48000sps, using plughw).

The goal is to feed RTE’s DRM signal on 252kHz to another computer
running the DRM decoder Dream [1]. The buffer problems are causing Dream
to drop the signal almost as soon as it locks on.