<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
> Hmm, tricky problem. I'm not sure that the current setup with ladspa<BR>> sinks really allows this.<BR>> <BR>> I think that to do this, the actual sink created by the ladspa module<BR>> would have to be unloaded when a certain "port" was used by the sink it<BR>> connected to. This requires more smarts than it can currently cope with.<BR>> <BR>> > If it is not possible then how do I detect in my LADSPA plugin if the<BR>> > headphones are connected? I assume there is some API that I can use?<BR>> <BR>> Well, I think it would require rather a lot of hacking.<BR>> <BR>> In theory, this is what you need to do (I think):<BR>> <BR>> Write a PA module that is similar to the ladspa one. When it specifies<BR>> a master sink to use, you can (in the PA module code) inspect the port<BR>> currently selected for that sink and get notifications when that port<BR>> changes. Your module could sit there and wait for the "headphone" port<BR>> to be activated on the sink and only then create the actual virtual<BR>> ladpsa sink.<BR>> <BR>> At present the ladspa sink is created at module initialisation.<BR>> <BR>> The way I look at it there are two choices:<BR>> <BR>> 1. Modify module-ladspa-sink to have a "master_port" argument and make<BR>> it only create the virtual sink when the master sink's port matches the<BR>> argument value (and to unload it when it changes).<BR>> 2. Rewrite your ladspa plugin in PA using the git master virtual sink<BR>> as a basis for the code.<BR>> <BR>> <BR>> Even when this is all done, you will still not get everything working<BR>> 100% perfectly just yet. Jack sensing is (apparently - not looked for a<BR>> while) a mess and does not work reliably on all drivers. We need to fix<BR>> that and probably will enable automatic port switching on jack status in<BR>> due course. But until this comes in, when you plug in your headphones,<BR>> you have to manually change the port in pavucontrol (labelled connector<BR>> in gnome tools).<BR>> <BR>> Col<BR>
<BR>
Thank you for the answer.<BR>Do you think it would be possible and a good idea to make the DSP as a kernel module instead? <BR>
I want the DSP module to be usable in different linux distributions - also those that do not use PulseAudio by default. <BR>
<BR>
I also have another problem with module-ladspa-sink - it seems to only support mono, so I would have to change that as well.<BR><BR>
/Kim<BR>                                            </body>
</html>