From fc5e344afa1af44cc9459306454ad473e8dd60b2a4575826303d2bb4281ceff4 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 31 Jan 2014 11:56:56 +0000 Subject: [PATCH] Accepting request 220463 from home:tiwai:branches:multimedia:libs - Backport minor fix patches for alsactl and aplay from upstream: 0017-alsactl-Fix-the-va_list-initialization-in-cerror_-an.patch 0018-aplay-fix-pcm_read-return-value.patch 0019-alsa-restore.rules-refer-to-correct-attr.patch 0020-aplay-fix-timespec-to-msec-conversion.patch OBS-URL: https://build.opensuse.org/request/show/220463 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=96 --- ...va_list-initialization-in-cerror_-an.patch | 45 +++++++++++++++++++ 0018-aplay-fix-pcm_read-return-value.patch | 40 +++++++++++++++++ ...-restore.rules-refer-to-correct-attr.patch | 35 +++++++++++++++ ...play-fix-timespec-to-msec-conversion.patch | 29 ++++++++++++ alsa-utils.changes | 9 ++++ alsa-utils.spec | 10 ++++- 6 files changed, 167 insertions(+), 1 deletion(-) create mode 100644 0017-alsactl-Fix-the-va_list-initialization-in-cerror_-an.patch create mode 100644 0018-aplay-fix-pcm_read-return-value.patch create mode 100644 0019-alsa-restore.rules-refer-to-correct-attr.patch create mode 100644 0020-aplay-fix-timespec-to-msec-conversion.patch diff --git a/0017-alsactl-Fix-the-va_list-initialization-in-cerror_-an.patch b/0017-alsactl-Fix-the-va_list-initialization-in-cerror_-an.patch new file mode 100644 index 0000000..a6c07ca --- /dev/null +++ b/0017-alsactl-Fix-the-va_list-initialization-in-cerror_-an.patch @@ -0,0 +1,45 @@ +From f4be3f88b6e80e3f3ea19ba5784cff49ab6e6277 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Sun, 29 Dec 2013 20:03:21 +0100 +Subject: [PATCH] alsactl: Fix the va_list initialization in cerror_() and + dbg_() + +The argument for syslog_() was uninitialized. + +From: Alan Hamilton +Signed-off-by: Jaroslav Kysela +--- + alsactl/utils.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/alsactl/utils.c b/alsactl/utils.c +index 072c23998e45..b5d183cb437c 100644 +--- a/alsactl/utils.c ++++ b/alsactl/utils.c +@@ -150,10 +150,10 @@ void cerror_(const char *fcn, long line, int cond, const char *fmt, ...) + + if (!cond && !debugflag) + return; ++ va_start(ap, fmt); + if (use_syslog) { + syslog_(LOG_ERR, fcn, line, fmt, ap); + } else { +- va_start(ap, fmt); + fprintf(stderr, "%s: %s:%ld: ", command, fcn, line); + vfprintf(stderr, fmt, ap); + putc('\n', stderr); +@@ -167,10 +167,10 @@ void dbg_(const char *fcn, long line, const char *fmt, ...) + + if (!debugflag) + return; ++ va_start(ap, fmt); + if (use_syslog) { + syslog_(LOG_DEBUG, fcn, line, fmt, ap); + } else { +- va_start(ap, fmt); + fprintf(stderr, "%s: %s:%ld: ", command, fcn, line); + vfprintf(stderr, fmt, ap); + putc('\n', stderr); +-- +1.8.4.5 + diff --git a/0018-aplay-fix-pcm_read-return-value.patch b/0018-aplay-fix-pcm_read-return-value.patch new file mode 100644 index 0000000..5a06c16 --- /dev/null +++ b/0018-aplay-fix-pcm_read-return-value.patch @@ -0,0 +1,40 @@ +From 8aa13eec80eac312e4b99423909387660fb99b8f Mon Sep 17 00:00:00 2001 +From: Olivier Langlois +Date: Tue, 7 Jan 2014 23:18:17 -0500 +Subject: [PATCH] aplay: fix pcm_read() return value + +Because of the way the pcm_read() functions are currently used, returning +rcount or result is equivalent but I feel it is more accurate to +return 'result'. + +Signed-off-by: Olivier Langlois +Signed-off-by: Takashi Iwai +--- + aplay/aplay.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/aplay/aplay.c b/aplay/aplay.c +index e0631c4aa752..69e8bdab63b7 100644 +--- a/aplay/aplay.c ++++ b/aplay/aplay.c +@@ -2039,7 +2039,7 @@ static ssize_t pcm_read(u_char *data, size_t rcount) + data += r * bits_per_frame / 8; + } + } +- return rcount; ++ return result; + } + + static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount) +@@ -2084,7 +2084,7 @@ static ssize_t pcm_readv(u_char **data, unsigned int channels, size_t rcount) + count -= r; + } + } +- return rcount; ++ return result; + } + + /* +-- +1.8.4.5 + diff --git a/0019-alsa-restore.rules-refer-to-correct-attr.patch b/0019-alsa-restore.rules-refer-to-correct-attr.patch new file mode 100644 index 0000000..f3785a3 --- /dev/null +++ b/0019-alsa-restore.rules-refer-to-correct-attr.patch @@ -0,0 +1,35 @@ +From ef0e588c76fbad4112193d311e51a60d18b44282 Mon Sep 17 00:00:00 2001 +From: Dave Reisner +Date: Sun, 12 Jan 2014 11:15:52 -0500 +Subject: [PATCH] alsa-restore.rules: refer to correct attr + +$attr{number} in the RUN rule is an empty expansion. This makes sense, +because the path doesn't exist -- i.e., it refers to the path: + +/sys/devices/pci0000:00/foo/bar/sound/card0/controlC0/number + +Instead, refer to $attr{device/number}, which does exist. + +Signed-off-by: Dave Reisner +Signed-off-by: Takashi Iwai +--- + alsactl/90-alsa-restore.rules.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/alsactl/90-alsa-restore.rules.in b/alsactl/90-alsa-restore.rules.in +index 88e12e0656d2..c68119d05839 100644 +--- a/alsactl/90-alsa-restore.rules.in ++++ b/alsactl/90-alsa-restore.rules.in +@@ -2,7 +2,7 @@ ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS!="card*", GOTO=" + GOTO="alsa_restore_end" + + LABEL="alsa_restore_go" +-TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl restore $attr{number}" +-TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl nrestore $attr{number}" ++TEST!="@daemonswitch@", RUN+="@sbindir@/alsactl restore $attr{device/number}" ++TEST=="@daemonswitch@", RUN+="@sbindir@/alsactl nrestore $attr{device/number}" + + LABEL="alsa_restore_end" +-- +1.8.4.5 + diff --git a/0020-aplay-fix-timespec-to-msec-conversion.patch b/0020-aplay-fix-timespec-to-msec-conversion.patch new file mode 100644 index 0000000..75c3103 --- /dev/null +++ b/0020-aplay-fix-timespec-to-msec-conversion.patch @@ -0,0 +1,29 @@ +From 360878f9c331d0aaedad6469275062540d8a4537 Mon Sep 17 00:00:00 2001 +From: Olivier Langlois +Date: Tue, 21 Jan 2014 15:25:12 -0500 +Subject: [PATCH] aplay: fix timespec to msec conversion + +There is 1M nsec in a msec. + +Signed-off-by: Olivier Langlois +Signed-off-by: Takashi Iwai +--- + aplay/aplay.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/aplay/aplay.c b/aplay/aplay.c +index 69e8bdab63b7..33a8ed5598f5 100644 +--- a/aplay/aplay.c ++++ b/aplay/aplay.c +@@ -1509,7 +1509,7 @@ static void xrun(void) + timermsub(&now, &tstamp, &diff); + fprintf(stderr, _("%s!!! (at least %.3f ms long)\n"), + stream == SND_PCM_STREAM_PLAYBACK ? _("underrun") : _("overrun"), +- diff.tv_sec * 1000 + diff.tv_nsec / 10000000.0); ++ diff.tv_sec * 1000 + diff.tv_nsec / 1000000.0); + #else + fprintf(stderr, "%s !!!\n", _("underrun")); + #endif +-- +1.8.5.2 + diff --git a/alsa-utils.changes b/alsa-utils.changes index 050f8e0..5c3e9c3 100644 --- a/alsa-utils.changes +++ b/alsa-utils.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Jan 31 12:13:49 CET 2014 - tiwai@suse.de + +- Backport minor fix patches for alsactl and aplay from upstream: + 0017-alsactl-Fix-the-va_list-initialization-in-cerror_-an.patch + 0018-aplay-fix-pcm_read-return-value.patch + 0019-alsa-restore.rules-refer-to-correct-attr.patch + 0020-aplay-fix-timespec-to-msec-conversion.patch + ------------------------------------------------------------------- Wed Nov 27 09:54:23 CET 2013 - tiwai@suse.de diff --git a/alsa-utils.spec b/alsa-utils.spec index 9ad2119..0db6276 100644 --- a/alsa-utils.spec +++ b/alsa-utils.spec @@ -1,7 +1,7 @@ # # spec file for package alsa-utils # -# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -74,6 +74,10 @@ Patch13: 0013-configure-detect-udevdir-via-pkg-config-fallback-to-.patch Patch14: 0014-alsactl-Add-monitor-command.patch Patch15: 0015-alsactl-Fix-REMOVE-event-handling-in-monitor-command.patch Patch16: 0016-alsactl-monitor-all-cards-as-default.patch +Patch17: 0017-alsactl-Fix-the-va_list-initialization-in-cerror_-an.patch +Patch18: 0018-aplay-fix-pcm_read-return-value.patch +Patch19: 0019-alsa-restore.rules-refer-to-correct-attr.patch +Patch20: 0020-aplay-fix-timespec-to-msec-conversion.patch # Patch99: alsa-utils-gettext-version-removal.diff Url: http://www.alsa-project.org/ @@ -105,6 +109,10 @@ sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am %patch14 -p1 %patch15 -p1 %patch16 -p1 +%patch17 -p1 +%patch18 -p1 +%patch19 -p1 +%patch20 -p1 # %if %suse_version < 1020 %patch99 -p1