summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2012-08-27 13:43:35 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-08-27 13:43:36 -0700
commitf8b01af4f290922eb57470509dfb0d6837793122 (patch)
treee344a33defcc651046b4a4ac6f7c6fe7c6837fd3 /audio
parent9d77c5c7d76b7d6f46ac0dd4c3d664b086bffa24 (diff)
parent937956eb1f26a559a46fe733eae705aa217bea44 (diff)
downloaddevice_samsung_tuna-f8b01af4f290922eb57470509dfb0d6837793122.zip
device_samsung_tuna-f8b01af4f290922eb57470509dfb0d6837793122.tar.gz
device_samsung_tuna-f8b01af4f290922eb57470509dfb0d6837793122.tar.bz2
Merge "Triple buffer if SRC enabled" into jb-mr1-dev
Diffstat (limited to 'audio')
-rw-r--r--audio/audio_hw.c7
1 files changed, 7 insertions, 0 deletions
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,