[pulseaudio-discuss] Pulseaudio with Application Asterisk

Jim Duda jim at duda.tzo.com
Sun Feb 3 13:38:09 PST 2008


I'm trying to use the Pulseaudio server on a machine which runs the 
Asterisk PBX application.  Asterisk can attach to ALSA using a console 
driver.  Basically, you call a phone extension and connect to an alsa 
driven sound card.

When I directly connect Asterisk to the sound card, everything works 
fine.  However, when I attempt to connect to the sound card through 
Pulseaudio, the Asterisk application will crash after making the second 
call connection.

The only evidence of something I currently see going wrong is that the 
alsa interface for Asterisk receives a -5 (-EIO) on a write to the alsa 
interface.  I don't know if that is the eventual cause of the crash.

I have the asterisk source code, and I understand where the alsa API 
interface is.  It looks very straight forward, much like any other alsa 
interface I've seen.  I'm certainly comfortable with modifying the code.

When attaching to the sound card through pulseaudio, I use these 
.asoundrc entries:

pcm.card0_record {
     type pulse
}

ctl.card0_record {
     type pulse
     sink alsa_output.hw_0
}

pcm.card0_playback {
     type pulse
}

ctl.card0_playback {
     type pulse
     source alsa_input.hw_0
}

my pulseaudio default.pa has these entries:

load-module module-detect
load-module module-native-protocol-unix auth-anonymous=1
load-module module-native-protocol-tcp auth-anonymous=1
load-module module-http-protocol-tcp
set-default-sink alsa_output.hw_0
set-default-source alsa_input.hw_0

I assume what is happening is that the Asterisk alsa interface needs to 
be adjusted to be more pulseaudio friendly.

How can I get started on figuring out what needs to be changed?

I read all the information on the wiki about writing clients and 
modules, but I'm not sure it applies to what I need to do.

Can anyone point me in the right direction?

Eventually, I'm hoping to be able to use Pulseaudio to be able to tunnel 
the audio from the Asterisk alsa console interface to a voice 
recognition application on either the same machine or another machine by 
routing the audio to a null-sink and attaching the listening application 
to the .monitor of that null-sink.

I've actually have this working, however, it's usage is not reliable 
since the Asterisk application keeps core dumping every other call.  I'm 
just trying to start simple by simply attempting to attach to the 
soundcard before I finalize the usage of the null-sink.

Thanks,

Jim




More information about the pulseaudio-discuss mailing list