[pulseaudio-discuss] [V3 PATCH] module-switch-on-connect: add an argument for conditionally connecting

hwang4 hui.wang at canonical.com
Sun Sep 21 20:46:56 PDT 2014


Sorry, please ignore this patch, and a follow-up V4  will be sent.

On 2014年09月22日 11:26, Hui Wang wrote:
> 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
> Signed-off-by: Hui Wang <hui.wang at canonical.com>
> ---
> In the V3:
> if the get_value_boolean fails, release the resource and return -1
>
>   src/modules/module-switch-on-connect.c | 32 +++++++++++++++++++++++++++++++-
>   1 file changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/src/modules/module-switch-on-connect.c b/src/modules/module-switch-on-connect.c
> index d9275d3..66f3f9b 100644
> --- a/src/modules/module-switch-on-connect.c
> +++ b/src/modules/module-switch-on-connect.c
> @@ -38,11 +38,15 @@
<snip>
>   
> +    if (pa_modargs_get_value_boolean(ma, "only_from_unavailable", &u->only_from_unavailable) < 0) {
> +	pa_log ("Failed to get a boolean value for only_from_unavailable.");
Will remove the space before ("
> +	goto fail;
> +    }
> +
>       pa_modargs_free(ma);
>       return 0;
> +
> +fail:
> +    if (ma)
> +        pa_modargs_free(ma);
> +
> +    pa__done(m);
> +
> +    return -1;
>   }
>   
>   void pa__done(pa_module*m) {



More information about the pulseaudio-discuss mailing list