Hi,

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.  

Furthermore I have updated module-ladspa-sink to support multiple audio 
channels based on:
http://www.pulseaudio.org/attachment/ticket/410/pulseaudio-0.9.12-multichannel-ladspa.patch

Unfortunately I can not find much information about how to handle these "ports" 
in the source code. 
I can see that pavucontrol can switch between the ports and from the "info" 
command in pulseaudio I get:

1 sink(s) available.
  * index: 0
    name: <alsa_output.pci-0000_00_1b.0.analog-stereo>
    driver: <module-alsa-card.c>
    flags: HARDWARE HW_MUTE_CTRL HW_VOLUME_CTRL DECIBEL_VOLUME LATENCY 
DYNAMIC_LATENCY
...
    ports:
        analog-output: Analog Output (priority 9900)
        analog-output-speaker: Analog Speakers (priority 10000)
        analog-output-headphones: Analog Headphones (priority 9000)
    active port: <analog-output-headphones>
...

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?

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.  
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?

Perhaps you have a link to some source code where something similar has been 
done?

/Kim

                                          
_______________________________________________
pulseaudio-discuss mailing list
pulseaudio-discuss@mail.0pointer.de
https://tango.0pointer.de/mailman/listinfo/pulseaudio-discuss

Reply via email to