summaryrefslogtreecommitdiffstats
path: root/meta-audio-4a-framework
diff options
context:
space:
mode:
Diffstat (limited to 'meta-audio-4a-framework')
-rw-r--r--meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa/0002-proxy-plugin-close-transport-when-null-device-is-set.patch46
-rw-r--r--meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa_git.bbappend1
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\
ont-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/bin/bash

################################################################################
#
# The MIT License (MIT)
#
# Copyright (c) 2016 Stéphane Desneux <sdx@iot.bzh>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
################################################################################

#################################################################################
#                              IMPORTANT NOTICE
#
# This script is a compatiblity script with previous (AGL 1.0) envsetup script
# It has been replaced by another script named "aglsetup.sh".
# 
################################################################################

# detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594
SOURCED=0
if [ -n "$ZSH_EVAL_CONTEXT" ]; then 
	[[ $ZSH_EVAL_CONTEXT =~ :file$ ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $0) && pwd -P); }
elif [ -n "$KSH_VERSION" ]; then
	[[ "$(cd $(dirname -- $0) && pwd -P)/$(basename -- $0)" != "$(cd $(dirname -- ${.sh.file}) && pwd -P)/$(basename -- ${.sh.file})" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- ${.sh.file}) && pwd -P); }
elif [ -n "$BASH_VERSION" ]; then
	[[ $0 != "$BASH_SOURCE" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $BASH_SOURCE) && pwd -P); }
fi

if [ $SOURCED -ne 1 ]; then
	unset SOURCED
	unset SOURCEDIR
	echo "Error: this script needs to be sourced in a supported shell" >&2
	echo "Please check that the current shell is bash, zsh or ksh and run this script as '. $0 <args>'" >&2
	return 1
else
	unset SOURCED
	if [ -z $1 ]; then
        echo -e "Usage: source envsetup.sh <board/device> [build dir]"
        return 1
	fi
	if [ -n "$2" ]; then
		BUILD_DIR="$2"
	else
		BUILD_DIR=build
	fi
	# echo "DEPRECATED..." | figlet -f big -w 80 -c
	cat <<'EOF' >&2
 ------------------------------------------------------------------------------
| using this script is...                                                      |
|   _____  ______ _____  _____  ______ _____       _______ ______ _____        |
|  |  __ \|  ____|  __ \|  __ \|  ____/ ____|   /\|__   __|  ____|  __ \       |
|  | |  | | |__  | |__) | |__) | |__ | |       /  \  | |  | |__  | |  | |      |
|  | |  | |  __| |  ___/|  _  /|  __|| |      / /\ \ | |  |  __| | |  | |      |
|  | |__| | |____| |    | | \ \| |___| |____ / ____ \| |  | |____| |__| | _ _  |
|  |_____/|______|_|    |_|  \_\______\_____/_/    \_\_|  |______|_____(_|_|_) |
|                                                                              |
| To support the newest/upcoming features, please use the script aglsetup.sh.  |
 ------------------------------------------------------------------------------
EOF
	. $SOURCEDIR/aglsetup.sh -m $1 -b $BUILD_DIR agl-devel agl-netboot agl-appfw-smack agl-demo
	rc=$?
	unset SOURCEDIR
	unset BUILD_DIR
	return $rc
fi