Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133210
b: refs/heads/master
c: 4d788e0
h: refs/heads/master
v: v3
  • Loading branch information
Clemens Ladisch authored and Takashi Iwai committed Jan 26, 2009
1 parent 4d94d55 commit 7d297da
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7eb4a06e9980973755b7e95a6d97fb8decbf8fd
refs/heads/master: 4d788e040b72d2a46ea3ba726b7fa0b65de06c88
9 changes: 8 additions & 1 deletion trunk/sound/usb/usbaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ MODULE_PARM_DESC(ignore_ctl_error,
#define MAX_URBS 8
#define SYNC_URBS 4 /* always four urbs for sync */
#define MIN_PACKS_URB 1 /* minimum 1 packet per urb */
#define MAX_QUEUE 24 /* try not to exceed this queue length, in ms */

struct audioformat {
struct list_head list;
Expand Down Expand Up @@ -1079,7 +1080,7 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri

/* decide how many packets to be used */
if (is_playback) {
unsigned int minsize;
unsigned int minsize, maxpacks;
/* determine how small a packet can be */
minsize = (subs->freqn >> (16 - subs->datainterval))
* (frame_bits >> 3);
Expand All @@ -1094,6 +1095,12 @@ static int init_substream_urbs(struct snd_usb_substream *subs, unsigned int peri
/* we need at least two URBs for queueing */
if (total_packs < 2 * MIN_PACKS_URB * packs_per_ms)
total_packs = 2 * MIN_PACKS_URB * packs_per_ms;
else {
/* and we don't want too long a queue either */
maxpacks = max((unsigned int)MAX_QUEUE, urb_packs * 2);
if (total_packs > maxpacks * packs_per_ms)
total_packs = maxpacks * packs_per_ms;
}
} else {
total_packs = MAX_URBS * urb_packs;
}
Expand Down

0 comments on commit 7d297da

Please sign in to comment.