hal: Support Multichannel Speaker playback
Until now speaker playback only supports stereo
and is limited to default sample rate.
Update code to support QCS405 configurations with
CSRA soundcards that can have up to 16 or 32 speaker
output channels and allow sample rates up to 384kHz.
Change-Id: Ib4ed5edafca6f8b15134ca66db4bf1ef719ec15d
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index bd3fa7c..198d871 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -990,7 +990,14 @@
if (usecase->id == USECASE_AUDIO_PLAYBACK_VOIP) {
usecase->stream.out->app_type_cfg.sample_rate = usecase->stream.out->sample_rate;
} else if (usecase->stream.out->devices & AUDIO_DEVICE_OUT_SPEAKER) {
- usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
+ if (platform_spkr_use_default_sample_rate(adev->platform)) {
+ usecase->stream.out->app_type_cfg.sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
+ } else {
+ platform_check_and_update_copp_sample_rate(adev->platform, snd_device,
+ usecase->stream.out->sample_rate,
+ &usecase->stream.out->app_type_cfg.sample_rate);
+ }
+
} else if ((snd_device == SND_DEVICE_OUT_HDMI ||
snd_device == SND_DEVICE_OUT_USB_HEADSET ||
snd_device == SND_DEVICE_OUT_DISPLAY_PORT) &&