From 5819b0c1d642ecb9036a7d0e1c15ec007ee59924 Mon Sep 17 00:00:00 2001 From: Stephen Sinclair Date: Mon, 20 Dec 2010 16:33:55 -0500 Subject: [PATCH] ALSA: Default to 4 periods, unless minimal latency is requested. --- RtAudio.cpp | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/RtAudio.cpp b/RtAudio.cpp index 78259e9..cacb181 100644 --- a/RtAudio.cpp +++ b/RtAudio.cpp @@ -5663,7 +5663,11 @@ bool RtApiAlsa :: probeDeviceOpen( unsigned int device, StreamMode mode, unsigne // Set the buffer number, which in ALSA is referred to as the "period". int totalSize, dir = 0; unsigned int periods = 0; - if ( options ) periods = options->numberOfBuffers; + if ( options ) { + periods = options->numberOfBuffers; + if ( periods==0 && !(options->flags & RTAUDIO_MINIMIZE_LATENCY) ) + periods = 4; + } totalSize = *bufferSize * periods; // Set the buffer (or period) size. -- 1.7.1