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

Mikel Astiz mikel.astiz.oss at gmail.com
Mon Aug 27 08:24:10 PDT 2012


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 cdb0c92..3b94f00 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1702,6 +1702,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;
@@ -1768,6 +1771,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



More information about the pulseaudio-discuss mailing list