From 8e4ab29924c8c5fe2a79e8b0ca41fa45cc8e94a1 Mon Sep 17 00:00:00 2001 From: Muzaffar Mahmood Date: Fri, 26 Sep 2014 18:28:54 +0500 Subject: alsa-utils: interrupt streaming via signal aplay/arecord (alsa-utils v1.0.28) cannot interrupt streaming via CTRL-C. Fixed the issue by reverting buggy patches and properly handling 'in_aborting' flag in appropriate functions. Signed-off-by: Anant Agrawal Signed-off-by: Mikhail Durnev Signed-off-by: Muzaffar Mahmood --- ...lsa-utils-aplay-interrupt-signal-handling.patch | 48 ++++++++++++++++++++++ meta/recipes-multimedia/alsa/alsa-utils_1.0.28.bb | 1 + 2 files changed, 49 insertions(+) create mode 100644 meta/recipes-multimedia/alsa/alsa-utils/alsa-utils-aplay-interrupt-signal-handling.patch diff --git a/meta/recipes-multimedia/alsa/alsa-utils/alsa-utils-aplay-interrupt-signal-handling.patch b/meta/recipes-multimedia/alsa/alsa-utils/alsa-utils-aplay-interrupt-signal-handling.patch new file mode 100644 index 0000000000..5df004aeae --- /dev/null +++ b/meta/recipes-multimedia/alsa/alsa-utils/alsa-utils-aplay-interrupt-signal-handling.patch @@ -0,0 +1,48 @@ +Upstream-Status: Pending + +aplay/arecord (alsa-utils v1.0.28) cannot interrupt streaming +via CTRL-C. Fixed the issue by reverting buggy patches and +properly handling 'in_aborting' flag in appropriate functions. + +Signed-off-by: Anant Agrawal +Signed-off-by: Mikhail Durnev + +--- a/aplay/aplay.c 2014-05-19 16:25:14.000000000 +0530 ++++ b/aplay/aplay.c 2014-05-20 15:17:14.364823007 +0530 +@@ -392,14 +392,22 @@ + putchar('\n'); + if (!quiet_mode) + fprintf(stderr, _("Aborted by signal %s...\n"), strsignal(sig)); +- if (handle) ++ if (stream == SND_PCM_STREAM_CAPTURE) { ++ if (fmt_rec_table[file_type].end) { ++ fmt_rec_table[file_type].end(fd); ++ fd = -1; ++ } ++ stream = -1; ++ } ++ if (fd > 1) { ++ close(fd); ++ fd = -1; ++ } ++ if (handle && sig != SIGABRT) { + snd_pcm_abort(handle); +- if (sig == SIGABRT) { +- /* do not call snd_pcm_close() and abort immediately */ + handle = NULL; +- prg_exit(EXIT_FAILURE); + } +- signal(sig, signal_handler); ++ prg_exit(EXIT_FAILURE); + } + + /* call on SIGUSR1 signal. */ +@@ -2096,7 +2104,7 @@ + ssize_t result = count, r; + size_t size; + +- while (count > 0) { ++ while (count > 0 && !in_aborting) { + size = count; + if (size > chunk_bytes - buffer_pos) + size = chunk_bytes - buffer_pos; diff --git a/meta/recipes-multimedia/alsa/alsa-utils_1.0.28.bb b/meta/recipes-multimedia/alsa/alsa-utils_1.0.28.bb index 2d23482c16..5f35d76a6e 100644 --- a/meta/recipes-multimedia/alsa/alsa-utils_1.0.28.bb +++ b/meta/recipes-multimedia/alsa/alsa-utils_1.0.28.bb @@ -13,6 +13,7 @@ PACKAGECONFIG[xmlto] = "--enable-xmlto, --disable-xmlto, xmlto-native docbook-xm SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \ file://0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch \ + file://alsa-utils-aplay-interrupt-signal-handling.patch \ " SRC_URI[md5sum] = "361552d5b1cacd0a1e7ba09e69990211" -- cgit 1.2.3-korg