module-switch-on-connect: add an argument for conditionally connecting

System Internals / PulseAudio - Hui Wang [canonical.com] - 22 September 2014 06:26 UTC

On a machine without fixed connecting audio devices like internal microphone or internal speaker, and when there is no external audio devices plugging in, the default source/sink is alsa_input/alsa_output and there is no input devices/output devices listed in the gnome sound-setting.

Under this situation, if we connect a bluetooth headset, the gnome sound-setting will list bluez input/output devices, but they are not active devices by default. This looks very weird that sound-setting lists only one input device and one output device, but they are not active. To change this situation, we add an argument, the policy is if a new source/sink is connected and current default source/sink's active_port is AVAILABLE_NO, we let the new added one switch to default one.

BugLink: http://bugs.launchpad.net/bugs/1369476

1ff4f1b module-switch-on-connect: add an argument for conditionally connecting
src/modules/module-switch-on-connect.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share