[pulseaudio-discuss] Routing of audio to loudspeakers or headphones

Kim Therkelsen kim_t26 at hotmail.com
Wed Aug 25 00:47:18 PDT 2010

> Hmm, tricky problem. I'm not sure that the current setup with ladspa
> sinks really allows this.
> I think that to do this, the actual sink created by the ladspa module
> would have to be unloaded when a certain "port" was used by the sink it
> connected to. This requires more smarts than it can currently cope with.
> > If it is not possible then how do I detect in my LADSPA plugin if the
> > headphones are connected? I assume there is some API that I can use?
> Well, I think it would require rather a lot of hacking.
> In theory, this is what you need to do (I think):
> Write a PA module that is similar to the ladspa one. When it specifies
> a master sink to use, you can (in the PA module code) inspect the port
> currently selected for that sink and get notifications when that port
> changes. Your module could sit there and wait for the "headphone" port
> to be activated on the sink and only then create the actual virtual
> ladpsa sink.
> At present the ladspa sink is created at module initialisation.
> The way I look at it there are two choices:
> 1. Modify module-ladspa-sink to have a "master_port" argument and make
> it only create the virtual sink when the master sink's port matches the
> argument value (and to unload it when it changes).
> 2. Rewrite your ladspa plugin in PA using the git master virtual sink
> as a basis for the code.
> Even when this is all done, you will still not get everything working
> 100% perfectly just yet. Jack sensing is (apparently - not looked for a
> while) a mess and does not work reliably on all drivers. We need to fix
> that and probably will enable automatic port switching on jack status in
> due course. But until this comes in, when you plug in your headphones,
> you have to manually change the port in pavucontrol (labelled connector
> in gnome tools).
> Col


Thank you for the answer.
Do you think it would be possible and a good idea to make the DSP as a kernel module instead? 

I want the DSP module to be usable in different linux distributions - also those that do not use PulseAudio by default. 


I also have another problem with module-ladspa-sink - it seems to only support mono, so I would have to change that as well.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/pulseaudio-discuss/attachments/20100825/17669c3b/attachment.htm>

More information about the pulseaudio-discuss mailing list