[Stk] Bug in RtAudio or base class?

Gary Scavone gary@ccrma.Stanford.EDU
Thu, 14 Nov 2002 09:29:17 -0800 (PST)


Hi John,

>>DirectX 8.1 has been installed and more up to date soundcard drivers have
>>been installed. This had no change.
>>
>>The soundcard is a Vibra 128.
>>
>>play.exe will not playback files recorded in, or converted to, various wav
>>formats using Windows Sound Recorder.

What was the error message?  Perhaps you could send me a short example
audio WAV file that doesn't work?  The WvIn class is intended to
support all sorts of WAV files, though there is no apparent agreement
on the normalization of 32-bit integer formats.

>>play.exe will play files recorded by STK record with similar quality as
>>Windows Sound Recorder.
>>
>>Using the various samples of the STK with the Tcl GUI there is static. This
>>is made dramatically worse by mouse movement anywhere in the screen.

This is likely a buffer size issue.  The default buffer size is set in
Stk.h to 512 sample frames (RT_BUFFER_SIZE).  If you are getting
static (especially with mouse movement), then you need to make that
bigger and recompile.  You should use power of two values, so try
2048, 4096 or higher.  The RtWvOut class also has an "nBuffers"
parameter similar to RtWvIn.  The default value is 4, but you might
consider messing with that as well (if changing RT_BUFFER_SIZE doesn't
totally fix the problem).

>>If there was a problem with soundcards drivers and/or the
>>DirectSound API I would expect complete failure (not so).

Not really.  A driver could sort of work, but have efficiency and
throughput problems that prevent it from keeping up under all
circumstances.  I wasn't necessary expecting the update of DirectX to
make a difference, but the driver update definitely could.  Don't be
afraid to set really high buffer sizes and "nBuffer" parameters ...  
the Windows Sound Recorder probably uses a buffer on the order of a
second ... that's what the DirectX examples do.  That is fine for
making sure your recorder app works under a wide range of soundcards
and systems, but it's pretty useless when you're trying to do duplex
with effects processing.

>>Given you have kept to the DirectSoundCapture API it is puzzling why some
>>Windows PCs are fine and mine is not, given this API is supposed to provide
>>independence from the Windows platforms.

The common API allows the programs to compile on a variety of systems.  
But the driver is what really controls how well the soundcard works
within the API.

--gary


>>----- Original Message -----
>>From: "Gary Scavone" <gary@ccrma.Stanford.EDU>
>>To: "John Heenan" <john@auscyber.com>
>>Cc: <stk@ccrma.Stanford.EDU>
>>Sent: Thursday, November 14, 2002 3:53 AM
>>Subject: Re: [Stk] Bug in RtAudio or base class?
>>
>>
>>Hi John,
>>
>>I'm assuming the "play" example works ok?  The playback and record
>>buffering schemes are exactly the same.  I don't use a multimedia
>>timer (which is common) because RtAudio implements a blocking
>>read/write call (and builds callback functionality on top of that).
>>That said, RtAudio has been working for many Windows users with good,
>>glitch-free response (Perry reports that he's sometimes left things
>>running for hours without a problem).
>>
>>I'd guess that this is an issue of either 1.) your soundcard driver;
>>and/or 2.) Your installed version of the DirectSound library.
>>DirectSound is up to version 8.x or higher.  The DirectSoundCapture
>>API is what is being used.  Can you check whether your soundcard
>>manufacturer has an updated driver (I now remember that my Maestro2e
>>driver initially did not work at all for capture but then did after I
>>downloaded and installed an update)?
>>
>>--gary
>>
>>On Thu, 14 Nov 2002, John Heenan wrote:
>>
>>>>Processor speed is around 800Mhz.
>>>>
>>>>No other recording software I have used has these problem. For example
>>>>Windows Sound Recorder works fine.
>>>>
>>>>It sounds as if the implementation of buffering algorithms have got their
>>>>knickers in a twist, such as overlapping data.
>>>>
>>>>John
>>>>
>>>>----- Original Message -----
>>>>From: "Perry R Cook" <prc@CS.Princeton.EDU>
>>>>To: "John Heenan" <john@auscyber.com>
>>>>Cc: <stk@ccrma.Stanford.EDU>
>>>>Sent: Thursday, November 14, 2002 2:59 AM
>>>>Subject: Re: [Stk] Bug in RtAudio or base class?
>>>>
>>>>
>>>>John,
>>>>
>>>>What speed is your processor?
>>>>
>>>>PRC
>>>>
>>>>
>>>>
>>>>
>>>>_______________________________________________
>>>>Stk mailing list
>>>>Stk@ccrma.stanford.edu
>>>>http://ccrma-mail.stanford.edu/mailman/listinfo/stk
>>>>
>>
>>--
>>-------------------------------------------------
>>Gary Scavone
>>Center for Computer Research in Music & Acoustics
>>Stanford University
>>gary@ccrma.stanford.edu
>>http://www-ccrma.stanford.edu/~gary/
>>-------------------------------------------------
>>
>>
>>
>>_______________________________________________
>>Stk mailing list
>>Stk@ccrma.stanford.edu
>>http://ccrma-mail.stanford.edu/mailman/listinfo/stk
>>

-- 
-------------------------------------------------
Gary Scavone
Center for Computer Research in Music & Acoustics
Stanford University
gary@ccrma.stanford.edu
http://www-ccrma.stanford.edu/~gary/
-------------------------------------------------