diff options
| -rw-r--r-- | meta/recipes-multimedia/alsa/alsa-utils/alsa-utils-aplay-interrupt-signal-handling.patch | 48 | ||||
| -rw-r--r-- | meta/recipes-multimedia/alsa/alsa-utils_1.0.28.bb | 1 |
2 files changed, 49 insertions, 0 deletions
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 @@ | |||
| 1 | Upstream-Status: Pending | ||
| 2 | |||
| 3 | aplay/arecord (alsa-utils v1.0.28) cannot interrupt streaming | ||
| 4 | via CTRL-C. Fixed the issue by reverting buggy patches and | ||
| 5 | properly handling 'in_aborting' flag in appropriate functions. | ||
| 6 | |||
| 7 | Signed-off-by: Anant Agrawal <Anant_Agrawal@mentor.com> | ||
| 8 | Signed-off-by: Mikhail Durnev <mikhail_durnev@mentor.com> | ||
| 9 | |||
| 10 | --- a/aplay/aplay.c 2014-05-19 16:25:14.000000000 +0530 | ||
| 11 | +++ b/aplay/aplay.c 2014-05-20 15:17:14.364823007 +0530 | ||
| 12 | @@ -392,14 +392,22 @@ | ||
| 13 | putchar('\n'); | ||
| 14 | if (!quiet_mode) | ||
| 15 | fprintf(stderr, _("Aborted by signal %s...\n"), strsignal(sig)); | ||
| 16 | - if (handle) | ||
| 17 | + if (stream == SND_PCM_STREAM_CAPTURE) { | ||
| 18 | + if (fmt_rec_table[file_type].end) { | ||
| 19 | + fmt_rec_table[file_type].end(fd); | ||
| 20 | + fd = -1; | ||
| 21 | + } | ||
| 22 | + stream = -1; | ||
| 23 | + } | ||
| 24 | + if (fd > 1) { | ||
| 25 | + close(fd); | ||
| 26 | + fd = -1; | ||
| 27 | + } | ||
| 28 | + if (handle && sig != SIGABRT) { | ||
| 29 | snd_pcm_abort(handle); | ||
| 30 | - if (sig == SIGABRT) { | ||
| 31 | - /* do not call snd_pcm_close() and abort immediately */ | ||
| 32 | handle = NULL; | ||
| 33 | - prg_exit(EXIT_FAILURE); | ||
| 34 | } | ||
| 35 | - signal(sig, signal_handler); | ||
| 36 | + prg_exit(EXIT_FAILURE); | ||
| 37 | } | ||
| 38 | |||
| 39 | /* call on SIGUSR1 signal. */ | ||
| 40 | @@ -2096,7 +2104,7 @@ | ||
| 41 | ssize_t result = count, r; | ||
| 42 | size_t size; | ||
| 43 | |||
| 44 | - while (count > 0) { | ||
| 45 | + while (count > 0 && !in_aborting) { | ||
| 46 | size = count; | ||
| 47 | if (size > chunk_bytes - buffer_pos) | ||
| 48 | 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 | |||
| 13 | 13 | ||
| 14 | SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \ | 14 | SRC_URI = "ftp://ftp.alsa-project.org/pub/utils/alsa-utils-${PV}.tar.bz2 \ |
| 15 | file://0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch \ | 15 | file://0001-alsactl-don-t-let-systemd-unit-restore-the-volume-wh.patch \ |
| 16 | file://alsa-utils-aplay-interrupt-signal-handling.patch \ | ||
| 16 | " | 17 | " |
| 17 | 18 | ||
| 18 | SRC_URI[md5sum] = "361552d5b1cacd0a1e7ba09e69990211" | 19 | SRC_URI[md5sum] = "361552d5b1cacd0a1e7ba09e69990211" |
