[pulseaudio-discuss] [PATCH v2 18/22] bluetooth: Avoid suspend-on-idle for HFGW

Mikel Astiz mikel.astiz.oss at gmail.com
Tue Jul 9 23:36:18 PDT 2013


Hi,

On Fri, Aug 31, 2012 at 12:51 PM, Mikel Astiz <mikel.astiz.oss at gmail.com> wrote:
> From: Mikel Astiz <mikel.astiz at bmw-carit.de>
>
> The hfgw card profile (headset role of the HFP Bluetooth profile) has
> some particularities that make it unsuitable for idle-timeout-based
> suspension.
>
> The motivation starts with the fact that the remote end (the phone) will
> report to the user whether the audio is being routed to the headset or
> not. However, several use-cases require that the user is not reported
> such condition: outband ringing, simulated held calls where the audio is
> just silenced, multi-phone use-cases, etc.
>
> Additionally, there are IOP issues: some phones do not handle correctly
> suspending and resuming SCO.
>
> Therefore this patch exploits a module-specific property such that
> module-suspend-on-idle will not suspend the sink and source of the
> hfgw card profile.
> ---
>  src/modules/bluetooth/module-bluetooth-device.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
> index 2d5c072..aac7e9d 100644
> --- a/src/modules/bluetooth/module-bluetooth-device.c
> +++ b/src/modules/bluetooth/module-bluetooth-device.c
> @@ -1723,6 +1723,9 @@ static int add_sink(struct userdata *u) {
>          pa_proplist_sets(data.proplist, "bluetooth.protocol", profile_to_string(u->profile));
>          if (u->profile == PROFILE_HSP)
>              pa_proplist_sets(data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
> +        else if (u->profile == PROFILE_HFGW)
> +            pa_proplist_sets(data.proplist, "module-suspend-on-idle.timeout", "3600");
> +
>          data.card = u->card;
>          data.name = get_name("sink", u->modargs, u->address, &b);
>          data.namereg_fail = b;
> @@ -1784,6 +1787,8 @@ static int add_source(struct userdata *u) {
>          pa_proplist_sets(data.proplist, "bluetooth.protocol", profile_to_string(u->profile));
>          if (u->profile == PROFILE_HSP)
>              pa_proplist_sets(data.proplist, PA_PROP_DEVICE_INTENDED_ROLES, "phone");
> +        else if (u->profile == PROFILE_HFGW)
> +            pa_proplist_sets(data.proplist, "module-suspend-on-idle.timeout", "3600");
>
>          data.card = u->card;
>          data.name = get_name("source", u->modargs, u->address, &b);
> --
> 1.7.7.6
>

Going through the list of non-merged patches, I came across this one.

IIRC it was nack-ed because such inter-module policies are
discouraged. Is there any other approach to solve this issue?

Most of the users won't care much about this issue if
module-bluetooth-policy is normally loaded, since it keeps a
module-loopback and thus the sink and source never enter idle.
However, when some alternative approach is used instead of
module-bluetooth-policy, the patch might become relevant.

One simple example to illustrate this problem is the ring-tone: some
setups require that a specific (user-defined) ring-tone is used when a
phone starts ringing, regardless of the ring-tone provided by the
phone (assuming this phone supports in-band ringing, e.g. iPhone).
During this time, the audio coming from the phone needs to be ignored
(source idle), but it can't be suspended because otherwise the phone
will start ringing because the audio is not being routed to the
headset (e.g. laptop or car).

Cheers,
Mikel


More information about the pulseaudio-discuss mailing list