Changeset 61 for pa_proposals/trunk

Show
Ignore:
Timestamp:
12/03/02 02:04:49 (6 years ago)
Author:
rossbencina
Message:

clean up and marked as ready to implement

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pa_proposals/trunk/020-AllowCallbackToPrimeStream.html

    r53 r61  
    1818<P><A href="index.html">Enhancement Proposals Index</A>, 
    1919<A href="http://www.portaudio.com/">PortAudio Home Page</A></P> 
    20 <P>Updated: October 22, 2002 </P> 
     20<P>Updated: December 3, 2002 </P> 
    2121 
    2222<H4>Status</H4> 
    2323 
    24 <P>This proposal is open for discussion.</P> 
     24<P>This proposal is sufficiently well defined to be implemented.</P> 
    2525 
    2626<H4>Background</H4> 
    2727 
    2828<P> 
    29 Currently (V18), when a stream is started, host buffers are initially filled with zeros (silence). This is done so that the Stream Callback: a) is called at regular intervals (useful for time syncronisation), b) provides relatively constant and predictable latency from calback to output, and c) avoids a peak in processor load that would occur if all of the buffers were initialised directly one after another. The downside of this strategy is that the startup latency is held constant, whereas some host APIs may be able to provide significantly lower startup latency if the initial buffers are filled with valid sample data.  
     29Currently (V18), when a stream is started, host buffers are initially filled with zeros (silence). This is done so that the Stream Callback: a) is called at regular intervals (useful for time syncronisation), b) provides relatively constant and predictable latency from calback to output, and c) avoids a peak in processor load that would occur if all of the buffers were initialised directly one after another. The downside of this strategy is that the startup latency is held constant, whereas some host APIs may be capable of providing significantly lower startup latency if the initial buffers are filled with valid sample data.  
    3030</P> 
    3131 
     
    3838 
    3939<P> 
    40 Define a flag to be used in the streamFlags parameter to Pa_OpenStream that indicates that the initial output buffer(s) should be primed using the stream callback instead of the default of priming the buffers with zeros (silence). This flag has no effect for input-only streams. 
     40Define a flag to be used in the streamFlags parameter to Pa_OpenStream that indicates that the initial output buffer(s) should be primed using the stream callback, instead of the default behavior of priming the buffers with zeros (silence). This flag has no effect for input-only streams. 
    4141</P> 
    4242 
    4343<PRE> 
    44 #define paPrimeOutputBuffersUsingStreamCallback (1<<3) 
     44/** Call the stream callback to fill initial output buffers, rather than the 
     45 default behavior of priming the buffers with zeros (silence). This flag has 
     46 no effect for input-only and blocking read/write streams. 
     47 @see PaStreamFlags 
     48*/ 
     49#define   paPrimeOutputBuffersUsingStreamCallback ((PaStreamFlags) 0x00000008) 
    4550</PRE> 
    4651 
     
    5055 
    5156<PRE> 
    52 #define paPrimingOutput (1<<4) 
     57/** Some of all of the output data will be used to prime the stream, input 
     58 data may be zero. 
     59 @see PaStreamCallbackFlags 
     60*/ 
     61#define paPrimingOutput    ((PaStreamCallbackFlags) 0x00000010) 
    5362</PRE> 
    5463 
     
    6271 
    6372<P> 
    64 It is not yet clear whether opening an input-only stream with the paPrimeOutputBuffersUsingStreamCallback flag is an error. 
    65 </P> 
    66  
    67 <P> 
    68 Although the new Pa_GetStream*Latency functions are able to report the latency  
     73Although the new inputLatency and outputLatency PaStreamInfo fields are able to report the latency  
    6974for a standard call to the stream callback, these latency values will not be accurate 
    7075for priming call(s) to the stream callback. It would be difficult to accurately