From owner-svn-src-all@FreeBSD.ORG Wed Oct 24 08:00:02 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 67520D71; Wed, 24 Oct 2012 08:00:02 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 368258FC14; Wed, 24 Oct 2012 08:00:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q9O802Dn070260; Wed, 24 Oct 2012 08:00:02 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q9O801cm070256; Wed, 24 Oct 2012 08:00:01 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201210240800.q9O801cm070256@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 24 Oct 2012 08:00:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r241988 - head/sys/dev/sound/usb X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 08:00:02 -0000 Author: hselasky Date: Wed Oct 24 08:00:01 2012 New Revision: 241988 URL: http://svn.freebsd.org/changeset/base/241988 Log: Fix USB audio specification compliance by filtering which descriptors can appear on which interface. This fixes detection of some USB audio adapters. Also increase the channel limit for FULL speed devices to 4 channels. Tested by: gavin MFC after: 1 week Modified: head/sys/dev/sound/usb/uaudio.c Modified: head/sys/dev/sound/usb/uaudio.c ============================================================================== --- head/sys/dev/sound/usb/uaudio.c Wed Oct 24 07:23:29 2012 (r241987) +++ head/sys/dev/sound/usb/uaudio.c Wed Oct 24 08:00:01 2012 (r241988) @@ -1054,13 +1054,20 @@ uaudio_chan_fill_info_sub(struct uaudio_ sed.v1 = NULL; } - if ((acdp == NULL) && - (desc->bDescriptorType == UDESC_CS_INTERFACE) && - (desc->bDescriptorSubtype == AS_GENERAL) && - (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) && - (desc->bLength >= sizeof(*acdp))) { - acdp = (void *)desc; - audio_rev = UGETW(acdp->bcdADC); + if (audio_if == 0) { + if ((acdp == NULL) && + (desc->bDescriptorType == UDESC_CS_INTERFACE) && + (desc->bDescriptorSubtype == UDESCSUB_AC_HEADER) && + (desc->bLength >= sizeof(*acdp))) { + acdp = (void *)desc; + audio_rev = UGETW(acdp->bcdADC); + } + + /* + * Don't collect any USB audio descriptors if + * this is not an USB audio stream interface. + */ + continue; } if ((acdp != NULL) && @@ -1132,9 +1139,8 @@ uaudio_chan_fill_info_sub(struct uaudio_ sed.v1 = (void *)desc; } } - if (audio_if == 0 || asid.v1 == NULL || - asf1d.v1 == NULL || ed1 == NULL || - sed.v1 == NULL) { + if (asid.v1 == NULL || asf1d.v1 == NULL || + ed1 == NULL || sed.v1 == NULL) { /* need more descriptors */ continue; } @@ -1349,7 +1355,7 @@ uaudio_chan_fill_info(struct uaudio_soft * disable surround setups on FULL-speed USB * by default */ - channels = 2; + channels = 4; break; default: channels = 16;