There appears to be a warm-up time for the CODEC to stabilize of
25 milliseconds (by measurement). Avoid noise at the start of
audio capture by holding off the CODEC enable for this duration.
Change-Id: I078af9272875cb77388fbbbd2796c4ba69301cb4
Signed-off-by: Iliyan Malchev <malchev@google.com>
#include <mach/cpcap_audio.h>
+#define CODEC_WARMUP_TIME_MS 25
#define SLEEP_ACTIVATE_POWER_DELAY_MS 2
#define STM_STDAC_ACTIVATE_RAMP_TIME 1
#define CLOCK_TREE_RESET_DELAY_MS 1
mdelay(CLOCK_TREE_RESET_DELAY_MS);
}
+ /* Todo: Follow-up with STMicro about why this is needed */
+ msleep(CODEC_WARMUP_TIME_MS);
/* Clear old settings */
codec_changes.mask = codec_changes.value | prev_codec_data;
prev_codec_data = codec_changes.value;