summaryrefslogtreecommitdiffstats
path: root/meta-agl-devel/ATTIC/meta-audio-4a-framework/recipes-connectivity/bluez-alsa/bluez-alsa/0004-bluealsa-pcm-bump-the-trigger-after-pcm-prepare.patch
blob: 7befe7332576839c75c40a63e5cb948d1b6eb9c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From ba292e82928a6a0ea663039ba2d5c030c4cfa80d Mon Sep 17 00:00:00 2001
From: Thierry Bultel <thierry.bultel@iot.bzh>
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 <thierry.bultel@iot.bzh>
---
 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