fix usb audio for devices with more than 8 channels
Use the lowest 8 channels.
Bug: 24468939
Change-Id: If116133ab3c902cc6d431b287058897c8e3af875
(cherry picked from commit 67c63b290460f36f7841d6f01017bb116a2a36f1)
diff --git a/alsa_utils/alsa_device_profile.c b/alsa_utils/alsa_device_profile.c
index dd238e7..054c77a 100644
--- a/alsa_utils/alsa_device_profile.c
+++ b/alsa_utils/alsa_device_profile.c
@@ -288,6 +288,12 @@
profile->channel_counts[num_counts++] = std_channel_counts[index];
}
}
+ // if we have no match with the standard counts, we use the largest (preferred) std count.
+ if (num_counts == 0) {
+ ALOGW("usb device does not match std channel counts, setting to %d",
+ std_channel_counts[0]);
+ profile->channel_counts[num_counts++] = std_channel_counts[0];
+ }
profile->channel_counts[num_counts] = 0;
return num_counts; /* return # of supported counts */
}