On Tue, Sep 20, 2011 at 03:07:49PM +0800, Lin, Mengdong wrote: > I want to switch to the loud speaker/mike (hand-free) during a phone call without unplugging my wired headset. And the wired-headset and speaker/mike are two ports of the ALSA sink/source on my platform. > > Does PA provide an API that can to set the active port on a sink/source? > I only found the API to set sink/source "pa_context_set_default_sink" but no API to set the port. Check PROTOCOL file gives me back: ~~~~~ ### v16, implemented by >= 0.9.15 new messages: PA_COMMAND_SET_SINK_PORT PA_COMMAND_SET_SOURCE_PORT ~~~~~ And the corresponding pa_context_set_sink_port_by_index is possibly what you want. -- guanqun