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

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

 



Patrick Lai wrote:
> Data is transferred in chunk equal to period size.

Data is transferred in whatever chunk size the hardware uses.

The period size specifies when the hardware raises an interrupt.
If some application is blocking, this interrupt is the only mechanism
by which userspace is woken up.

> 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?

I guess you wouldn't ask if your hardware supported smaller periods? ;-)

Use non-blocking writes, and use some other timer to wait for the actual
data to be played.  (But if the hardware cannot report the current
playback position accurately, ALSA won't notice that the playback has
reached the end.)


Regards,
Clemens
_______________________________________________
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