diff --git a/sys/dev/sound/usb/uaudio.c b/sys/dev/sound/usb/uaudio.c --- a/sys/dev/sound/usb/uaudio.c +++ b/sys/dev/sound/usb/uaudio.c @@ -1725,6 +1725,7 @@ uint8_t audio_if = 0; uint8_t midi_if = 0; uint8_t uma_if_class; + uint8_t i; while ((desc = usb_desc_foreach(cd, desc))) { if ((desc->bDescriptorType == UDESC_INTERFACE) && @@ -2017,6 +2018,20 @@ chan->set_alt = 0; chan->cur_alt = CHAN_MAX_ALT; + for (i = 0; i != chan->num_alt; i++) { + chan_alt = &chan->usb_alt[i]; + + if (chan_alt->sample_rate == rate && + chan_alt->channels == channels && + chan_alt->p_fmt->bPrecision == bit_resolution) { + DPRINTF("Skipping duplicate configuration: " + "sample rate = %dHz, channels = %d, " + "bits = %d\n", + rate, channels, bit_resolution); + goto next_ep; + } + } + chan_alt = &chan->usb_alt[chan->num_alt++]; #ifdef USB_DEBUG