From 104ca04438957ca5524786654464697273ef30e1 Mon Sep 17 00:00:00 2001 From: Adam Miartus Date: Thu, 20 Feb 2020 14:17:59 +0100 Subject: [PATCH] QTISA-195 alsa: qnx call plugin flush for every device separately snd_pcm_plugin_flush will not flush all linked devices on qnx, each device has to be flushed separately Change-Id: Ie2921ecc9d9f7cdd88e6b80f6a51e7d7bfd3d954 Signed-off-by: Adam Miartus (cherry picked from commit 8ff259557563bbc9098c5d5435228a51e2b0c4bf) Signed-off-by: Timo Wischer --- linux/alsa/alsa_driver.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/linux/alsa/alsa_driver.c b/linux/alsa/alsa_driver.c index 43d6d484..7aa19899 100644 --- a/linux/alsa/alsa_driver.c +++ b/linux/alsa/alsa_driver.c @@ -1766,14 +1766,14 @@ alsa_driver_stop (alsa_driver_t *driver) continue; } - if (device->capture_linked) { - group_done = 1; - } - #ifdef __QNXNTO__ /* In case of capture: Flush discards the frames */ err = snd_pcm_plugin_flush(device->capture_handle, SND_PCM_CHANNEL_CAPTURE); #else + if (device->capture_linked) { + group_done = 1; + } + err = snd_pcm_drop (device->capture_handle); #endif if (err < 0) { @@ -1796,14 +1796,14 @@ alsa_driver_stop (alsa_driver_t *driver) continue; } - if (device->playback_linked) { - group_done = 1; - } - #ifdef __QNXNTO__ /* In case of playback: Drain discards the frames */ err = snd_pcm_plugin_playback_drain(device->playback_handle); #else + if (device->playback_linked) { + group_done = 1; + } + err = snd_pcm_drop (device->playback_handle); #endif if (err < 0) {