<div>Hi All,</div><div><br></div><div>Firstly apologies if my audio domain terminology is incorrect, I&#39;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.</div>

<div><br></div>I&#39;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 &#39;active&#39; stream and routed to a single output. Eventually I&#39;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.<div>

<br></div><div>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).</div><div><br></div><div><font face="&#39;courier new&#39;, monospace">pcm.virtual01 {</font></div>

<div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="&#39;courier new&#39;, monospace">type pulse</font></div></blockquote><font face="&#39;courier new&#39;, monospace">}</font></div><div><font face="&#39;courier new&#39;, monospace"><br>

</font></div><div><font face="&#39;courier new&#39;, monospace">pcm.virtual02 {</font></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><font face="&#39;courier new&#39;, monospace">type pulse</font></div>

</blockquote><div><font face="&#39;courier new&#39;, monospace">}</font></div><div><font face="&#39;courier new&#39;, monospace"><br></font></div><div><font face="arial, helvetica, sans-serif">As an initial test I then played two audio tracks, one at each virtual devices and fired up the &#39;pacmd&#39; CLI to experiment with manipulating the two sources.</font></div>

<div><font face="arial, helvetica, sans-serif"><br></font></div><div><span style="font-family:arial,helvetica,sans-serif">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.</span></div>

<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">With the CLI  I am able to see that the instances of the application used to play the streams are identified as &#39;sink inputs&#39;, and I am able to mute or re-route a sink input to a null output sink by means of the CLI commands.</font></div>

<div><span style="font-family:arial,helvetica,sans-serif">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.</span></div>

<div><span style="font-family:arial,helvetica,sans-serif"><br></span></div><div><span style="font-family:arial,helvetica,sans-serif">Ultimately I want to expose the switching functionality via a C++ API so will need to accomplish this via the Async PulseAudio API.</span></div>

<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Can PulseAudio form a framework for what I am trying to achieve or am I misconstruing its purpose?</font></div>

<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Regards,</font></div><div><font face="arial, helvetica, sans-serif">Tez</font></div>