At Tue, 25 Mar 2003 18:24:13 +0100 (CET),
Giuliano Pochini wrote:
> 
> snd_pcm_new() has two parameters for the number of substreams
> for playback and capture. Yes, but what does it mean ? If I
> have N playback substreams, can I service N applications that
> use one stream ? Can channels be allocated on demand, to allow
> the user to use 4 xmms or 1 xmms and a dvd player (5.1) at the
> same time ? :)) It's quite useless... I'm just curious.
> Also snd_pcm_new() can create multiple pcm interfaces. SP/DIF
> and ADAT i/o need a pcm instance too, isn't it ?

well, the term "stream" is a bit confusing.

in ALSA, the term "pcm stream" defines the direction of pcm, either
playback or capture.  hence, there are at most two streams per pcm
instance.

the "pcm substreams" belong to each pcm stream.  when you open a pcm
device, one pcm substream will be used at each time.
snd_pcm_new() takes the argument how many pcm substreams are created
for each pcm stream.  you can give more than one here only if the
hardware supports multiple-playback/capture, such as emu10k1.
otherwise, these arguments must be 1 or 0.

for the multiple-playback/capture, each created substream is numbered
from 0 to (N-1).  if you open the pcm without specifying the substream
number, the empty substream is searched and assigned to be opened.  if
you specify the substream number (e.g. "hw:0,0,2"), the specified
substream is tried for open (the substream #2 in the example).

again, if the HARDWARE supports the multiple open, you can play 4 xmms
simultaneously.  if it doesn't, dmix plugin is your friend.


Takashi


-------------------------------------------------------
This SF.net email is sponsored by:
The Definitive IT and Networking Event. Be There!
NetWorld+Interop Las Vegas 2003 -- Register today!
http://ads.sourceforge.net/cgi-bin/redirect.pl?keyn0001en
_______________________________________________
Alsa-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-devel

Reply via email to