[alsa-utils/f16] alsamixer fixes

perex perex at fedoraproject.org
Wed Nov 2 19:29:23 UTC 2011


commit 01e61b34fd2eda9940f04e6278d30e87070a4a28
Author: Jaroslav Kysela <perex at perex.cz>
Date:   Wed Nov 2 20:23:01 2011 +0100

    alsamixer fixes

 0002-alsamixer1.patch |   80 ++++++++++++++++++++++++++++++++++++++++++++
 0003-alsamixer2.patch |   88 +++++++++++++++++++++++++++++++++++++++++++++++++
 alsa-utils.spec       |   12 +++++-
 3 files changed, 178 insertions(+), 2 deletions(-)
---
diff --git a/0002-alsamixer1.patch b/0002-alsamixer1.patch
new file mode 100644
index 0000000..8be0151
--- /dev/null
+++ b/0002-alsamixer1.patch
@@ -0,0 +1,80 @@
+From cd26f244e7f2648a63411741552c658ca67334e9 Mon Sep 17 00:00:00 2001
+From: Raymond Yau <superquad.vortex2 at gmail.com>
+Date: Mon, 28 Feb 2011 15:36:36 +0100
+Subject: [PATCH] alsamixer: fix display of active/inactive controls
+
+Signed-off-by: Raymond Yau <superquad.vortex2 at gmail.com>
+Signed-off-by: Clemens Ladisch <clemens at ladisch.de>
+---
+ alsamixer/mixer_widget.c |   11 +++++++++++
+ 1 files changed, 11 insertions(+), 0 deletions(-)
+
+diff --git a/alsamixer/mixer_widget.c b/alsamixer/mixer_widget.c
+index fb352d3..caaf777 100644
+--- a/alsamixer/mixer_widget.c
++++ b/alsamixer/mixer_widget.c
+@@ -59,10 +59,21 @@ enum channel_mask {
+ 
+ static int elem_callback(snd_mixer_elem_t *elem, unsigned int mask)
+ {
++	unsigned int i;
++
+ 	if (mask & (SND_CTL_EVENT_MASK_REMOVE |
+ 		    SND_CTL_EVENT_MASK_INFO |
+ 		    SND_CTL_EVENT_MASK_VALUE))
+ 		controls_changed = TRUE;
++
++	if (mask & SND_CTL_EVENT_MASK_INFO)
++		for (i = 0; i < controls_count; ++i)
++			if (controls[i].elem == elem) {
++				controls[i].flags &= ~IS_ACTIVE;
++				if (snd_mixer_selem_is_active(controls[i].elem))
++					controls[i].flags |= IS_ACTIVE;
++			}
++
+ 	return 0;
+ }
+ 
+-- 
+1.7.6.4
+
+From 3bea722b3bfdbec2e26218aca66e55b019a24436 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai at suse.de>
+Date: Fri, 3 Jun 2011 14:28:28 +0200
+Subject: [PATCH] alsamixer: Fix 64bit issues
+
+lrint() returns a long int.
+
+Signed-off-by: Takashi Iwai <tiwai at suse.de>
+---
+ alsamixer/mixer_display.c |    6 +++---
+ 1 files changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/alsamixer/mixer_display.c b/alsamixer/mixer_display.c
+index 51a1546..8ba396a 100644
+--- a/alsamixer/mixer_display.c
++++ b/alsamixer/mixer_display.c
+@@ -486,17 +486,17 @@ static void display_control(unsigned int control_index)
+ 		if (control->flags & IS_ACTIVE)
+ 			wattrset(mixer_widget.window, attr_mixer_active);
+ 		if (!(control->flags & HAS_VOLUME_1)) {
+-			sprintf(buf, "%d", lrint(volumes[0] * 100));
++			sprintf(buf, "%d", (int)lrint(volumes[0] * 100));
+ 			display_string_in_field(values_y, frame_left - 2, buf, 8, ALIGN_CENTER);
+ 		} else {
+ 			mvwprintw(mixer_widget.window, values_y, frame_left - 2,
+-				  "%3d", lrint(volumes[0] * 100));
++				  "%3d", (int)lrint(volumes[0] * 100));
+ 			if (control->flags & IS_ACTIVE)
+ 				wattrset(mixer_widget.window, attr_ctl_frame);
+ 			waddstr(mixer_widget.window, "<>");
+ 			if (control->flags & IS_ACTIVE)
+ 				wattrset(mixer_widget.window, attr_mixer_active);
+-			wprintw(mixer_widget.window, "%-3d", lrint(volumes[1] * 100));
++			wprintw(mixer_widget.window, "%-3d", (int)lrint(volumes[1] * 100));
+ 		}
+ 	}
+ 
+-- 
+1.7.6.4
+
diff --git a/0003-alsamixer2.patch b/0003-alsamixer2.patch
new file mode 100644
index 0000000..42794c9
--- /dev/null
+++ b/0003-alsamixer2.patch
@@ -0,0 +1,88 @@
+From 4c09aaa5c13c2260fea57a89c47f88252da8a692 Mon Sep 17 00:00:00 2001
+From: Jaroslav Kysela <perex at perex.cz>
+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 <perex at perex.cz>
+---
+ 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.6.4
+
diff --git a/alsa-utils.spec b/alsa-utils.spec
index ea1345d..c2e335d 100644
--- a/alsa-utils.spec
+++ b/alsa-utils.spec
@@ -4,7 +4,7 @@
 Summary: Advanced Linux Sound Architecture (ALSA) utilities
 Name:    alsa-utils
 Version: %{baseversion}%{?fixversion}
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: GPLv2+
 Group:   Applications/Multimedia
 URL:     http://www.alsa-project.org/
@@ -28,6 +28,9 @@ Requires: alsa-lib >= %{baseversion}, systemd-units, dialog
 # https://bugzilla.redhat.com/show_bug.cgi?id=738227
 Patch0: 0001-Unmute-MacBookAir4-1-speakers.patch
 
+Patch1: 0002-alsamixer1.patch
+Patch2: 0003-alsamixer2.patch
+
 %description
 This package contains command line utilities for the Advanced Linux Sound
 Architecture (ALSA).
@@ -35,6 +38,8 @@ Architecture (ALSA).
 %prep
 %setup -q -n %{name}-%{version}
 %patch0 -p1 -b .mba41
+%patch1 -p1 -b .alsamixer1
+%patch2 -p1 -b .alsamixer2
 
 %build
 %configure CFLAGS="$RPM_OPT_FLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64" --sbindir=/sbin --disable-alsaconf
@@ -112,7 +117,10 @@ if [ -s /etc/asound.state -a ! -s /var/lib/alsa/asound.state ] ; then
 fi
 
 %changelog
-* Mon Oct 31 2011 Bastien Nocera <bnocera at redhat.com> 1.0.24-4
+* Wed Nov 02 2011 Jaroslav Kysela <jkysela at redhat.com> 1.0.24.1-5
+- Fix alsamixer segfaults (rhbz#731381) and other alsamixer issues
+
+* Mon Oct 31 2011 Bastien Nocera <bnocera at redhat.com> 1.0.24.1-4
 - Add patch to unmute MacBookAir4,1 speakers
 
 * Mon Feb 07 2011 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.0.24.1-3


More information about the scm-commits mailing list