diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2009-03-02 06:06:28 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-03-02 08:50:01 -0500 |
commit | b1c86bb807448701400abc6eb8e958475ab5424b (patch) | |
tree | 7673a17d82c20f5bc1824c17bc2cb1a0c05004ea /sound | |
parent | eab2b553c3d3ed20698c4a9c7e049a60b804e2f5 (diff) |
sound: usb-audio: fix queue length check for high speed devices
When checking for the maximum queue length, we have to take into account
that MAX_QUEUE is measured in milliseconds (i.e., frames) while the unit
of urb_packs is whatever data packet interval the device uses (possibly
less than one frame when using high speed devices).
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/usb/usbaudio.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c index f853b627cf43..defe9913cbb2 100644 --- a/sound/usb/usbaudio.c +++ b/sound/usb/usbaudio.c | |||
@@ -1095,9 +1095,8 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri | |||
1095 | total_packs = 2 * packs_per_ms; | 1095 | total_packs = 2 * packs_per_ms; |
1096 | } else { | 1096 | } else { |
1097 | /* and we don't want too long a queue either */ | 1097 | /* and we don't want too long a queue either */ |
1098 | maxpacks = max((unsigned int)MAX_QUEUE, urb_packs * 2); | 1098 | maxpacks = max(MAX_QUEUE * packs_per_ms, urb_packs * 2); |
1099 | if (total_packs > maxpacks * packs_per_ms) | 1099 | total_packs = min(total_packs, maxpacks); |
1100 | total_packs = maxpacks * packs_per_ms; | ||
1101 | } | 1100 | } |
1102 | } else { | 1101 | } else { |
1103 | total_packs = MAX_URBS * urb_packs; | 1102 | total_packs = MAX_URBS * urb_packs; |