hal: Fix backend configuration during stream switch
-Currently, input stream sample rate and/or bit width is compared
with current backend sample rate and/or bit width. Backend is
re-configured only if input stream's rate/width is higher. This
causes incorrect sampling rate during stream switch of varying
sample rates.
-The backend is configured at highest bit width and/or sample rate
amongst all active playback usecases.
-By setting the backend re-configuration flag only when the selected
sample rate and/or bit width differ with current backend sample rate
and/or bit width, re-routing is enabled and backend is re-configured.
-Exception: 16 bit playbacks is allowed through 16/48 backend only.
-Enable logs for app type, acdb id and sample rate.
Change-Id: I09bfe30ebf8bdb3f9b481d7375ce7450fa67270c
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index c01ba77..9f5da7d 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2541,6 +2541,8 @@
out->sample_rate = out->config.rate;
}
+ ALOGV("%s flags %x, format %x, out->sample_rate %d, out->bit_width %d",
+ __func__, flags, format, out->sample_rate, out->bit_width);
audio_extn_utils_update_stream_app_type_cfg(adev->platform,
&adev->streams_output_cfg_list,
flags, format, out->sample_rate,