<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Hi,<br><br>Based on the advice from Colin Guthrie I am now trying to modify the module-ladspa-sink module so that it takes a "master_port" argument and only creates the virtual sink when the master sink's port matches the argument value (and unload it when it changes). I think it should be possible to leave the master_port argument out and let the functionality fall back to the original functionality to ensure backward compatibility.&nbsp; <br><br>Furthermore I have updated module-ladspa-sink to support multiple audio channels based on:<br>http://www.pulseaudio.org/attachment/ticket/410/pulseaudio-0.9.12-multichannel-ladspa.patch<br><br>Unfortunately I can not find much information about how to handle these "ports" in the source code. <br>I can see that pavucontrol can switch between the ports and from the "info" command in pulseaudio I get:<br><br>1 sink(s) available.<br>&nbsp; * index: 0<br>&nbsp;&nbsp;&nbsp; name: &lt;alsa_output.pci-0000_00_1b.0.analog-stereo&gt;<br>&nbsp;&nbsp;&nbsp; driver: &lt;module-alsa-card.c&gt;<br>&nbsp;&nbsp;&nbsp; flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY<br>...<br>&nbsp;&nbsp;&nbsp; ports:<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; analog-output: Analog Output (priority 9900)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; analog-output-speaker: Analog Speakers (priority 10000)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; analog-output-headphones: Analog Headphones (priority 9000)<br>&nbsp;&nbsp;&nbsp; active port: &lt;analog-output-headphones&gt;<br>...<br><br>But how do I update int pa__init(pa_module*m) to perform the port check? Which command should I use to ask PA which port is active?<br><br>I need to load the LADSPA module once right after PA has started. After that processing through the LADSPA module should only happen when audio is routed to the PC loudspeakers and not when something (like headphones) is connected to the PC output mini-jack. The user should not have to change anything - it should happen automatically.&nbsp; <br>Based on that how can I avoid creating the virtual sink if the master sink's port does not not match the argument (returning -1 in pa__init does not seem right as it will indicate an error)? How do you make it unload/load automatically as the headphone jack is plugged/unplugged?<br><br>Perhaps you have a link to some source code where something similar has been done?<br><br>/Kim<br><br>                                               </body>
</html>