sound: usb-audio: do not make URBs longer than sync packet interval
authorClemens Ladisch <clemens@ladisch.de>
Mon, 10 Aug 2009 08:07:35 +0000 (10:07 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 10 Aug 2009 11:13:56 +0000 (13:13 +0200)
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>
sound/usb/usbaudio.c

index 44b9cdc..fa3f7a1 100644 (file)
@@ -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) {