* [PATCH 0/2] Init handsfree audio manager only for Bluez5
@ 2015-02-02 12:43 Tommi Kenakkala
2015-02-02 12:43 ` [PATCH 1/2] main: Remove handsfree audio manager init and cleanup Tommi Kenakkala
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Tommi Kenakkala @ 2015-02-02 12:43 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 478 bytes --]
Ofono should initialise Bluetooth handsfree SCO audio socket only
with Bluez5, not with Bluez4.
Here's one approach to work around the problem. Feel free to improve.
Tommi Kenakkala (2):
main: Remove handsfree audio manager init and cleanup
handsfree-audio: Init and cleanup audio manager on ref/unref calls
src/handsfree-audio.c | 16 ++++++++--------
src/main.c | 4 ----
2 files changed, 8 insertions(+), 12 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] main: Remove handsfree audio manager init and cleanup
2015-02-02 12:43 [PATCH 0/2] Init handsfree audio manager only for Bluez5 Tommi Kenakkala
@ 2015-02-02 12:43 ` Tommi Kenakkala
2015-02-02 12:43 ` [PATCH 2/2] handsfree-audio: Init and cleanup audio manager on ref/unref calls Tommi Kenakkala
2015-02-02 15:30 ` [PATCH 0/2] Init handsfree audio manager only for Bluez5 Denis Kenzior
2 siblings, 0 replies; 4+ messages in thread
From: Tommi Kenakkala @ 2015-02-02 12:43 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 704 bytes --]
Init allocates a SCO audio socket always. Ofono should do that
with bluez5 but not with bluez4.
---
src/main.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/main.c b/src/main.c
index d6349cb..46bb90b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -239,8 +239,6 @@ int main(int argc, char **argv)
__ofono_manager_init();
- __ofono_handsfree_audio_manager_init();
-
__ofono_plugin_init(option_plugin, option_noplugin);
g_free(option_plugin);
@@ -250,8 +248,6 @@ int main(int argc, char **argv)
__ofono_plugin_cleanup();
- __ofono_handsfree_audio_manager_cleanup();
-
__ofono_manager_cleanup();
__ofono_modemwatch_cleanup();
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] handsfree-audio: Init and cleanup audio manager on ref/unref calls
2015-02-02 12:43 [PATCH 0/2] Init handsfree audio manager only for Bluez5 Tommi Kenakkala
2015-02-02 12:43 ` [PATCH 1/2] main: Remove handsfree audio manager init and cleanup Tommi Kenakkala
@ 2015-02-02 12:43 ` Tommi Kenakkala
2015-02-02 15:30 ` [PATCH 0/2] Init handsfree audio manager only for Bluez5 Denis Kenzior
2 siblings, 0 replies; 4+ messages in thread
From: Tommi Kenakkala @ 2015-02-02 12:43 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1197 bytes --]
---
src/handsfree-audio.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 6f69fb3..14f65dc 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -845,6 +845,8 @@ void ofono_handsfree_audio_ref(void)
if (ref_count != 1)
return;
+ __ofono_handsfree_audio_manager_init();
+
if (!g_dbus_register_interface(ofono_dbus_get_connection(),
OFONO_MANAGER_PATH,
HFP_AUDIO_MANAGER_INTERFACE,
@@ -873,6 +875,8 @@ void ofono_handsfree_audio_unref(void)
agent_release(agent);
agent_free(agent);
}
+
+ __ofono_handsfree_audio_manager_cleanup();
}
int __ofono_handsfree_audio_manager_init(void)
@@ -882,15 +886,11 @@ int __ofono_handsfree_audio_manager_init(void)
void __ofono_handsfree_audio_manager_cleanup(void)
{
- if (ref_count == 0)
+ if (ref_count != 0)
return;
- ofono_error("Handsfree Audio manager not cleaned up properly,"
- "fixing...");
-
- ref_count = 1;
- ofono_handsfree_audio_unref();
-
- if (sco_watch > 0)
+ if (sco_watch > 0) {
g_source_remove(sco_watch);
+ sco_watch = 0;
+ }
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 0/2] Init handsfree audio manager only for Bluez5
2015-02-02 12:43 [PATCH 0/2] Init handsfree audio manager only for Bluez5 Tommi Kenakkala
2015-02-02 12:43 ` [PATCH 1/2] main: Remove handsfree audio manager init and cleanup Tommi Kenakkala
2015-02-02 12:43 ` [PATCH 2/2] handsfree-audio: Init and cleanup audio manager on ref/unref calls Tommi Kenakkala
@ 2015-02-02 15:30 ` Denis Kenzior
2 siblings, 0 replies; 4+ messages in thread
From: Denis Kenzior @ 2015-02-02 15:30 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 633 bytes --]
Hi Tommi,
On 02/02/2015 06:43 AM, Tommi Kenakkala wrote:
> Ofono should initialise Bluetooth handsfree SCO audio socket only
> with Bluez5, not with Bluez4.
> Here's one approach to work around the problem. Feel free to improve.
>
> Tommi Kenakkala (2):
> main: Remove handsfree audio manager init and cleanup
> handsfree-audio: Init and cleanup audio manager on ref/unref calls
>
> src/handsfree-audio.c | 16 ++++++++--------
> src/main.c | 4 ----
> 2 files changed, 8 insertions(+), 12 deletions(-)
>
Looks good to me. Applied after tweaking the commit messages.
Regards,
-Denis
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-02-02 15:30 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-02 12:43 [PATCH 0/2] Init handsfree audio manager only for Bluez5 Tommi Kenakkala
2015-02-02 12:43 ` [PATCH 1/2] main: Remove handsfree audio manager init and cleanup Tommi Kenakkala
2015-02-02 12:43 ` [PATCH 2/2] handsfree-audio: Init and cleanup audio manager on ref/unref calls Tommi Kenakkala
2015-02-02 15:30 ` [PATCH 0/2] Init handsfree audio manager only for Bluez5 Denis Kenzior
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox