aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb
diff options
context:
space:
mode:
authorAlan Stern <stern@rowland.harvard.edu>2013-09-24 15:51:58 -0400
committerTakashi Iwai <tiwai@suse.de>2013-09-26 04:25:31 -0400
commit976b6c064a957445eb0573b270f2d0282630e9b9 (patch)
tree3a80a94273feeb9c30ac6f2e23976d020dc44aaf /sound/usb
parente8bc99425e8159cd5f56bb76419158857bd358ed (diff)
ALSA: improve buffer size computations for USB PCM audio
This patch changes the way URBs are allocated and their sizes are determined for PCM playback in the snd-usb-audio driver. Currently the driver allocates too few URBs for endpoints that don't use implicit sync, making underruns more likely to occur. This may be a holdover from before I/O delays could be measured accurately; in any case, it is no longer necessary. The patch allocates as many URBs as possible, subject to four limitations: The total number of URBs for the endpoint is not allowed to exceed MAX_URBS (which the patch increases from 8 to 12). The total number of packets per URB is not allowed to exceed MAX_PACKS (or MAX_PACKS_HS for high-speed devices), which is decreased from 20 to 6. The total duration of queued data is not allowed to exceed MAX_QUEUE, which is decreased from 24 ms to 18 ms. The total number of ALSA frames in the output queue is not allowed to exceed the ALSA buffer size. The last requirement is the hardest to implement. Currently the number of URBs needed to fill a buffer cannot be determined in advance, because a buffer contains a fixed number of frames whereas the number of frames in an URB varies to match shifts in the device's clock rate. To solve this problem, the patch changes the logic for deciding how many packets an URB should contain. Rather than using as many as possible without exceeding an ALSA period boundary, now the driver uses only as many packets as needed to transfer a predetermined number of frames. As a result, unless the device's clock has an exceedingly variable rate, the number of URBs making up each period (and hence each buffer) will remain constant. The overall effect of the patch is that playback works better in low-latency settings. The user can still specify values for frames/period and periods/buffer that exceed the capabilities of the hardware, of course. But for values that are within those capabilities, the performance will be improved. For example, testing shows that a high-speed device can handle 32 frames/period and 3 periods/buffer at 48 KHz, whereas the current driver starts to get glitchy at 64 frames/period and 2 periods/buffer. A side effect of these changes is that the "nrpacks" module parameter is no longer used. The patch removes it. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Clemens Ladisch <clemens@ladisch.de> Tested-by: Daniel Mack <zonque@gmail.com> Tested-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r--sound/usb/card.c8
-rw-r--r--sound/usb/card.h10
-rw-r--r--sound/usb/endpoint.c106
-rw-r--r--sound/usb/endpoint.h2
-rw-r--r--sound/usb/pcm.c14
-rw-r--r--sound/usb/usbaudio.h1
6 files changed, 82 insertions, 59 deletions
diff --git a/sound/usb/card.c b/sound/usb/card.c
index 64952e2d3ed1..d1f54dfe41d5 100644
--- a/sound/usb/card.c
+++ b/sound/usb/card.c
@@ -79,7 +79,6 @@ static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;/* Enable this card *
79/* Vendor/product IDs for this card */ 79/* Vendor/product IDs for this card */
80static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; 80static int vid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 };
81static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 }; 81static int pid[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = -1 };
82static int nrpacks = 8; /* max. number of packets per urb */
83static int device_setup[SNDRV_CARDS]; /* device parameter for this card */ 82static int device_setup[SNDRV_CARDS]; /* device parameter for this card */
84static bool ignore_ctl_error; 83static bool ignore_ctl_error;
85static bool autoclock = true; 84static bool autoclock = true;
@@ -94,8 +93,6 @@ module_param_array(vid, int, NULL, 0444);
94MODULE_PARM_DESC(vid, "Vendor ID for the USB audio device."); 93MODULE_PARM_DESC(vid, "Vendor ID for the USB audio device.");
95module_param_array(pid, int, NULL, 0444); 94module_param_array(pid, int, NULL, 0444);
96MODULE_PARM_DESC(pid, "Product ID for the USB audio device."); 95MODULE_PARM_DESC(pid, "Product ID for the USB audio device.");
97module_param(nrpacks, int, 0644);
98MODULE_PARM_DESC(nrpacks, "Max. number of packets per URB.");
99module_param_array(device_setup, int, NULL, 0444); 96module_param_array(device_setup, int, NULL, 0444);
100MODULE_PARM_DESC(device_setup, "Specific device setup (if needed)."); 97MODULE_PARM_DESC(device_setup, "Specific device setup (if needed).");
101module_param(ignore_ctl_error, bool, 0444); 98module_param(ignore_ctl_error, bool, 0444);
@@ -374,7 +371,6 @@ static int snd_usb_audio_create(struct usb_device *dev, int idx,
374 chip->dev = dev; 371 chip->dev = dev;
375 chip->card = card; 372 chip->card = card;
376 chip->setup = device_setup[idx]; 373 chip->setup = device_setup[idx];
377 chip->nrpacks = nrpacks;
378 chip->autoclock = autoclock; 374 chip->autoclock = autoclock;
379 chip->probing = 1; 375 chip->probing = 1;
380 376
@@ -756,10 +752,6 @@ static struct usb_driver usb_audio_driver = {
756 752
757static int __init snd_usb_audio_init(void) 753static int __init snd_usb_audio_init(void)
758{ 754{
759 if (nrpacks < 1 || nrpacks > MAX_PACKS) {
760 printk(KERN_WARNING "invalid nrpacks value.\n");
761 return -EINVAL;
762 }
763 return usb_register(&usb_audio_driver); 755 return usb_register(&usb_audio_driver);
764} 756}
765 757
diff --git a/sound/usb/card.h b/sound/usb/card.h
index 5ecacaa90b53..ca98a9b915c9 100644
--- a/sound/usb/card.h
+++ b/sound/usb/card.h
@@ -2,11 +2,11 @@
2#define __USBAUDIO_CARD_H 2#define __USBAUDIO_CARD_H
3 3
4#define MAX_NR_RATES 1024 4#define MAX_NR_RATES 1024
5#define MAX_PACKS 20 5#define MAX_PACKS 6 /* per URB */
6#define MAX_PACKS_HS (MAX_PACKS * 8) /* in high speed mode */ 6#define MAX_PACKS_HS (MAX_PACKS * 8) /* in high speed mode */
7#define MAX_URBS 8 7#define MAX_URBS 12
8#define SYNC_URBS 4 /* always four urbs for sync */ 8#define SYNC_URBS 4 /* always four urbs for sync */
9#define MAX_QUEUE 24 /* try not to exceed this queue length, in ms */ 9#define MAX_QUEUE 18 /* try not to exceed this queue length, in ms */
10 10
11struct audioformat { 11struct audioformat {
12 struct list_head list; 12 struct list_head list;
@@ -87,6 +87,7 @@ struct snd_usb_endpoint {
87 unsigned int phase; /* phase accumulator */ 87 unsigned int phase; /* phase accumulator */
88 unsigned int maxpacksize; /* max packet size in bytes */ 88 unsigned int maxpacksize; /* max packet size in bytes */
89 unsigned int maxframesize; /* max packet size in frames */ 89 unsigned int maxframesize; /* max packet size in frames */
90 unsigned int max_urb_frames; /* max URB size in frames */
90 unsigned int curpacksize; /* current packet size in bytes (for capture) */ 91 unsigned int curpacksize; /* current packet size in bytes (for capture) */
91 unsigned int curframesize; /* current packet size in frames (for capture) */ 92 unsigned int curframesize; /* current packet size in frames (for capture) */
92 unsigned int syncmaxsize; /* sync endpoint packet size */ 93 unsigned int syncmaxsize; /* sync endpoint packet size */
@@ -116,6 +117,8 @@ struct snd_usb_substream {
116 unsigned int channels_max; /* max channels in the all audiofmts */ 117 unsigned int channels_max; /* max channels in the all audiofmts */
117 unsigned int cur_rate; /* current rate (for hw_params callback) */ 118 unsigned int cur_rate; /* current rate (for hw_params callback) */
118 unsigned int period_bytes; /* current period bytes (for hw_params callback) */ 119 unsigned int period_bytes; /* current period bytes (for hw_params callback) */
120 unsigned int period_frames; /* current frames per period */
121 unsigned int buffer_periods; /* current periods per buffer */
119 unsigned int altset_idx; /* USB data format: index of alternate setting */ 122 unsigned int altset_idx; /* USB data format: index of alternate setting */
120 unsigned int txfr_quirk:1; /* allow sub-frame alignment */ 123 unsigned int txfr_quirk:1; /* allow sub-frame alignment */
121 unsigned int fmt_type; /* USB audio format type (1-3) */ 124 unsigned int fmt_type; /* USB audio format type (1-3) */
@@ -125,6 +128,7 @@ struct snd_usb_substream {
125 128
126 unsigned int hwptr_done; /* processed byte position in the buffer */ 129 unsigned int hwptr_done; /* processed byte position in the buffer */
127 unsigned int transfer_done; /* processed frames since last period update */ 130 unsigned int transfer_done; /* processed frames since last period update */
131 unsigned int frame_limit; /* limits number of packets in URB */
128 132
129 /* data and sync endpoints for this stream */ 133 /* data and sync endpoints for this stream */
130 unsigned int ep_num; /* the endpoint number */ 134 unsigned int ep_num; /* the endpoint number */
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c
index 93e970f2b3c0..21dc6422d747 100644
--- a/sound/usb/endpoint.c
+++ b/sound/usb/endpoint.c
@@ -574,11 +574,14 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep,
574 snd_pcm_format_t pcm_format, 574 snd_pcm_format_t pcm_format,
575 unsigned int channels, 575 unsigned int channels,
576 unsigned int period_bytes, 576 unsigned int period_bytes,
577 unsigned int frames_per_period,
578 unsigned int periods_per_buffer,
577 struct audioformat *fmt, 579 struct audioformat *fmt,
578 struct snd_usb_endpoint *sync_ep) 580 struct snd_usb_endpoint *sync_ep)
579{ 581{
580 unsigned int maxsize, i, urb_packs, total_packs, packs_per_ms; 582 unsigned int maxsize, minsize, packs_per_ms, max_packs_per_urb;
581 int is_playback = usb_pipeout(ep->pipe); 583 unsigned int max_packs_per_period, urbs_per_period, urb_packs;
584 unsigned int max_urbs, i;
582 int frame_bits = snd_pcm_format_physical_width(pcm_format) * channels; 585 int frame_bits = snd_pcm_format_physical_width(pcm_format) * channels;
583 586
584 if (pcm_format == SNDRV_PCM_FORMAT_DSD_U16_LE && fmt->dsd_dop) { 587 if (pcm_format == SNDRV_PCM_FORMAT_DSD_U16_LE && fmt->dsd_dop) {
@@ -611,58 +614,67 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep,
611 else 614 else
612 ep->curpacksize = maxsize; 615 ep->curpacksize = maxsize;
613 616
614 if (snd_usb_get_speed(ep->chip->dev) != USB_SPEED_FULL) 617 if (snd_usb_get_speed(ep->chip->dev) != USB_SPEED_FULL) {
615 packs_per_ms = 8 >> ep->datainterval; 618 packs_per_ms = 8 >> ep->datainterval;
616 else 619 max_packs_per_urb = MAX_PACKS_HS;
617 packs_per_ms = 1;
618
619 if (is_playback && !snd_usb_endpoint_implicit_feedback_sink(ep)) {
620 urb_packs = max(ep->chip->nrpacks, 1);
621 urb_packs = min(urb_packs, (unsigned int) MAX_PACKS);
622 } else { 620 } else {
623 urb_packs = 1; 621 packs_per_ms = 1;
622 max_packs_per_urb = MAX_PACKS;
624 } 623 }
624 if (sync_ep && !snd_usb_endpoint_implicit_feedback_sink(ep))
625 max_packs_per_urb = min(max_packs_per_urb,
626 1U << sync_ep->syncinterval);
627 max_packs_per_urb = max(1u, max_packs_per_urb >> ep->datainterval);
625 628
626 urb_packs *= packs_per_ms; 629 /*
630 * Capture endpoints need to use small URBs because there's no way
631 * to tell in advance where the next period will end, and we don't
632 * want the next URB to complete much after the period ends.
633 *
634 * Playback endpoints with implicit sync much use the same parameters
635 * as their corresponding capture endpoint.
636 */
637 if (usb_pipein(ep->pipe) ||
638 snd_usb_endpoint_implicit_feedback_sink(ep)) {
627 639
628 if (sync_ep && !snd_usb_endpoint_implicit_feedback_sink(ep)) 640 /* make capture URBs <= 1 ms and smaller than a period */
629 urb_packs = min(urb_packs, 1U << sync_ep->syncinterval); 641 urb_packs = min(max_packs_per_urb, packs_per_ms);
642 while (urb_packs > 1 && urb_packs * maxsize >= period_bytes)
643 urb_packs >>= 1;
644 ep->nurbs = MAX_URBS;
630 645
631 /* decide how many packets to be used */ 646 /*
632 if (is_playback && !snd_usb_endpoint_implicit_feedback_sink(ep)) { 647 * Playback endpoints without implicit sync are adjusted so that
633 unsigned int minsize, maxpacks; 648 * a period fits as evenly as possible in the smallest number of
649 * URBs. The total number of URBs is adjusted to the size of the
650 * ALSA buffer, subject to the MAX_URBS and MAX_QUEUE limits.
651 */
652 } else {
634 /* determine how small a packet can be */ 653 /* determine how small a packet can be */
635 minsize = (ep->freqn >> (16 - ep->datainterval)) 654 minsize = (ep->freqn >> (16 - ep->datainterval)) *
636 * (frame_bits >> 3); 655 (frame_bits >> 3);
637 /* with sync from device, assume it can be 12% lower */ 656 /* with sync from device, assume it can be 12% lower */
638 if (sync_ep) 657 if (sync_ep)
639 minsize -= minsize >> 3; 658 minsize -= minsize >> 3;
640 minsize = max(minsize, 1u); 659 minsize = max(minsize, 1u);
641 total_packs = (period_bytes + minsize - 1) / minsize;
642 /* we need at least two URBs for queueing */
643 if (total_packs < 2) {
644 total_packs = 2;
645 } else {
646 /* and we don't want too long a queue either */
647 maxpacks = max(MAX_QUEUE * packs_per_ms, urb_packs * 2);
648 total_packs = min(total_packs, maxpacks);
649 }
650 } else {
651 while (urb_packs > 1 && urb_packs * maxsize >= period_bytes)
652 urb_packs >>= 1;
653 total_packs = MAX_URBS * urb_packs;
654 }
655 660
656 ep->nurbs = (total_packs + urb_packs - 1) / urb_packs; 661 /* how many packets will contain an entire ALSA period? */
657 if (ep->nurbs > MAX_URBS) { 662 max_packs_per_period = DIV_ROUND_UP(period_bytes, minsize);
658 /* too much... */ 663
659 ep->nurbs = MAX_URBS; 664 /* how many URBs will contain a period? */
660 total_packs = MAX_URBS * urb_packs; 665 urbs_per_period = DIV_ROUND_UP(max_packs_per_period,
661 } else if (ep->nurbs < 2) { 666 max_packs_per_urb);
662 /* too little - we need at least two packets 667 /* how many packets are needed in each URB? */
663 * to ensure contiguous playback/capture 668 urb_packs = DIV_ROUND_UP(max_packs_per_period, urbs_per_period);
664 */ 669
665 ep->nurbs = 2; 670 /* limit the number of frames in a single URB */
671 ep->max_urb_frames = DIV_ROUND_UP(frames_per_period,
672 urbs_per_period);
673
674 /* try to use enough URBs to contain an entire ALSA buffer */
675 max_urbs = min((unsigned) MAX_URBS,
676 MAX_QUEUE * packs_per_ms / urb_packs);
677 ep->nurbs = min(max_urbs, urbs_per_period * periods_per_buffer);
666 } 678 }
667 679
668 /* allocate and initialize data urbs */ 680 /* allocate and initialize data urbs */
@@ -670,8 +682,7 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep,
670 struct snd_urb_ctx *u = &ep->urb[i]; 682 struct snd_urb_ctx *u = &ep->urb[i];
671 u->index = i; 683 u->index = i;
672 u->ep = ep; 684 u->ep = ep;
673 u->packets = (i + 1) * total_packs / ep->nurbs 685 u->packets = urb_packs;
674 - i * total_packs / ep->nurbs;
675 u->buffer_size = maxsize * u->packets; 686 u->buffer_size = maxsize * u->packets;
676 687
677 if (fmt->fmt_type == UAC_FORMAT_TYPE_II) 688 if (fmt->fmt_type == UAC_FORMAT_TYPE_II)
@@ -748,6 +759,8 @@ out_of_memory:
748 * @pcm_format: the audio fomat. 759 * @pcm_format: the audio fomat.
749 * @channels: the number of audio channels. 760 * @channels: the number of audio channels.
750 * @period_bytes: the number of bytes in one alsa period. 761 * @period_bytes: the number of bytes in one alsa period.
762 * @period_frames: the number of frames in one alsa period.
763 * @buffer_periods: the number of periods in one alsa buffer.
751 * @rate: the frame rate. 764 * @rate: the frame rate.
752 * @fmt: the USB audio format information 765 * @fmt: the USB audio format information
753 * @sync_ep: the sync endpoint to use, if any 766 * @sync_ep: the sync endpoint to use, if any
@@ -760,6 +773,8 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
760 snd_pcm_format_t pcm_format, 773 snd_pcm_format_t pcm_format,
761 unsigned int channels, 774 unsigned int channels,
762 unsigned int period_bytes, 775 unsigned int period_bytes,
776 unsigned int period_frames,
777 unsigned int buffer_periods,
763 unsigned int rate, 778 unsigned int rate,
764 struct audioformat *fmt, 779 struct audioformat *fmt,
765 struct snd_usb_endpoint *sync_ep) 780 struct snd_usb_endpoint *sync_ep)
@@ -793,7 +808,8 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
793 switch (ep->type) { 808 switch (ep->type) {
794 case SND_USB_ENDPOINT_TYPE_DATA: 809 case SND_USB_ENDPOINT_TYPE_DATA:
795 err = data_ep_set_params(ep, pcm_format, channels, 810 err = data_ep_set_params(ep, pcm_format, channels,
796 period_bytes, fmt, sync_ep); 811 period_bytes, period_frames,
812 buffer_periods, fmt, sync_ep);
797 break; 813 break;
798 case SND_USB_ENDPOINT_TYPE_SYNC: 814 case SND_USB_ENDPOINT_TYPE_SYNC:
799 err = sync_ep_set_params(ep, fmt); 815 err = sync_ep_set_params(ep, fmt);
diff --git a/sound/usb/endpoint.h b/sound/usb/endpoint.h
index 2287adf5ca59..3bd02f0d226c 100644
--- a/sound/usb/endpoint.h
+++ b/sound/usb/endpoint.h
@@ -12,6 +12,8 @@ int snd_usb_endpoint_set_params(struct snd_usb_endpoint *ep,
12 snd_pcm_format_t pcm_format, 12 snd_pcm_format_t pcm_format,
13 unsigned int channels, 13 unsigned int channels,
14 unsigned int period_bytes, 14 unsigned int period_bytes,
15 unsigned int period_frames,
16 unsigned int buffer_periods,
15 unsigned int rate, 17 unsigned int rate,
16 struct audioformat *fmt, 18 struct audioformat *fmt,
17 struct snd_usb_endpoint *sync_ep); 19 struct snd_usb_endpoint *sync_ep);
diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
index b375d58871e7..19e79953f2e3 100644
--- a/sound/usb/pcm.c
+++ b/sound/usb/pcm.c
@@ -595,6 +595,7 @@ static int configure_sync_endpoint(struct snd_usb_substream *subs)
595 subs->pcm_format, 595 subs->pcm_format,
596 subs->channels, 596 subs->channels,
597 subs->period_bytes, 597 subs->period_bytes,
598 0, 0,
598 subs->cur_rate, 599 subs->cur_rate,
599 subs->cur_audiofmt, 600 subs->cur_audiofmt,
600 NULL); 601 NULL);
@@ -631,6 +632,7 @@ static int configure_sync_endpoint(struct snd_usb_substream *subs)
631 subs->pcm_format, 632 subs->pcm_format,
632 sync_fp->channels, 633 sync_fp->channels,
633 sync_period_bytes, 634 sync_period_bytes,
635 0, 0,
634 subs->cur_rate, 636 subs->cur_rate,
635 sync_fp, 637 sync_fp,
636 NULL); 638 NULL);
@@ -653,6 +655,8 @@ static int configure_endpoint(struct snd_usb_substream *subs)
653 subs->pcm_format, 655 subs->pcm_format,
654 subs->channels, 656 subs->channels,
655 subs->period_bytes, 657 subs->period_bytes,
658 subs->period_frames,
659 subs->buffer_periods,
656 subs->cur_rate, 660 subs->cur_rate,
657 subs->cur_audiofmt, 661 subs->cur_audiofmt,
658 subs->sync_endpoint); 662 subs->sync_endpoint);
@@ -689,6 +693,8 @@ static int snd_usb_hw_params(struct snd_pcm_substream *substream,
689 693
690 subs->pcm_format = params_format(hw_params); 694 subs->pcm_format = params_format(hw_params);
691 subs->period_bytes = params_period_bytes(hw_params); 695 subs->period_bytes = params_period_bytes(hw_params);
696 subs->period_frames = params_period_size(hw_params);
697 subs->buffer_periods = params_periods(hw_params);
692 subs->channels = params_channels(hw_params); 698 subs->channels = params_channels(hw_params);
693 subs->cur_rate = params_rate(hw_params); 699 subs->cur_rate = params_rate(hw_params);
694 700
@@ -1363,6 +1369,7 @@ static void prepare_playback_urb(struct snd_usb_substream *subs,
1363 frames = 0; 1369 frames = 0;
1364 urb->number_of_packets = 0; 1370 urb->number_of_packets = 0;
1365 spin_lock_irqsave(&subs->lock, flags); 1371 spin_lock_irqsave(&subs->lock, flags);
1372 subs->frame_limit += ep->max_urb_frames;
1366 for (i = 0; i < ctx->packets; i++) { 1373 for (i = 0; i < ctx->packets; i++) {
1367 if (ctx->packet_size[i]) 1374 if (ctx->packet_size[i])
1368 counts = ctx->packet_size[i]; 1375 counts = ctx->packet_size[i];
@@ -1377,6 +1384,7 @@ static void prepare_playback_urb(struct snd_usb_substream *subs,
1377 subs->transfer_done += counts; 1384 subs->transfer_done += counts;
1378 if (subs->transfer_done >= runtime->period_size) { 1385 if (subs->transfer_done >= runtime->period_size) {
1379 subs->transfer_done -= runtime->period_size; 1386 subs->transfer_done -= runtime->period_size;
1387 subs->frame_limit = 0;
1380 period_elapsed = 1; 1388 period_elapsed = 1;
1381 if (subs->fmt_type == UAC_FORMAT_TYPE_II) { 1389 if (subs->fmt_type == UAC_FORMAT_TYPE_II) {
1382 if (subs->transfer_done > 0) { 1390 if (subs->transfer_done > 0) {
@@ -1399,8 +1407,10 @@ static void prepare_playback_urb(struct snd_usb_substream *subs,
1399 break; 1407 break;
1400 } 1408 }
1401 } 1409 }
1402 if (period_elapsed && 1410 /* finish at the period boundary or after enough frames */
1403 !snd_usb_endpoint_implicit_feedback_sink(subs->data_endpoint)) /* finish at the period boundary */ 1411 if ((period_elapsed ||
1412 subs->transfer_done >= subs->frame_limit) &&
1413 !snd_usb_endpoint_implicit_feedback_sink(ep))
1404 break; 1414 break;
1405 } 1415 }
1406 bytes = frames * ep->stride; 1416 bytes = frames * ep->stride;
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index caabe9b3af49..5d2fe0530745 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -55,7 +55,6 @@ struct snd_usb_audio {
55 struct list_head mixer_list; /* list of mixer interfaces */ 55 struct list_head mixer_list; /* list of mixer interfaces */
56 56
57 int setup; /* from the 'device_setup' module param */ 57 int setup; /* from the 'device_setup' module param */
58 int nrpacks; /* from the 'nrpacks' module param */
59 bool autoclock; /* from the 'autoclock' module param */ 58 bool autoclock; /* from the 'autoclock' module param */
60 59
61 struct usb_host_interface *ctrl_intf; /* the audio control interface */ 60 struct usb_host_interface *ctrl_intf; /* the audio control interface */