diff options
author | Thierry Bultel <thierry.bultel@iot.bzh> | 2018-09-10 15:04:34 +0200 |
---|---|---|
committer | Stéphane Desneux <stephane.desneux@iot.bzh> | 2018-09-13 17:46:52 +0000 |
commit | e2823687d14f5183fcb1370897bb1dc386a3cd39 (patch) | |
tree | a176f2ee1496e3d4a383e37d8db83e445b6323a3 /meta-audio-4a-framework/recipes-connectivity/bluez-alsa | |
parent | 779c5e0a06a872f962645a0e384a07a7bd0a7152 (diff) |
bluez-alsa: added patch for null device
This closes the transport connection when a null device is
specified.
Change-Id: I6d69c68a2ca91bd9fb3d7fdf51f470f243e76d5f
Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh>
(cherry picked from commit 7e06277dd1389b1ca08ec390040adf792c6a14fa)
Diffstat (limited to 'meta-audio-4a-framework/recipes-connectivity/bluez-alsa')
2 files changed, 47 insertions, 0 deletions
diff --git a/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa/0002-proxy-plugin-close-transport-when-null-device-is-set.patch b/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa/0002-proxy-plugin-close-transport-when-null-device-is-set.patch new file mode 100644 index 00000000..d21555ea --- /dev/null +++ b/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa/0002-proxy-plugin-close-transport-when-null-device-is-set.patch @@ -0,0 +1,46 @@ +From 39f578d2c44fef9fd2e105eb7594a2d249152e63 Mon Sep 17 00:00:00 2001 +From: Thierry Bultel <thierry.bultel@iot.bzh> +Date: Mon, 10 Sep 2018 14:56:14 +0200 +Subject: [PATCH] proxy plugin: close transport when null device is set + +Simply closes the transport when bluealsa_proxy_set_remote_device +specifies a null device. +Also removed spurious log. + +Signed-off-by: Thierry Bultel <thierry.bultel@iot.bzh> +--- + src/asound/bluealsa-pcm-proxy.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) + +diff --git a/src/asound/bluealsa-pcm-proxy.c b/src/asound/bluealsa-pcm-proxy.c +index 4abab2b..7c59cd1 100644 +--- a/src/asound/bluealsa-pcm-proxy.c ++++ b/src/asound/bluealsa-pcm-proxy.c +@@ -130,7 +130,7 @@ static void *io_thread(void *arg) { + + wait_pcm_fd: + +- debug("PLUGIN io-thread: wait for pcm_fd\n"); ++ //debug("PLUGIN io-thread: wait for pcm_fd\n"); + + /* In the capture mode, the PCM FIFO is opened in the non-blocking mode. + * So right now, we have to synchronize write and read sides, otherwise +@@ -784,7 +784,14 @@ int bluealsa_proxy_set_remote_device(const char * interface, const char * device + + enum pcm_type type; + +- if (device == NULL || str2ba(device, &the_pcm->addr) != 0) { ++ /* When the hardware address is NULL, just close the connection */ ++ if (device == NULL ) { ++ close_bluez_connection(); ++ ret = 0; ++ goto failed; ++ } ++ ++ if ( str2ba(device, &the_pcm->addr) != 0) { + SNDERR("Invalid BT device address: %s", device); + ret = -EINVAL; + goto failed; +-- +2.16.4 + diff --git a/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa_git.bbappend b/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa_git.bbappend index 0c2ddee4..ecb73b34 100644 --- a/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa_git.bbappend +++ b/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa_git.bbappend @@ -3,6 +3,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://0001-Added-a-connection-proxy-plugin.patch" +SRC_URI += "file://0002-proxy-plugin-close-transport-when-null-device-is-set.patch" FILES_${PN} += "\ ${libdir}/alsa-lib/libasound_module_pcm_bluealsa_proxy.so\ |