ALSA: USB: adjust for changed 3.8 USB API
authorClemens Ladisch <clemens@ladisch.de>
Sat, 27 Apr 2013 10:10:32 +0000 (12:10 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 29 Apr 2013 08:57:35 +0000 (10:57 +0200)
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>
sound/usb/6fire/pcm.c
sound/usb/caiaq/audio.c
sound/usb/endpoint.c
sound/usb/misc/ua101.c
sound/usb/usx2y/usb_stream.c
sound/usb/usx2y/usbusx2yaudio.c
sound/usb/usx2y/usx2yhwdeppcm.c

index e2ca12fe92e946f662d47ae39983e176f7a50402..40dd50a80f55de653ffc30c2c4a4960c4d868025 100644 (file)
@@ -575,7 +575,6 @@ static void usb6fire_pcm_init_urb(struct pcm_urb *urb,
        urb->instance.pipe = in ? usb_rcvisocpipe(chip->dev, ep)
                        : usb_sndisocpipe(chip->dev, ep);
        urb->instance.interval = 1;
-       urb->instance.transfer_flags = URB_ISO_ASAP;
        urb->instance.complete = handler;
        urb->instance.context = urb;
        urb->instance.number_of_packets = PCM_N_PACKETS_PER_URB;
index 67330af21b0e09e86adae106cad40c266a7fb96e..c1916184e2e1e604955b19ba0f9ae23b4788cc2a 100644 (file)
@@ -683,7 +683,6 @@ static void read_completed(struct urb *urb)
 
        if (send_it) {
                out->number_of_packets = outframe;
-               out->transfer_flags = URB_ISO_ASAP;
                usb_submit_urb(out, GFP_ATOMIC);
        } else {
                struct snd_usb_caiaq_cb_info *oinfo = out->context;
@@ -699,7 +698,6 @@ requeue:
        }
 
        urb->number_of_packets = FRAMES_PER_URB;
-       urb->transfer_flags = URB_ISO_ASAP;
        usb_submit_urb(urb, GFP_ATOMIC);
 }
 
@@ -765,7 +763,6 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *cdev, int dir, int *ret)
                                                * BYTES_PER_FRAME;
                urbs[i]->context = &cdev->data_cb_info[i];
                urbs[i]->interval = 1;
-               urbs[i]->transfer_flags = URB_ISO_ASAP;
                urbs[i]->number_of_packets = FRAMES_PER_URB;
                urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ?
                                        read_completed : write_completed;
index 32d0b41a1ff6512643c7a83c72d1831f304bad91..7a444b5501d91d28a4e7e8fb5e044c2b4e7ea41b 100644 (file)
@@ -684,7 +684,7 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep,
                if (!u->urb->transfer_buffer)
                        goto out_of_memory;
                u->urb->pipe = ep->pipe;
-               u->urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP;
+               u->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
                u->urb->interval = 1 << ep->datainterval;
                u->urb->context = u;
                u->urb->complete = snd_complete_urb;
@@ -723,8 +723,7 @@ static int sync_ep_set_params(struct snd_usb_endpoint *ep,
                u->urb->transfer_dma = ep->sync_dma + i * 4;
                u->urb->transfer_buffer_length = 4;
                u->urb->pipe = ep->pipe;
-               u->urb->transfer_flags = URB_ISO_ASAP |
-                                        URB_NO_TRANSFER_DMA_MAP;
+               u->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
                u->urb->number_of_packets = 1;
                u->urb->interval = 1 << ep->syncinterval;
                u->urb->context = u;
index 8b81cb54026f9877d5c83a9a91b95ff1a8abde55..6ad617b947321b438d3ae1b1071364109747d379 100644 (file)
@@ -1120,8 +1120,7 @@ static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream,
                        usb_init_urb(&urb->urb);
                        urb->urb.dev = ua->dev;
                        urb->urb.pipe = stream->usb_pipe;
-                       urb->urb.transfer_flags = URB_ISO_ASAP |
-                                       URB_NO_TRANSFER_DMA_MAP;
+                       urb->urb.transfer_flags = URB_NO_TRANSFER_DMA_MAP;
                        urb->urb.transfer_buffer = addr;
                        urb->urb.transfer_dma = dma;
                        urb->urb.transfer_buffer_length = max_packet_size;
index 1e7a47a86605078d2934720f168da85cbf8145ce..bf618e1500acb3488193b90e6e7dc4469e22509d 100644 (file)
@@ -69,7 +69,6 @@ static void init_pipe_urbs(struct usb_stream_kernel *sk, unsigned use_packsize,
             ++u, transfer += transfer_length) {
                struct urb *urb = urbs[u];
                struct usb_iso_packet_descriptor *desc;
-               urb->transfer_flags = URB_ISO_ASAP;
                urb->transfer_buffer = transfer;
                urb->dev = dev;
                urb->pipe = pipe;
index 520ef96d7c75f14094c12ce4cc950e72c846c5d2..b37653247ef4e035b096153253b69ca0fd1e9a8b 100644 (file)
@@ -503,7 +503,6 @@ static int usX2Y_urbs_start(struct snd_usX2Y_substream *subs)
                        if (0 == i)
                                atomic_set(&subs->state, state_STARTING3);
                        urb->dev = usX2Y->dev;
-                       urb->transfer_flags = URB_ISO_ASAP;
                        for (pack = 0; pack < nr_of_packs(); pack++) {
                                urb->iso_frame_desc[pack].offset = subs->maxpacksize * pack;
                                urb->iso_frame_desc[pack].length = subs->maxpacksize;
index cc56007791e02192bd6176050a252b1eed2fc53a..f2a1acdc4d839f22eb7fa83d63b5f35ce367c5cd 100644 (file)
@@ -443,7 +443,6 @@ static int usX2Y_usbpcm_urbs_start(struct snd_usX2Y_substream *subs)
                                        if (0 == u)
                                                atomic_set(&subs->state, state_STARTING3);
                                        urb->dev = usX2Y->dev;
-                                       urb->transfer_flags = URB_ISO_ASAP;
                                        for (pack = 0; pack < nr_of_packs(); pack++) {
                                                urb->iso_frame_desc[pack].offset = subs->maxpacksize * (pack + u * nr_of_packs());
                                                urb->iso_frame_desc[pack].length = subs->maxpacksize;