From 937956eb1f26a559a46fe733eae705aa217bea44 Mon Sep 17 00:00:00 2001 From: Glenn Kasten Date: Tue, 7 Aug 2012 14:10:40 -0700 Subject: Triple buffer if SRC enabled Bug: 6881638 Change-Id: I76255c2cd5845671c2342e22932c692342257208 --- audio/audio_hw.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 8ae519c..b841c57 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -180,6 +180,11 @@ */ #ifdef PLAYBACK_MMAP #define PLAYBACK_SHORT_PERIOD_COUNT 4 +/* If sample rate converter is required, then use triple-buffering to + * help mask the variance in cycle times. Otherwise use double-buffering. + */ +#elif DEFAULT_OUT_SAMPLING_RATE != MM_FULL_POWER_SAMPLING_RATE +#define PLAYBACK_SHORT_PERIOD_COUNT 3 #else #define PLAYBACK_SHORT_PERIOD_COUNT 2 #endif @@ -297,6 +302,7 @@ enum tty_modes { TTY_MODE_FULL }; +/* deep buffer */ struct pcm_config pcm_config_mm = { .channels = 2, .rate = MM_FULL_POWER_SAMPLING_RATE, @@ -307,6 +313,7 @@ struct pcm_config pcm_config_mm = { .avail_min = DEEP_BUFFER_LONG_PERIOD_SIZE, }; +/* low latency */ struct pcm_config pcm_config_tones = { .channels = 2, .rate = MM_FULL_POWER_SAMPLING_RATE, -- cgit v1.1