Discussion:
augment latency to avoid underrun issue
(too old to reply)
Yannick Kohn
2018-04-24 19:31:29 UTC
Permalink
Hi,

Is it possible to use a big buffer to avoid any underrun issue when using ASIO to output audio on Windows 7/10 or do we need to be in the range of minimum -high latency by query of the output ?

Best regards
Phil Burk
2018-04-29 22:42:29 UTC
Permalink
Increasing the framesPerBuffer parameter will generally not reduce glitches
and might make them worse. Setting it to paFramesPerBufferUnspecified is
best.
The framesPerBuffer is the amount processed in one burst. It is not the
total size of the buffer.

Changing the suggestedLatency in the outputStreamParameters can reduce
latency.
It is difficult to predict the right value. Glitches are affected by the
audio load and by what else is happening in the system.

Phil Burk
Post by Yannick Kohn
Hi,
Is it possible to use a big buffer to avoid any underrun issue when using
ASIO to output audio on Windows 7/10 or do we need to be in the range of
minimum -high latency by query of the output ?
Best regards
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
Ross Bencina
2018-04-30 01:13:29 UTC
Permalink
Hi Phil, Yannick,
Post by Phil Burk
Increasing the framesPerBuffer parameter will generally not reduce
glitches and might make them worse.

In general this is true. What Phil has described is the best portable
strategy, and it will work with PA/ASIO. There is a another way to tune
buffers for PA/ASIO however.
Post by Phil Burk
Setting it to paFramesPerBufferUnspecified is best. > The
framesPerBuffer is the amount processed in one burst. It is not the
Post by Phil Burk
total size of the buffer.
Changing the suggestedLatency in the outputStreamParameters can reduce
latency.
And increasing suggestedLatency should reduce glitching.

Here's a low level approach to tuning ASIO buffering:

In general, framesPerBuffer is not the total native buffer size, but you
can make it so for PA/ASIO as follows:

Call PaAsio_GetAvailableBufferSizes() defined in pa_asio.h documented here:

http://portaudio.com/docs/v19-doxydocs/pa__asio_8h.html

Then use one of the values returned by PaAsio_GetAvailableBufferSizes
for framesPerBuffer.

And set suggestedLatency to 0 for both input and output. For PA/ASIO,
this will give you double buffered latency with host ASIO buffer size of
framesPerBuffer. Once you have that set up, increase/reduce
framesPerBuffer, making sure to keep it compatible with
PaAsio_GetAvailableBufferSizes(). Under these circumstances, increasing
framesPerBuffer will reduce glitching because it directly controls the
ASIO buffer size.

Of course this method isn't portable.
Post by Phil Burk
It is difficult to predict the right value. Glitches are affected by
the audio load and by what else is happening in the system.

This is true. The buffer sizes needed also depend on the audio hardware
and drivers being used.

Ross.
Post by Phil Burk
Phil Burk
On Tue, Apr 24, 2018 at 12:31 PM, Yannick Kohn
Hi,____
__ __
Is it possible to use a big buffer to avoid any underrun issue when
using ASIO to output audio on Windows 7/10 or do we need to be in
the range of minimum -high latency by query of the output ?____
__ __
Best regards____
__ __
__ __
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
<https://lists.columbia.edu/mailman/listinfo/portaudio>
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
Yannick Kohn
2018-04-30 10:27:06 UTC
Permalink
Hi Phil and Ross

Thanks for your answer. What is the recommended version to use on windows X64 Seven/10 msvc 2015 x64 to use with MME & ASIO. Is it the last snapshot or more the last stable from 20161016 ?

Best regards

Yannick

Le 30/04/2018 03:14, « portaudio-***@lists.columbia.edu au nom de Ross Bencina » <portaudio-***@lists.columbia.edu au nom de rossb-***@audiomulch.com> a écrit :

Hi Phil, Yannick,
Post by Phil Burk
Increasing the framesPerBuffer parameter will generally not reduce
glitches and might make them worse.

In general this is true. What Phil has described is the best portable
strategy, and it will work with PA/ASIO. There is a another way to tune
buffers for PA/ASIO however.
Post by Phil Burk
Setting it to paFramesPerBufferUnspecified is best. > The
framesPerBuffer is the amount processed in one burst. It is not the
Post by Phil Burk
total size of the buffer.
Changing the suggestedLatency in the outputStreamParameters can reduce
latency.
And increasing suggestedLatency should reduce glitching.

Here's a low level approach to tuning ASIO buffering:

In general, framesPerBuffer is not the total native buffer size, but you
can make it so for PA/ASIO as follows:

Call PaAsio_GetAvailableBufferSizes() defined in pa_asio.h documented here:

http://portaudio.com/docs/v19-doxydocs/pa__asio_8h.html

Then use one of the values returned by PaAsio_GetAvailableBufferSizes
for framesPerBuffer.

And set suggestedLatency to 0 for both input and output. For PA/ASIO,
this will give you double buffered latency with host ASIO buffer size of
framesPerBuffer. Once you have that set up, increase/reduce
framesPerBuffer, making sure to keep it compatible with
PaAsio_GetAvailableBufferSizes(). Under these circumstances, increasing
framesPerBuffer will reduce glitching because it directly controls the
ASIO buffer size.

Of course this method isn't portable.
Post by Phil Burk
It is difficult to predict the right value. Glitches are affected by
the audio load and by what else is happening in the system.

This is true. The buffer sizes needed also depend on the audio hardware
and drivers being used.

Ross.
Post by Phil Burk
Phil Burk
On Tue, Apr 24, 2018 at 12:31 PM, Yannick Kohn
Hi,____
__ __
Is it possible to use a big buffer to avoid any underrun issue when
using ASIO to output audio on Windows 7/10 or do we need to be in
the range of minimum -high latency by query of the output ?____
__ __
Best regards____
__ __
__ __
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
<https://lists.columbia.edu/mailman/listinfo/portaudio>
_______________________________________________
Portaudio mailing list
https://lists.columbia.edu/mailman/listinfo/portaudio
_______________________________________________
Portaudio mailing list
***@lists.columbia.edu
https://lists.columbia.edu/mailman/listinfo/portaudio

Loading...