aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorThierry Bultel <thierry.bultel@iot.bzh>2019-02-07 11:52:52 +0100
committerThierry Bultel <thierry.bultel@iot.bzh>2019-02-07 11:52:52 +0100
commit24391a4b6050819935f66897e49ffdb2fddc714a (patch)
tree8319720b6c3a44311cec54e32205f44ee6c014e7 /plugins
parentfbad8c202c86e4cf6503a99161aabf87ab7a7109 (diff)
hal-bluealsa: fixes the abort due to sync call in io eventhalibut_7.90.0halibut/7.90.07.90.0
The binder does not accept that synchronous calls are performed in the context of a systemd event, it makes is abort. To solve that, synchronous calls for creating/deleting bluetooth streams in the softmixer are simply here replaced by asynchronous calls. BUG-AGL: SPEC-2162 Change-Id: I4916d11cc904622449930365c5c09f67fe74425f Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/lib/bluealsa/hal-bluealsa.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/plugins/lib/bluealsa/hal-bluealsa.c b/plugins/lib/bluealsa/hal-bluealsa.c
index ebc0560..10a61ae 100644
--- a/plugins/lib/bluealsa/hal-bluealsa.c
+++ b/plugins/lib/bluealsa/hal-bluealsa.c
@@ -442,7 +442,6 @@ static int halBlueAlsaAttachTransportStreams(bluealsa_transport_t * transport) {
hal_bluealsa_plugin_data_t * pluginData=getPluginContext(plugin);
json_object* requestJ = NULL;
- json_object* returnJ = NULL;
json_object* sourceJ = NULL;
json_object* playbackJ = NULL;
@@ -562,16 +561,11 @@ static int halBlueAlsaAttachTransportStreams(bluealsa_transport_t * transport) {
/* In softmixer, this will create a transaction verb (whose name is transactionUidS),
* will be used later to destroy all the created objects upon transport removal */
- if (afb_api_call_sync(plugin->api, SMIXER_API_NAME, "attach", requestJ, &returnJ, NULL, NULL)) {
- AFB_API_ERROR(plugin->api, "Error calling attach verb of mixer" );
- goto done;
- }
+ /* a call sync is forbidden, because we in the context of an event io */
+ afb_api_call(plugin->api, SMIXER_API_NAME, "attach", requestJ, NULL, NULL);
transport->transactionUidS = transactionUidS;
- if (returnJ)
- json_object_put(returnJ);
-
ret = 0;
goto done;
@@ -587,7 +581,6 @@ static int halBluezAlsaRemoveTransportStream(bluealsa_transport_t * transport) {
CtlPluginT * plugin = transport->watch->plugin;
json_object* requestJ = NULL;
- json_object* returnJ = NULL;
AFB_API_INFO(plugin->api, "Call transaction detach verb %s", transport->transactionUidS);
if (transport->transactionUidS == NULL)
@@ -599,14 +592,8 @@ static int halBluezAlsaRemoveTransportStream(bluealsa_transport_t * transport) {
json_object_object_add(requestJ, "action", json_object_new_string("remove"));
- if (afb_api_call_sync(plugin->api, SMIXER_API_NAME, transport->transactionUidS, requestJ, &returnJ, NULL, NULL)) {
- AFB_API_ERROR(plugin->api, "Error calling attach verb of mixer" );
- goto fail;
- }
-
- if (returnJ)
- json_object_put(returnJ);
-
+ /* a call sync is forbidden, because we in the context of an event io */
+ afb_api_call(plugin->api, SMIXER_API_NAME, transport->transactionUidS, requestJ, NULL, NULL);
return 0;
fail: