hal: Use deep buffer output as primary
- The audio content in video clips, YouTube content, etc
are being rendered through low latency path as it was
set as default output profile. This results more power
consumption for video playback.
- Fix this using deep buffer path as default one and use
low latency path only for those audio tracks that
request with AUDIO_OUTPUT_FLAG_FAST.
Change-Id: I52fafa0ec2a312bc4383c813497830e6ded071bc
CRs-Fixed: 570389
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index aa7e6a6..68c9777 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -1873,10 +1873,6 @@
out->config.rate = config->sample_rate;
out->config.channels = popcount(out->channel_mask);
out->config.period_size = HDMI_MULTI_PERIOD_BYTES / (out->config.channels * 2);
- } else if (out->flags & AUDIO_OUTPUT_FLAG_DEEP_BUFFER) {
- out->usecase = USECASE_AUDIO_PLAYBACK_DEEP_BUFFER;
- out->config = pcm_config_deep_buffer;
- out->sample_rate = out->config.rate;
} else if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) {
if (config->offload_info.version != AUDIO_INFO_INITIALIZER.version ||
config->offload_info.size != AUDIO_INFO_INITIALIZER.size) {
@@ -1934,10 +1930,14 @@
__func__, ret);
goto error_open;
}
- } else {
+ } else if (out->flags & AUDIO_OUTPUT_FLAG_FAST) {
out->usecase = USECASE_AUDIO_PLAYBACK_LOW_LATENCY;
out->config = pcm_config_low_latency;
out->sample_rate = out->config.rate;
+ } else {
+ out->usecase = USECASE_AUDIO_PLAYBACK_DEEP_BUFFER;
+ out->config = pcm_config_deep_buffer;
+ out->sample_rate = out->config.rate;
}
if (flags & AUDIO_OUTPUT_FLAG_PRIMARY) {