diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2013-04-27 06:10:32 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2013-04-29 04:57:35 -0400 |
commit | c75c5ab575af7db707689cdbb5a5c458e9a034bb (patch) | |
tree | 66bf7a427bcb7a46de41f58efdaa3be853b42e6f /sound/usb | |
parent | fa92dd77ec5623cc0546acb77ee61a0a7ea4f0f0 (diff) |
ALSA: USB: adjust for changed 3.8 USB API
The recent changes in the USB API ("implement new semantics for
URB_ISO_ASAP") made the former meaning of the URB_ISO_ASAP flag the
default, and changed this flag to mean that URBs can be delayed.
This is not the behaviour wanted by any of the audio drivers because
it leads to discontinuous playback with very small period sizes.
Therefore, our URBs need to be submitted without this flag.
Reported-by: Joe Rayhawk <jrayhawk@fairlystable.org>
Cc: <stable@vger.kernel.org> # 3.8 only
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/usb')
-rw-r--r-- | sound/usb/6fire/pcm.c | 1 | ||||
-rw-r--r-- | sound/usb/caiaq/audio.c | 3 | ||||
-rw-r--r-- | sound/usb/endpoint.c | 5 | ||||
-rw-r--r-- | sound/usb/misc/ua101.c | 3 | ||||
-rw-r--r-- | sound/usb/usx2y/usb_stream.c | 1 | ||||
-rw-r--r-- | sound/usb/usx2y/usbusx2yaudio.c | 1 | ||||
-rw-r--r-- | sound/usb/usx2y/usx2yhwdeppcm.c | 1 |
7 files changed, 3 insertions, 12 deletions
diff --git a/sound/usb/6fire/pcm.c b/sound/usb/6fire/pcm.c index e2ca12fe92e9..40dd50a80f55 100644 --- a/sound/usb/6fire/pcm.c +++ b/sound/usb/6fire/pcm.c | |||
@@ -575,7 +575,6 @@ static void usb6fire_pcm_init_urb(struct pcm_urb *urb, | |||
575 | urb->instance.pipe = in ? usb_rcvisocpipe(chip->dev, ep) | 575 | urb->instance.pipe = in ? usb_rcvisocpipe(chip->dev, ep) |
576 | : usb_sndisocpipe(chip->dev, ep); | 576 | : usb_sndisocpipe(chip->dev, ep); |
577 | urb->instance.interval = 1; | 577 | urb->instance.interval = 1; |
578 | urb->instance.transfer_flags = URB_ISO_ASAP; | ||
579 | urb->instance.complete = handler; | 578 | urb->instance.complete = handler; |
580 | urb->instance.context = urb; | 579 | urb->instance.context = urb; |
581 | urb->instance.number_of_packets = PCM_N_PACKETS_PER_URB; | 580 | urb->instance.number_of_packets = PCM_N_PACKETS_PER_URB; |
diff --git a/sound/usb/caiaq/audio.c b/sound/usb/caiaq/audio.c index 67330af21b0e..c1916184e2e1 100644 --- a/sound/usb/caiaq/audio.c +++ b/sound/usb/caiaq/audio.c | |||
@@ -683,7 +683,6 @@ static void read_completed(struct urb *urb) | |||
683 | 683 | ||
684 | if (send_it) { | 684 | if (send_it) { |
685 | out->number_of_packets = outframe; | 685 | out->number_of_packets = outframe; |
686 | out->transfer_flags = URB_ISO_ASAP; | ||
687 | usb_submit_urb(out, GFP_ATOMIC); | 686 | usb_submit_urb(out, GFP_ATOMIC); |
688 | } else { | 687 | } else { |
689 | struct snd_usb_caiaq_cb_info *oinfo = out->context; | 688 | struct snd_usb_caiaq_cb_info *oinfo = out->context; |
@@ -699,7 +698,6 @@ requeue: | |||
699 | } | 698 | } |
700 | 699 | ||
701 | urb->number_of_packets = FRAMES_PER_URB; | 700 | urb->number_of_packets = FRAMES_PER_URB; |
702 | urb->transfer_flags = URB_ISO_ASAP; | ||
703 | usb_submit_urb(urb, GFP_ATOMIC); | 701 | usb_submit_urb(urb, GFP_ATOMIC); |
704 | } | 702 | } |
705 | 703 | ||
@@ -765,7 +763,6 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret) | |||
765 | * BYTES_PER_FRAME; | 763 | * BYTES_PER_FRAME; |
766 | urbs[i]->context = &cdev->data_cb_info[i]; | 764 | urbs[i]->context = &cdev->data_cb_info[i]; |
767 | urbs[i]->interval = 1; | 765 | urbs[i]->interval = 1; |
768 | urbs[i]->transfer_flags = URB_ISO_ASAP; | ||
769 | urbs[i]->number_of_packets = FRAMES_PER_URB; | 766 | urbs[i]->number_of_packets = FRAMES_PER_URB; |
770 | urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ? | 767 | urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ? |
771 | read_completed : write_completed; | 768 | read_completed : write_completed; |
diff --git a/sound/usb/endpoint.c b/sound/usb/endpoint.c index 32d0b41a1ff6..7a444b5501d9 100644 --- a/sound/usb/endpoint.c +++ b/sound/usb/endpoint.c | |||
@@ -684,7 +684,7 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep, | |||
684 | if (!u->urb->transfer_buffer) | 684 | if (!u->urb->transfer_buffer) |
685 | goto out_of_memory; | 685 | goto out_of_memory; |
686 | u->urb->pipe = ep->pipe; | 686 | u->urb->pipe = ep->pipe; |
687 | u->urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; | 687 | u->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
688 | u->urb->interval = 1 << ep->datainterval; | 688 | u->urb->interval = 1 << ep->datainterval; |
689 | u->urb->context = u; | 689 | u->urb->context = u; |
690 | u->urb->complete = snd_complete_urb; | 690 | u->urb->complete = snd_complete_urb; |
@@ -723,8 +723,7 @@ static int sync_ep_set_params(struct snd_usb_endpoint *ep, | |||
723 | u->urb->transfer_dma = ep->sync_dma + i * 4; | 723 | u->urb->transfer_dma = ep->sync_dma + i * 4; |
724 | u->urb->transfer_buffer_length = 4; | 724 | u->urb->transfer_buffer_length = 4; |
725 | u->urb->pipe = ep->pipe; | 725 | u->urb->pipe = ep->pipe; |
726 | u->urb->transfer_flags = URB_ISO_ASAP | | 726 | u->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
727 | URB_NO_TRANSFER_DMA_MAP; | ||
728 | u->urb->number_of_packets = 1; | 727 | u->urb->number_of_packets = 1; |
729 | u->urb->interval = 1 << ep->syncinterval; | 728 | u->urb->interval = 1 << ep->syncinterval; |
730 | u->urb->context = u; | 729 | u->urb->context = u; |
diff --git a/sound/usb/misc/ua101.c b/sound/usb/misc/ua101.c index 8b81cb54026f..6ad617b94732 100644 --- a/sound/usb/misc/ua101.c +++ b/sound/usb/misc/ua101.c | |||
@@ -1120,8 +1120,7 @@ static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream, | |||
1120 | usb_init_urb(&urb->urb); | 1120 | usb_init_urb(&urb->urb); |
1121 | urb->urb.dev = ua->dev; | 1121 | urb->urb.dev = ua->dev; |
1122 | urb->urb.pipe = stream->usb_pipe; | 1122 | urb->urb.pipe = stream->usb_pipe; |
1123 | urb->urb.transfer_flags = URB_ISO_ASAP | | 1123 | urb->urb.transfer_flags = URB_NO_TRANSFER_DMA_MAP; |
1124 | URB_NO_TRANSFER_DMA_MAP; | ||
1125 | urb->urb.transfer_buffer = addr; | 1124 | urb->urb.transfer_buffer = addr; |
1126 | urb->urb.transfer_dma = dma; | 1125 | urb->urb.transfer_dma = dma; |
1127 | urb->urb.transfer_buffer_length = max_packet_size; | 1126 | urb->urb.transfer_buffer_length = max_packet_size; |
diff --git a/sound/usb/usx2y/usb_stream.c b/sound/usb/usx2y/usb_stream.c index 1e7a47a86605..bf618e1500ac 100644 --- a/sound/usb/usx2y/usb_stream.c +++ b/sound/usb/usx2y/usb_stream.c | |||
@@ -69,7 +69,6 @@ static void init_pipe_urbs(struct usb_stream_kernel *sk, unsigned use_packsize, | |||
69 | ++u, transfer += transfer_length) { | 69 | ++u, transfer += transfer_length) { |
70 | struct urb *urb = urbs[u]; | 70 | struct urb *urb = urbs[u]; |
71 | struct usb_iso_packet_descriptor *desc; | 71 | struct usb_iso_packet_descriptor *desc; |
72 | urb->transfer_flags = URB_ISO_ASAP; | ||
73 | urb->transfer_buffer = transfer; | 72 | urb->transfer_buffer = transfer; |
74 | urb->dev = dev; | 73 | urb->dev = dev; |
75 | urb->pipe = pipe; | 74 | urb->pipe = pipe; |
diff --git a/sound/usb/usx2y/usbusx2yaudio.c b/sound/usb/usx2y/usbusx2yaudio.c index 520ef96d7c75..b37653247ef4 100644 --- a/sound/usb/usx2y/usbusx2yaudio.c +++ b/sound/usb/usx2y/usbusx2yaudio.c | |||
@@ -503,7 +503,6 @@ static int usX2Y_urbs_start(struct snd_usX2Y_substream *subs) | |||
503 | if (0 == i) | 503 | if (0 == i) |
504 | atomic_set(&subs->state, state_STARTING3); | 504 | atomic_set(&subs->state, state_STARTING3); |
505 | urb->dev = usX2Y->dev; | 505 | urb->dev = usX2Y->dev; |
506 | urb->transfer_flags = URB_ISO_ASAP; | ||
507 | for (pack = 0; pack < nr_of_packs(); pack++) { | 506 | for (pack = 0; pack < nr_of_packs(); pack++) { |
508 | urb->iso_frame_desc[pack].offset = subs->maxpacksize * pack; | 507 | urb->iso_frame_desc[pack].offset = subs->maxpacksize * pack; |
509 | urb->iso_frame_desc[pack].length = subs->maxpacksize; | 508 | urb->iso_frame_desc[pack].length = subs->maxpacksize; |
diff --git a/sound/usb/usx2y/usx2yhwdeppcm.c b/sound/usb/usx2y/usx2yhwdeppcm.c index cc56007791e0..f2a1acdc4d83 100644 --- a/sound/usb/usx2y/usx2yhwdeppcm.c +++ b/sound/usb/usx2y/usx2yhwdeppcm.c | |||
@@ -443,7 +443,6 @@ static int usX2Y_usbpcm_urbs_start(struct snd_usX2Y_substream *subs) | |||
443 | if (0 == u) | 443 | if (0 == u) |
444 | atomic_set(&subs->state, state_STARTING3); | 444 | atomic_set(&subs->state, state_STARTING3); |
445 | urb->dev = usX2Y->dev; | 445 | urb->dev = usX2Y->dev; |
446 | urb->transfer_flags = URB_ISO_ASAP; | ||
447 | for (pack = 0; pack < nr_of_packs(); pack++) { | 446 | for (pack = 0; pack < nr_of_packs(); pack++) { |
448 | urb->iso_frame_desc[pack].offset = subs->maxpacksize * (pack + u * nr_of_packs()); | 447 | urb->iso_frame_desc[pack].offset = subs->maxpacksize * (pack + u * nr_of_packs()); |
449 | urb->iso_frame_desc[pack].length = subs->maxpacksize; | 448 | urb->iso_frame_desc[pack].length = subs->maxpacksize; |