PA/ASIO SelectHostBufferSize() doesn't take user framesPerBuffer into account
pa_asio.cpp SelectHostBufferSize() doesn't take the user's requested callback framesPerBuffer into account at all when computing the native ASIO buffer size.
It should attempt to conform the ASIO buffer size to the callback framesPerBuffer (or multiples of it). This is pretty nasty since it impacts available CPU time in the audio callback, but we've been living with it forever apparently...
Further: pa_asio.h provides a method to query for available buffer sizes (PaAsio_GetAvailableLatencyValues) but no host api specific extension to set i/o buffer sizes in frames. If the computation of the ASIO buffer size was based on framesPerBuffer there would be no need for such an extension.
In general, the algorithm used to select a host buffer size needs to prioritise (in this order):
1. ASIO buffer sizes permitted by the driver
2. multiples of the user requested framesPerBuffer
3. the user's requested latency
META TICKET: #98 [META] Harmonize Pa_OpenStream() suggestedLatency param to native buffer size calculations
It should attempt to conform the ASIO buffer size to the callback framesPerBuffer (or multiples of it). This is pretty nasty since it impacts available CPU time in the audio callback, but we've been living with it forever apparently...
Further: pa_asio.h provides a method to query for available buffer sizes (PaAsio_GetAvailableLatencyValues) but no host api specific extension to set i/o buffer sizes in frames. If the computation of the ASIO buffer size was based on framesPerBuffer there would be no need for such an extension.
In general, the algorithm used to select a host buffer size needs to prioritise (in this order):
1. ASIO buffer sizes permitted by the driver
2. multiples of the user requested framesPerBuffer
3. the user's requested latency
META TICKET: #98 [META] Harmonize Pa_OpenStream() suggestedLatency param to native buffer size calculations
Leave a comment