alsa_sound: Add support for flexible buffer size for recording
- In the current implementation, all the read calls to the driver
are limited to 320 bytes only. This results performance overhead
for recording at higher sampling rates.
- Added support for flexible buffer size to allow upto 4096 bytes.
Bug: 7223456
Change-Id: Ic0522d92de905b04481a0d8daa103c77552257e8
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/alsa_sound/AudioHardwareALSA.h b/alsa_sound/AudioHardwareALSA.h
index 0a0b06e..3d952a4 100644
--- a/alsa_sound/AudioHardwareALSA.h
+++ b/alsa_sound/AudioHardwareALSA.h
@@ -65,8 +65,11 @@
#define DEFAULT_BUFFER_SIZE 4096
#define DEFAULT_VOICE_BUFFER_SIZE 2048
#define PLAYBACK_LOW_LATENCY_BUFFER_SIZE 1024
-#define PLAYBACK_LOW_LATENCY 11000
+#define PLAYBACK_LOW_LATENCY 22000
+#define PLAYBACK_LOW_LATENCY_MEASURED 42000
#define DEFAULT_IN_BUFFER_SIZE 320
+#define MIN_CAPTURE_BUFFER_SIZE_PER_CH 320
+#define MAX_CAPTURE_BUFFER_SIZE_PER_CH 2048
#define FM_BUFFER_SIZE 1024
#define VOIP_SAMPLING_RATE_8K 8000