hal : add default format handling for multi channel HDMI
Allow to open the HDMI multi channel direct output stream
with default sample format.
It is legitimate for the framework to open a stream with default
audio attributes in which case the defaults are chosen by the HAL.
Change-Id: Iff319ea5f47d9f80725ee895e49606e5b6804d22
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index a72ca53..7e8716d 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -2162,9 +2162,12 @@
config->sample_rate = DEFAULT_OUTPUT_SAMPLING_RATE;
if (config->channel_mask == 0)
config->channel_mask = AUDIO_CHANNEL_OUT_5POINT1;
+ if (config->format == AUDIO_FORMAT_DEFAULT)
+ config->format = AUDIO_FORMAT_PCM_16_BIT;
out->channel_mask = config->channel_mask;
out->sample_rate = config->sample_rate;
+ out->format = config->format;
out->usecase = USECASE_AUDIO_PLAYBACK_MULTI_CH;
out->config = pcm_config_hdmi_multi;
out->config.rate = config->sample_rate;
@@ -2782,7 +2785,6 @@
ALOGV("%s: (%s) card %d device %d", __func__,
dir ? "input" : "output", card_id, device_id);
pcm_params_to_string(*pparams, info, ARRAY_SIZE(info));
- ALOGV(info); /* print parameters */
} else {
ALOGV("%s: cannot locate card %d device %d", __func__, card_id, device_id);
}