From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alfredo" Subject: Little question about ALSA callbacks Date: Wed, 27 Jul 2005 11:28:26 +0200 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_6334_00018467.00000041" Return-path: Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: "alsa-devel@lists.sourceforge.net" List-Id: alsa-devel@alsa-project.org ------_=_NextPart_6334_00018467.00000041 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello, I have read the article "Introduction to Sound Programming with ALSA from Linux Journal. This article explains: // Starts here: ------------------------------------------------------------------------ ------------------------------------------- "In the previous examples, the PCM streams were operating in blocking mode, that is, the calls would not return until the data had been transferred. In an interactive event-driven application, this situation could lock up the application for unacceptably long periods of time. ALSA allows opening a stream in nonblocking mode where the read and write functions return immediately. If data transfers are pending and the calls cannot be processed, ALSA returns an error code of EBUSY. Many graphical applications use callbacks to handle events. ALSA supports opening a PCM stream in asynchronous mode. This allows registering a callback function to be called when a period of sample data has been transferred." // Finishes here: ------------------------------------------------------------------------ ------- I'm developing an event driven Linux server that will use ALSA library. Please, could you point me to some resources in order to learn how to use alsa in asynchronous mode (the event driven mechanism will be based in poll()). Clemens Ladisch helped me suggesting that I must use poll to wait for events in different file descriptors. I need to be notified when audio buffer has been recorded. I need to learn how to use ALSA in conjunction with poll. I'm a Linux developer beginner and I'm glad to use ALSA. Thank you very much ;-) ------_=_NextPart_6334_00018467.00000041 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello, I have read the article “Introductio= n to Sound Programming with ALSA from Linux Journal. This article explains:=

 

// Starts here: ---------------------------------------------------------------------------= ----------------------------------------

In the previous examples, th= e PCM streams were operating in blocking mode, that is, the calls would not retur= n until the data had been transferred. In an interactive event-driven application, this situation could lock up the application for unacceptably = long periods of time. ALSA allows opening a stream in nonblocking mode where the read and write functions return immediately. If data transfers are pending = and the calls cannot be processed, ALSA returns an error code of EBUSY.

Many graphical applications use callbacks to handle events. ALSA supports openin= g a PCM stream in asynchronous mode. This allows registering a callback functio= n to be called when a period of sample data has been transferred.<= font size=3D2 face=3DArial>

// Finishes here: ---------------------------------------------------------------------------= ----

I’m developing an event driven Linux server that will use ALSA library. Please, could you point me to some resources in order to learn how= to use alsa in asynchronous mode (the event driven mechanism will be based in poll()).

Clemens Ladisch helped me suggesting that I must use poll to wait fo= r events in different file descriptors. I need to be notified when audio buff= er has been recorded. I need to learn how to use ALSA in conjunction with poll= .

I’m a Linux developer beginner and I’m glad to use ALSA.=

Thank you very much ;-)

------_=_NextPart_6334_00018467.00000041-- ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click