David Scrève wrote:
> > David Scrève wrote:
> > >   I've successfully been able to play one sound using the
> > > snd_pcm_open("plughw:0,0"...) and snd_pcm_writei, but if I want to
> > > play another sound, snd_pcm_open hangs and I'm unable to paly another
> > > sound. I though Alsa was responsible for mixing and hardware channel
> > > allocation ?
> >
> > Only if you use the right plugin for this. Try "plug:dmix"
> > instead of "plughw:0,0".
> >
> > >   I have a via_82xx Alsa driver, but it does not seems to handle
> > > severals pcm playback at the same time : I cannot open device with
> > > name "plughw:1,0","plughw:0,1",etc...
> >
> > See "aplay -l" for a list of PCM devices. The additional
> > streams on VIAxxx are subdevices of the first device IIRC, so
> > their name would be "plughw:0,0,0", "plughw:0,0,1" etc.
>
>       Does it mean I have to open "plughw:0,0,0", "plughw:0,0,1"...or
> "plug:dmix" ?

Use "plug:dmix". This default device for this is hw:0,0 which is just
fine because omitting the third number results in the first free
substream being opened.

>       I did not find any doc about device name with snd_pcm_open, and
> aplay -l does not list anything like plughw, etc...

aplay lists the card, device, and subdevice numbers. It doesn't list
plugin names because it's possible to stack any number of plugins in
various combinations on top of one hardware device.

(It does list all defined plugins with "aplay -L", but the syntax
isn't very well documented. YMMV.)

>       If I open "plughw:0,0,0", "plughw:0,0,1" for my via 686b,
> will it continue to work on other soundcard in the same way (with
> multiple stream with different format) ?

Many other cards don't have multiple streams, so it won't work.


The "correct" way to select an ALSA device is to let the user specify
a device name (which is defined in his .asoundrc), or to use
"default".


HTH
Clemens





-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps1
_______________________________________________
Alsa-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to