Here's a patch that adds the idea of a stream "class" to alsa-streams. It's against alsa-plugins-1.0.14a. All it does is prepend the name of the ALSA stream with the class that you indicated. You can put a default class in the
asound.conf file, and also reconfigure it on the fly.<br><br>Asound.conf example:<br><br>pcm.pulse{<br> type pulse<br> class app<br>}<br><br>Runtime configuration example:<br><br><pre class="code c"><b class="lno">
<span style="font-weight: bold;"> </span>1:</b> <span class="kw4">int</span> err;<br><b class="lno"> 2:</b> snd_config_t* classconf;<br><b class="lno"> 3:</b><br><b class="lno"> 4:</b> snd_config_update<span class="br0">
(</span><span class="br0">)</span>;<br><b class="lno"> 5:</b> <span class="co1">//you can replace "pulse" with "default" if pulse is set up as your default device</span><br><b class="lno"> 6:</b> err=snd_config_search
<span class="br0">(</span>snd_config, <span class="st0">"pcm.pulse.class"</span>, &classconf<span class="br0">)</span>;<br><b class="lno"> 7:</b><br><b class="lno"> 8:</b> <span class="kw1">if</span><span class="br0">
(</span>!err<span class="br0">)</span><br><b class="lno"> 9:</b> snd_config_set_string<span class="br0">(</span>classconf, <span class="st0">"alert"</span><span class="br0">)</span>;<span class="co1"></span>
<br><b class="lno">10:</b> <span class="kw1">else</span><br><b class="lno">11:</b> <span class="br0">{</span><br><b class="lno">12:</b> snd_config_make<span class="br0">(</span>&classconf, <span class="st0">
"pcm.pulse.class"</span>, SND_CONFIG_TYPE_STRING<span class="br0">)</span>;<br><b class="lno">13:</b> snd_config_set_string<span class="br0">(</span>classconf, <span class="st0">"alert"</span><span class="br0">
)</span>;<span class="co1"></span><br><b class="lno">14:</b> snd_config_add<span class="br0">(</span>snd_config, classconf<span class="br0">)</span>;<br><b class="lno">15:</b> <span class="br0">}<br><br></span>
</pre>Let me know if you have any problems or questions. <br><br>Justin<br>