lkml.org 
[lkml]   [2010]   [May]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [alsa-devel] USB transfer_buffer allocations on 64bit systems
Date
Am Freitag, 7. Mai 2010 13:42:34 schrieb Oliver Neukum:
> Am Freitag, 7. Mai 2010 11:47:37 schrieb Clemens Ladisch:
> > > In the particular case of audio drivers, though, the contents of the
> > > buffers are likely to change after the submission. What we do here
> > > is that we map the audio stream buffers which are used by ALSA to
> > > the output URBs, so they're filled asychronously. Once the buffer is
> > > actually sent out on the bus, it is believed to contain proper audio
> > > date. If it doesn't, that's due to too tight audio timing or other
> > > problems. This breaks once buffers are magically bounced in the
> > > background.
> >
> > At least the audio class and ua101 drivers don't do this and fill the
> > buffers before they are submitted.
> >
> > > So - long story short: these audio buffers need to be DMA coherent.
> >
> > Does the USB API actually guarantee that all controllers use DMA, i.e.,
> > that the buffers can be filled after submission?
>
> No, you must not touch buffers after submission. This does not even
> work if we use DMA, because on some architectures this violates
> guarantees to the dma primitives. It cannot be done.

Or to be precise it could be done with coherent memory, but you'd risk
transfering partially updated buffers, as you cannot know when DMA will
be done and we don't guarantee that DMA will be done right as we transfer.

Regards
Oliver


\
 
 \ /
  Last update: 2010-05-07 13:51    [from the cache]
©2003-2011 Jasper Spaans