[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#697867: unblock: alsa-utils/1.0.25-4



Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock

Please unblock package alsa-utils.

It fixes RC bug #697651

Dropping the udev rule in [1] caused a major regression compared to the
version in squeeze, since this broke restoring of mixer levels for
a/ hot plugged sound hardware which is attached after boot
b/ on fast systems (SSD) it is possible that loading the driver takes
longer then starting the alsa-utils sysv init script.

The udev rule was removed, because alsactl is installed in /usr, and
udev generated an error message for users with a split-usr partition as
it couldn't find the binary.
While we could move the alsactl tool and libasound to /sbin and /lib, it
is too late in the release cycle to do that and also not necessary.
alsa-utils also ships a sysv init script, which is guaranteed to run after
all the file systems have been mounted.

So what the fix in 1.0.25-4 does is to re-add the upstream udev rule and
simply add a TEST for the binary in the udev rule.
This way the rule is skipped for users with a split-usr partition during
early boot and it avoids the error message from udev.


Michael,
on behalf ofthe Debian ALSA team

unblock alsa-utils/1.0.25-4

[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=636437
[2] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=697651

-- System Information:
Debian Release: 7.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (200, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.utf8, LC_CTYPE=de_DE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
diff -Nru alsa-utils-1.0.25/debian/changelog alsa-utils-1.0.25/debian/changelog
--- alsa-utils-1.0.25/debian/changelog	2012-05-20 02:59:18.000000000 +0200
+++ alsa-utils-1.0.25/debian/changelog	2013-01-10 01:54:17.000000000 +0100
@@ -1,3 +1,18 @@
+alsa-utils (1.0.25-4) unstable; urgency=low
+
+  * Remove debian/set-default-soundcard which hasn't been installed since
+    1.0.10rc1-1, in 2005.
+  * Restore the installation of the upstream udev rules file.
+  * Drop debian/udev.{rules,script} entirely and just rely on upstream's
+    simpler udev rule file. Our rules were wrong or pointless.
+  * udev_test_alsactl.patch: include a TEST=="/usr/sbin/alsactl" in the
+    upstream udev rule, to properly fix the state restoring for users
+    with split /usr filesystems (really addresses: #670490).
+    Many thanks to Michael Biebl for analysis and proposed fix.
+  * Stop removing /lib/udev/rules.d stuff on purge, as that is dpkg-owned.
+
+ -- Jordi Mallach <jordi@debian.org>  Thu, 10 Jan 2013 01:54:13 +0100
+
 alsa-utils (1.0.25-3) unstable; urgency=low
 
   * Handle addition and removal of soundcards, so sound levels are
diff -Nru alsa-utils-1.0.25/debian/install alsa-utils-1.0.25/debian/install
--- alsa-utils-1.0.25/debian/install	2012-02-11 19:56:25.000000000 +0100
+++ alsa-utils-1.0.25/debian/install	2013-01-10 01:51:41.000000000 +0100
@@ -3,3 +3,4 @@
 usr/bin
 usr/sbin
 usr/share
+lib/udev
diff -Nru alsa-utils-1.0.25/debian/patches/series alsa-utils-1.0.25/debian/patches/series
--- alsa-utils-1.0.25/debian/patches/series	2012-02-11 20:02:37.000000000 +0100
+++ alsa-utils-1.0.25/debian/patches/series	2013-01-10 01:12:48.000000000 +0100
@@ -1,3 +1,4 @@
 aseqnet_manpage_errors.patch
 spelling_fixes.patch
 fix_misspelling_speaker-test_man_page.patch
+udev_test_alsactl.patch
diff -Nru alsa-utils-1.0.25/debian/patches/udev_test_alsactl.patch alsa-utils-1.0.25/debian/patches/udev_test_alsactl.patch
--- alsa-utils-1.0.25/debian/patches/udev_test_alsactl.patch	1970-01-01 01:00:00.000000000 +0100
+++ alsa-utils-1.0.25/debian/patches/udev_test_alsactl.patch	2013-01-10 02:01:36.000000000 +0100
@@ -0,0 +1,14 @@
+From: Jordi Mallach <jordi@debian.org>
+Description: test for alsactl
+ Test for @sbindir@/alsactl to fix state restoration for systems with
+ split /usr.
+Forwarded: no
+
+Index: alsa-utils-1.0.25/alsactl/90-alsa-restore.rules.in
+===================================================================
+--- alsa-utils-1.0.25.orig/alsactl/90-alsa-restore.rules.in	2012-01-25 10:43:38.000000000 +0100
++++ alsa-utils-1.0.25/alsactl/90-alsa-restore.rules.in	2013-01-10 01:12:15.679998854 +0100
+@@ -1,2 +1,2 @@
+ ACTION=="add", SUBSYSTEM=="sound", KERNEL=="controlC*", KERNELS=="card*", \
+-        RUN+="@sbindir@/alsactl restore $attr{number}"
++        TEST=="@sbindir@/alsactl", RUN+="@sbindir@/alsactl restore $attr{number}"
diff -Nru alsa-utils-1.0.25/debian/postrm alsa-utils-1.0.25/debian/postrm
--- alsa-utils-1.0.25/debian/postrm	2011-09-09 11:21:46.000000000 +0200
+++ alsa-utils-1.0.25/debian/postrm	2013-01-10 01:25:19.000000000 +0100
@@ -11,9 +11,6 @@
 	/etc/modprobe.d/sound.conf
 	# Remove state file generated by alsactl
 	rm -f /var/lib/alsa/asound.state
-	# Remove possibly existing udev rules
-	rm -f /lib/udev/rules.d/80-alsa.rules
-	rm -f /lib/udev/rules.d/90-alsa-restore.rules
 	;;
 esac
 
diff -Nru alsa-utils-1.0.25/debian/rules alsa-utils-1.0.25/debian/rules
--- alsa-utils-1.0.25/debian/rules	2012-05-19 19:37:11.000000000 +0200
+++ alsa-utils-1.0.25/debian/rules	2013-01-10 01:50:54.000000000 +0100
@@ -12,7 +12,7 @@
 
 # Kill *.la files, and make sure we install everything else
 override_dh_install:
-	dh_install -Xusr/share/man/fr -Xlib/udev --fail-missing
+	dh_install -Xusr/share/man/fr --fail-missing
 
 override_dh_installchangelogs:
 	dh_installchangelogs debian/changelog.ALSA
diff -Nru alsa-utils-1.0.25/debian/set-default-soundcard alsa-utils-1.0.25/debian/set-default-soundcard
--- alsa-utils-1.0.25/debian/set-default-soundcard	2005-09-29 21:02:57.000000000 +0200
+++ alsa-utils-1.0.25/debian/set-default-soundcard	1970-01-01 01:00:00.000000000 +0100
@@ -1,123 +0,0 @@
-#!/usr/bin/python
-
-# (C) 2005 Canonical Ltd.
-# Author: Martin Pitt <martin.pitt@ubuntu.com>
-# License: GNU General Public License, version 2 or any later version
-
-# Configure default output device in ~/.asoundrc.
-
-import sys, re, os.path
-
-conffile = os.path.expanduser('~/.asoundrc')
-
-def help(): 
-	print '''Usage: set-default-soundcard <number> | --check-markers
-If %s does not exist, or its magic comments are present, 
-change the default sound card setting in it to the given number. If
---check-markers is given, the exit code shows whether the configuration file
-could be modified, but does not actually change it.
-''' % conffile 
-
-def create_conffile(card_num): 
-	'''Create a new configuration file with the given card as default.'''
-
-	try:
-		f = open(conffile, 'w')
-		print >> f, '''### BEGIN set-default-soundcard
-# If the "### BEGIN..." and "### END..." comments are intact, then you
-# can change your default soundcard with "set-default-soundcard(1)."
-# Remove these comments if you want to maintain a custom configuration
-# that should not be changed automatically.
-
-# Default soundcard
-defaults.pcm.card %s
-
-### END set-default-soundcard
-''' % card_num
-	except IOError:
-		print >> sys.stderr, 'Could not create', conffile
-		sys.exit(1)
-
-def change_conffile(card_num):
-	'''Change default to given card number an existing configuration file. If
-	successful, return true; return false if the file does not exist, cannot be
-	written, or does not have the magic comments. If card_num is None, then
-	only the markers are checked without actually modifying the file.'''
-
-	try:
-		lines = open(conffile).readlines()
-	except IOError:
-		return False
-
-	# search for the BEGIN marker
-	marker = re.compile('### BEGIN set-default-soundcard')
-	lineno = 0
-	found = 0
-	for l in lines:
-		lineno = lineno+1
-		if marker.match(l):
-			found = 1
-			break
-	if not found:
-		return False
-
-	# search for default setting
-	marker = re.compile('(defaults.pcm.card\s+)(\d+)(.*)$')
-	found = 0
-	for l in lines[lineno:]:
-		lineno = lineno+1
-		m = marker.match(l)
-		if m:
-			if card_num:
-				lines[lineno-1] = m.group(1) + card_num + m.group(3) + '\n'
-			found = 1
-			break
-	if not found:
-		return False
-
-	# search for the END marker
-	marker = re.compile('### END set-default-soundcard')
-	found = 0
-	for l in lines[lineno:]:
-		lineno = lineno+1
-		if marker.match(l):
-			found = 1
-			break
-	if not found:
-		return False
-
-	# write back file
-	if card_num:
-		try:
-			open(conffile, 'w').writelines(lines)
-		except IOError:
-			return False
-	return True
-
-if len(sys.argv) < 2 or sys.argv[1] == '--help' or sys.argv[1] == '-h':
-	help()
-	sys.exit(0)
-
-check_only = (sys.argv[1] == '--check-markers')
-
-if len(sys.argv) != 2 or not (check_only or sys.argv[1].isdigit()):
-	help()
-	sys.exit(1)
-
-if not check_only:
-	card_num = sys.argv[1]
-else:
-	card_num = None
-
-# if ~/.asoundrc does not exist, create it
-if not os.path.exists(conffile):
-	if check_only:
-		sys.exit(0)
-	create_conffile(card_num)
-else:
-	if not change_conffile(card_num):
-		if not check_only:
-			print >> sys.stderr, conffile, \
-				'was modified manually, cannot be changed by this program.'
-		sys.exit(1) 
-
diff -Nru alsa-utils-1.0.25/debian/udev.rules alsa-utils-1.0.25/debian/udev.rules
--- alsa-utils-1.0.25/debian/udev.rules	2012-05-20 02:58:32.000000000 +0200
+++ alsa-utils-1.0.25/debian/udev.rules	1970-01-01 01:00:00.000000000 +0100
@@ -1,7 +0,0 @@
-KERNEL=="controlC[0-7]", ACTION=="add", RUN+="/lib/udev/alsa-utils"
-
-# Handle addition and removal of soundcards.
-KERNEL=="controlC*", ACTION=="add", SUBSYSTEM=="sound", \
-  RUN+="/usr/sbin/alsactl restore /dev/$name"
-KERNEL=="controlC*", ACTION=="remove", SUBSYSTEM=="sound", \
-  RUN+="/usr/sbin/alsactl store /dev/$name"
diff -Nru alsa-utils-1.0.25/debian/udev.script alsa-utils-1.0.25/debian/udev.script
--- alsa-utils-1.0.25/debian/udev.script	2011-09-06 13:17:07.000000000 +0200
+++ alsa-utils-1.0.25/debian/udev.script	1970-01-01 01:00:00.000000000 +0100
@@ -1,12 +0,0 @@
-#!/bin/sh -e
-#
-# udev script for alsa-utils
-
-(
-	. /lib/udev/hotplug.functions
-	wait_for_file /usr/sbin/alsactl
-	DEV_BASENAME="${DEVNAME##*/}"
-	N="${DEV_BASENAME#controlC}"
-	exec /etc/init.d/alsa-utils start $N
-) &
-

Reply to: