summaryrefslogtreecommitdiffstats
path: root/alsa_utils
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2015-09-28 16:31:54 -0700
committerAndy Hung <hunga@google.com>2015-10-01 20:20:37 +0000
commitdce0eca34eab2016d6d11cb32f072db4079a4461 (patch)
tree4f11bda7c05d098b440e3e99299938bd002d8ab5 /alsa_utils
parent2d950898d4dc311ecfd2b64ea8880656dd6a14fa (diff)
downloadandroid_system_media-dce0eca34eab2016d6d11cb32f072db4079a4461.tar.gz
android_system_media-dce0eca34eab2016d6d11cb32f072db4079a4461.tar.bz2
android_system_media-dce0eca34eab2016d6d11cb32f072db4079a4461.zip
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)
Diffstat (limited to 'alsa_utils')
-rw-r--r--alsa_utils/alsa_device_profile.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/alsa_utils/alsa_device_profile.c b/alsa_utils/alsa_device_profile.c
index dd238e74..054c77a6 100644
--- a/alsa_utils/alsa_device_profile.c
+++ b/alsa_utils/alsa_device_profile.c
@@ -288,6 +288,12 @@ static unsigned profile_enum_channel_counts(alsa_device_profile* profile, unsign
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 */
}