audio: hal: add 32 bit recording support in hal
Add support and set bit width for S32_LE audo
format in recording path.
Change-Id: I38b5bda66d395c7db61b8b7918fcb0cbd31d9d9c
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 704f3f3..601d8ff 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -6728,6 +6728,10 @@
channel_count = audio_channel_count_from_in_mask(config->channel_mask);
} else if (config->format == AUDIO_FORMAT_DEFAULT) {
config->format = AUDIO_FORMAT_PCM_16_BIT;
+ } else if (property_get_bool("vendor.audio.capture.pcm.32bit.enable", false)
+ && config->format == AUDIO_FORMAT_PCM_32_BIT) {
+ in->config.format = PCM_FORMAT_S32_LE;
+ in->bit_width = 32;
} else if ((config->format == AUDIO_FORMAT_PCM_FLOAT) ||
(config->format == AUDIO_FORMAT_PCM_32_BIT) ||
(config->format == AUDIO_FORMAT_PCM_24_BIT_PACKED) ||