alsa_sound: Add support for multichannel hdmi
- Multichannel audio support for HDMI for AAC
format with 5.1 channels max.
Bug: 7156174
Change-Id: I42e92fa2b14d35a5882cc6d84c6651a6a4d5092a
Signed-off-by: Iliyan Malchev <malchev@google.com>
diff --git a/alsa_sound/ALSAStreamOps.cpp b/alsa_sound/ALSAStreamOps.cpp
index f38b35e..aafc736 100644
--- a/alsa_sound/ALSAStreamOps.cpp
+++ b/alsa_sound/ALSAStreamOps.cpp
@@ -104,6 +104,11 @@
*channels = 0;
if (mHandle->devices & AudioSystem::DEVICE_OUT_ALL) {
switch(mHandle->channels) {
+ case 6:
+ case 5:
+ *channels |= audio_channel_out_mask_from_count(mHandle->channels);
+ break;
+ // Do not fall through
case 4:
*channels |= AudioSystem::CHANNEL_OUT_BACK_LEFT;
*channels |= AudioSystem::CHANNEL_OUT_BACK_RIGHT;
@@ -348,6 +353,11 @@
if (mDevices & AudioSystem::DEVICE_OUT_ALL)
switch(count) {
+ case 6:
+ case 5:
+ channels |=audio_channel_out_mask_from_count(count);
+ break;
+ // Do not fall through
case 4:
channels |= AudioSystem::CHANNEL_OUT_BACK_LEFT;
channels |= AudioSystem::CHANNEL_OUT_BACK_RIGHT;