subs->hwptr_done -= runtime->buffer_size * stride;
}
-static void copy_to_urb(struct snd_usb_substream *subs,
- struct urb *urb, int stride, unsigned int bytes)
+static void copy_to_urb(struct snd_usb_substream *subs, struct urb *urb,
+ int offset, int stride, unsigned int bytes)
{
struct snd_pcm_runtime *runtime = subs->pcm_substream->runtime;
/* err, the transferred area goes over buffer boundary. */
unsigned int bytes1 =
runtime->buffer_size * stride - subs->hwptr_done;
- memcpy(urb->transfer_buffer,
+ memcpy(urb->transfer_buffer + offset,
runtime->dma_area + subs->hwptr_done, bytes1);
- memcpy(urb->transfer_buffer + bytes1,
+ memcpy(urb->transfer_buffer + offset + bytes1,
runtime->dma_area, bytes - bytes1);
} else {
- memcpy(urb->transfer_buffer,
+ memcpy(urb->transfer_buffer + offset,
runtime->dma_area + subs->hwptr_done, bytes);
}
subs->hwptr_done += bytes;
subs->hwptr_done -= runtime->buffer_size * stride;
} else {
/* usual PCM */
- copy_to_urb(subs, urb, stride, bytes);
+ copy_to_urb(subs, urb, 0, stride, bytes);
}
/* update delay with exact number of samples queued */