On Tue, 24 Feb 2004, Kirk Bauer wrote:

> On Tue, 24 Feb 2004, Jaroslav Kysela wrote:
> 
> > Here is the most optimized way to create three devices without mixing of 
> > all 10 channels which your hardware (ICE1712) has:
> 
> > pcm.dmixer12 {
> >      type dmix
> >      ipc_key 1024
> >      slave {
> >         pcm "hw:0,0"
> >         period_time 0
> >         period_size 1024
> >         buffer_size 6553
> >         rate 44100          # set to your source rate
> >     }
> >     bindings.0 0
> >     bindings.1 1
> > }
> > 
> > pcm.channel12 {
> >     type plug
> >     slave.pcm "dmixer12"
> > }
> >
> > Explanation: The specified bindings also REDUCES the used channels (only 
> > destination channels are mixed). It's great speedup for your hardware.
> > 
> > Also, note that if you don't want mix sources, you may replace 'plug dmix'
> > with 'plug dshare'. It is also very good optimization.
> 
> Wow!  This changed everything... here I have three MP3s playing to the
> same output channel (for testing purposes).  Not only does it sound
> great and not skip like it was doing before, the CPU usage is next to
> nothing:
> 
> 30540 root       5 -20  2980 2980  2784 S <   3.5  0.7   0:04 mpg123
> 30566 root       4 -20  2480 2480  2284 S <   3.3  0.6   0:03 mpg123
> 30580 root       5 -20  2108 2108  1912 S <   3.1  0.5   0:02 mpg123
> 30567 root      12   0  1560 1300  1172 R     2.1  0.3   0:01 aplay
> 30541 root      11   0  1580 1320  1240 R     1.9  0.3   0:02 aplay
> 30581 root      13   0  1560 1300  1172 R     1.7  0.3   0:01 aplay
> 
> I tried everything I could do to get it to skip yet all three played to
> completion without problems!
> 
> I'd like to understand a little about what you changed to make this work
> so much better.  Now each stereo output has its own mixer instead of
> previously all outputs sharing a mixer?

Yes, exactly. The plug plugin figured that you have hardware with 10 
channels so it sent all 10 channels to dmix plugin (which is not exactly 
you wanted). The "auto" way may not be the "desired" way.

> What does sharing a mixer do for you?

Sorry? I don't understand this question.

> And it seems that 'dshare' just allows the two channels to be used as a
> pair and that is all?  I can't play more than one stream to the same

It's not limited to pair. You can divide your card to one stereo, and two 
surround streams with four channels for example.

> output device using dshare, which I guess is why I use dmix! :)

Yes, the dshare plugin creates exclusive devices routed to different 
channels (you can separate the device with many channels to devices with 
less number of channels).

The difference between dmix and dshare plugin is that dmix does 
sample mixing and dshare does sample copying which is far more
faster.

                                                Jaroslav

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


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Alsa-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to