]> git.baikalelectronics.ru Git - kernel.git/commit
ALSA: usb-audio: do not trust too-big wMaxPacketSize values
authorClemens Ladisch <clemens@ladisch.de>
Thu, 8 Aug 2013 09:24:55 +0000 (11:24 +0200)
committerTakashi Iwai <tiwai@suse.de>
Thu, 8 Aug 2013 09:37:34 +0000 (11:37 +0200)
commite3dd92876805f47ff96a931c024c9ed97ef5d99e
tree3f96789f16329d9053f02c0699a3eb48b4f28e62
parentdd2b33d22b03a51cc846e638204dca32369826db
ALSA: usb-audio: do not trust too-big wMaxPacketSize values

The driver used to assume that the streaming endpoint's wMaxPacketSize
value would be an indication of how much data the endpoint expects or
sends, and compute the number of packets per URB using this value.

However, the Focusrite Scarlett 2i4 declares a value of 1024 bytes,
while only about 88 or 44 bytes are be actually used.  This discrepancy
would result in URBs with far too few packets, which would not work
correctly on the EHCI driver.

To get correct URBs, use wMaxPacketSize only as an upper limit on the
packet size.

Reported-by: James Stone <jamesmstone@gmail.com>
Tested-by: James Stone <jamesmstone@gmail.com>
Cc: <stable@vger.kernel.org> # 2.6.35+
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/endpoint.c