From c0cd57af094b36410b9a546b7acc83b463991c19e5fb405300a7c15375bd3c8c Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Wed, 2 Nov 2011 16:38:59 +0000 Subject: [PATCH 1/2] - Backport upstream fix: - fix a crash of alsamixer with pulse plugin OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=42 --- ...win-related-crash-for-PulseAudio-plu.patch | 88 +++++++++++++++++++ alsa-utils.changes | 6 ++ alsa-utils.spec | 2 + 3 files changed, 96 insertions(+) create mode 100644 0021-alsamixer-Fix-X-win-related-crash-for-PulseAudio-plu.patch diff --git a/0021-alsamixer-Fix-X-win-related-crash-for-PulseAudio-plu.patch b/0021-alsamixer-Fix-X-win-related-crash-for-PulseAudio-plu.patch new file mode 100644 index 0000000..c5c46fe --- /dev/null +++ b/0021-alsamixer-Fix-X-win-related-crash-for-PulseAudio-plu.patch @@ -0,0 +1,88 @@ +From 4c09aaa5c13c2260fea57a89c47f88252da8a692 Mon Sep 17 00:00:00 2001 +From: Jaroslav Kysela +Date: Wed, 2 Nov 2011 17:27:47 +0100 +Subject: [PATCH] alsamixer: Fix X-win related crash for PulseAudio plugin + (bad linking) + +A lot of reports that alsamixer crashes in X terminal when the PulseAudio +CTL plugin is activated were entered to the tracking systems. + +I figured that there is a linking clash for the shutdown() function. +The shutdown() function in glibc is socket related, but the alsamixer code +redefines this function and appearently that under some linking +circumstances - which PA client invokes during the runtime dynamic linking +- the wrong function is called. + +This patch, for safety, renames the shutdown() function from alsamixer +to app_shutdown(), but it might make sense to figure the real linking +culprit to avoid future surprises. + +Signed-off-by: Jaroslav Kysela +--- + alsamixer/cli.c | 2 +- + alsamixer/die.c | 4 ++-- + alsamixer/mainloop.c | 2 +- + alsamixer/mainloop.h | 2 +- + 4 files changed, 5 insertions(+), 5 deletions(-) + +diff --git a/alsamixer/cli.c b/alsamixer/cli.c +index 3898196..bb4f030 100644 +--- a/alsamixer/cli.c ++++ b/alsamixer/cli.c +@@ -130,6 +130,6 @@ int main(int argc, char *argv[]) + + mainloop(); + +- shutdown(); ++ app_shutdown(); + return 0; + } +diff --git a/alsamixer/die.c b/alsamixer/die.c +index dcd8536..899a501 100644 +--- a/alsamixer/die.c ++++ b/alsamixer/die.c +@@ -26,14 +26,14 @@ + + void fatal_error(const char *msg) + { +- shutdown(); ++ app_shutdown(); + fprintf(stderr, "%s\n", msg); + exit(EXIT_FAILURE); + } + + void fatal_alsa_error(const char *msg, int err) + { +- shutdown(); ++ app_shutdown(); + fprintf(stderr, _("%s: %s\n"), msg, snd_strerror(err)); + exit(EXIT_FAILURE); + } +diff --git a/alsamixer/mainloop.c b/alsamixer/mainloop.c +index eddaf3b..dbfef9b 100644 +--- a/alsamixer/mainloop.c ++++ b/alsamixer/mainloop.c +@@ -52,7 +52,7 @@ void initialize_curses(bool use_color) + snd_lib_error_set_handler(black_hole_error_handler); + } + +-void shutdown(void) ++void app_shutdown(void) + { + if (curses_initialized) { + clear(); +diff --git a/alsamixer/mainloop.h b/alsamixer/mainloop.h +index 0cfc989..22317be 100644 +--- a/alsamixer/mainloop.h ++++ b/alsamixer/mainloop.h +@@ -5,6 +5,6 @@ + + void initialize_curses(bool use_color); + void mainloop(void); +-void shutdown(void); ++void app_shutdown(void); + + #endif +-- +1.7.7 + diff --git a/alsa-utils.changes b/alsa-utils.changes index 2ef25d9..e2d2200 100644 --- a/alsa-utils.changes +++ b/alsa-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Nov 2 17:38:32 CET 2011 - tiwai@suse.de + +- Backport upstream fix: + - fix a crash of alsamixer with pulse plugin + ------------------------------------------------------------------- Tue Sep 20 09:47:45 CEST 2011 - tiwai@suse.de diff --git a/alsa-utils.spec b/alsa-utils.spec index 99f0975..cce853f 100644 --- a/alsa-utils.spec +++ b/alsa-utils.spec @@ -55,6 +55,7 @@ Patch17: 0017-speaker-test.1-Clarify-man-page-by-giving-examples.patch Patch18: 0018-alsa-utils-amixer-Fix-SND_CTL_TLVT_DB_RANGE-handling.patch Patch19: 0019-aplay-increase-channel-limit-to-256.patch Patch20: 0020-fix-use-of-SED.patch +Patch21: 0021-alsamixer-Fix-X-win-related-crash-for-PulseAudio-plu.patch Patch99: alsa-utils-gettext-version-removal.diff Url: http://www.alsa-project.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -88,6 +89,7 @@ sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am %patch18 -p1 %patch19 -p1 %patch20 -p1 +%patch21 -p1 %if %suse_version < 1020 %patch99 -p1 %endif From 84cb1887f10375eea5dd63bed7d32d96205d1276bd97a3cdab3193d7bd408c8e Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 4 Nov 2011 16:27:51 +0000 Subject: [PATCH 2/2] - Fix missing initialization of Surround, etc, as well as Front Speaker, etc mixer elements in alsactl init OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=43 --- ...alsactl-Initialize-Front-Speaker-etc.patch | 104 ++++++++++++++++++ alsa-utils.changes | 6 + alsa-utils.spec | 2 + 3 files changed, 112 insertions(+) create mode 100644 0022-alsactl-Initialize-Front-Speaker-etc.patch diff --git a/0022-alsactl-Initialize-Front-Speaker-etc.patch b/0022-alsactl-Initialize-Front-Speaker-etc.patch new file mode 100644 index 0000000..45e30f2 --- /dev/null +++ b/0022-alsactl-Initialize-Front-Speaker-etc.patch @@ -0,0 +1,104 @@ +From 9fa7cd2176a6be077f61c0f050f257beedf8b0c0 Mon Sep 17 00:00:00 2001 +From: Takashi Iwai +Date: Fri, 4 Nov 2011 17:01:57 +0100 +Subject: [PATCH] alsactl: Initialize Front Speaker, etc + +Add missing initialization of surround and CLFE playback volumes and +switches. Ditto for "Front Speaker", etc. + +Signed-off-by: Takashi Iwai +--- + alsactl/init/default | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++ + 1 files changed, 70 insertions(+), 0 deletions(-) + +diff --git a/alsactl/init/default b/alsactl/init/default +index b7cb941..af64cb1 100644 +--- a/alsactl/init/default ++++ b/alsactl/init/default +@@ -53,6 +53,36 @@ CTL{name}="Front Playback Switch",CTL{do_search}=="1", \ + CTL{values}="on" + + CTL{reset}="mixer" ++CTL{name}="Surround Playback Volume",PROGRAM!="__ctl_search",GOTO="" ++# if master volume control is present, turn front volume to max ++ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" ++ENV{has_pmaster_vol}=="true",CTL{write}=="100%",GOTO="" ++CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}" ++LABEL="" ++CTL{name}="Surround Playback Switch",CTL{do_search}=="1", \ ++ CTL{values}="on" ++ ++CTL{reset}="mixer" ++CTL{name}="Center Playback Volume",PROGRAM!="__ctl_search",GOTO="" ++# if master volume control is present, turn front volume to max ++ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" ++ENV{has_pmaster_vol}=="true",CTL{write}=="100%",GOTO="" ++CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}" ++LABEL="" ++CTL{name}="Center Playback Switch",CTL{do_search}=="1", \ ++ CTL{values}="on" ++ ++CTL{reset}="mixer" ++CTL{name}="LFE Playback Volume",PROGRAM!="__ctl_search",GOTO="" ++# if master volume control is present, turn front volume to max ++ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" ++ENV{has_pmaster_vol}=="true",CTL{write}=="100%",GOTO="" ++CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}" ++LABEL="" ++CTL{name}="LFE Playback Switch",CTL{do_search}=="1", \ ++ CTL{values}="on" ++ ++CTL{reset}="mixer" + CTL{name}="Headphone Playback Volume",PROGRAM!="__ctl_search",GOTO="" + # if master volume control is present, turn headphone volume to max + ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" +@@ -84,6 +114,46 @@ CTL{name}="Speaker Playback Switch",CTL{do_search}=="1", \ + CTL{values}="on" + + CTL{reset}="mixer" ++CTL{name}="Front Speaker Playback Volume",PROGRAM!="__ctl_search",GOTO="" ++# if master volume control is present, turn speaker volume to max ++ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" ++ENV{has_pmaster_vol}=="true",CTL{write}=="100%",GOTO="" ++CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}" ++LABEL="" ++CTL{name}="Front Speaker Playback Switch",CTL{do_search}=="1", \ ++ CTL{values}="on" ++ ++CTL{reset}="mixer" ++CTL{name}="Front Speaker Playback Volume",PROGRAM!="__ctl_search",GOTO="" ++# if master volume control is present, turn speaker volume to max ++ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" ++ENV{has_pmaster_vol}=="true",CTL{write}=="100%",GOTO="" ++CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}" ++LABEL="" ++CTL{name}="Surround Speaker Playback Switch",CTL{do_search}=="1", \ ++ CTL{values}="on" ++ ++CTL{reset}="mixer" ++CTL{name}="Front Speaker Playback Volume",PROGRAM!="__ctl_search",GOTO="" ++# if master volume control is present, turn speaker volume to max ++ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" ++ENV{has_pmaster_vol}=="true",CTL{write}=="100%",GOTO="" ++CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}" ++LABEL="" ++CTL{name}="Center Speaker Playback Switch",CTL{do_search}=="1", \ ++ CTL{values}="on" ++ ++CTL{reset}="mixer" ++CTL{name}="Front Speaker Playback Volume",PROGRAM!="__ctl_search",GOTO="" ++# if master volume control is present, turn speaker volume to max ++ENV{has_pmaster_vol}=="true",CTL{write}=="0dB",GOTO="" ++ENV{has_pmaster_vol}=="true",CTL{write}=="100%",GOTO="" ++CTL{write}!="$env{pvolume}",CTL{values}="$env{ppercent}" ++LABEL="" ++CTL{name}="LFE Speaker Playback Switch",CTL{do_search}=="1", \ ++ CTL{values}="on" ++ ++CTL{reset}="mixer" + CTL{name}="PC Speaker Playback Volume",CTL{do_search}=="1", \ + CTL{values}="$env{pvolume}",RESULT!="0",CTL{values}="$env{ppercent}" + CTL{name}="PC Speaker Playback Switch",CTL{do_search}=="1", \ +-- +1.7.7 + diff --git a/alsa-utils.changes b/alsa-utils.changes index e2d2200..7420cd0 100644 --- a/alsa-utils.changes +++ b/alsa-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Fri Nov 4 17:27:05 CET 2011 - tiwai@suse.de + +- Fix missing initialization of Surround, etc, as well as Front + Speaker, etc mixer elements in alsactl init + ------------------------------------------------------------------- Wed Nov 2 17:38:32 CET 2011 - tiwai@suse.de diff --git a/alsa-utils.spec b/alsa-utils.spec index cce853f..917992a 100644 --- a/alsa-utils.spec +++ b/alsa-utils.spec @@ -56,6 +56,7 @@ Patch18: 0018-alsa-utils-amixer-Fix-SND_CTL_TLVT_DB_RANGE-handling.patch Patch19: 0019-aplay-increase-channel-limit-to-256.patch Patch20: 0020-fix-use-of-SED.patch Patch21: 0021-alsamixer-Fix-X-win-related-crash-for-PulseAudio-plu.patch +Patch22: 0022-alsactl-Initialize-Front-Speaker-etc.patch Patch99: alsa-utils-gettext-version-removal.diff Url: http://www.alsa-project.org/ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -90,6 +91,7 @@ sed -i -e's/EXTRA_DIST= config.rpath /EXTRA_DIST=/' Makefile.am %patch19 -p1 %patch20 -p1 %patch21 -p1 +%patch22 -p1 %if %suse_version < 1020 %patch99 -p1 %endif