Re: DMA Transfer Synchronization Issue in Out-of-Tree Sound Card Driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 21 May 2024 20:32:59 +0200,
Mark Brown wrote:
> 
> On Tue, May 21, 2024 at 10:31:12AM +0200, Louis Chauvet wrote:
> 
> > To address this DMA issue, I have created a patch [1] that guarantees the 
> > completion of the DMA transfer upon the return of xdma_synchronize. This 
> > means xdma_synchronize now sleeps, but looking at other drivers around it 
> > appears expected to be able to do so.
> 
> You need to set the nonatomic flag for the PCM to allow this, the
> default is that triggers run in atomic context.

Right, that's a most straightforward solution.  It implies that the
period updates must be in non-atomic, i.e. use a threaded irq handler
in most cases.

If the synchronization is needed for assuring the hardware stop, there
is an alternative with PCM sync_stop callback, too.  The callback is
called at each time after a stream gets stopped before the next action
(that is, either prepare, hw_params or close).  It's only for
stopping, and there is no similar way for sync of a stream start,
though.


thanks,

Takashi



[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux