ALSA: usb - For class 2 devices, use channel map from altsettings

The channel config from the streaming descriptor is probably a
better indicator of the channel map than the input terminal.
Use the input terminal's channel map as fallback only.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
David Henningsson 2013-11-05 04:41:07 +01:00 committed by Takashi Iwai
parent 0dca01c37a
commit e3e35f750f

View File

@ -587,6 +587,7 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no)
num_channels = as->bNrChannels; num_channels = as->bNrChannels;
format = le32_to_cpu(as->bmFormats); format = le32_to_cpu(as->bmFormats);
chconfig = le32_to_cpu(as->bmChannelConfig);
/* lookup the terminal associated to this interface /* lookup the terminal associated to this interface
* to extract the clock */ * to extract the clock */
@ -594,7 +595,8 @@ int snd_usb_parse_audio_interface(struct snd_usb_audio *chip, int iface_no)
as->bTerminalLink); as->bTerminalLink);
if (input_term) { if (input_term) {
clock = input_term->bCSourceID; clock = input_term->bCSourceID;
chconfig = le32_to_cpu(input_term->bmChannelConfig); if (!chconfig && (num_channels == input_term->bNrChannels))
chconfig = le32_to_cpu(input_term->bmChannelConfig);
break; break;
} }