From 765e8db078e63fdc076fcf6024c15d3b7b955746 Mon Sep 17 00:00:00 2001 From: Clemens Ladisch Date: Mon, 10 Aug 2009 10:07:35 +0200 Subject: 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 Signed-off-by: Takashi Iwai --- sound/usb/usbaudio.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'sound/usb/usbaudio.c') diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index 44b9cdc8a83..fa3f7a1dc5e 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) { -- cgit v1.2.3-18-g5258 From f1e6d3c5cf86675e54a17a89668aa6685d2ef59d Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 11 Aug 2009 08:15:04 +0200 Subject: ALSA: usb-audio - Fix types taken in min() Fix the compile warning due to different integer types used in min(): sound/usb/usbaudio.c: In function 'init_substream_urbs': sound/usb/usbaudio.c:1087: warning: comparison of distinct pointer types lacks a cast Signed-off-by: Takashi Iwai --- sound/usb/usbaudio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sound/usb/usbaudio.c') diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index fa3f7a1dc5e..5149c5893ea 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c @@ -1084,7 +1084,7 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri urb_packs = 1; urb_packs *= packs_per_ms; if (subs->syncpipe) - urb_packs = min(urb_packs, 1 << subs->syncinterval); + urb_packs = min(urb_packs, 1U << subs->syncinterval); /* decide how many packets to be used */ if (is_playback) { -- cgit v1.2.3-18-g5258