[pulseaudio-discuss] PulseAudio and ALSA virtual devices

McArt, Terence terence.mcart at mobica.com
Wed Feb 29 10:51:36 PST 2012


Hi All,

Firstly apologies if my audio domain terminology is incorrect, I'm new to
the topic currently exploring ways to solve the task I have, and would like
to check that PulseAudio is the right tool for the job.

I'm currently looking to implement an audio switching solution on Meego
initially just taking inputs from multiple ALSA sources and controlling
which audio stream is currently the 'active' stream and routed to a single
output. Eventually I'll want to add in more complexity, by routing the
audio through custom sound effects modules (Echo cancellation and the
like), and by having a routing policy to make decisions based on the needs
of the sources, e.g. requires exclusive use of the single output, or can be
mixed together, etc.

My initial approach has been to create two virtual ALSA devices by editing
the /etc/asound.conf (or rather the default pulse file which is hooked to).

pcm.virtual01 {

type pulse

}

pcm.virtual02 {

type pulse

}

As an initial test I then played two audio tracks, one at each virtual
devices and fired up the 'pacmd' CLI to experiment with manipulating the
two sources.

If my understanding of what is happening is correct, both of these virtual
devices, (and indeed all the ALSA audio on the platform) are first collated
into an ALSA plugin which then feeds into PulseAudio.

With the CLI  I am able to see that the instances of the application used
to play the streams are identified as 'sink inputs', and I am able to mute
or re-route a sink input to a null output sink by means of the CLI commands.
However, the sink inputs are identified and manipulated by their index, and
I cannot seen any obvious way to map a sink input to the virtual ALSA
device source, as the source looks to be the ALSA plugin.

Ultimately I want to expose the switching functionality via a C++ API so
will need to accomplish this via the Async PulseAudio API.

Can PulseAudio form a framework for what I am trying to achieve or am I
misconstruing its purpose?

Regards,
Tez
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20120229/9c266577/attachment.htm>


More information about the pulseaudio-discuss mailing list