From 288e217279919b64677c5b2d6c5d5e23bca67d3b Mon Sep 17 00:00:00 2001 From: Kyle Repinski Date: Tue, 24 Mar 2015 22:57:56 -0500 Subject: audio: Fix buffer underrun doing short to long period transition. This basically halves the long period size. I wish there was a different way to fix this but I don't think there is. --- audio/audio_hw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/audio/audio_hw.c b/audio/audio_hw.c index dae9d8a..eaf09a0 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -161,8 +161,10 @@ ((DEEP_BUFFER_SHORT_PERIOD_SIZE * PLAYBACK_DEEP_BUFFER_SHORT_PERIOD_COUNT) / 2) /* number of short deep buffer periods in a long period */ -#define DEEP_BUFFER_LONG_PERIOD_MULTIPLIER \ - (DEEP_BUFFER_LONG_PERIOD_MS / DEEP_BUFFER_SHORT_PERIOD_MS) +/* previously, this was (DEEP_BUFFER_LONG_PERIOD_MS / DEEP_BUFFER_SHORT_PERIOD_MS), but that caused a buffer underrun + * during the transition from short to long periods. A MULTIPLIER_FACTOR of 7 is the sweet-spot to stop those underruns. */ +#define DEEP_BUFFER_LONG_PERIOD_MULTIPLIER 7 + /* number of frames per long deep buffer period (screen off) */ #define DEEP_BUFFER_LONG_PERIOD_SIZE \ (DEEP_BUFFER_SHORT_PERIOD_SIZE * DEEP_BUFFER_LONG_PERIOD_MULTIPLIER) -- cgit v1.1