From b8eb563087ff8d4dcb945f5c2b6c56e5c68abab8 Mon Sep 17 00:00:00 2001 From: Thierry Bultel Date: Tue, 12 Feb 2019 13:10:31 +0100 Subject: bluez-alsa: added a patch of bug fix in the ioplug This adds an early patch for fixing the "stuck poll" issue when using the PCM ioplug. This patch has already been discussed with the bluez-alsa maintainer, and submitted as a pull request: https://github.com/Arkq/bluez-alsa/pull/184 Change-Id: I3cec6625b501025286878d9da2c782014b224d41 Signed-off-by: Thierry Bultel --- ...sa-pcm-bump-the-trigger-after-pcm-prepare.patch | 35 ++++++++++++++++++++++ .../bluez-alsa/bluez-alsa_git.bbappend | 3 +- 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa/0004-bluealsa-pcm-bump-the-trigger-after-pcm-prepare.patch (limited to 'meta-audio-4a-framework/recipes-connectivity/bluez-alsa') diff --git a/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa/0004-bluealsa-pcm-bump-the-trigger-after-pcm-prepare.patch b/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa/0004-bluealsa-pcm-bump-the-trigger-after-pcm-prepare.patch new file mode 100644 index 00000000..7befe733 --- /dev/null +++ b/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa/0004-bluealsa-pcm-bump-the-trigger-after-pcm-prepare.patch @@ -0,0 +1,35 @@ +From ba292e82928a6a0ea663039ba2d5c030c4cfa80d Mon Sep 17 00:00:00 2001 +From: Thierry Bultel +Date: Fri, 8 Feb 2019 10:21:55 +0100 +Subject: [PATCH] bluealsa-pcm: bump the trigger after pcm prepare + +When a sound application recovers from a EPIPE by calling +snd_pcm_prepare, and goes immediately after to a call to poll, +it would be stuck forever unless the internal event trigger +is bumped. + +Signed-off-by: Thierry Bultel +--- + src/asound/bluealsa-pcm.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/asound/bluealsa-pcm.c b/src/asound/bluealsa-pcm.c +index 42cb61d..4ccbf0d 100644 +--- a/src/asound/bluealsa-pcm.c ++++ b/src/asound/bluealsa-pcm.c +@@ -351,6 +351,12 @@ static int bluealsa_prepare(snd_pcm_ioplug_t *io) { + pcm->io_ptr = 0; + + debug("Prepared: %d", pcm->fd); ++ ++ /* When the sound application calls poll just after snd_pcm_prepare, ++ * it would block forever unless the internal trigger is bumped ++ * */ ++ eventfd_write(pcm->event_fd, 1); ++ + return 0; + } + +-- +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 70c731a6..ece43824 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 @@ -4,6 +4,7 @@ # the list of audio transports from bluez-alsa # - patch 2 makes the "debug" macro always display the caller name # - patch 3 asks dbus for a name like 'org.bluez-alsa.hciX' where hciX +# - patch 4 is a bug fix # name of the HCI interface that the bluealsa daemon instance is handling # # Notice that patch 2 will very likely be replaced by a full dbus interface @@ -15,4 +16,4 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" SRC_URI += "file://0001-build-and-link-with-a-shared-library.patch" SRC_URI += "file://0002-log-add-calling-function-name.patch" SRC_URI += "file://0003-dbus-request-a-name-on-startup.patch" - +SRC_URI += "file://0004-bluealsa-pcm-bump-the-trigger-after-pcm-prepare.patch" -- cgit 1.2.3-korg