Re: Mystic 'Playback stops' problem with waveInPrepareHeader, waveInAddBuffer etc.

From: Phil Taylor (ptaylor_at_private-citizen.com)
Date: 04/12/04


Date: Mon, 12 Apr 2004 09:29:20 -0700

wrong.

preparing/unpreparing can cause a perf hit large enough to cause audible
glitches in the audio stream playback.

"Kurt Grittner" <grittkmg_NO_SPAM_@mailbag.com> wrote in message
news:h7el70h0604fjfhutdhbmrp4j3889a2uj1@4ax.com...
> Hi Chris,
>
> Yes, the docs are vague. The critical sentence is:
>
> "This function MUST<my caps> be called after the device driver fills a
> buffer and returns it to the application."
>
> But unfortunately, it doesn't say how soon this must be done. This
> has led device driver writers towards incompatible implementations
> with regards to the reuse issue. I agree that if you are only using
> modern sound cards you are probably ok reusing accross AddBuffer
> boundaries. If you are targeting every win32 implementation and sound
> card on the entire planet, then it is wise to play it safe.
>
> If you use a thread for wavein and another thread for waveout, and you
> have a sufficiently deep record buffer pool, then you should not get
> into any performance issues when preparing/unpreparing with every use.
>
> Kurt
>
>
> On Mon, 12 Apr 2004 11:33:59 -0400, "Chris P. [MVP]"
> <msdn@chrisnet.net> wrote:
>
> >
> >Yes, waveInUnprepareHeader cleans up after waveInPrepareHeader. The
> >documentation simply says you must wait until the driver is finished with
> >the buffer before calling, i.e. "not playing the buffer" and that you
should
> >call before freeing the buffer. There is nothing that says you must call
> >after each and every call to waveInAddBuffer, but rather when you are
"done"
> >with the buffer.
> >
> >This is going to continue to be a point of contention until the docs
> >explicitly say one way or the other. Nor will it help in the case of
buggy
> >Windows 98 drivers.
> >
> >-Chris
> >
>



Relevant Pages

  • Re: Mystic Playback stops problem with waveInPrepareHeader, waveInAddBuffer etc.
    ... has led device driver writers towards incompatible implementations ... modern sound cards you are probably ok reusing accross AddBuffer ... If you use a thread for wavein and another thread for waveout, ... have a sufficiently deep record buffer pool, ...
    (microsoft.public.win32.programmer.mmedia)
  • WaveIn Problem in XP
    ... This won't make much sense unless you have used waveIn functions to ... record wave files. ... When the buffer is filled with wave data it sends a MM_WIM_DATA message ...
    (comp.lang.pascal.delphi.misc)
  • Re: Can someone explain how to correctly use Low level Digital Audio A
    ... You have to have more than one buffer and associated WaveHdr structure ... All that starts the waveIn recording. ... PtrWaveHdr: PWaveHdr; ...
    (microsoft.public.win32.programmer.mmedia)
  • Re: callback function immediatly called with an empty buffer
    ... > I try to record a wavefile with wavein API. ... > Waveinprepareheader and waveinAddbuffer work fine, with a waveheader ... > buffer large to hold a few seconds audio. ... > Strangely, just after waveinstart, the callback function is executed, ...
    (microsoft.public.win32.programmer.mmedia)
  • Re: Sound Card read Data
    ... > I want to read realtime data from sound cards R/L channels. ... > I've found sources of an oscilloscope program using ... waveInUnprepareHeader, copy the data from the buffer, then re-prepare it. ... Using two buffers ensures that the waveIn device continues to ...
    (comp.programming)