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

Alberto I2PHD i2phd at weaksignals.com
Mon Apr 14 14:48:12 PDT 2008


Chris Stratton wrote:
> 
> Using the windows WAVEHDR mechanism, yes.  And I
> believe you have the option to change the size of the
> buffers: to quote from MSDN's commentary on
> waveOutPrepareHeader:
> 
> "The dwFlags, dwBufferLength, and dwLoops members of
> the WAVEHDR structure can change between calls to this
> function and the waveOutWrite function. (The only
> flags that can change in this interval for the dwFlags
> member are WHDR_BEGINLOOP and WHDR_ENDLOOP.) If you
> change the size specified by dwBufferLength before the
> call to waveOutWrite, the new value must be less than
> the prepared value."

  Hmm, as I get it, that means that you can change the buffer length after having issued the waveOutPrepareHeader API 
and before issuing the waveOutWrite API. But what would be needed is the capability to change the buffer length between 
successive calls to waveOutWrite.  The waveOutPrepareHeader is issued just once, at initialization time, after you have 
allocated the buffers. But maybe it works, just the MSDN documentation is not clear enough (as usual...). When I have 
some time I will try to modify the dwBufferLength field between calls to the waveOutWrite and see what happens.

But of course the most elegant method is, as you say, to take out of the picture the sound card, using the PWM of the 
Mercury. Of course this works only if you have a Mercury...

73  Alberto  I2PHD


 1208209692.0


More information about the Hpsdr mailing list