On Tue, 14 Jan 2003, Paul Davis wrote:

> >> that said, i think it would be great if this found its way into libasound.
> >
> >I wonder why to implement this function when one can link more pcm streams
> >with "snd_pcm_link()" together? Then polling one stream is sufficient when
> >streams are hardware synchronized.
> 
> why don't you go read the function in question and then consider
> whether that would actually accomplish anything like what it does? i
> say that because i don't think its even close. 

Why not? In the perfect world, when the hardware supports paralel start of 
multiple streams and application sets all equal parameters for all 
streams, the pointers to ring buffer are equal. Thus checking of only one 
stream is quite sufficient before r/w operation.

When hardware does not support paralel start, but the parts are running at 
same clock, then you can expect that last started stream in serialized 
start sequence (as ALSA driver does) has valid position and all other
streams, too.

And if clock are not synced, you cannot expect nothing and your code will 
fail later (when you don't do clock corrections), too.

So resume:

1) use snd_pcm_link to link all streams
2) start first linked stream (thus all in paralel or serial or combination 
   sequence)
3) poll the last stream handle for valid position

And you don't need your complicate function.

                                                Jaroslav

-----
Jaroslav Kysela <[EMAIL PROTECTED]>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs



-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving 
your online business a competitive advantage. Test-drive a Thawte SSL 
certificate - our easy online guide will show you how. Click here to get 
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to