Re: Handle large period size end-of-stream situation

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

 



On 04/03/2013 08:07 AM, Patrick Lai wrote:
I am dealing with a use case requiring passing large buffer down to the
DSP. Application in the user-space passes PCM through mmap interface.
Per my understanding, ALSA is designed to work with DMA. Data is
transferred in chunk equal to period size. At the end of playback,
there may not be enough audio data left in the music stream to fill
entire period. If remaining audio data only takes up very small chunk
of period, playback takes longer to stop. Given that period size I have
to deal with is quite large, this problem is observed easily. If my
understanding is correct, what is the standard/recommended way of
handling end of stream case?

In the typical end-of-stream case, you simply write the data that you have. When the hw pointer catches up to the application pointer, you get an XRUN and the stream stops immediately. There's no requirement that streams have to stop on period boundaries.

-gabriel

_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxx
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel




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

  Powered by Linux