[hpsdr] buffer over/underflow (was Mercury sampling rate)

Alberto I2PHD i2phd at weaksignals.com
Mon Apr 14 13:23:50 PDT 2008


Chris Stratton wrote:
> 
>> So, when you have to throw away one block, because you
>> are in a condition of buffer overflow, 
>> you throw away more than two elements of the incoming  CW
>> signal. Not nice.
> 
> Flawed assumption.  You do not have to throw away a
> whole block.  Keep all of your receive processing
> slaved to the clock of the data source.  Then, when
> sending output to the soundcard, do one of two things:
> 
> 1) If you are overflowing, tell the sound card you are
> giving it a receiver that is a sample or two shorter
> than the processing buffer actually was, discarding
> just that sample or two.
> 
> 2) If you are underflowing, tell the soundcard you are
> giving it a slightly larger buffer and repeate a few
> samples at the end.  

  Have you ever written a program that talks to a sound card under Windows, using the MME subsystem ?
The buffer length is determined when you open the interface, and you have to preallocate and initialize the buffers you 
intend to use. It is not possible to decide at any single sending how long the data will be this specific time. You 
would have to close and reopen the interface, with a result much worse than the problem that we are trying to fix.

73  Alberto  I2PHD


 1208204630.0


More information about the Hpsdr mailing list