Re: non-blocking mode example

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

 



ThomasJF wrote:
> I have read a file to buffer with "allframes".
>
> 1.) Do I use snd_pcm_writei(...) with a size of "allframes" or loop it
>     with smaller packages (periodsize)

In blocking mode, the call would be able to write all bytes, eventually.
But in non-blocking mode, it is never possible to write more than the
buffer size immediately.  So if you try with more frames, the function
will write as much as it can, and you have to retry with the remaining
frames later anyway.

> 2.) What are the actual functions to get the interrupt and send the
>     frames needed into the ringbuffer (standard I/O or select)?

The snd_pcm_writei() call sends the frames to the buffer.  The
notification that the device is ready (i.e., that there is enough free
space in the buffer to write more samples) comes through any of the
file-handle-waiting functions (select, poll, epoll).


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