summaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorClemens Ladisch <clemens@ladisch.de>2009-08-10 10:07:35 +0200
committerTakashi Iwai <tiwai@suse.de>2009-08-10 13:13:56 +0200
commit765e8db078e63fdc076fcf6024c15d3b7b955746 (patch)
tree2962fb6a3f4b03cf1480c122356fed0069d3bdff /sound/usb
parenta65dd997b3cf057f6524466cf8dfb8382c132bd5 (diff)
downloadop-kernel-dev-765e8db078e63fdc076fcf6024c15d3b7b955746.zip
op-kernel-dev-765e8db078e63fdc076fcf6024c15d3b7b955746.tar.gz
sound: usb-audio: do not make URBs longer than sync packet interval
Using more packets in one URB do avoid interrupts does not make sense when we have a sync pipe whose packets generate interrupts more often. Therefore, limit the URB size to the synchronization packet interval. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/usbaudio.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
index 44b9cdc..fa3f7a1 100644
--- a/sound/usb/usbaudio.c
+++ b/sound/usb/usbaudio.c
@@ -1083,6 +1083,8 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri
} else
urb_packs = 1;
urb_packs *= packs_per_ms;
+ if (subs->syncpipe)
+ urb_packs = min(urb_packs, 1 << subs->syncinterval);
/* decide how many packets to be used */
if (is_playback) {
OpenPOWER on IntegriCloud