[alsa-devel] Application and hw mixing for VoIP

Fabien COMTE fabien.comte at ercogener.com
Thu Sep 17 11:51:33 CEST 2009

I need some help please.
I have an application that does VoIP and use OSS emulated interface.

I want to :
- send through VoIP application a mixed sound from mic and an another
application (aplay should be ok for testing).

mic ----------------->
                         mix  ---- oss emulation -----> voip application
application 1 ------->

- use sound received from VoIP with HP output and an another application
(arecord should be ok for testing).

                                                  ---------> application 2
voip application ----- oss emulation ---->  copy
                                                  ---------> HP output

I tried a lot of asoundrc but they doesn't work. Every try I did, Dsnoop
cannot mix sound for application 1 and copy is already in use.

Could someone help me ?

# wm8731 is the name of my hardware codec
pcm_slave.wm8731 {
	type hw
	card 0
	device 0

pcm.from_voip {
       ipc_key 1025
       type dmix
       slave.pcm wm8731 
   #one called "to_voip" for capturing 
   pcm.to_voip {
       ipc_key 1027
       type dsnoop
       slave.pcm wm8731 
   #and this is the real magic
   pcm.temp_voip {
       type asym
       playback.pcm "from_voip"
       capture.pcm "to_voip"
   #a quick plug plugin for above device to do the converting magic
   pcm.voip {
       type plug
       slave.pcm "temp_voip"
   #a ctl device to keep xmms happy
   ctl.voip {
       type hw
       card 0
   #for aoss:
   pcm.dsp0 {
       type plug
       slave.pcm "voip"
   ctl.mixer0 {
       type hw
       card 0

   pcm.from_voip_copy {
	type plug
	slave from_voip
	route_policy copy

Thank you.


More information about the Alsa-devel mailing list