From d9dc7f88fed2d6d744e24063c23b2e9205595d05cce9026fe8fa832ef9e19702 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= Date: Wed, 2 Oct 2013 21:43:29 +0000 Subject: [PATCH] Accepting request 201581 from home:tiwai:branches:multimedia:libs - Upstream fixes: addition of -z option to alsaloop, and a fix for amixer TLV parser 0004-alsaloop-add-z-syslog-option-to-use-syslog-for-error.patch 0005-amixer-actually-print-all-TLVs-in-a-container-TLV.patch OBS-URL: https://build.opensuse.org/request/show/201581 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=92 --- ...yslog-option-to-use-syslog-for-error.patch | 77 +++++++++++++++++++ ...ly-print-all-TLVs-in-a-container-TLV.patch | 36 +++++++++ alsa-utils.changes | 8 ++ alsa-utils.spec | 4 + 4 files changed, 125 insertions(+) create mode 100644 0004-alsaloop-add-z-syslog-option-to-use-syslog-for-error.patch create mode 100644 0005-amixer-actually-print-all-TLVs-in-a-container-TLV.patch diff --git a/0004-alsaloop-add-z-syslog-option-to-use-syslog-for-error.patch b/0004-alsaloop-add-z-syslog-option-to-use-syslog-for-error.patch new file mode 100644 index 0000000..0a78846 --- /dev/null +++ b/0004-alsaloop-add-z-syslog-option-to-use-syslog-for-error.patch @@ -0,0 +1,77 @@ +From 87bcda4b8a12d0fabab0bf4b0c1197089d2f9c4c Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Fri, 26 Jul 2013 16:16:00 +0200 +Subject: [PATCH] alsaloop: add -z,--syslog option to use syslog for errors + +Signed-off-by: Jaroslav Kysela +--- + alsaloop/alsaloop.c | 18 +++++++++++++++--- + 1 file changed, 15 insertions(+), 3 deletions(-) + +diff --git a/alsaloop/alsaloop.c b/alsaloop/alsaloop.c +index 20150dd..3b20682 100644 +--- a/alsaloop/alsaloop.c ++++ b/alsaloop/alsaloop.c +@@ -195,6 +195,7 @@ void help(void) + "-w,--workaround use workaround (serialopen)\n" + "-U,--xrun xrun profiling\n" + "-W,--wake process wake timeout in ms\n" ++"-z,--syslog use syslog for errors\n" + ); + printf("\nRecognized sample formats are:"); + for (k = 0; k < SND_PCM_FORMAT_LAST; ++k) { +@@ -334,6 +335,14 @@ static int add_oss_mixers(struct loopback *loop, + return 0; + } + ++static void enable_syslog(void) ++{ ++ if (!use_syslog) { ++ use_syslog = 1; ++ openlog("alsaloop", LOG_NDELAY|LOG_PID, LOG_DAEMON); ++ } ++} ++ + static int parse_config_file(const char *file, snd_output_t *output); + + static int parse_config(int argc, char *argv[], snd_output_t *output, +@@ -368,6 +377,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output, + {"ossmixer", 1, NULL, 'O'}, + {"workaround", 1, NULL, 'w'}, + {"xrun", 0, NULL, 'U'}, ++ {"syslog", 0, NULL, 'z'}, + {NULL, 0, NULL, 0}, + }; + int err, morehelp; +@@ -405,7 +415,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output, + while (1) { + int c; + if ((c = getopt_long(argc, argv, +- "hdg:P:C:X:Y:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:UW:", ++ "hdg:P:C:X:Y:l:t:F:f:c:r:s:benvA:S:a:m:T:O:w:UW:z", + long_option, NULL)) < 0) + break; + switch (c) { +@@ -417,8 +427,7 @@ static int parse_config(int argc, char *argv[], snd_output_t *output, + break; + case 'd': + daemonize = 1; +- use_syslog = 1; +- openlog("alsaloop", LOG_NDELAY|LOG_PID, LOG_DAEMON); ++ enable_syslog(); + break; + case 'P': + arg_pdevice = strdup(optarg); +@@ -561,6 +570,9 @@ static int parse_config(int argc, char *argv[], snd_output_t *output, + if (cmdline) + arg_default_wake = arg_wake; + break; ++ case 'z': ++ enable_syslog(); ++ break; + } + } + +-- +1.8.4 + diff --git a/0005-amixer-actually-print-all-TLVs-in-a-container-TLV.patch b/0005-amixer-actually-print-all-TLVs-in-a-container-TLV.patch new file mode 100644 index 0000000..8098b8e --- /dev/null +++ b/0005-amixer-actually-print-all-TLVs-in-a-container-TLV.patch @@ -0,0 +1,36 @@ +From 180283e2307b07bbd3958d24382aab8271dd4c1d Mon Sep 17 00:00:00 2001 +From: Anssi Hannula +Date: Mon, 30 Sep 2013 23:46:50 +0300 +Subject: [PATCH] amixer: actually print all TLVs in a container TLV + +Due to a wrong indexing of tlv[] decode_tlv() always skips to the end of +the container TLV since the used tlv[1] contains the container TLV size +instead of the intended element size. + +This causes, for example, only the first HDMI channel map TLV to be +shown. + +Fix the indexing to actually use the element size. + +Signed-off-by: Anssi Hannula +Signed-off-by: Takashi Iwai +--- + amixer/amixer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/amixer/amixer.c b/amixer/amixer.c +index 7727943..b83b0c3 100644 +--- a/amixer/amixer.c ++++ b/amixer/amixer.c +@@ -468,7 +468,7 @@ static void decode_tlv(unsigned int spaces, unsigned int *tlv, unsigned int tlv_ + return; + } + decode_tlv(spaces + 2, tlv + idx, tlv[idx+1] + 8); +- idx += 2 + (tlv[1] + sizeof(unsigned int) - 1) / sizeof(unsigned int); ++ idx += 2 + (tlv[idx+1] + sizeof(unsigned int) - 1) / sizeof(unsigned int); + } + break; + case SND_CTL_TLVT_DB_SCALE: +-- +1.8.4 + diff --git a/alsa-utils.changes b/alsa-utils.changes index 7e35223..1facd69 100644 --- a/alsa-utils.changes +++ b/alsa-utils.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Oct 1 12:30:28 CEST 2013 - tiwai@suse.de + +- Upstream fixes: addition of -z option to alsaloop, and a fix for + amixer TLV parser + 0004-alsaloop-add-z-syslog-option-to-use-syslog-for-error.patch + 0005-amixer-actually-print-all-TLVs-in-a-container-TLV.patch + ------------------------------------------------------------------- Mon Sep 9 14:16:52 CEST 2013 - tiwai@suse.de diff --git a/alsa-utils.spec b/alsa-utils.spec index 4fc41f2..7cd0043 100644 --- a/alsa-utils.spec +++ b/alsa-utils.spec @@ -61,6 +61,8 @@ Source1: 01beep.conf Patch1: 0001-alsactl-alsa-state.service-fix-typo-rkill-kill.patch Patch2: 0002-alsaloop-fix-wrong-alias-for-signal.h.patch Patch3: 0003-aplay-fix-two-off-by-one-errors.patch +Patch4: 0004-alsaloop-add-z-syslog-option-to-use-syslog-for-error.patch +Patch5: 0005-amixer-actually-print-all-TLVs-in-a-container-TLV.patch # Patch99: alsa-utils-gettext-version-removal.diff Url: http://www.alsa-project.org/ @@ -79,6 +81,8 @@ sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am %patch1 -p1 %patch2 -p1 %patch3 -p1 +%patch4 -p1 +%patch5 -p1 # %if %suse_version < 1020 %patch99 -p1