Commit ff865cae authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Greg Kroah-Hartman

ALSA: USB: adjust for changed 3.8 USB API

commit c75c5ab5 upstream.

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: default avatarJoe Rayhawk <jrayhawk@fairlystable.org>
Signed-off-by: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 62d585f3
...@@ -575,7 +575,6 @@ static void usb6fire_pcm_init_urb(struct pcm_urb *urb, ...@@ -575,7 +575,6 @@ static void usb6fire_pcm_init_urb(struct pcm_urb *urb,
urb->instance.pipe = in ? usb_rcvisocpipe(chip->dev, ep) urb->instance.pipe = in ? usb_rcvisocpipe(chip->dev, ep)
: usb_sndisocpipe(chip->dev, ep); : usb_sndisocpipe(chip->dev, ep);
urb->instance.interval = 1; urb->instance.interval = 1;
urb->instance.transfer_flags = URB_ISO_ASAP;
urb->instance.complete = handler; urb->instance.complete = handler;
urb->instance.context = urb; urb->instance.context = urb;
urb->instance.number_of_packets = PCM_N_PACKETS_PER_URB; urb->instance.number_of_packets = PCM_N_PACKETS_PER_URB;
......
...@@ -670,7 +670,6 @@ static void read_completed(struct urb *urb) ...@@ -670,7 +670,6 @@ static void read_completed(struct urb *urb)
if (send_it) { if (send_it) {
out->number_of_packets = outframe; out->number_of_packets = outframe;
out->transfer_flags = URB_ISO_ASAP;
usb_submit_urb(out, GFP_ATOMIC); usb_submit_urb(out, GFP_ATOMIC);
} else { } else {
struct snd_usb_caiaq_cb_info *oinfo = out->context; struct snd_usb_caiaq_cb_info *oinfo = out->context;
...@@ -686,7 +685,6 @@ static void read_completed(struct urb *urb) ...@@ -686,7 +685,6 @@ static void read_completed(struct urb *urb)
} }
urb->number_of_packets = FRAMES_PER_URB; urb->number_of_packets = FRAMES_PER_URB;
urb->transfer_flags = URB_ISO_ASAP;
usb_submit_urb(urb, GFP_ATOMIC); usb_submit_urb(urb, GFP_ATOMIC);
} }
...@@ -751,7 +749,6 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret) ...@@ -751,7 +749,6 @@ static struct urb **alloc_urbs(struct snd_usb_caiaqdev *dev, int dir, int *ret)
* BYTES_PER_FRAME; * BYTES_PER_FRAME;
urbs[i]->context = &dev->data_cb_info[i]; urbs[i]->context = &dev->data_cb_info[i];
urbs[i]->interval = 1; urbs[i]->interval = 1;
urbs[i]->transfer_flags = URB_ISO_ASAP;
urbs[i]->number_of_packets = FRAMES_PER_URB; urbs[i]->number_of_packets = FRAMES_PER_URB;
urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ? urbs[i]->complete = (dir == SNDRV_PCM_STREAM_CAPTURE) ?
read_completed : write_completed; read_completed : write_completed;
......
...@@ -677,7 +677,7 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep, ...@@ -677,7 +677,7 @@ static int data_ep_set_params(struct snd_usb_endpoint *ep,
if (!u->urb->transfer_buffer) if (!u->urb->transfer_buffer)
goto out_of_memory; goto out_of_memory;
u->urb->pipe = ep->pipe; 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->interval = 1 << ep->datainterval;
u->urb->context = u; u->urb->context = u;
u->urb->complete = snd_complete_urb; u->urb->complete = snd_complete_urb;
...@@ -716,8 +716,7 @@ static int sync_ep_set_params(struct snd_usb_endpoint *ep, ...@@ -716,8 +716,7 @@ static int sync_ep_set_params(struct snd_usb_endpoint *ep,
u->urb->transfer_dma = ep->sync_dma + i * 4; u->urb->transfer_dma = ep->sync_dma + i * 4;
u->urb->transfer_buffer_length = 4; u->urb->transfer_buffer_length = 4;
u->urb->pipe = ep->pipe; u->urb->pipe = ep->pipe;
u->urb->transfer_flags = URB_ISO_ASAP | u->urb->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
URB_NO_TRANSFER_DMA_MAP;
u->urb->number_of_packets = 1; u->urb->number_of_packets = 1;
u->urb->interval = 1 << ep->syncinterval; u->urb->interval = 1 << ep->syncinterval;
u->urb->context = u; u->urb->context = u;
......
...@@ -1120,8 +1120,7 @@ static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream, ...@@ -1120,8 +1120,7 @@ static int alloc_stream_urbs(struct ua101 *ua, struct ua101_stream *stream,
usb_init_urb(&urb->urb); usb_init_urb(&urb->urb);
urb->urb.dev = ua->dev; urb->urb.dev = ua->dev;
urb->urb.pipe = stream->usb_pipe; urb->urb.pipe = stream->usb_pipe;
urb->urb.transfer_flags = URB_ISO_ASAP | urb->urb.transfer_flags = URB_NO_TRANSFER_DMA_MAP;
URB_NO_TRANSFER_DMA_MAP;
urb->urb.transfer_buffer = addr; urb->urb.transfer_buffer = addr;
urb->urb.transfer_dma = dma; urb->urb.transfer_dma = dma;
urb->urb.transfer_buffer_length = max_packet_size; urb->urb.transfer_buffer_length = max_packet_size;
......
...@@ -69,7 +69,6 @@ static void init_pipe_urbs(struct usb_stream_kernel *sk, unsigned use_packsize, ...@@ -69,7 +69,6 @@ static void init_pipe_urbs(struct usb_stream_kernel *sk, unsigned use_packsize,
++u, transfer += transfer_length) { ++u, transfer += transfer_length) {
struct urb *urb = urbs[u]; struct urb *urb = urbs[u];
struct usb_iso_packet_descriptor *desc; struct usb_iso_packet_descriptor *desc;
urb->transfer_flags = URB_ISO_ASAP;
urb->transfer_buffer = transfer; urb->transfer_buffer = transfer;
urb->dev = dev; urb->dev = dev;
urb->pipe = pipe; urb->pipe = pipe;
......
...@@ -503,7 +503,6 @@ static int usX2Y_urbs_start(struct snd_usX2Y_substream *subs) ...@@ -503,7 +503,6 @@ static int usX2Y_urbs_start(struct snd_usX2Y_substream *subs)
if (0 == i) if (0 == i)
atomic_set(&subs->state, state_STARTING3); atomic_set(&subs->state, state_STARTING3);
urb->dev = usX2Y->dev; urb->dev = usX2Y->dev;
urb->transfer_flags = URB_ISO_ASAP;
for (pack = 0; pack < nr_of_packs(); pack++) { for (pack = 0; pack < nr_of_packs(); pack++) {
urb->iso_frame_desc[pack].offset = subs->maxpacksize * pack; urb->iso_frame_desc[pack].offset = subs->maxpacksize * pack;
urb->iso_frame_desc[pack].length = subs->maxpacksize; urb->iso_frame_desc[pack].length = subs->maxpacksize;
......
...@@ -443,7 +443,6 @@ static int usX2Y_usbpcm_urbs_start(struct snd_usX2Y_substream *subs) ...@@ -443,7 +443,6 @@ static int usX2Y_usbpcm_urbs_start(struct snd_usX2Y_substream *subs)
if (0 == u) if (0 == u)
atomic_set(&subs->state, state_STARTING3); atomic_set(&subs->state, state_STARTING3);
urb->dev = usX2Y->dev; urb->dev = usX2Y->dev;
urb->transfer_flags = URB_ISO_ASAP;
for (pack = 0; pack < nr_of_packs(); pack++) { 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].offset = subs->maxpacksize * (pack + u * nr_of_packs());
urb->iso_frame_desc[pack].length = subs->maxpacksize; urb->iso_frame_desc[pack].length = subs->maxpacksize;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment