[Stk] realtime problem: under-run?

Stephen Sinclair stephen.sinclair@mail.mcgill.ca
Tue, 03 Oct 2006 15:31:28 -0400


My initial guess would be that you are using relatively long loops... 
perhaps when you loop back to the beginning you are suddenly accessing 
memory that is far away, causing a cache hit.

This shouldn't really be a problem if you are using double buffering.  
What parameters are you creating your RtDuplex object with?  Try 
increasing nBuffers, perhaps.  Does the problem happen less frequently 
if you increase bufferFrames?

Also, are you writing to the file and the sound buffer simultaneously?  
The FileWvOut object doesn't provide any parallelism, so I wouldn't put 
it in my realtime audio thread, except for test purposes.  (i.e, comment 
it out when playing to the soundcard.)

Steve


Enrico Costanza wrote:
> Hi All,
>
> I am building a loop based audio sequencer.  It uses WvIn objects for 
> the audio clips, wrapped inside a Sampler class I created (Sampler is 
> a subclass of .Instrument)
>
> I am experiencing a weird problem.  My sequencer can "wrap around", 
> i.e. if an audio clip is longer than the loop, the tail will be simply 
> added to the head and played on it.
> I am using RtDuplex to play the result out from the soundcard.
> I hear a "click" (basically the sound seems to go to zero) when the 
> "tail" hits the head.  However if I also save the output to a file the 
> file is perfect.  The way I do this is by using a WvOut object in 
> parallel to the RtDuplex:
> StkFloat value = samplerInstance->tick();
> rtduplex->tick(value);
> waveout->tick(value);
>
> The wave file produced by wvout is perfect.
> Why can this be? And how can I fix this?
>
>
> Thanks a lot,
> Enrico
>
> _______________________________________________
> Stk mailing list
> Stk@ccrma.stanford.edu
> http://ccrma-mail.stanford.edu/mailman/listinfo/stk