Changeset 61
- Timestamp:
- 12/03/02 02:04:49 (6 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pa_proposals/trunk/020-AllowCallbackToPrimeStream.html
r53 r61 18 18 <P><A href="index.html">Enhancement Proposals Index</A>, 19 19 <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> 21 21 22 22 <H4>Status</H4> 23 23 24 <P>This proposal is open for discussion.</P>24 <P>This proposal is sufficiently well defined to be implemented.</P> 25 25 26 26 <H4>Background</H4> 27 27 28 28 <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 providesignificantly lower startup latency if the initial buffers are filled with valid sample data.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 capable of providing significantly lower startup latency if the initial buffers are filled with valid sample data. 30 30 </P> 31 31 … … 38 38 39 39 <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 defaultof priming the buffers with zeros (silence). This flag has no effect for input-only streams.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 behavior of priming the buffers with zeros (silence). This flag has no effect for input-only streams. 41 41 </P> 42 42 43 43 <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) 45 50 </PRE> 46 51 … … 50 55 51 56 <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) 53 62 </PRE> 54 63 … … 62 71 63 72 <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 73 Although the new inputLatency and outputLatency PaStreamInfo fields are able to report the latency 69 74 for a standard call to the stream callback, these latency values will not be accurate 70 75 for priming call(s) to the stream callback. It would be difficult to accurately
