[alsa-devel] How to apply rate conversion in asound.conf

Dolevo Jay cmst at live.com
Fri Nov 8 15:15:30 CET 2013





> Date: Wed, 6 Nov 2013 17:30:25 +0100
> From: clemens at ladisch.de
> To: cmst at live.com; alsa-devel at alsa-project.org
> Subject: Re: [alsa-devel] How to apply rate conversion in asound.conf
> 
> Dolevo Jay wrote:
> > pcm.!default {
> > 	type plug
> > 	slave.pcm multi
> > }
> >
> > pcm.multi {
> >         slaves.a.pcm "hw:0,1";
> >         slaves.b.pcm "hw:1,1";
> > ...
> >
> > My purpose is to apply rate conversion to the "hw:1,1" and have 44100 rate
> > out.
> 
> All slaves must use the same rate.
> 
> The easiest way is apply this to the plug plugin:
> 
> pcm.!default {
> 	type plug
> 	slave {
> 		pcm multi
> 		rate 44100
> 	}
> }
> 
> 
> Regards,
> Clemens
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel at alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

Hi,

What you suggested worked perfect but I implemented the rate conversion in my software for some specific reasons.
What I need to do now is to have a aosund.conf which has dmix into multi plugins together. 
So, here is my multi configuration:
--------------------------------
pcm.!default {
	type plug
	slave.pcm multi
}
 
pcm.multi {
        type multi;
        slaves.a.pcm "hw:0,1";
        slaves.a.channels 2;
        slaves.b.pcm "hw:1,1";
        slaves.b.channels 2;
 
        bindings.0.slave a;
        bindings.0.channel 0;
        bindings.1.slave a;
        bindings.1.channel 1;
        bindings.2.slave b;
        bindings.2.channel 0;
        bindings.3.slave b;
        bindings.3.channel 1;
}

--------------------------------
The following dmix runs ok for 1,1 hardware:
--------------------------------
pcm.dmixer {
    type dmix
    ipc_key 2048
    slave {
        pcm "hw:1,1"
    }
    bindings {
        0 0
        1 1
    }
}

pcm.!default {
    type plug
    slave.pcm dmixer
}
--------------------------------

Could you please tell me how I can implement the second configuration with dmixer into the first one which has multi. 
So, basically how can I call a plugin inside of another plugin?

Thanks a lot.

 		 	   		   		 	   		  


More information about the Alsa-devel mailing list